Class EmpiricalStrategy
java.lang.Object
NetStrategies.RoutingStrategy
NetStrategies.RoutingStrategies.EmpiricalStrategy
- All Implemented Interfaces:
AutoCheck
The node, into which job must be routed, is chosen using an empirical strategy.
An empirical strategy is based on an empirical distribution, that is a
distribution constructed from the data provided by the user.
- Author:
- Federico Granata, Stefano Omini, Bertoli Marco
-
Constructor Summary
ConstructorsConstructorDescriptionEmpiricalStrategy(EmpiricalEntry[] entries) Creates an empirical strategy using the passed data.EmpiricalStrategy(Empirical distribution, EmpiricalPar param) Creates an empirical strategy by adding nodes and naming them with the specified names. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck()It controls whether the distribution is correct or not.getOutNode(NetNode ownerNode, JobClass jobClass) Gets the output node, into which the job must be routed, using an empirical strategy.voidsetRandomEngine(RandomEngine randomEngine) Methods inherited from class RoutingStrategy
getOutNode, getOutNode
-
Constructor Details
-
EmpiricalStrategy
public EmpiricalStrategy(EmpiricalEntry[] entries) throws LoadException, IncorrectDistributionParameterException Creates an empirical strategy using the passed data.- Parameters:
entries- Entries used to construct the empirical distribution (each entry contains a node name and the corresponding routing probability).- Throws:
LoadExceptionIncorrectDistributionParameterException
-
EmpiricalStrategy
Creates an empirical strategy by adding nodes and naming them with the specified names.- Parameters:
distribution- The empirical distributionparam- The parameters of the empirical distribution- Throws:
LoadException
-
-
Method Details
-
check
public boolean check()It controls whether the distribution is correct or not. For the empirical distribution, the parameter is correct if the sum of the routing probabilities are greater than zero and they sum to 1.0.- Specified by:
checkin interfaceAutoCheck- Overrides:
checkin classRoutingStrategy
-
getOutNode
Gets the output node, into which the job must be routed, using an empirical strategy.- Specified by:
getOutNodein classRoutingStrategy- Parameters:
ownerNode- Owner node of the output section.jobClass- Class of current job to be routed.- Returns:
- Selected node.
-
setRandomEngine
-