[英]The method areEqualByThreeDecimalPlace(double, double) is undefined for the type DecimalComparator
[英]The method getDistanceByRoute(double, double, double, double) is undefined for the type Car Anylogic
我是 Anylogic 的新手,我正在研究 model,其中一些汽车使用我在 GIS map 中创建的 GIS 路线从 A 点行驶到 B 点。
我需要使用 function getDistanceByRoute 来使用纬度和经度进行一些计算,但它不起作用并且给出了此错误:
说明:方法 getDistanceByRoute(double, double, double, double) 未针对 Car 类型定义。 位置:dinamic3/Car/moving_to_CS - State
我不知道如何解决这个问题,我尝试了 function getDistanceGIS 并且它有效,但我需要使用 getDistanceByRoute,它对距离测量更精确。
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state at_Milano = statechart_state.at_Milano;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state moving_to_Cortina = statechart_state.moving_to_Cortina;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state moving_to_CS = statechart_state.moving_to_CS;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state at_CS = statechart_state.at_CS;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state state5 = statechart_state.state5;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state at_Cortina = statechart_state.at_Cortina;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state state4 = statechart_state.state4;
@AnyLogicCustomProposalPriority(type = AnyLogicCustomProposalPriority.Type.STATIC_ELEMENT)
public static final statechart_state finalState = statechart_state.finalState;
@AnyLogicInternalCodegenAPI
private void enterState( statechart_state self, boolean _destination ) {
switch( self ) {
case at_Milano:
logToDBEnterState(statechart, self);
// (Simple state (not composite))
statechart.setActiveState_xjal( at_Milano );
transition2.start();
return;
case moving_to_Cortina:
logToDBEnterState(statechart, self);
// (Composite state)
{
moveTo(main.cortina);
consumption_switch=1;
charging_switch=0;
time=time();
;}
transition3.start();
transition5.start();
if ( _destination ) {
enterState( state4, true );
}
return;
case moving_to_CS:
logToDBEnterState(statechart, self);
// (Composite state)
{
double a;
double b;
double c;
double d;
a=main.charging_stations.get(k+1).lat_cs;
b=main.charging_stations.get(k+1).lon_cs;
c=main.charging_stations.get(k).lat_cs;
d=main.charging_stations.get(k).lon_cs;
x=(getDistanceByRoute(lat_1,lon_1,a,b)*0.001);
要使这个 function 起作用,您需要引用您希望它应用到的 map:
map.getDistanceByRoute(double, double, double, double);
所以一定要加上“地图”。 到你的代码,如果这是你的名字 map object。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.