Class Fork
- All Implemented Interfaces:
Serializable,Cloneable,Copyable
Fork nodes split incoming jobs into parallel sibling tasks that are sent to multiple
output destinations. The number of tasks per output link can be configured using
setTasksPerLink(int).
Solver compatibility for tasksPerLink > 1:
- SolverLDES: Fully supported - correctly simulates multiple tasks per link
- SolverJMT: Fully supported - simulation handles multiple tasks correctly
- SolverMVA (H-T method): Not supported - throws error when tasksPerLink > 1
- SolverMVA (MMT method): Supported - analytical approximation
- See Also:
-
Field Summary
Fields inherited from class jline.lang.nodes.Node
dropStrategy, input, model, nodeIndex, output, sdrDeclarations, server, state, statefulIdx, stationIdx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetModel()Returns the network model containing this node.voidsetBranchProbability(JobClass jobClass, Node destNode, double prob) Activates an outgoing branch only with probabilityprob.voidsetTasksPerLink(int nTasks) Sets the number of tasks sent out on each outgoing link.voidsetTasksPerLink(JobClass jobClass, double nTasks) Sets the tasks per link for one class only, leaving every other class on the node-wide value.voidsetTasksPerLinkDistribution(JobClass jobClass, DiscreteSampler dist) Makes the number of tasks emitted on each outgoing link RANDOM.voidsetTasksPerLinkDistribution(JobClass jobClass, DiscreteSampler dist, Node destNode) Makes the number of tasks emitted on ONE outgoing link random.Methods inherited from class jline.lang.nodes.Node
copy, copyElement, getAttribute, getCap, getClassCap, getDropStrategy, getInput, getNodeIndex, getOutput, getOutputStrategies, getRoutingStrategy, getSections, getServer, getState, getStateDepRouting, getStatefulIdx, getStationIdx, hasClassSwitching, isReferenceStation, isStateful, isStation, link, printSummary, removeJobClass, reset, resetRouting, setModel, setNodeIdx, setProbRouting, setRouting, setRouting, setRouting, setSQRouting, setState, setStateDepRouting, setStationIdx, summary
-
Constructor Details
-
Fork
Creates a new fork node with default name "Fork".- Parameters:
model- the network model to add this fork node to
-
Fork
Creates a new fork node with the specified name. Initializes the fork with buffer input, service tunnel server, and forker output sections.- Parameters:
model- the network model to add this fork node toname- the name for this fork node
-
-
Method Details
-
getModel
Description copied from class:NodeReturns the network model containing this node. -
setTasksPerLink
public void setTasksPerLink(int nTasks) Sets the number of tasks sent out on each outgoing link.By default, a Fork node sends exactly one task per outgoing link. This method allows configuring the Fork to send multiple identical tasks on each link. The total number of tasks created will be: (number of outgoing links) × tasksPerLink.
Important: Values greater than 1 are only fully supported by simulation-based solvers (SolverLDES, SolverJMT). Analytical solvers may produce errors or inaccurate results.
- Parameters:
nTasks- the number of tasks to send on each outgoing link (default: 1)- See Also:
-
setTasksPerLink
Sets the tasks per link for one class only, leaving every other class on the node-wide value.- Parameters:
jobClass- the class the count applies tonTasks- the number of tasks emitted on each outgoing link
-
setTasksPerLinkDistribution
Makes the number of tasks emitted on each outgoing link RANDOM.The degree is redrawn independently for every link and every forked job, which is the variable forking level of JMT's JobsPerLinkDis. Exact under SolverJMT and SolverLDES, which draw it at the fork epoch; the analytical solvers see E[dist].
- Parameters:
jobClass- the class the distribution applies todist- a DiscreteSampler over the tasks-per-link support
-
setTasksPerLinkDistribution
Makes the number of tasks emitted on ONE outgoing link random.- Parameters:
jobClass- the class the distribution applies todist- a DiscreteSampler over the tasks-per-link supportdestNode- the destination node of the link, or null for every link
-
setBranchProbability
Activates an outgoing branch only with probabilityprob.Branches are activated independently, so the number of siblings a job produces is random even when the tasks per link are deterministic. The matched Join must be told what to wait for: under a standard join a job that skipped a branch would block forever, so any probability below one requires JoinStrategy.PARTIAL or a quorum.
- Parameters:
jobClass- the class the probability applies todestNode- the destination node of the branchprob- the activation probability, in [0,1]
-