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 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, boolean deepCopy)Copy constructorLinkBasedRelativeDualityGapFunction(IdGroupingToken idToken, StopCriterion stopCriterion)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecomputeGap()Compute the gap and return itLinkBasedRelativeDualityGapFunctiondeepClone()deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibledoublegetGap()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 functionLinkBasedRelativeDualityGapFunctionshallowClone()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:
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
-
shallowClone
public LinkBasedRelativeDualityGapFunction shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein 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:
deepClonein interfaceIdAble- Specified by:
deepClonein classGapFunction- Returns:
- deep copy of entity
-
-