use of aimax.osm.routing.MapAdapter in project aima-java by aimacode.
the class OsmAgentBaseApp method updateTrack.
/** Visualizes agent positions. Call from simulation thread. */
private void updateTrack(Agent agent, Metrics metrics) {
MapAdapter map = (MapAdapter) env.getMap();
MapNode node = map.getWayNode(env.getAgentLocation(agent));
if (node != null) {
Platform.runLater(() -> map.getOsmMap().addToTrack(TRACK_NAME, new Position(node.getLat(), node.getLon())));
}
simPaneCtrl.setStatus(metrics.toString());
}
use of aimax.osm.routing.MapAdapter in project aima-java by aimacode.
the class OsmAgentView method updateTrack.
private void updateTrack(Agent agent, String location) {
MapAdapter map = (MapAdapter) getMapEnv().getMap();
MapNode node = map.getWayNode(location);
if (node != null) {
int aIdx = getMapEnv().getAgents().indexOf(agent);
map.getOsmMap().addToTrack(TRACK_NAME + aIdx, new Position(node.getLat(), node.getLon()));
}
}
Aggregations