Class MacroscopicNetworkBuilder
- java.lang.Object
-
- org.planit.network.physical.macroscopic.MacroscopicNetworkBuilder
-
- All Implemented Interfaces:
PhysicalNetworkBuilder
public class MacroscopicNetworkBuilder extends Object implements PhysicalNetworkBuilder
Create network entities for a macroscopic simulation model- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdGroupingToken
groupId
Contiguous id generation within this group id token for all instances created with factory methods in this class
-
Constructor Summary
Constructors Constructor Description MacroscopicNetworkBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Link
createLink(Node nodeA, Node nodeB, double length, String name)
Create a new link instanceLinkSegment
createLinkSegment(Link parentLink, boolean directionAB)
Create a new MacroscopicLinkSegmentMacroscopicLinkSegmentType
createLinkSegmentType(String name, double capacity, double maximumDensity, Object externalId, Map<Mode,MacroscopicModeProperties> modeProperties)
Create a fully functional macroscopic link segment type instanceMode
createMode(long externalModeId, String name, double pcu)
Create a new modeNode
createNode()
Create a new node instanceIdGroupingToken
getIdGroupingToken()
Collect the id grouping token used by this buildervoid
setIdGroupingToken(IdGroupingToken groupId)
Each builder needs a group if token to allow all underlying factory methods to generated ids uniquely tied to the group the entities belong to
-
-
-
Field Detail
-
groupId
protected IdGroupingToken groupId
Contiguous id generation within this group id token for all instances created with factory methods in this class
-
-
Method Detail
-
createMode
public Mode createMode(long externalModeId, String name, double pcu)
Create a new mode- Specified by:
createMode
in interfacePhysicalNetworkBuilder
- Parameters:
externalModeId
- external id of the modename
- name of the modepcu
- pcu value of the mode- Returns:
- created mode
-
createNode
public Node createNode()
Create a new node instance- Specified by:
createNode
in interfacePhysicalNetworkBuilder
- Returns:
- created node
-
createLink
public Link createLink(Node nodeA, Node nodeB, double length, String name) throws PlanItException
Create a new link instance- Specified by:
createLink
in interfacePhysicalNetworkBuilder
- Parameters:
nodeA
- the first node in this linknodeB
- the second node in this linklength
- the length of this linkname
- the name of the link- Returns:
- created link
- Throws:
PlanItException
- thrown if there is an error
-
createLinkSegment
public LinkSegment createLinkSegment(Link parentLink, boolean directionAB)
Create a new MacroscopicLinkSegment- Specified by:
createLinkSegment
in interfacePhysicalNetworkBuilder
- Parameters:
parentLink
- the parent link of this link segmentdirectionAB
- the direction of this link- Returns:
- LinkSegment created
-
createLinkSegmentType
public MacroscopicLinkSegmentType createLinkSegmentType(String name, double capacity, double maximumDensity, Object externalId, Map<Mode,MacroscopicModeProperties> modeProperties)
Create a fully functional macroscopic link segment type instance- Parameters:
name
- the name of this link typecapacity
- the capacity of this link typemaximumDensity
- the maximum density of this link typeexternalId
- the external reference number of this link typemodeProperties
- the mode properties for each mode along this link- Returns:
- macroscopicLinkSegmentType the created link segment type
-
setIdGroupingToken
public void setIdGroupingToken(IdGroupingToken groupId)
Each builder needs a group if token to allow all underlying factory methods to generated ids uniquely tied to the group the entities belong to- Specified by:
setIdGroupingToken
in interfacePhysicalNetworkBuilder
- Parameters:
groupId
- , contiguous id generation within this group for instances created with the factory methods
-
getIdGroupingToken
public IdGroupingToken getIdGroupingToken()
Collect the id grouping token used by this builder- Specified by:
getIdGroupingToken
in interfacePhysicalNetworkBuilder
- Returns:
- idGroupingToken the id grouping token used by this builder
-
-