com.azalient.api.b.assignment
Interface ITwig

All Superinterfaces:
IDecisionOption, IDecisionPoint, ITwigRouting
All Known Subinterfaces:
ILink, IParkingDestination, IUserTwig

public interface ITwig
extends ITwigRouting, IDecisionPoint, IDecisionOption

A "twig" is one section or "branch" of a route. It can represent a walkway or a road or railway, or a section of a trip taken on public transport. It holds information about the number of possible exits and entries, restrictions on use, and places (origins or destinations) to which it is connected


Field Summary
static ITwig[] ZERO
          A static zero-length array, created for convenience, and to save memory
 
Method Summary
 boolean allowed(IBehaviour behaviour)
          Returns true if agents with this behaviour are allowed to travel on this twig
 boolean barred()
          Returns true if this twig is permanently barred to all agents
 boolean barredTurn(ITwig that)
          Returns true if the turn from this twig to that is permanently barred
 boolean canArriveHere()
          Returns true if a trip can finish here - which means that this twig is inside or connected to a destination place
 boolean canDepartHere()
          Returns true if a trip can start here - which means that this twig is inside or connected to an origin place
 IXyz centroid()
          The location of a point that is near the centre of this twig.
 boolean connectedTo(ITwig that)
          returns true if this link is connected to the given link
 void drawConnectionTo(ITwig that, IDrawing drw, int rgb, double strength, boolean drawInTwig, ITwig origin, IPlace dest, IBehaviour b, IType type)
          Draw the connection between this twig and that in the given colour.
 void drawFilled(IDrawing drw, int rgb)
          Draw this twig in the given colour.
 IXyz endLocation()
          Returns a point location at the end of this twig, used for route display and to centre the view on this twig
 int entries()
          the number of open inward components
 int entriesXU()
          the number of open inward components
 ITwig entry(int index)
          an open inward component, index [1..N]
 ITwig exit(int index)
          an open outward component, index [1..N]
 int exitIndex(ITwig exit)
          Return the [1..N] index of the given outward link, or 0 if it is not connected.
 int exits()
          the number of open outward components, including U_turn, if allowed
 int exitsXU()
          the number of open outward components, excluding U-Turn
 boolean highlightAllOptions()
          Returns true of all available options should be highlighted in the display when a highlighted trip passes this twig
 boolean inside(IPlace place)
          Returns true if this twig is inside (or connected to) the given place
 boolean insidePlace()
          Returns true if this twig is inside (or connected to) any place
 Distance length()
          The (apparent) length of this twig, for routing purposes.
 boolean permittedByModeChanges(IBehaviour b)
          Returns true if an agent with the given behaviour is permitted on this twig.
 boolean permittedByModeChanges(IModeChanges mc, boolean set)
          Returns true if an agent with the given set of recorded mode changes can use this twig
 IPlace[] places()
          An array of places to which this twig is connected, or inside
 double releaseRate()
          Returns the release rate for trips departing from this twig, in the range [0.0 ...
 void releaseRate(Double d)
          Set the release rate for this twig, a value in the range [0.0 ...
 Strand routeChoiceStrand()
          Return the route choice strand (of DNA) that is used for routing decisions on twigs of this type
 boolean selected()
          Returns true if this twig is selected in the GUI.
 Signal signal(ITwig that)
          Returns the current Signal associated with this twig, or null, if this type of twig does not support signalling
 void signal(ITwig that, Signal signal)
          Sets the current Signal associated with this twig.
 IXyz startLocation()
          Returns a point location at the start of this twig, used for route display and to centre the view on this twig
 String traceDescription()
          Returns a description of this twig, for route tracing
 TravelMode travelMode()
          The mode of travel on this twig
 
Methods inherited from interface com.azalient.api.b.assignment.ITwigRouting
alwaysEnd, alwaysStart, costFactor, distance, distance, perturbHere, price, price, routeClass, routeDistanceFactor, routeLength, routePrice, routePriceFactor, routeSpeed, routeTimeFactor, travelTime, travelTime
 
Methods inherited from interface com.azalient.api.b.assignment.IDecisionPoint
addSplit, name, options, splits, splits
 
Methods inherited from interface com.azalient.api.b.assignment.IDecisionOption
openFrom
 

Field Detail

ZERO

static final ITwig[] ZERO
A static zero-length array, created for convenience, and to save memory

Method Detail

travelMode

TravelMode travelMode()
The mode of travel on this twig


exits

int exits()
the number of open outward components, including U_turn, if allowed


exitsXU

int exitsXU()
the number of open outward components, excluding U-Turn


exit

ITwig exit(int index)
an open outward component, index [1..N]


exitIndex

int exitIndex(ITwig exit)
Return the [1..N] index of the given outward link, or 0 if it is not connected. For roads, when driving on the left, this is in clockwise order, for driving on the right, it is in anti-clockwise order. Where a U-Turn is possible, this will be the last exit, N


entries

int entries()
the number of open inward components


entriesXU

int entriesXU()
the number of open inward components


entry

ITwig entry(int index)
an open inward component, index [1..N]


length

Distance length()
The (apparent) length of this twig, for routing purposes. Might be more or less than the length of the physical surface that models this twig.


centroid

IXyz centroid()
The location of a point that is near the centre of this twig. This location is used for labelling and to centre the view point on this twig.


allowed

boolean allowed(IBehaviour behaviour)
Returns true if agents with this behaviour are allowed to travel on this twig


barred

boolean barred()
Returns true if this twig is permanently barred to all agents


barredTurn

boolean barredTurn(ITwig that)
Returns true if the turn from this twig to that is permanently barred


canArriveHere

boolean canArriveHere()
Returns true if a trip can finish here - which means that this twig is inside or connected to a destination place


canDepartHere

boolean canDepartHere()
Returns true if a trip can start here - which means that this twig is inside or connected to an origin place


releaseRate

double releaseRate()
Returns the release rate for trips departing from this twig, in the range [0.0 ... 1.0]

This is valid only if this is a departure twig and there are other departure twigs inside or connected to a place.

For example, if there were two departure twigs, and the rate on this twig was set to 0.8 and the rate on the other was set to 0.2, then on average 8 out of every 10 trips would be released from this twig.


releaseRate

void releaseRate(Double d)
Set the release rate for this twig, a value in the range [0.0 ... 1.0]. See releaseRate()


signal

Signal signal(ITwig that)
Returns the current Signal associated with this twig, or null, if this type of twig does not support signalling


signal

void signal(ITwig that,
            Signal signal)
Sets the current Signal associated with this twig. This has no effect if this type of twig does not support signalling


connectedTo

boolean connectedTo(ITwig that)
returns true if this link is connected to the given link


drawFilled

void drawFilled(IDrawing drw,
                int rgb)
Draw this twig in the given colour. Like any drawing command, this can only be called when the context is set - see IDrawing


drawConnectionTo

void drawConnectionTo(ITwig that,
                      IDrawing drw,
                      int rgb,
                      double strength,
                      boolean drawInTwig,
                      ITwig origin,
                      IPlace dest,
                      IBehaviour b,
                      IType type)
Draw the connection between this twig and that in the given colour. Like any drawing command, this can only be called when the context is set - see IDrawing

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

traceDescription

String traceDescription()
Returns a description of this twig, for route tracing


routeChoiceStrand

Strand routeChoiceStrand()
Return the route choice strand (of DNA) that is used for routing decisions on twigs of this type


selected

boolean selected()
Returns true if this twig is selected in the GUI.


highlightAllOptions

boolean highlightAllOptions()
Returns true of all available options should be highlighted in the display when a highlighted trip passes this twig


permittedByModeChanges

boolean permittedByModeChanges(IModeChanges mc,
                               boolean set)
Returns true if an agent with the given set of recorded mode changes can use this twig

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

permittedByModeChanges

boolean permittedByModeChanges(IBehaviour b)
Returns true if an agent with the given behaviour is permitted on this twig. This is similar to allowed(IBehaviour)


startLocation

IXyz startLocation()
Returns a point location at the start of this twig, used for route display and to centre the view on this twig


endLocation

IXyz endLocation()
Returns a point location at the end of this twig, used for route display and to centre the view on this twig


places

IPlace[] places()
An array of places to which this twig is connected, or inside


inside

boolean inside(IPlace place)
Returns true if this twig is inside (or connected to) the given place


insidePlace

boolean insidePlace()
Returns true if this twig is inside (or connected to) any place