Package com.dna.jopt.util.nodesplitter
Class NodeSplitter
java.lang.Object
com.dna.jopt.util.nodesplitter.NodeSplitter
The Class NodeSplitter.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BiFunction<INode,
Integer, String> static final double
static final Duration
-
Method Summary
Modifier and TypeMethodDescriptionstatic Node2NodesMultiDayRelation
attachMultiDayRelation
(List<INode> nodes) Attach multi day relation.resourcesToResourceMap
(List<IResource> ress) splitNodeByConstantMaxDuration
(INode srcNode, Map<String, IResource> map, BiFunction<INode, Integer, String> idGenerator, Duration maxIndividualDuration) Split node by constant max duration.splitNodeByConstantMaxNumber
(INode srcNode, Map<String, IResource> map, BiFunction<INode, Integer, String> idGenerator, int numElements) splitNodeByFlexibleDuration
(INode srcNode, Map<String, IResource> map, Duration maxIndividualDuration) Split node by flexible duration.splitNodeByFlexibleDuration
(INode srcNode, Map<String, IResource> map, Duration maxIndividualDuration, Duration minIndividualDuration) splitNodeByFlexibleDuration
(INode srcNode, Map<String, IResource> map, BiFunction<INode, Integer, String> idGenerator, Duration maxIndividualDuration, Duration minIndividualDuration, double splitRatio)
-
Field Details
-
DEFAULT_INDIVIDUAL_SPLIT_DURATION_RATIO
public static final double DEFAULT_INDIVIDUAL_SPLIT_DURATION_RATIO- See Also:
-
DEFAULT_MIN_INDIVIDUAL_SPLIT_NODE_DURATION
-
DEFAULT_ID_GENERATOR
-
-
Method Details
-
splitNodeByConstantMaxDuration
public static List<INode> splitNodeByConstantMaxDuration(INode srcNode, Map<String, IResource> map, BiFunction<INode, Integer, String> idGenerator, Duration maxIndividualDuration) Split node by constant max duration.- Parameters:
srcNode
- the src nodemap
- the mapidGenerator
- the id generatormaxIndividualDuration
- the max individual duration- Returns:
- the list
-
splitNodeByConstantMaxNumber
-
splitNodeByFlexibleDuration
public static List<INode> splitNodeByFlexibleDuration(INode srcNode, Map<String, IResource> map, Duration maxIndividualDuration) Split node by flexible duration.- Parameters:
srcNode
- the src nodemap
- the mapmaxIndividualDuration
- the max individual duration- Returns:
- the list
-
splitNodeByFlexibleDuration
-
splitNodeByFlexibleDuration
-
optiToResourceMap
-
resourcesToResourceMap
-
attachMultiDayRelation
Attach multi day relation.- Parameters:
nodes
- the nodes- Returns:
- the node 2 nodes multi day relation
-