public class DefaultReconfigurationPlan extends Object implements ReconfigurationPlan
ReconfigurationPlan
.
By default, the instance relies on a TimeBasedPlanApplier
to check for the plan applicability.Constructor and Description |
---|
DefaultReconfigurationPlan(Model m)
Make a new plan that starts from a given model.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Action a)
Add a new action to a plan.
|
boolean |
equals(Object o) |
Set<Action> |
getActions()
Get all the actions to perform.
|
Set<Action> |
getDirectDependencies(Action a)
Get the actions that have to be executed before
a given action.
|
int |
getDuration()
Return the theoretical duration of a reconfiguration plan.
|
Model |
getOrigin()
Get the model that is used as a starting point
to perform the reconfiguration.
|
ReconfigurationPlanApplier |
getReconfigurationApplier()
Get the applier that is used to simulate the actions application
on the starting model.
|
Model |
getResult()
Get the resulting model once all the actions are executed.
|
int |
getSize()
Get the number of actions in the plan.
|
int |
hashCode() |
boolean |
isApplyable()
Check if all the actions can be applied according
to their schedule.
|
Iterator<Action> |
iterator()
Iterate over the actions.
|
void |
setReconfigurationApplier(ReconfigurationPlanApplier ra)
Set the applier to use to simulate the actions application.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public DefaultReconfigurationPlan(Model m)
m
- the source modelpublic Model getOrigin()
ReconfigurationPlan
getOrigin
in interface ReconfigurationPlan
public boolean add(Action a)
ReconfigurationPlan
add
in interface ReconfigurationPlan
a
- the action to addtrue
iff the action has been addedpublic int getSize()
ReconfigurationPlan
getSize
in interface ReconfigurationPlan
public int getDuration()
ReconfigurationPlan
getDuration
in interface ReconfigurationPlan
public Set<Action> getActions()
ReconfigurationPlan
getActions
in interface ReconfigurationPlan
public Iterator<Action> iterator()
public Model getResult()
ReconfigurationPlan
getResult
in interface ReconfigurationPlan
null
if the plan cannot be appliedpublic boolean isApplyable()
ReconfigurationPlan
Action.apply(org.btrplace.model.Model)
while
respecting their orderingisApplyable
in interface ReconfigurationPlan
true
iff the actions can be appliedpublic Set<Action> getDirectDependencies(Action a)
ReconfigurationPlan
getDirectDependencies
in interface ReconfigurationPlan
a
- the actionpublic ReconfigurationPlanApplier getReconfigurationApplier()
ReconfigurationPlan
getReconfigurationApplier
in interface ReconfigurationPlan
public void setReconfigurationApplier(ReconfigurationPlanApplier ra)
ReconfigurationPlan
setReconfigurationApplier
in interface ReconfigurationPlan
ra
- the applier to useCopyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.