19 package tutorial.programming.ownMobsimAgentWithPerception;
34 private MyObserver observer;
38 MyGuidance( MyObserver observer,
Scenario sc ) {
39 this.observer = observer ;
43 public Id<Link> getBestOutgoingLink(Id<Link> linkId) {
47 Id<Link> bestLinkId = null ;
48 double bestLinkCongestion = Double.POSITIVE_INFINITY ;
49 for (
Link outLink : outLinks.values() ) {
50 if ( this.observer.congestionLevel( outLink.getId() ) < bestLinkCongestion ) {
51 bestLinkCongestion = this.observer.congestionLevel( outLink.getId() ) ;
52 bestLinkId = outLink.getId();
Map< Id< Link >,?extends Link > getLinks()
Map< Id< Link >,?extends Link > getOutLinks()