public abstract class CompositeGoal extends java.lang.Object implements Goal
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Goal> |
completedGoals |
protected GoalEvent |
failedGoal |
protected java.util.Collection<Goal> |
goals |
| Constructor and Description |
|---|
CompositeGoal(java.util.Collection<Goal> goals)
Instantiates a CompositeGoal with the provided goals.
|
CompositeGoal(Goal[] goals)
Instantiates a CompositeGoal with the provided goals array.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.util.Collection<Goal> |
createGoals(int size)
Creates an instance of the collection that holds the goals of this
composite goal.
|
java.util.List<Goal> |
getCompletedGoals()
Returns the goals of this composite goal that successfully finished.
|
GoalEvent |
getFailedGoal()
Returns the goal event associated with a goal that could not be achieved,
if any.
|
java.util.Collection<Goal> |
getGoals()
Returns the goals associated with this composite goal.
|
void |
setCompletedGoals(java.util.List<Goal> completedGoals)
Sets the list of completed goals.
|
void |
setFailedGoal(GoalEvent failedGoal)
Sets the goal event associated with the goal that failed.
|
protected java.util.List<Goal> completedGoals
protected GoalEvent failedGoal
protected final java.util.Collection<Goal> goals
public CompositeGoal(java.util.Collection<Goal> goals)
goals - the goals that compose this goal.public CompositeGoal(Goal[] goals)
Collection is instantiated by the method
createGoals(int) and is initialized with the provided goals.goals - the goals that compose this goal.protected abstract java.util.Collection<Goal> createGoals(int size)
size - the size of the collection.public java.util.List<Goal> getCompletedGoals()
public GoalEvent getFailedGoal()
public java.util.Collection<Goal> getGoals()
public void setCompletedGoals(java.util.List<Goal> completedGoals)
completedGoals - the completedGoals to set.public void setFailedGoal(GoalEvent failedGoal)
failedGoal - the failedGoal to set.