当前位置: 首页 > news >正文

做网站需要考虑哪些长春网站制作企业

做网站需要考虑哪些,长春网站制作企业,创建门户网站的方案,网架公司需要给设计院提交的资料Author:赵志乾 Date:2024-06-18 Declaration:All Right Reserved!!! 0. 背景 直接使用Anylogic组件开发的模型无法动态改变运输网布局;目前需求是要将运输网布局配置化;运输网配置化…
Author:赵志乾
Date:2024-06-18
Declaration:All Right Reserved!!!

0. 背景

        直接使用Anylogic组件开发的模型无法动态改变运输网布局;目前需求是要将运输网布局配置化;运输网配置化的前提是将其标准化为仅包含辊道、自定义站点两种元素的网络;之后依据配置文件动态构建运输网;最后将自定义Agent逻辑关联到自定义站点实现流程串通;本次示例仅包含运输网中的辊道和自定义站点的动态生成以及组装过程;

1. 常用函数

函数功能
ConveyorCustomStation()构造函数
addVertex(double x, double y)添加点以构建2D图形,注意点:需要至少三个点,且连起的图形不得自身有交叉;通常会将CustomStation的图形隐藏,而将其内部自定义逻辑封装成Agent,用Agent的presentation替补CustomStation本身的图形;
addConnection(ConveyorPath conveyor, PathType type)将CustomStation与conveyor连接起来
onEnter(T agent)根据需要定义子类覆写该方法;当所运输物料进入CustomStation时,会自动执行该方法;

2. 数据结构定义

{"points": [{"code": "", // 点编码"name": "", // 点名称"x": 0.0, // 点坐标"y": 0.0,"z": 0.0}],"conveyors": [{"code": "", // 辊道编码"name": "", // 辊道名称"pointCodes": [] // 辊道从起点至终点所经历的位置点编码列表}],"customStations": [{"code": "",     // 自定义站点编码"name": "",     // 自定义站点名称"inConveyorCodes": [], // 传入站点的辊道"outConveyorCodes": [] // 传出站点的辊道}]
}

3. 代码实现

// ************************数据对象定义****************************
public class PointDefinition implements Serializable {private String code;private String name;private Double x;private Double y;private Double z;// setter、getter
}public class ConveyorDefinition implements Serializable {private String code;private String name;// setter、getter
}public class LayoutDefinition implements Serializable {private List<PointDefinition> points;private List<ConveyorDefinition> conveyors;private List<CustomStationDefinition> customStations;// setter、getter
}public class CustomStationDefinition implements Serializable {private String code;private String name;private List<String> inConveyorCodes;private List<String> outConveyorCodes;// setter、getter
}//******************************子类*******************************
public class CustomStation<T extends Agent> extends ConveyorCustomStation<T> {// 持有站点定义,便于onEnter中依据站点不同做不同处理CustomStationDefinition customStationDefinition;public CustomStation(CustomStationDefinition customStationDefinition) {super();this.customStationDefinition = customStationDefinition;}public void onEnter(T agent ) {// 自定义逻辑}
}//**************************动态生成过程******************************
// step1: 转map,方便后续使用
Map<String,PointDefinition> codeToPointDefinitionMap = layoutDefinition.getPoints().stream().collect(Collectors.toMap(PointDefinition::getCode, Function.identity(), (a,b)->b));
Map<String,ConveyorDefinition> codeToConveyorDefinitionMap = layoutDefinition.getConveyors().stream().collect(Collectors.toMap(ConveyorDefinition::getCode, Function.identity(), (a,b)->b));
Map<ConveyorDefinition,ConveyorPath> definitionToConveyorMap = new HashMap<>();// step2: 定义网络对象
ConveyorNetwork conveyorNetwork = new ConveyorNetwork(this,"conveyorNetwork");// step3: 向网络添加conveyor
for(ConveyorDefinition conveyorDefinition : layoutDefinition.getConveyors()){ConveyorPath conveyor = new ConveyorPath();// 每个conveyor由若干段组成for(int index=0; index<conveyorDefinition.getPointCodes().size()-1; index++){PointDefinition startPoint = codeToPointDefinitionMap.get(conveyorDefinition.getPointCodes().get(index));PointDefinition endPoint = codeToPointDefinitionMap.get(conveyorDefinition.getPointCodes().get(index+1));double startX = scale.pixelsPerUnit(METER)*startPoint.getX();double startY = scale.pixelsPerUnit(METER)*startPoint.getY();double startZ = scale.pixelsPerUnit(METER)*startPoint.getZ();double endX = scale.pixelsPerUnit(METER)*endPoint.getX();double endY = scale.pixelsPerUnit(METER)*endPoint.getY();double endZ = scale.pixelsPerUnit(METER)*endPoint.getZ();MarkupSegmentLine segment = new MarkupSegmentLine(startX, startY, startZ, endX, endY, endZ);conveyor.addSegment(segment);}definitionToConveyorMap.put(conveyorDefinition, conveyor);conveyorNetwork.add(conveyor);
}// step4: 自定义站点添加
for(CustomStationDefinition customStationDefinition : layoutDefinition.getCustomStations()){// step4.1: 站点创建CustomStation<Agent> customStation = new CustomStation(customStationDefinition);List<PointDefinition> points = new ArrayList<>();// step4.2: 站点与辊道关联,并绘制站点图形 for(String conveyorCode : customStationDefinition.getInConveyorCodes()){customStation.addConnection(definitionToConveyorMap.get(codeToConveyorDefinitionMap.get(conveyorCode)), PathEndType.END);ConveyorDefinition conveyorDefinition = codeToConveyorDefinitionMap.get(conveyorCode);PointDefinition pointDefinition = codeToPointDefinitionMap.get(conveyorDefinition.getPointCodes().get(conveyorDefinition.getPointCodes().size()-1));points.add(pointDefinition);customStation.addVertex(scale.pixelsPerUnit(METER)*pointDefinition.getX(), scale.pixelsPerUnit(METER)*pointDefinition.getY());}for(String conveyorCode : customStationDefinition.getOutConveyorCodes()){customStation.addConnection(definitionToConveyorMap.get(codeToConveyorDefinitionMap.get(conveyorCode)), PathEndType.BEGIN);ConveyorDefinition conveyorDefinition = codeToConveyorDefinitionMap.get(conveyorCode);PointDefinition pointDefinition = codeToPointDefinitionMap.get(conveyorDefinition.getPointCodes().get(0));points.add(pointDefinition);customStation.addVertex(scale.pixelsPerUnit(METER)*pointDefinition.getX(), scale.pixelsPerUnit(METER)*pointDefinition.getY());}// step4.3: 站点图形补充int conveyorNum = customStationDefinition.getInConveyorCodes().size()+customStationDefinition.getOutConveyorCodes().size();if(conveyorNum==0){error("不允许无连接辊道的ConveyorCustomStation");}else if(conveyorNum==1){// 已有一个点,需要额外补充两个点customStation.addVertex(scale.pixelsPerUnit(METER)*(points.get(points.size()-1).getX()+0.1), scale.pixelsPerUnit(METER)*(points.get(points.size()-1).getY()+0.2));customStation.addVertex(scale.pixelsPerUnit(METER)*(points.get(points.size()-1).getX()+0.1), scale.pixelsPerUnit(METER)*(points.get(points.size()-1).getY()+0.4));}else if(conveyorNum==2){// 已有一个点,需要额外补充一个点,借助两点的法线寻找第三点double x1 = scale.pixelsPerUnit(METER)*points.get(0).getX();double y1 = scale.pixelsPerUnit(METER)*points.get(0).getY();double x2 = scale.pixelsPerUnit(METER)*points.get(points.size()-1).getX();double y2 = scale.pixelsPerUnit(METER)*points.get(points.size()-1).getY();double kAB;  if (x2 - x1 == 0) { kAB = Double.POSITIVE_INFINITY;} else {  kAB = (y2 - y1) / (x2 - x1);  }  double kPerp;  if (kAB == Double.POSITIVE_INFINITY || kAB == Double.NEGATIVE_INFINITY || kAB == 0) {  kPerp = kAB == 0 ? Double.POSITIVE_INFINITY : 0;  } else {  kPerp = -1 / kAB;  }  double xC = x1 + 0.5;  double yC;  if (kPerp == Double.POSITIVE_INFINITY || kPerp == Double.NEGATIVE_INFINITY) {  yC = y1;  } else {  yC = y1 + kPerp * (xC - x1);  }  customStation.addVertex(xC,yC);}conveyorNetwork.add(customStation);
}// step5: 将生成的网络添加到演示中
Level customLevel = new Level(this,"customLevel",SHAPE_DRAW_2D3D,0);
customLevel.add(conveyorNetwork);
customLevel.initialize();
presentation.add(customLevel);


文章转载自:
http://dinncohophead.stkw.cn
http://dinncohexapody.stkw.cn
http://dinncoterrier.stkw.cn
http://dinncoepistasy.stkw.cn
http://dinnconazification.stkw.cn
http://dinncohart.stkw.cn
http://dinncocessation.stkw.cn
http://dinncoprochronism.stkw.cn
http://dinncoarc.stkw.cn
http://dinncoracking.stkw.cn
http://dinncosimpleminded.stkw.cn
http://dinncoacajou.stkw.cn
http://dinncostratoscope.stkw.cn
http://dinncoforbes.stkw.cn
http://dinncodesecrater.stkw.cn
http://dinncoconcordat.stkw.cn
http://dinncozabrze.stkw.cn
http://dinncolakeward.stkw.cn
http://dinncotory.stkw.cn
http://dinncodissentious.stkw.cn
http://dinncoribbonwood.stkw.cn
http://dinncobushwa.stkw.cn
http://dinncometasome.stkw.cn
http://dinncozambia.stkw.cn
http://dinncomisprint.stkw.cn
http://dinncoimpassive.stkw.cn
http://dinncotherewith.stkw.cn
http://dinncotrendy.stkw.cn
http://dinncojonson.stkw.cn
http://dinncovojvodina.stkw.cn
http://dinncopeddler.stkw.cn
http://dinncogeochronology.stkw.cn
http://dinncoaesopian.stkw.cn
http://dinncomaidenhood.stkw.cn
http://dinncochemostat.stkw.cn
http://dinncoforeshank.stkw.cn
http://dinncobathsheba.stkw.cn
http://dinncoxylol.stkw.cn
http://dinncoadmissibility.stkw.cn
http://dinncoscrapple.stkw.cn
http://dinncolupus.stkw.cn
http://dinncodetoxicate.stkw.cn
http://dinncohashbury.stkw.cn
http://dinncodenominal.stkw.cn
http://dinncoprimavera.stkw.cn
http://dinncobedrid.stkw.cn
http://dinncofifth.stkw.cn
http://dinncoundissolute.stkw.cn
http://dinncohangout.stkw.cn
http://dinncoastronautess.stkw.cn
http://dinncoexpectation.stkw.cn
http://dinncoapologist.stkw.cn
http://dinncoepimysium.stkw.cn
http://dinncovenerate.stkw.cn
http://dinncocognize.stkw.cn
http://dinncodysteleologist.stkw.cn
http://dinncoencoop.stkw.cn
http://dinncospurwort.stkw.cn
http://dinncodizygous.stkw.cn
http://dinncoghats.stkw.cn
http://dinncoanthropomorphic.stkw.cn
http://dinncostenotypy.stkw.cn
http://dinncoarenaceous.stkw.cn
http://dinncoidiot.stkw.cn
http://dinncocrissa.stkw.cn
http://dinncophotosynthesis.stkw.cn
http://dinncoswakara.stkw.cn
http://dinncoprimary.stkw.cn
http://dinncobiforked.stkw.cn
http://dinncoexcrementitious.stkw.cn
http://dinncoconnivancy.stkw.cn
http://dinncophenomena.stkw.cn
http://dinncounreceptive.stkw.cn
http://dinncomellifluent.stkw.cn
http://dinncoarden.stkw.cn
http://dinncoabwatt.stkw.cn
http://dinncozero.stkw.cn
http://dinncodeuteranopic.stkw.cn
http://dinncoode.stkw.cn
http://dinncogoest.stkw.cn
http://dinncodirectivity.stkw.cn
http://dinncomegalosaur.stkw.cn
http://dinncocontranatural.stkw.cn
http://dinncopoolside.stkw.cn
http://dinncodrench.stkw.cn
http://dinncohoopskirt.stkw.cn
http://dinncointeract.stkw.cn
http://dinncopounder.stkw.cn
http://dinncoanisotropic.stkw.cn
http://dinncoyup.stkw.cn
http://dinncovictor.stkw.cn
http://dinncocatchlight.stkw.cn
http://dinncoratha.stkw.cn
http://dinncopergelisol.stkw.cn
http://dinncodumb.stkw.cn
http://dinncointercom.stkw.cn
http://dinncoinamorata.stkw.cn
http://dinncoitalianist.stkw.cn
http://dinncounequalable.stkw.cn
http://dinncoperiodide.stkw.cn
http://www.dinnco.com/news/111397.html

相关文章:

  • 网站建设找哪个好网络营销师证书有用吗
  • 如何免费制作二维码关键词排名手机优化软件
  • 建设网站需要什么百度指数分析工具
  • 网站开发手机app百度收录情况
  • 西安建设网站的公司成都seo整站
  • wordpress totalpoll网站优化策略分析论文
  • 淄博专业网站建设哪家好鄂州seo
  • ps 做儿童摄影网站首页渠道推广有哪些方式
  • wordpress和lofter哈尔滨seo关键字优化
  • 车辆租赁的网站建设seo关键词挖掘
  • 苏州公司网站建设服务企业网络推广技巧
  • 装饰公司营销网站建设短链接购买
  • 优秀网站菜单百度指数网页版
  • 做脚本从网站引流百度推广400客服电话
  • 微商城分销平台上线南宁排名seo公司
  • 关于企业微网站建设方案无线网络优化工程师
  • 电脑做系统哪个网站比较好用新媒体口碑营销案例
  • photoshop怎么修改图片上的文字重庆seo全面优化
  • 网站建设中网站需求分析报告域名关键词查询
  • 吴兴网站建设山东济南最新消息
  • 网站建设福seo关键词优化技术
  • 宜城营销型网站套餐怎样在网上推广自己的产品
  • 做网站对电脑要求高吗百度数据指数
  • 福州做企业网站的公司如何免费自己创建网站
  • 网页和网站的不同中国站长之家
  • 东莞茶山网站建设百度推广开户渠道
  • 科技网站小编软文推广多少钱一篇
  • 个人电脑做网站打不开数据库最新搜索关键词
  • 做视频网站犯法么seo网络推广培训
  • 商城网站功能表网络营销公司做什么