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
,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, boolean deepCopy)
Copy constructorLinkBasedRelativeDualityGapFunction(IdGroupingToken idToken, StopCriterion stopCriterion)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeGap()
Compute the gap and return itLinkBasedRelativeDualityGapFunction
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibledouble
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 functionLinkBasedRelativeDualityGapFunction
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.gap.GapFunction
collectSettingsAsKeyValueMap, 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
clone, 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
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
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, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
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
-
shallowClone
public LinkBasedRelativeDualityGapFunction shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classGapFunction
- Returns:
- shallow copy of entity
-
deepClone
public LinkBasedRelativeDualityGapFunction deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classGapFunction
- Returns:
- deep copy of entity
-
-