1070 - Conveyor Belt

本文介绍了一种用于解决机械系统中带轮与输送带连接问题的算法,旨在找到从一个给定带轮到另一个带轮的最短路径。该算法考虑了带轮的位置、旋转方向、距离限制以及带轮间的相互作用,确保输送带不会自相交叉或通过其他带轮。输入包括多个带轮的坐标、尺寸、旋转方向以及起始和结束带轮的编号和最大距离约束。输出是两个带轮间最短路径的距离,或者如果无法到达目标带轮,则提示无法到达。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Many mechanical systems work with rotating shafts connected with conveyor belts. The shafts have a variety of sizes and rotate in either a clockwise or a counterclockwise manner. The exact way in which a belt will connect two shafts depends on their rotations, as shown in Figures 1 and 2.

\epsfbox{p4120a.eps}
\epsfbox{p4120b.eps}

One task in setting up such mechanical systems is to link together two given shafts, subject to these constraints:

  • If the two shafts being connected are too far apart, the belt may start to vibrate chaotically when perturbed slightly. To prevent this, you can connect shafts only when the distance between the points where the belt leaves one shaft and touches the other is less than some distance d (the exact value of d varies depending on the type of belt).
  • No belt can cross over itself, as shown in Figure 3.
  • No belt can pass through another shaft (or touch one rotating the wrong way), as shown in Figure 4.
  • The belt is not a loop; it goes in only one direction, from the starting shaft to the ending shaft. The starting shaft ``pushes'' the belt and the ending shaft ``pulls'' it.

As an example, consider the problem of connecting shaft A to shaft D in Figure 5. Suppose that the distance needed to connect A to C (shown in blue dashed line) or to connect B to D is greater than the limit allowed. Then the shortest distance to connect A to D is shown in solid line, going from shaft A to B to C and then D. Notice that the connection cannot go from B to E and then D as the belt would cross itself.

\epsfbox{p4120c.eps}

You must write a program that calculates the minimum length of the belt to connect the two given shafts.

Input 

The input consists of multiple test cases. Each test case starts with a line containing an integer N (1$ \le$N$ \le$20) indicating the number of shafts, numbered from 0 to N - 1 . Starting on the next line are N four-tuples of the form x y r s , where x and y are the integer coordinates of a shaft center, r is the integer radius of the shaft, and s is either ``C" for clockwise or ``CC" for counterclockwise (0$ \le$xy$ \le$10000 and 0 < r$ \le$1000) . Positive x is right and positive y is up. The first four-tuple specifies shaft 0, the second one shaft 1 and so on. These four-tuples may extend over multiple lines, though no four-tuple will be split across two lines. No two shafts touch or overlap. The last line of each test case contains two integers iand j indicating the starting and ending shafts, followed by a floating point value d specifying the maximum distance constraint.

The last test case is followed by a line containing a single zero.

Output 

For each test case, print the case number (starting with 1) followed by the length of the path of minimum distance. Print `Cannot reach destination shaft' if the destination shaft cannot be reached. Use the format shown in the sample output.

When measuring the distance, start where the belt first leaves the starting shaft and end where the belt first touches the ending shaft. Your distance calculation must include both the length of belt between shafts as well as the distance the belt travels around intermediate shafts. Your answer should be rounded to the nearest hundredth, though you need not print trailing zeroes after the decimal point.

Sample Input 

5 
24 50 14 C 93 78 20 C 118 8 15 CC 
167 32 13 C 159 88 15 CC
0 3 82.5 
5 

24 50 14 C 93 78 20 C 118 8 15 CC 
167 32 13 C 159 88 15 C
0 3 82.5 
5
24 50 14 C 93 78 20 C 118 8 15 CC 
167 32 13 C 159 88 15 C
0 3 8.5 
0

Sample Output 

Case 1: length = 271 
Case 2: length = 228.23 
Case 3: Cannot reach destination shaft





#include<stdio.h>
#include<math.h>
int x[20],y[20],r[20],st,ed,n,i,j,k,cases;
char dr[3],mark[20];
double dc[20][20],arg[20][20],len[20][20],xi[20][20],yi[20][20],xj[20][20],yj[20][20];
double pxa[20],pya[20],pxb[20],pyb[20],eps,pi,d,cur,ans;

double dis(double x,double y)
{
	return sqrt(x*x+y*y);
}

double angle(double x,double y)
{
	if(y>0)
		return acos(x/dis(x,y));
	if(y<0)
		return 2*pi-acos(x/dis(x,y));
	if(x>0)
		return 0;
	return pi;
}

int cross(double xa,double ya,double xb,double yb,double xc,double yc,double xd,double yd)
{
	double cra,crb;
	cra=(xb-xa)*(yc-ya) - (xc-xa)*(yb-ya);
	crb=(xb-xa)*(yd-ya) - (xd-xa)*(yb-ya);
	if(cra*crb>-eps)
		return 0;
	cra=(xd-xc)*(ya-yc) - (xa-xc)*(yd-yc);
	crb=(xd-xc)*(yb-yc) - (xb-xc)*(yd-yc);
	if(cra*crb>-eps)
		return 0;
	return 1;
}

void go(int v,double a)
{
	int j,k;
	double add;
	for(j=0;j<n;j++)
		if(mark[j]&&len[v][j]>0)
		{
			for(k=0;k<i;k++)
				if(cross(pxa[k],pya[k],pxb[k],pyb[k],xi[v][j],yi[v][j],xj[v][j],xj[v][j]))
					break;
			if(k<i)
				continue;
			pxa[i]=xi[v][j];
			pya[i]=yi[v][j];
			pxb[i]=xj[v][j];
			pyb[i]=yj[v][j];
			add=len[v][j];
			if(a>-1)
				if(r[v]<0)
				{
					if(arg[v][j]>a-eps)
						add-=r[v]*(arg[v][j]-a);
					else
						add-=r[v]*(2*pi+arg[v][j]-a);
				}
				else
				{
					if(a>arg[v][j]-eps)
						add+=r[v]*(a-arg[v][j]);
					else
						add+=r[v]*(2*pi+a-arg[v][j]);
				}
				mark[j]=0;
				cur+=add;
				i++;
				if(cur<ans)
					if(j==ed)
						ans=cur;
					else
						go(j,arg[v][j]);
				i--;
				cur-=add;
				mark[j]=1;
		}
}

int main()
{
	eps=1e-8;
	pi=acos(-1.0);
	while(scanf("%d",&n)&&n)
	{
		for(i=0;i<n;i++)
		{
			scanf("%d%d%d %s",&x[i],&y[i],&r[i],dr);
			if(dr[1])
				r[i]=-r[i];
			mark[i]=1;
		}
		scanf("%d%d%lf",&st,&ed,&d);
		mark[st]=0;
		for(i=0;i<n;i++)
			for(j=0;j<n;j++)
				dc[i][j]=dis(x[j]-x[i],y[j]-y[i]);
		for(i=0;i<n;i++)
			for(j=0;j<n;j++) if(i!=j)
			{
				arg[i][j]=angle(x[j]-x[i],y[j]-y[i]) + acos((r[i]-r[j])/dc[i][j]);
				if(arg[i][j]>=2*pi)
					arg[i][j]-=2*pi;
				if(arg[i][j]<0)
					arg[i][j]+=2*pi;
				len[i][j]=sqrt(dc[i][j]*dc[i][j] - (r[j]-r[i])*(r[j]-r[i]));
				if(len[i][j]>d)
					len[i][j]=-1;
				else
				{
					xi[i][j]=x[i]+r[i]*cos(arg[i][j]);yi[i][j]=y[i]+r[i]*sin(arg[i][j]);
					xj[i][j]=x[j]+r[j]*cos(arg[i][j]);yi[i][j]=y[j]+r[j]*sin(arg[i][j]);
					for(k=0;k<n;k++) if(k!=i&&k!=j)
					{
						if((xj[i][j]-xi[i][j])*(x[k]-xi[i][j]) + (yj[i][j]-yi[i][j])*(y[k]-yi[i][j])<=0)
							continue;
						if((xi[i][j]-xj[i][j])*(x[k]-xj[i][j]) + (yi[i][j]-yj[i][j])*(y[k]-yj[i][j])<=0)
							continue;
						if(fabs((xj[i][j]-xi[i][j])*(y[k]-yi[i][j]) - (yj[i][j]-yi[i][j])*(x[k]-xi[i][j]))/len[i][j] >labs(r[k])+eps)
							continue;
						len[i][j]=-1;
						break;
					}
				}
			}
		cur=0;
		ans=2e9;
		i=0;
		go(st,-2);
		printf("Cases %d: ",++cases);
		if(ans<1e9)
			if(int(ans*100+0.5)%10)
				printf("length = %2.lf\n",ans);
			else
				if(int(ans*100+0.5)%100)
					printf("length = %1.lf\n",ans);
				else
					printf("length = %0.lf\n",ans);
		else
			printf("Cannot reach destination shaft");
	}
	return 0;
}


### 回答1: 澳大利亚标准DLT667-1999是针对计算机系统和信息技术设备的测试和评估的国际标准。这个标准是由澳大利亚标准协会(Standards Australia)制定的,目的是提供一个标准化的框架,以确保计算机系统和信息技术设备的功能和性能符合预期要求。 DLT667-1999标准涵盖了多个方面,包括硬件和软件的测试方法、测试环境的要求、性能的测量和评估、以及验证测试结果的报告等。通过遵守这个标准,企业和机构可以获得对计算机系统和信息技术设备进行完整、准确和可靠评估的指南。 DLT667-1999标准的实施对于企业和机构来说有多个好处。首先,它能够确保计算机系统和信息技术设备的功能和性能达到预期,从而提高工作效率和数据安全性。其次,它提供了一种标准化的测试方法和评估框架,使得不同厂家和供应商提供的设备能够进行公平和客观的比较。此外,DLT667-1999还可以作为企业和机构与供应商之间合同谈判的参考依据,确保双方对于计算机系统和信息技术设备的功能和性能有明确的理解和期望。 总的来说,澳大利亚标准DLT667-1999在计算机系统和信息技术设备的测试和评估方面提供了一个有用的指南和框架。通过遵守这个标准,企业和机构可以确保其所采购和使用的设备符合预期要求,从而提高工作效率和数据安全性。同时,DLT667-1999标准还为企业和机构与供应商的合作提供了一个公平和客观的基础。 ### 回答2: dlt667-1999是一个产品标准的编号。这个标准指的是磁带驱动器,具体规定了该驱动器的性能、尺寸、接口等方面的要求。标准的编号中的“dlt”是指“数字线性磁带”,有着高容量和高性能的特点。而“667”则是指该规格的第667个版本。 根据这个标准,制造商可以根据要求生产磁带驱动器,使其具备相应的性能和尺寸,并符合与其他设备的兼容性。 标准制定的目的是保证产品的质量和功能的统一性,以便更好地满足用户的需求。这不仅有助于制造商开发相应的产品,也对用户的使用提供了便利。通过遵循标准,制造商可以更容易地获得市场认可,用户则可以更方便地找到符合自己需求的产品。 dlt667-1999标准还规定了磁带驱动器的性能指标,例如传输速率、容量、数据密度等等。这些性能要求有助于用户选择合适的驱动器,同时也可以作为制造商设计和生产产品的基准。此外,标准还包括了外观尺寸和接口类型的要求,以确保磁带驱动器可以与其他设备进行良好的连接和兼容。 总之,dlt667-1999是一个针对磁带驱动器的产品标准,规定了该驱动器的性能、尺寸和接口等方面的要求,以保证产品的质量和功能的统一性,并提供给制造商和用户作为参考的依据。 ### 回答3: dlt667-1999 是指由中国国家标准化管理委员会发布的国家标准,其全名为《输送机带运输车用带轮系列》(Ditch Lorry Conveyor Belt Series),标准编号为DL/T 667-1999。该标准主要适用于输送机带轮的设计、制造和使用,具体规定了输送机带轮的技术要求、试验方法、检验规则以及标志、包装、运输等方面的要求。 DL/T 667-1999 标准的制定旨在保障输送机带轮在运输车辆中的正常运行和使用安全,提高运输车辆的工作效率。该标准规定了输送机带轮的基本形状、尺寸、结构和材料要求,要求其具备一定的耐磨、耐久性和可靠性。 在技术要求方面,标准要求输送机带轮的材料选择合理,具备良好的抗张强度和耐磨性能。同时,要求输送机带轮的安装方式和操作方便,能够在使用过程中进行调整和维护。 为了保证输送机带轮的质量,标准还规定了相应的试验方法和检验规则。例如,要求对输送机带轮进行外观检查、尺寸测量、材料性能测试等,确保其符合标准的要求。 总的来说,DL/T 667-1999 标准对输送机带轮的设计、制造和使用进行了规定,旨在提高输送机设备的质量和安全性。通过遵循该标准,可以保证输送机带轮的正常运行,提高运输车辆的工作效率,为相关行业的发展和应用提供了技术支持。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值