Class Allocate

java.lang.Object
org.btrplace.plan.event.Action
org.btrplace.plan.event.Allocate
All Implemented Interfaces:
Event, VMEvent

public class Allocate
extends Action
implements VMEvent
An action to indicate the amount of resources of a given type to allocate to a VM.
Author:
Fabien Hermenier
  • Constructor Details

    • Allocate

      public Allocate​(VM vm, Node on, String rc, int amount, int start, int end)
      Make a new constraint.
      Parameters:
      vm - the VM
      on - the node hosting the VM
      rc - the resource identifier
      amount - the minimum amount of resource to allocate
      start - the moment the action starts
      end - the moment the action ends
  • Method Details

    • getHost

      public Node getHost()
      Get the node that is currently hosting the VM.
      Returns:
      the node
    • getVM

      public VM getVM()
      Description copied from interface: VMEvent
      Get the VM to involved in the action.
      Specified by:
      getVM in interface VMEvent
      Returns:
      the VM identifier
    • getResourceId

      public String getResourceId()
      Get the resource identifier.
      Returns:
      a non-empty string
    • getAmount

      public int getAmount()
      Get the amount of resources to allocate to the VM.
      Returns:
      a positive number
    • applyAction

      public boolean applyAction​(Model i)
      Description copied from class: Action
      Apply only the scheduled action.
      Specified by:
      applyAction in class Action
      Parameters:
      i - the model to modify
      Returns:
      true if the action was applied successfully
    • pretty

      public String pretty()
      Description copied from class: Action
      Pretty print of the action.
      Specified by:
      pretty in class Action
      Returns:
      a String
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Action
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Action
    • visit

      public Object visit​(ActionVisitor v)
      Description copied from interface: Event
      Notify a visitor to visit the action.
      Specified by:
      visit in interface Event
      Parameters:
      v - the visitor to notify
      Returns:
      the visit result