Class CausalLink

java.lang.Object
FAtiMA.Core.plans.CausalLink
All Implemented Interfaces:
Serializable

public class CausalLink extends Object implements Serializable
Represents a Causal Link between two Steps A and B. The causal link A --p--> B means that A achieves the precondition P for B.
Author:
Joao Dias
See Also:
  • Field Details

  • Constructor Details

    • CausalLink

      public CausalLink(Integer source, Integer effect, Integer destination, Integer condition, String description)
      Creates a new Causal Link A --p--> B
      Parameters:
      source - - the ID of the Step that provides the effect (ID of Step A)
      effect - - the ID of the source's effect that establishes the link (ID of p in A)
      destination - - the ID of the Step that needs the effect (ID of Step B)
      condition - - the ID of the destination's precondition that is established by the link (ID of p in B)
      description - - a string that displays the condition p, usefull for output purpouses
    • CausalLink

      public CausalLink(Integer source, Integer effect, Integer destination, Integer condition)
      Creates a new Causal Link A --p--> B
      Parameters:
      source - - the ID of the Step that provides the effect (ID of Step A)
      effect - - the ID of the source's effect that establishes the link (ID of p in A)
      destination - - the ID of the Step that needs the effect (ID of Step B)
      condition - - the ID of the destination's precondition that is established by the link (ID of p in B)
  • Method Details

    • getSource

      public Integer getSource()
      Gets the step A in the Causal Link A --p--> B
      Returns:
      the ID of the Step A in the plan
    • getEffect

      public Integer getEffect()
      Gets Effect p in the Causal Link A --p--> B
      Returns:
      The ID of Effect p in step A
    • getDestination

      public Integer getDestination()
      Gets the step B in the Causal Link A --p--> B
      Returns:
      the ID of the Step B in the plan
    • getCondition

      public Integer getCondition()
      Gets Condition p in the Causal Link A --p--> B
      Returns:
      The ID of condition p in step B
    • setCondition

      public void setCondition(Integer condition)
      Sets the condition p in the Causal Link A --p--> B
      Parameters:
      condition - - The ID of condition p in step B
    • getOrderConstraint

      public OrderingConstraint getOrderConstraint()
      Gets the ordering constraint A < B that is implicit in the Causal Link A --p--> B
      Returns:
      the OrderingConstraint A < B
    • toString

      public String toString()
      Converts the causal link to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String