本文整理汇总了Java中movement.map.MapRoute类的典型用法代码示例。如果您正苦于以下问题:Java MapRoute类的具体用法?Java MapRoute怎么用?Java MapRoute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapRoute类属于movement.map包,在下文中一共展示了MapRoute类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MapRouteMovement
import movement.map.MapRoute; //导入依赖的package包/类
/**
* Creates a new movement model based on a Settings object's settings.
* @param settings The Settings object where the settings are read from
*/
public MapRouteMovement(Settings settings) {
super(settings);
String fileName = settings.getSetting(ROUTE_FILE_S);
int type = settings.getInt(ROUTE_TYPE_S);
allRoutes = MapRoute.readRoutes(fileName, type, getMap());
nextRouteIndex = 0;
pathFinder = new DijkstraPathFinder(getOkMapNodeTypes());
this.route = this.allRoutes.get(this.nextRouteIndex).replicate();
if (this.nextRouteIndex >= this.allRoutes.size()) {
this.nextRouteIndex = 0;
}
if (settings.contains(ROUTE_FIRST_STOP_S)) {
this.firstStopIndex = settings.getInt(ROUTE_FIRST_STOP_S);
if (this.firstStopIndex >= this.route.getNrofStops()) {
throw new SettingsError("Too high first stop's index (" +
this.firstStopIndex + ") for route with only " +
this.route.getNrofStops() + " stops");
}
}
}
开发者ID:mdonnyk,项目名称:the-one-mdonnyk,代码行数:26,代码来源:MapRouteMovement.java
示例2: MapRouteMovement
import movement.map.MapRoute; //导入依赖的package包/类
/**
* Creates a new movement model based on a Settings object's settings.
* @param settings The Settings object where the settings are read from
*/
public MapRouteMovement(Settings settings) {
super(settings);
String fileName = settings.getSetting(ROUTE_FILE_S);
int type = settings.getInt(ROUTE_TYPE_S);
allRoutes = MapRoute.readRoutes(fileName, type, getMap());
nextRouteIndex = 0;
pathFinder = new DijkstraPathFinder(getOkMapNodeTypes());
this.route = this.allRoutes.get(this.nextRouteIndex).replicate();
if (this.nextRouteIndex >= this.allRoutes.size()) {
this.nextRouteIndex = 0;
}
if (settings.contains(ROUTE_FIRST_STOP_S)) {
this.firstStopIndex = settings.getInt(ROUTE_FIRST_STOP_S);
if (this.firstStopIndex >= this.route.getNrofStops()) {
throw new SettingsError("Too high first stop's index (" +
this.firstStopIndex + ") for route with only " +
this.route.getNrofStops() + " stops");
}
}
}
开发者ID:raveious,项目名称:delay-tolerant-network,代码行数:26,代码来源:MapRouteMovement.java
示例3: MapRouteMovement
import movement.map.MapRoute; //导入依赖的package包/类
/**
* Creates a new movement model based on a Settings object's settings.
*
* @param settings
* The Settings object where the settings are read from
*/
public MapRouteMovement(Settings settings) {
super(settings);
String fileName = settings.getSetting(ROUTE_FILE_S);
int type = settings.getInt(ROUTE_TYPE_S);
allRoutes = MapRoute.readRoutes(fileName, type, getMap());
nextRouteIndex = 0;
pathFinder = new DijkstraPathFinder(getOkMapNodeTypes());
this.route = this.allRoutes.get(this.nextRouteIndex).replicate();
if (this.nextRouteIndex >= this.allRoutes.size()) {
this.nextRouteIndex = 0;
}
}
开发者ID:robgjansen,项目名称:tps-one-simulator,代码行数:19,代码来源:MapRouteMovement.java
注:本文中的movement.map.MapRoute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论