/** * Loads the inLinks-array with the corresponding links. * Cannot be called in constructor, as the queueNetwork does not yet know * the queueLinks. Should be called by QueueNetwork, after creating all * QueueNodes and QueueLinks. */ @Override public void init() { int i = 0; for (Link l : this.node.getInLinks().values()) { QNetwork network = netsimEngine.getNetsimNetwork() ; this.inLinksArrayCache[i] = network.getNetsimLinks().get(l.getId()); i++; } /* As the order of links has an influence on the simulation results, * the nodes are sorted to avoid indeterministic simulations. dg[april08] */ Arrays.sort(this.inLinksArrayCache, new Comparator<NetsimLink>() { @Override public int compare(NetsimLink o1, NetsimLink o2) { return o1.getLink().getId().compareTo(o2.getLink().getId()); } }); }
@Override void initializeFactory(AgentCounter agentCounter, MobsimTimer mobsimTimer, NetsimInternalInterface arg2) { network = arg2.getNetsimNetwork().getNetwork(); double effectiveCellSize = ( network).getEffectiveCellSize() ; SnapshotLinkWidthCalculator linkWidthCalculator = new SnapshotLinkWidthCalculator(); linkWidthCalculator.setLinkWidthForVis( qsimConfig.getLinkWidthForVis() ); if (! Double.isNaN(network.getEffectiveLaneWidth())){ linkWidthCalculator.setLaneWidth( network.getEffectiveLaneWidth() ); } AbstractAgentSnapshotInfoBuilder snapshotInfoBuilder = QNetsimEngine.createAgentSnapshotInfoBuilder( scenario, linkWidthCalculator ); this.context = new NetsimEngineContext( events, effectiveCellSize, agentCounter, snapshotInfoBuilder, qsimConfig, mobsimTimer, linkWidthCalculator ) ; this.netsimEngine = arg2 ; }
Link currentLink = fromLink.getLink() ; AcceptTurn turn = turnAcceptanceLogic.isAcceptingTurn(currentLink, fromLane, nextLinkId, veh, this.netsimEngine.getNetsimNetwork(), now); if ( turn.equals(AcceptTurn.ABORT) ) { moveVehicleFromInlinkToAbort( veh, fromLane, now, currentLink.getId() ) ; QLinkI nextQueueLink = this.netsimEngine.getNetsimNetwork().getNetsimLinks().get(nextLinkId); QLaneI nextQueueLane = nextQueueLink.getAcceptingQLane() ; if (nextQueueLane.isAcceptingFromUpstream()) {