Class ServiceTimeStrategy
java.lang.Object
NetStrategies.ServiceStrategy
NetStrategies.ServiceStrategies.ServiceTimeStrategy
- All Implemented Interfaces:
AutoCheck
This strategy calculates the time of service of a job, using the specified
distribution and parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DistributionService time distribution.protected ParameterDistribution parameters. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of ServiceTime.ServiceTimeStrategy(Distribution distribution, Parameter parameter) Creates a new instance of ServiceTime. -
Method Summary
Modifier and TypeMethodDescriptiondoubleexpect(NodeSection nodeSection, JobClass jobClass) Calculates the service mean using the specified distribution.doublegetRand()booleansetDistribution(Distribution distribution) Sets the distribution.booleansetParameter(Parameter parameter) Sets the parameters of the distribution.doublewait(NodeSection nodeSection, JobClass jobClass) Calculates the service time using the specified distribution.Methods inherited from class ServiceStrategy
check
-
Field Details
-
distribution
Service time distribution. -
parameter
Distribution parameters.
-
-
Constructor Details
-
ServiceTimeStrategy
public ServiceTimeStrategy()Creates a new instance of ServiceTime. -
ServiceTimeStrategy
Creates a new instance of ServiceTime.- Parameters:
distribution- service time distribution.parameter- distribution parameter.
-
-
Method Details
-
setDistribution
Sets the distribution.- Parameters:
distribution- the distribution to be used by this strategy.- Returns:
- true, if distribution has been set.
-
setParameter
Sets the parameters of the distribution.- Parameters:
parameter- the parameter object.- Returns:
- true, if parameters have been set.
-
wait
Calculates the service time using the specified distribution.- Specified by:
waitin classServiceStrategy- Parameters:
nodeSection- the node section which applies this strategy.jobClass- the job class which follows this strategy.- Returns:
- the value of service time.
- Throws:
NetException
-
expect
Calculates the service mean using the specified distribution.- Specified by:
expectin classServiceStrategy- Parameters:
nodeSection- the node section which applies this strategy.jobClass- the job class which follows this strategy.- Returns:
- the value of service mean.
- Throws:
NetException
-
getDistribution
-
getParameter
-
getRand
public double getRand()
-