Class ScheduledGoal

java.lang.Object
edu.tufts.hrilab.action.goal.Goal
edu.tufts.hrilab.action.goal.schedule.ScheduledGoal

public class ScheduledGoal extends Goal
  • Constructor Details

    • ScheduledGoal

      public ScheduledGoal(Predicate goalState)
      Scheduled goal form: scheduled(goalPred, startPred, periodPred, endPred) - only goalPred and startPred OR periodPred are required - no startTime means start right away - endPred only valid if periodPred is specified - startPred forms: start(number, timeunit), start(date-format) - periodPred forms: period(number,timeunit), period(date-format) - endPred forms: end(number, timeunit), end(date-format)
      Parameters:
      goalState - scheduled goal predicate: scheduled(goalPred, [startPred], [periodPred], [endPred])
  • Method Details

    • getDisplayPredicate

      public Predicate getDisplayPredicate()
    • getGoalPredicate

      public Predicate getGoalPredicate()
      Description copied from class: Goal
      Get the full goal predicate. This is the predicate that was used to create this goal. Examples: goal(self,state) --> goal(self,state) action1(self,args) --> action1(self,args) obs(self,state) --> obs(self,state) If the original goal predicate was unbound, this will return the unbound version.
      Overrides:
      getGoalPredicate in class Goal
      Returns:
    • getGoalPredicate

      public Predicate getGoalPredicate(boolean reformatDateString)
    • getSubmittedGoals

      public List<Goal> getSubmittedGoals()
      Get shallow copy of the submitted goals for this scheduled goal.
      Returns:
    • getNextGoalToSubmit

      public Goal getNextGoalToSubmit()
      Generate and return a new Goal instance to execute.
      Returns:
    • getLastSubmittedGoal

      public Goal getLastSubmittedGoal()
      Get the last submitted Goal instance from this scheduled goal.
      Returns:
    • isScheduled

      public final boolean isScheduled()
      This class represents scheduled goals, so this always returns true.
      Overrides:
      isScheduled in class Goal
      Returns:
    • isPeriodic

      public boolean isPeriodic()
      If this goal is periodic.
      Returns:
    • getScheduledPeriod

      public long getScheduledPeriod()
      Get periodicity in milliseconds
      Returns:
    • hasStartDate

      public boolean hasStartDate()
      If this goal has a specified start time.
      Returns:
    • getStartDate

      public Date getStartDate()
      Get start time specified in Date format.
      Returns:
    • hasEndDate

      public boolean hasEndDate()
      If this goal has a specified end time.
      Returns:
    • getEndDate

      public Date getEndDate()
      Get end time specified in Date format.
      Returns:
    • update

      public boolean update(Predicate update)
      Update this goal's schedule.
      Parameters:
      update - predicate specifying update details
      Returns:
      if update was successful
    • parseDateString

      public static Date parseDateString(String dateString)