Car Anylogic 类型未定义方法 getDistanceByRoute(double, double, double, double)
The method getDistanceByRoute(double, double, double, double) is undefined for the type Car Anylogic
我是 Anylogic 的新手,我正在研究一个模型,其中人口中的一些汽车使用我在 GIS 地图中创建的 GIS 路线从 A 点行驶到 B 点。
我需要使用函数 getDistanceByRoute 来使用纬度和经度进行一些计算,但它不起作用并给出此错误:
描述:方法 getDistanceByRoute(double, double, double, double) 未为 Car 类型定义。地点:dinamic3/Car/moving_to_CS - 州
我不知道如何解决这个问题,我尝试了函数 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);
要使此功能起作用,您需要引用要应用它的地图:
map.getDistanceByRoute(double, double, double, double);
因此请务必添加“地图”。到您的代码,如果这是您的地图对象的名称。
我是 Anylogic 的新手,我正在研究一个模型,其中人口中的一些汽车使用我在 GIS 地图中创建的 GIS 路线从 A 点行驶到 B 点。
我需要使用函数 getDistanceByRoute 来使用纬度和经度进行一些计算,但它不起作用并给出此错误:
描述:方法 getDistanceByRoute(double, double, double, double) 未为 Car 类型定义。地点:dinamic3/Car/moving_to_CS - 州
我不知道如何解决这个问题,我尝试了函数 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);
要使此功能起作用,您需要引用要应用它的地图:
map.getDistanceByRoute(double, double, double, double);
因此请务必添加“地图”。到您的代码,如果这是您的地图对象的名称。