@Override public double getFlowCapacityPerSec() { return this.link.getFlowCapacityPerSec() ; } @Override
@Override public double getFlowCapacityPerSec( double time ) { return this.link.getFlowCapacityPerSec(time) ; }
@Override public void recalcTimeVariantAttributes() { double now = context.getSimTimer().getTimeOfDay() ; qlane.changeUnscaledFlowCapacityPerSecond( this.getLink().getFlowCapacityPerSec(now ) ); qlane.changeEffectiveNumberOfLanes(this.getLink().getNumberOfLanes(now)); // qlane.changeSpeedMetersPerSecond( getLink().getFreespeed(now) ) ; flowCap & nLanes are "push", freeSpeed is //"pull". This is not completely honest w.r.t. freeSpeed consequences to the fdiag, but also wasn't correctly //thought through/implemented when I found it. kai, feb'18 qlane.recalcTimeVariantAttributes(); }
@Override public QueueWithBuffer createLane( AbstractQLink qLink ) { // a number of things I cannot configure before I have the qlink: if ( id==null ) { id = Id.create( qLink.getLink().getId() , Lane.class ) ; } if ( length==null ) { length = qLink.getLink().getLength() ; } if ( effectiveNumberOfLanes==null ) { effectiveNumberOfLanes = qLink.getLink().getNumberOfLanes() ; } if ( flowCapacity_s==null ) { flowCapacity_s = ((Link)qLink.getLink()).getFlowCapacityPerSec() ; } return new QueueWithBuffer( qLink.getInternalInterface(), vehicleQueue, id, length, effectiveNumberOfLanes, flowCapacity_s, context ) ; } }
public Road(Scheduler scheduler, Link link) { super(scheduler); this.link = link; /* * calculate the maximum number of cars, which can be on the road at the * same time */ this.maxNumberOfCarsOnRoad = Math.round(link.getLength() * NetworkUtils.getNumberOfLanesAsInt(Time.UNDEFINED_TIME, link) * config.getStorageCapacityFactor() / config.getCarSize()); /** * it is assured here, that a road must have the space of at least one * car */ if (this.maxNumberOfCarsOnRoad == 0) { this.maxNumberOfCarsOnRoad = 1; } double maxInverseInFlowCapacity = 3600 / (config.getMinimumInFlowCapacity() * config.getFlowCapacityFactor() * NetworkUtils.getNumberOfLanesAsInt(Time.UNDEFINED_TIME, link)); this.inverseOutFlowCapacity = 1 / (((Link) link).getFlowCapacityPerSec() * config.getFlowCapacityFactor()); if (this.inverseOutFlowCapacity > maxInverseInFlowCapacity) { this.inverseInFlowCapacity = maxInverseInFlowCapacity; } else { this.inverseInFlowCapacity = this.inverseOutFlowCapacity; } this.gapTravelTime = link.getLength() / config.getGapTravelSpeed(); // gap must be initialized to null because of the application logic this.gap = null; }