Class ProceduralCreationGoal.Builder

Enclosing class:
ProceduralCreationGoal

public static class ProceduralCreationGoal.Builder extends ActivityExistentialGoal.Builder<ProceduralCreationGoal.Builder>
the builder can construct goals piecemeal via a series of method calls
  • Field Details

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • generateWith

      specifies the procedure used to generate desired activities the procedure takes as input the "current" partial plan as of the execution of this goal's satisfaction and produces a list of activity instances that must exist to satisfy this goal. the activities are not immediately inserted in the plan. partial satisfaction is possible, using the heuristic that more matching activities is always preferable to fewer. individual instances must match exactly (all arguments) the procedure may recommend creation of a list of activities all at once, or may make repeated incremental recommendations for single additional activities at a time the procedure should be a pure function and not have any internal state that could produce variant results on re-invocation with different hypothetical inputs this specifier is required. it replaces any previous specification. TODO: generator function should take arg for temporal context
      Parameters:
      generator - IN/OUT the function invoked to generate the desired activity instances, which takes the plan as input and outputs a list of activity instances. should be an idempotent pure function. may be called out of order from different contexts.
      Returns:
      this builder, ready for additional specification
    • build

      public ProceduralCreationGoal build()
      uses all pending specifications to construct a matching new goal object this is typically the last client call after a chain of specifiers, but the builder object remains viable to be further specified and build additional goals
      Overrides:
      build in class ActivityExistentialGoal.Builder<ProceduralCreationGoal.Builder>
      Returns:
      a newly allocated goal object matching all specifications
    • getThis

      protected ProceduralCreationGoal.Builder getThis()
      returns the current builder object (but typed at the lowest level) should be implemented by the builder at the bottom of the type heirarchy
      Specified by:
      getThis in class Goal.Builder<ProceduralCreationGoal.Builder>
      Returns:
      reference to the current builder object (specifically typed)
    • fill

      populates the provided goal with specifiers from this builder and above typically called by any derived builder classes to fill in the specifiers managed at this builder level and above
      Parameters:
      goal - IN/OUT a goal object to be filled with specifiers from this level of builder and above
      Returns:
      the provided object, with details filled in