public abstract class ICombinedEventGenerator extends IEventGenerator
Abstract class providing an event generator that is able to combine
existing event generators into a common one. All the event generators are
called for each method corresponding to the IEventGenerator
class,
i.e. initialize, finish..., in the order defined in the constructor. The only
method to be implemented is processEvent()
,
which would send the event to the specific event generator.
Important: Classes for event generators must be in the classpath
of Net2Plan
. Otherwise, a NoClassDefFoundError
exception would appear.
Modifier and Type | Field and Description |
---|---|
IEventGenerator[] |
eventGenerators
Reference to the set of event generators.
|
Constructor and Description |
---|
ICombinedEventGenerator(IEventGenerator... eventGenerators)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
finish(StringBuilder output,
double simTime)
Returns an algorithm-specific report.
|
void |
finishTransitory(double simTime)
Performs some transitory-finished action.
|
String |
getDescription()
Returns the description.
|
List<Triple<String,String,String>> |
getParameters()
Returns the list of required parameters, where the first item of each element
is the parameter name, the second one is the parameter value, and the third
one is the parameter description.
|
void |
initialize(NetPlan initialNetPlan,
Map<String,String> algorithmParameters,
Map<String,String> simulationParameters,
Map<String,String> net2planParameters)
Initializes the algorithm (i.e.
|
abstract void |
processEvent(NetPlan currentNetPlan,
SimEvent event)
Processes the next event in the future event list.
|
endSimulation, endTransitory, scheduleEvent
public final IEventGenerator[] eventGenerators
public ICombinedEventGenerator(IEventGenerator... eventGenerators)
eventGenerators
- Events generators to be combinedpublic String finish(StringBuilder output, double simTime)
IEventGenerator
finish
in class IEventGenerator
output
- Container for the reportsimTime
- Current simulation timenull
, or an empty output
to omit it)public void finishTransitory(double simTime)
IEventGenerator
finishTransitory
in class IEventGenerator
simTime
- Current timepublic String getDescription()
IEventGenerator
getDescription
in interface com.net2plan.internal.IExternal
getDescription
in class IEventGenerator
public List<Triple<String,String,String>> getParameters()
IEventGenerator
Returns the list of required parameters, where the first item of each element is the parameter name, the second one is the parameter value, and the third one is the parameter description.
It is possible to define type-specific parameters if the default value is set according to the following rules (but user is responsible of checking in its own code):
.class
or .jar
file where the code is located, the class name,
and a set of parameters (pair of key-values separated by commas, where individual
key and value are separated with an equal symbol. The same applies to reports (#report#),
event generators (#eventGenerator#) and event processors (#eventProcessor#).getParameters
in interface com.net2plan.internal.IExternal
getParameters
in class IEventGenerator
public void initialize(NetPlan initialNetPlan, Map<String,String> algorithmParameters, Map<String,String> simulationParameters, Map<String,String> net2planParameters)
IEventGenerator
initialize
in class IEventGenerator
initialNetPlan
- Initial network planalgorithmParameters
- A key-value map with specific algorithm parameters.simulationParameters
- A key-value map with simulation parametersnet2planParameters
- A key-value map with Net2Plan
-wide configuration optionspublic abstract void processEvent(NetPlan currentNetPlan, SimEvent event)
IEventGenerator
scheduleEvent
method.processEvent
in class IEventGenerator
currentNetPlan
- Current network planevent
- Current event to be processedCopyright © 2018. All rights reserved.