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 IdGroupingTokengroupIdContiguous 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 LinkcreateLink(Node nodeA, Node nodeB, double length, String name)Create a new link instanceLinkSegmentcreateLinkSegment(Link parentLink, boolean directionAB)Create a new MacroscopicLinkSegmentMacroscopicLinkSegmentTypecreateLinkSegmentType(String name, double capacity, double maximumDensity, Object externalId, Map<Mode,MacroscopicModeProperties> modeProperties)Create a fully functional macroscopic link segment type instanceModecreateMode(long externalModeId, String name, double pcu)Create a new modeNodecreateNode()Create a new node instanceIdGroupingTokengetIdGroupingToken()Collect the id grouping token used by this buildervoidsetIdGroupingToken(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:
createModein 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:
createNodein 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:
createLinkin 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:
createLinkSegmentin 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:
setIdGroupingTokenin 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:
getIdGroupingTokenin interfacePhysicalNetworkBuilder- Returns:
- idGroupingToken the id grouping token used by this builder
-
-