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 double
gap
Gapstatic double
INITIAL_GAP
initial gap to useprotected double
measuredNetworkCost
Current system cost as it standsprotected double
minimumNetworkCost
Represents 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 LinkBasedRelativeDualityGapFunction
clone()
Create a shallow copy of this entitydouble
computeGap()
Compute the gap and return itdouble
getGap()
Returns the last computed gapdouble
getMeasuredNetworkCost()
Return the measured costvoid
increaseConvexityBound(double value)
Increase convexity bound cost, i.e.void
increaseMeasuredCost(double value)
Increase system cost, i.e.void
reset()
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:
reset
in classGapFunction
-
computeGap
public double computeGap()
Compute the gap and return it- Specified by:
computeGap
in classGapFunction
- Returns:
- the gap for the current iteration
-
getGap
public double getGap()
Returns the last computed gap- Specified by:
getGap
in classGapFunction
- Returns:
- latest gap
-
clone
public LinkBasedRelativeDualityGapFunction clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceIdAble
- Specified by:
clone
in classGapFunction
- Returns:
- shallow copy of entity
-
-