Package moise.os.fs

Class Mission

java.lang.Object
moise.common.MoiseElement
moise.os.fs.Mission
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Identifiable, ToProlog, ToXML

public class Mission
extends MoiseElement
implements ToXML, ToProlog
Represents a Mission. The mission id is prefixed by the scheme id.
Author:
Jomi Fred Hubner
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
      Constant Field Values
    • goals

      protected java.util.Set<Goal> goals
    • preferable

      protected java.util.Set<Mission> preferable
    • sch

      protected Scheme sch
  • Constructor Details

    • Mission

      public Mission​(java.lang.String id, Scheme sch)
      Creates a new Mission
      Parameters:
      id - the identification of the role
  • Method Details

    • addGoal

      public Goal addGoal​(java.lang.String goalSpecId) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • getGoals

      public java.util.Collection<Goal> getGoals()
      returns a collection of GoalSpec objects of this Mission
    • addPreferable

      public void addPreferable​(java.lang.String missionId) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • getPreferables

      public java.util.Collection<Mission> getPreferables()
      returns a collection of Mission objects preferable to this mission
    • getAllPreferables

      public java.util.Collection<Mission> getAllPreferables()
      returns a collection of Mission objects preferable to this mission including the transitivity of the preference relation. For instance, if one has m1 < m2 (m2 has greater preference); m2 < m3; m2 < m4; m4 < m5, for m1, this method will return {m2, m3, m4, m5}
    • compareTo

      public int compareTo​(java.lang.Object o)
      Specified by:
      compareTo in interface java.lang.Comparable
      Overrides:
      compareTo in class MoiseElement
    • getAsProlog

      public java.lang.String getAsProlog()
      returns a string representing the goal in Prolog syntax, format: mission(id,min,max cardinality,list of goals,list of preferred missions)
      Specified by:
      getAsProlog in interface ToProlog
    • getXMLTag

      public static java.lang.String getXMLTag()
    • getAsDOM

      public org.w3c.dom.Element getAsDOM​(org.w3c.dom.Document document)
      Specified by:
      getAsDOM in interface ToXML
    • setFromDOM

      public void setFromDOM​(org.w3c.dom.Element ele) throws MoiseException
      Throws:
      MoiseException
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class MoiseElement