Package org.goplanit.gap
Class LinkBasedRelativeDualityGapFunction
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<GapFunction>
-
- org.goplanit.gap.GapFunction
-
- org.goplanit.gap.LinkBasedRelativeDualityGapFunction
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IdAble>,EventListener,PlanitComponentListener,EventListener,ExternalIdAble,IdAble
public class LinkBasedRelativeDualityGapFunction extends GapFunction
Gap function based on the work of Bovy and Jansen (1983) who take the different between the current system travel time and the system travel time if all flow were to be assigned to the shortest paths, divided by the system travel time- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected doublegapGapstatic doubleINITIAL_GAPinitial gap to useprotected doublemeasuredNetworkCostCurrent system cost as it standsprotected doubleminimumNetworkCostRepresents the total minimum cost possible-
Fields inherited from class org.goplanit.gap.GapFunction
LINK_BASED_RELATIVE_GAP, NORM_BASED_GAP, stopCriterion
-
-
Constructor Summary
Constructors Constructor Description LinkBasedRelativeDualityGapFunction(LinkBasedRelativeDualityGapFunction other)Copy constructorLinkBasedRelativeDualityGapFunction(IdGroupingToken idToken, StopCriterion stopCriterion)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkBasedRelativeDualityGapFunctionclone()Create a shallow copy of this entitydoublecomputeGap()Compute the gap and return itdoublegetGap()Returns the last computed gapdoublegetMeasuredNetworkCost()Return the measured costvoidincreaseConvexityBound(double value)Increase convexity bound cost, i.e.voidincreaseMeasuredCost(double value)Increase system cost, i.e.voidreset()Reset the gap function-
Methods inherited from class org.goplanit.gap.GapFunction
getStopCriterion, hasConverged
-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
hasExternalId, hasXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Constructor Detail
-
LinkBasedRelativeDualityGapFunction
public LinkBasedRelativeDualityGapFunction(IdGroupingToken idToken, StopCriterion stopCriterion)
Constructor- Parameters:
idToken- to use for the generation of its idstopCriterion- StopCriterion object being used
-
LinkBasedRelativeDualityGapFunction
public LinkBasedRelativeDualityGapFunction(LinkBasedRelativeDualityGapFunction other)
Copy constructor- Parameters:
other- to copy
-
-
Method Detail
-
getMeasuredNetworkCost
public double getMeasuredNetworkCost()
Return the measured cost- Returns:
- the measured cost
-
increaseMeasuredCost
public void increaseMeasuredCost(double value)
Increase system cost, i.e. compute it exogenously- Parameters:
value- increase
-
increaseConvexityBound
public void increaseConvexityBound(double value)
Increase convexity bound cost, i.e. compute it exogenously- Parameters:
value- the increase
-
reset
public void reset()
Reset the gap function- Specified by:
resetin classGapFunction
-
computeGap
public double computeGap()
Compute the gap and return it- Specified by:
computeGapin classGapFunction- Returns:
- the gap for the current iteration
-
getGap
public double getGap()
Returns the last computed gap- Specified by:
getGapin classGapFunction- Returns:
- latest gap
-
clone
public LinkBasedRelativeDualityGapFunction clone()
Create a shallow copy of this entity- Specified by:
clonein interfaceIdAble- Specified by:
clonein classGapFunction- Returns:
- shallow copy of entity
-
-