com.azalient.api.b.network
Interface IIntersection

All Superinterfaces:
IRecord, ISurface, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW

public interface IIntersection
extends ISurface, StoreRecordRW

A road intersection, which may be signalised or unsignalised. An intersection contains one or more nodes, and there is no upper limit on the number of nodes, so intersections may be arbitrarily complex.

For example, a roundabout is commonly configured to be a single intersection, as is a staggered 4-way junction.

A vehicle approaching an intersection can make decisions based on the numbered exit from that intersection, which is more powerful than decisions based on simple link-exit numbers.

If the intersection is signalised it will have an associated controller. The limitation of one intersection per controller is not really a limitation, as the intersection can be arbitrarily complex.


Field Summary
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 IUndoable add(IUndoStack us, IStream m)
          Add a stream to this intersection
 void addCrossing(ICrossing crossing)
          Add a crossing to the array stored by this intersection
 IUndoable addNode(IUndoStack us, INode node)
          Add a node to this intersection
 IUndoable addTurn(IUndoStack us, ITurn turn)
          Add a turn to this intersection
 IController controller()
          Returns the controller for this intersection, if it is signalised
 void controller(IController controller)
          Set the controller for this intersection
 ICrossing[] crossings()
          An array of crossings stored at this intersection.
 IXyz defaultControllerPosition()
          Returns the default location for the south-west corner of the controller box
 void delCrossing(ICrossing crossing)
          Delete a crossing from the array stored by this intersection
 IUndoable delNode(IUndoStack us, INode node)
          Delete a node from this intersection
 IUndoable delTurn(IUndoStack us, ITurn turn)
          Delete a turn from this intersection
 IXyz[][] edgePoints()
          Return a 2-dimensional array of points defining the intersection outline.
 int exits()
          The number of exits from this intersection.
 ITurn firstTurnMatching(ILink linkI, ILink linkO)
          Returns the first turn that matches the inward-outward link pair.
 void nextlanes(ILane entry, ILink exit, int next, int range)
          Create or remove streams on this intersection between the given pair of links to match the lane range specified
 IXyz nodeCentroid()
          A location point calculated as the centred of all the nodes that are included in the intersection.
 INode[] nodes()
          Returns an array of nodes that form part of this intersection
 int number()
          Returns the "name" of an intersection, which is an integer number, unique within the model.
 IUndoable remove(IUndoStack us, IStream m)
          Remove a stream from this intersection
 boolean signalized()
          Returns true if the intersection is signalized
 IStream[] streams()
          Returns an array of all the streams on this intersection.
 ITurn[] turns()
          Returns an array of all the turns on this intersection.
 ITurn[] turnsMatching(ILink linkI, ILink linkO)
          Returns an array of all the turns that match the inward-outward link pair.
 
Methods inherited from interface com.azalient.api.b.network.ISurface
add, name, remove, selected
 
Methods inherited from interface com.azalient.api.file.StoreRecordRW
canRename, rename, store
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile
 

Method Detail

number

int number()
Returns the "name" of an intersection, which is an integer number, unique within the model.


nodes

INode[] nodes()
Returns an array of nodes that form part of this intersection


turns

ITurn[] turns()
Returns an array of all the turns on this intersection. If there are multiple nodes, this array includes all the turns at all of those nodes


streams

IStream[] streams()
Returns an array of all the streams on this intersection. If there are multiple nodes, this array includes all the streams at all of those nodes


exits

int exits()
The number of exits from this intersection. Can be used in conjunction with IExitChoice


signalized

boolean signalized()
Returns true if the intersection is signalized


controller

IController controller()
Returns the controller for this intersection, if it is signalised


controller

void controller(IController controller)
Set the controller for this intersection

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

addNode

IUndoable addNode(IUndoStack us,
                  INode node)
Add a node to this intersection

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

delNode

IUndoable delNode(IUndoStack us,
                  INode node)
Delete a node from this intersection

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

addTurn

IUndoable addTurn(IUndoStack us,
                  ITurn turn)
Add a turn to this intersection

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

delTurn

IUndoable delTurn(IUndoStack us,
                  ITurn turn)
Delete a turn from this intersection

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

add

IUndoable add(IUndoStack us,
              IStream m)
Add a stream to this intersection

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

remove

IUndoable remove(IUndoStack us,
                 IStream m)
Remove a stream from this intersection

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

firstTurnMatching

ITurn firstTurnMatching(ILink linkI,
                        ILink linkO)
Returns the first turn that matches the inward-outward link pair. If there is no matching turn for this pair of links, then return null.

On most intersections, there will be either zero or one turn for each link pair, but where an extra turn has been created, perhaps for a bus phase, this will return one of those turns. To retrieve all turns for a link pair, use turnsMatching(ILink, ILink)

A turn will exist for a link pair only if there is a stream connecting a lane on the inward link to a lane on the outward link. If there is only a filter lane, then no turn will exist.

Parameters:
linkI - the inward link, also referred to as the approach road or link
linkO - the outward link, also referred to as the exit road or link

turnsMatching

ITurn[] turnsMatching(ILink linkI,
                      ILink linkO)
Returns an array of all the turns that match the inward-outward link pair. If there is no matching turn for this pair of links, then this returns a zero length array, ITurn.ZERO.

On most intersections, there will be either zero or one turn for each link pair, but where an extra turn has been created, perhaps for a bus phase, there will be two turns for this pair. Theoretically, there is no limit to the number of turns for a link pair, although each turn must have at least one stream.

A turn will exist for a link pair only if there is a stream connecting a lane on the inward link to a lane on the outward link. If there is only a filter lane, then no turn will exist.

Parameters:
linkI - the inward link, also referred to as the approach road or link
linkO - the outward link, also referred to as the exit road or link

nodeCentroid

IXyz nodeCentroid()
A location point calculated as the centred of all the nodes that are included in the intersection. This location point could be used for labelling, but is also used in the calculation of the intersection boundary. Moving the node positions will cause this to be recalculated.


defaultControllerPosition

IXyz defaultControllerPosition()
Returns the default location for the south-west corner of the controller box


addCrossing

void addCrossing(ICrossing crossing)
Add a crossing to the array stored by this intersection

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

delCrossing

void delCrossing(ICrossing crossing)
Delete a crossing from the array stored by this intersection

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

crossings

ICrossing[] crossings()
An array of crossings stored at this intersection.


edgePoints

IXyz[][] edgePoints()
Return a 2-dimensional array of points defining the intersection outline.

First dimension = number of polylines
Second dimension = number of points in each polyline


nextlanes

void nextlanes(ILane entry,
               ILink exit,
               int next,
               int range)
Create or remove streams on this intersection between the given pair of links to match the lane range specified

Parameters:
entry - the entry or approach link
exit - the exit link
next - the lowest numbered exit lane index
range - the size of the range of exit lanes, 1 for a single lane, 2 for 2 lanes, etc.
Internal - Not recommended for use. Public as a side-effect of implementation method