com.azalient.api.sim.routes
Interface IRouter

All Superinterfaces:
AgentEventDepart, AgentEventTestRoute, ModelEventActionSelection, ModelEventSaveListener, ModelEventTimeRewind, ModelEventTimeSec, ModelEventTimeStep, ModelEventViewLegend, ModelEventViewModel
All Known Subinterfaces:
IPersonRouter, IVehicleRouter

public interface IRouter
extends ModelEventActionSelection, ModelEventTimeRewind, ModelEventTimeSec, ModelEventTimeStep, ModelEventViewModel, ModelEventViewLegend, ModelEventSaveListener, AgentEventDepart, AgentEventTestRoute

The router contains the logic for route choice decisions. There is a router for people, and a separate one for vehicles.


Method Summary
 boolean activeAndReady()
          Returns true if this router is ready to be used by agents
 void afterPluginOpen()
          [Internal] Called after all plugins have been opened - some may choose to modify routing costs
 void afterRenew()
          [Internal] Called after any module has been renewed
 IAgentLocator agentLocator(ITwig twig, ITrip trip, boolean useParked)
          Set the initial location for the agent, if necessary using additional logic (such as lane choice)
 IBehaviour behaviour(int tableIndex)
          Returns the behaviour that corresponds to the given table index
 void clearUnavailable()
          Clear the table on the routing window showing unavailable routes
 void destroy()
          [Internal] called when router is about to be destroyed, to discard resources and clean up memory
 double feedbackDecay()
          Returns the route feedback decay parameter, a value between 0.0 and 1.0.
 void feedbackDecay(double d)
          Set the feedback decay parameter
 UTime feedbackPeriod()
          Returns the feedback interval time.
 void feedbackPeriod(UTime t)
          Set the feedback interval time.
 double feedbackSmoothing()
          Returns the route feedback smoothing parameter, a value between 0.0 and 1.0.
 void feedbackSmoothing(double d)
          Set the feedback smoothing parameter
 void findPlaces()
          Carry out walkway-inside-area and link-inside-zone tests, to determine the place, if any, for each twig.
 int lookAhead()
          Returns the number of lookahead links, default is 1.
 void lookAhead(int choices)
          Set the routing look ahead parameter
 ITwig lowestCostExit(ITrip trip, ITwig twig)
          Return the lowest cost exit for the given trip at the given location
 ITwig lowestCostExit(ITwig twig, IPlace dest, IBehaviour b)
          Return the lowest cost exit to the given dest at the given location, for the given behaviour, using AON routing.
 ITwig lowestCostExit(ITwig twig, IPlace dest, IType type)
          Return the lowest cost exit to the given dest at the given location, for the given type, using AON routing.
 int lowestCostExitIndex(ITrip trip, ITwig twig)
          Return the lowest cost exit Index for the given trip at the given location
 TripMode mode()
          The mode of trip for this router
 int nTables()
          Returns the number of separate route cost tables, equal to the number of behaviours
 void openTurn(ITwig link, ITwig exit, boolean open)
          Open (or close) the turn at the given entry-exit pair.
 ITwig originTwig(ITrip trip, boolean reportAllFailures)
          Return the best departure location twig for the given trip
 ITwig originTwigSetImmediateDest(ITrip trip, boolean reportAllFailures)
          Return the best departure location twig for the given trip, and set the immediate destination index in the trip (either a gateway, if there are any, or the ultimate destination)
 void pluginClose()
          [Internal] Called when plugins are closed
 void rebuildIfRequired()
          Rebuild routes only if there has been a change to the routing origins and destinations, for example zones or areas have been added, moved or deleted.
 void rebuildNow()
          Rebuild all routes now, regardless of any changes, but do not mark the router as ready for use by agents.
 void rebuildNow(boolean isReady)
          Rebuild all routes now, regardless of any changes, and if isReady is true, mark the router as ready for use by agents.
 void rebuildOnSave()
          Queue up a router rebuild on the next save operation
 void recalculate()
          Recalculate the costs of routes from each twig to each destination.
 Price routeCost(ITwig twig, IAgent agent)
          Return the cost to the destination for the given agent from the given twig
 Price routeCost(ITwig twig, int placeIndex, int behaviourIndex)
          Return the cost to the destination given by an index into the list of places, and a given behaviour index
 boolean routeExists(ITwig anyTwig, IAgent agent)
          Does a route exist from the given twig for the given agent.
 boolean routeExists(ITwig link, ITwig exit, IAgent agent)
          Does a route exist given the pair of twigs, the first of which must be at the end of a limb, and the second must be at the start
 boolean signalised(ITwig twig)
          Returns true if this twig is signalised
 int tableIndex(IType type)
          Returns the table index (the behaviour index) for the given type
 Price turnCost(ITwig twig, ITwig exit, IAgent agent)
          Return the cost of making the turn from twig to exit for the given agent
 UTime turnTime(ITwig entry, ITwig exit, IBehaviour behaviour)
          Returns any turn-time object for the given entry-exit turn, and the given behaviour.
 
Methods inherited from interface com.azalient.api.event.model.ModelEventActionSelection
actionSelection
 
Methods inherited from interface com.azalient.api.event.model.ModelEventTimeRewind
timeRewind
 
Methods inherited from interface com.azalient.api.event.model.ModelEventTimeSec
timeSec
 
Methods inherited from interface com.azalient.api.event.model.ModelEventTimeStep
timeStep
 
Methods inherited from interface com.azalient.api.event.model.ModelEventViewModel
viewModel
 
Methods inherited from interface com.azalient.api.event.model.ModelEventViewLegend
viewLegend
 
Methods inherited from interface com.azalient.api.event.model.ModelEventSaveListener
pluginSave
 
Methods inherited from interface com.azalient.api.event.agent.AgentEventDepart
depart
 
Methods inherited from interface com.azalient.api.event.agent.AgentEventTestRoute
testRoute
 

Method Detail

mode

TripMode mode()
The mode of trip for this router


rebuildOnSave

void rebuildOnSave()
Queue up a router rebuild on the next save operation


rebuildIfRequired

void rebuildIfRequired()
Rebuild routes only if there has been a change to the routing origins and destinations, for example zones or areas have been added, moved or deleted.


rebuildNow

void rebuildNow()
Rebuild all routes now, regardless of any changes, but do not mark the router as ready for use by agents.


rebuildNow

void rebuildNow(boolean isReady)
Rebuild all routes now, regardless of any changes, and if isReady is true, mark the router as ready for use by agents.

This is a more compute-intensive operation than recalculate(), which assumes origins and destinations are unchanged in number and location.


findPlaces

void findPlaces()
Carry out walkway-inside-area and link-inside-zone tests, to determine the place, if any, for each twig.


clearUnavailable

void clearUnavailable()
Clear the table on the routing window showing unavailable routes


recalculate

void recalculate()
Recalculate the costs of routes from each twig to each destination. This takes into account changing costs caused, for example, by time-dependent restrictions.


openTurn

void openTurn(ITwig link,
              ITwig exit,
              boolean open)
Open (or close) the turn at the given entry-exit pair. A closed turn will have an infinite cost.


lowestCostExit

ITwig lowestCostExit(ITwig twig,
                     IPlace dest,
                     IBehaviour b)
Return the lowest cost exit to the given dest at the given location, for the given behaviour, using AON routing. There can be no perturbation as there is no trip DNA


lowestCostExit

ITwig lowestCostExit(ITwig twig,
                     IPlace dest,
                     IType type)
Return the lowest cost exit to the given dest at the given location, for the given type, using AON routing. There can be no perturbation as there is no trip DNA


lowestCostExit

ITwig lowestCostExit(ITrip trip,
                     ITwig twig)
Return the lowest cost exit for the given trip at the given location


lowestCostExitIndex

int lowestCostExitIndex(ITrip trip,
                        ITwig twig)
Return the lowest cost exit Index for the given trip at the given location


routeExists

boolean routeExists(ITwig anyTwig,
                    IAgent agent)
Does a route exist from the given twig for the given agent. The twig can be anywhere on a limb.


routeExists

boolean routeExists(ITwig link,
                    ITwig exit,
                    IAgent agent)
Does a route exist given the pair of twigs, the first of which must be at the end of a limb, and the second must be at the start


routeCost

Price routeCost(ITwig twig,
                IAgent agent)
Return the cost to the destination for the given agent from the given twig


turnCost

Price turnCost(ITwig twig,
               ITwig exit,
               IAgent agent)
Return the cost of making the turn from twig to exit for the given agent


routeCost

Price routeCost(ITwig twig,
                int placeIndex,
                int behaviourIndex)
Return the cost to the destination given by an index into the list of places, and a given behaviour index


afterPluginOpen

void afterPluginOpen()
[Internal] Called after all plugins have been opened - some may choose to modify routing costs

Internal - Not recommended for use. Public as a side-effect of implementation method

afterRenew

void afterRenew()
[Internal] Called after any module has been renewed

Internal - Not recommended for use. Public as a side-effect of implementation method

pluginClose

void pluginClose()
[Internal] Called when plugins are closed

Internal - Not recommended for use. Public as a side-effect of implementation method

originTwig

ITwig originTwig(ITrip trip,
                 boolean reportAllFailures)
Return the best departure location twig for the given trip


originTwigSetImmediateDest

ITwig originTwigSetImmediateDest(ITrip trip,
                                 boolean reportAllFailures)
Return the best departure location twig for the given trip, and set the immediate destination index in the trip (either a gateway, if there are any, or the ultimate destination)


agentLocator

IAgentLocator agentLocator(ITwig twig,
                           ITrip trip,
                           boolean useParked)
Set the initial location for the agent, if necessary using additional logic (such as lane choice)


feedbackPeriod

UTime feedbackPeriod()
Returns the feedback interval time. If this is non-zero, recalculate() will be called at the end of every interval, and routes will be recalculated based on experienced travel time, updated public transport schedules


feedbackDecay

double feedbackDecay()
Returns the route feedback decay parameter, a value between 0.0 and 1.0. A value of 1.0 means no decay, a value of 0.0 is maximum decay, returning the recorded time to the freeflow time after a single decay interval


feedbackSmoothing

double feedbackSmoothing()
Returns the route feedback smoothing parameter, a value between 0.0 and 1.0. A value of 1.0 means no smoothing - apply the new value immediately, a value of 0.0 is maximum smoothing - always retain the old value


lookAhead

int lookAhead()
Returns the number of lookahead links, default is 1. This is used to look ahead for changes in cost on each recalculation


feedbackPeriod

void feedbackPeriod(UTime t)
Set the feedback interval time.

See Also:
feedbackPeriod()

feedbackDecay

void feedbackDecay(double d)
Set the feedback decay parameter

See Also:
feedbackDecay()

feedbackSmoothing

void feedbackSmoothing(double d)
Set the feedback smoothing parameter

See Also:
feedbackSmoothing()

lookAhead

void lookAhead(int choices)
Set the routing look ahead parameter

See Also:
lookAhead()

destroy

void destroy()
[Internal] called when router is about to be destroyed, to discard resources and clean up memory

Internal - Not recommended for use. Public as a side-effect of implementation method

turnTime

UTime turnTime(ITwig entry,
               ITwig exit,
               IBehaviour behaviour)
Returns any turn-time object for the given entry-exit turn, and the given behaviour. Returns null if no turn time has been defined for this turn-behaviour combination.


activeAndReady

boolean activeAndReady()
Returns true if this router is ready to be used by agents


signalised

boolean signalised(ITwig twig)
Returns true if this twig is signalised


nTables

int nTables()
Returns the number of separate route cost tables, equal to the number of behaviours


tableIndex

int tableIndex(IType type)
Returns the table index (the behaviour index) for the given type


behaviour

IBehaviour behaviour(int tableIndex)
Returns the behaviour that corresponds to the given table index