public interface IProvisioningAlgorithm
Contract that must be fulfilled such that a provisioning algorithm can be run in Net2Plan
.
The key difference with algorithms
is that provisioning algorithms are used to react to failure/reparation events. In contrast, algorithms
are used just for network planning.
com.net2plan.interfaces.IAlgorithm
Modifier and Type | Method and Description |
---|---|
String |
finish(StringBuilder output,
double simTime)
Returns an algorithm-specific report.
|
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 netPlan,
ResilienceNetState netState,
Map<String,String> algorithmParameters,
Map<String,String> net2planParameters)
Initializes the provisioning algorithm (i.e. reading input parameters).
|
List<ProvisioningAction> |
processEvent(NetPlan netPlan,
ResilienceNetState netState,
ResilienceEvent event)
Executes the provisioning algorithm.
|
String getDescription()
List<Triple<String,String,String>> getParameters()
List<ProvisioningAction> processEvent(NetPlan netPlan, ResilienceNetState netState, ResilienceEvent event)
netPlan
- Network plannetState
- Current network stateevent
- Resilience event: node/link/SRG failure, node/link/SRG reparationvoid initialize(NetPlan netPlan, ResilienceNetState netState, Map<String,String> algorithmParameters, Map<String,String> net2planParameters)
netPlan
- Network plannetState
- Current network statealgorithmParameters
- A key-value map with specific algorithm parameters.net2planParameters
- A key-value map with Net2Plan
-wide configuration optionsString finish(StringBuilder output, double simTime)
output
- Container for the reportsimTime
- Current simulation timenull
, or an empty output
to omit it)