Class SequentialGoalStructure<TBeliefSet>
- Namespace
- Aplib.Core.Desire.GoalStructures
- Assembly
- Aplib.Core.dll
Represents a goal structure that will complete if all of its children complete.
public class SequentialGoalStructure<TBeliefSet> : GoalStructure<TBeliefSet>, IGoalStructure<TBeliefSet>, ICompletable, ILoggable, IDocumented, IDisposable where TBeliefSet : IBeliefSet
Type Parameters
TBeliefSet
The type of belief set that this goal structure operates on.
- Inheritance
-
GoalStructure<TBeliefSet>SequentialGoalStructure<TBeliefSet>
- Implements
-
IGoalStructure<TBeliefSet>
- Inherited Members
- Extension Methods
Remarks
The children of this goal structure will be executed in the order they are given.
Constructors
SequentialGoalStructure(params IGoalStructure<TBeliefSet>[])
Initializes a new instance of the SequentialGoalStructure<TBeliefSet> class.
public SequentialGoalStructure(params IGoalStructure<TBeliefSet>[] children)
Parameters
children
IGoalStructure<TBeliefSet>[]The children of the goal structure.
SequentialGoalStructure(IMetadata, params IGoalStructure<TBeliefSet>[])
Initializes a new instance of the SequentialGoalStructure<TBeliefSet> class.
public SequentialGoalStructure(IMetadata metadata, params IGoalStructure<TBeliefSet>[] children)
Parameters
metadata
IMetadataMetadata about this GoalStructure, used to quickly display the goal in several contexts.
children
IGoalStructure<TBeliefSet>[]The children of the goal structure.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Disposes the enumerator.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolWhether the object is being disposed.
GetCurrentGoal(TBeliefSet)
Gets the current goal using the given IBeliefSet.
public override IGoal<TBeliefSet> GetCurrentGoal(TBeliefSet beliefSet)
Parameters
beliefSet
TBeliefSetThe belief set of the agent.
Returns
- IGoal<TBeliefSet>
The current goal to be fulfilled.
GetLogChildren()
Gets the children of the loggable object.
public override IEnumerable<ILoggable> GetLogChildren()
Returns
- IEnumerable<ILoggable>
The children of the loggable object.
Reset()
Resets the goal structure to its initial state.
public override void Reset()
UpdateStatus(TBeliefSet)
Updates the status of the SequentialGoalStructure<TBeliefSet>. The goal structure status is set to:
- SuccessWhen all children are successful.
- FailureWhen any one of its children fails.
- UnfinishedOtherwise.
public override void UpdateStatus(TBeliefSet beliefSet)
Parameters
beliefSet
TBeliefSetThe belief set of the agent.