>xabsl   The Extensible Agent Behavior Specification Language

XabslEngine Class Library Reference

 

xabsl::Option Class Reference

#include <XabslOption.h>

Inheritance diagram for xabsl::Option:

Inheritance graph
[legend]
Collaboration diagram for xabsl::Option:

Collaboration graph
[legend]
List of all members.

Detailed Description

Represents a single option written in.

Author:
Martin Loetzsch

Max Risler

Definition at line 53 of file XabslOption.h.


Public Member Functions

 Option (const char *name, InputSource &input, ErrorHandler &errorHandler, Symbols &symbols, const unsigned &time, int index)
 Constructor.

 ~Option ()
 Destructor.

void create (InputSource &input, NamedArray< Option * > &options, NamedArray< BasicBehavior * > &basicBehaviors, Symbols &symbols, const int &agentPriority, const int &synchronizationTicks)
 Creates the option and it's states from the intermediate code.

virtual void execute ()
 Executes the option.

bool getOptionReachedATargetState () const
 Returns wheter the option reached a target state.


Public Attributes

NamedArray< State * > states
 The states of the option.

StateactiveState
 A pointer to the active state.

int index
 Index of the option in array options in corresponding engine.


Private Attributes

StateinitialState
 A pointer to the initial state.

ErrorHandlererrorHandler
 Used for error handling.

const unsigned & time
 The system time in ms.


Constructor & Destructor Documentation

xabsl::Option::Option const char *  name,
InputSource input,
ErrorHandler errorHandler,
Symbols symbols,
const unsigned &  time,
int  index
 

Constructor.

Does not create the option.

Parameters:
name The name of the option. For debugging purposes.
input An input source for the intermediate code. It must be opened and read until A position where an option starts.
errorHandler A reference to a ErrorHandler instance
symbols All available symbols
time The system time in ms.
Index of the option in array options in corresponding engine

Definition at line 71 of file XabslOption.cpp.

xabsl::Option::~Option  ) 
 

Destructor.

Deletes the states

Definition at line 86 of file XabslOption.cpp.

References xabsl::Array< NamedArrayElement< State * > * >::getSize(), and states.

Here is the call graph for this function:


Member Function Documentation

void xabsl::Option::create InputSource input,
NamedArray< Option * > &  options,
NamedArray< BasicBehavior * > &  basicBehaviors,
Symbols symbols,
const int &  agentPriority,
const int &  synchronizationTicks
 

Creates the option and it's states from the intermediate code.

Parameters:
input An input source for the intermediate code. It must be opened and read until A position where an option starts.
options All other options
basicBehaviors All basic behaviors
symbols All available symbols
agentPriority Priority value of the agent, used for solving conflicts in cooperative state assignment
synchronizationTicks Number of execution cycles that is required for synchonization with other agents, i.e time from sending a message until answer is received

Definition at line 94 of file XabslOption.cpp.

References activeState, xabsl::NamedArray< State * >::append(), xabsl::ErrorHandler::error(), xabsl::ErrorHandler::errorsOccurred, initialState, xabsl::ErrorHandler::message(), xabsl::InputSource::readString(), xabsl::InputSource::readValue(), states, and XABSL_DEBUG_INIT.

Here is the call graph for this function:

void xabsl::Option::execute  )  [virtual]
 

Executes the option.

The state machine is carried out to determine the subsequent option or the subsequent basic behavior. Output symbols are set.

Implements xabsl::Behavior.

Definition at line 151 of file XabslOption.cpp.

References xabsl::State::actions, activeState, xabsl::ErrorHandler::error(), xabsl::State::getNextState(), xabsl::Array< Action * >::getSize(), initialState, and xabsl::State::reset().

Here is the call graph for this function:

bool xabsl::Option::getOptionReachedATargetState  )  const
 

Returns wheter the option reached a target state.

Definition at line 177 of file XabslOption.cpp.

References activeState, and xabsl::State::isTargetState().

Referenced by xabsl::SubsequentOptionReachedTargetStateCondition::getValue().

Here is the call graph for this function:


Member Data Documentation

NamedArray<State*> xabsl::Option::states
 

The states of the option.

Definition at line 99 of file XabslOption.h.

Referenced by xabsl::Engine::addActions(), xabsl::Engine::checkForLoops(), xabsl::Engine::countActions(), create(), xabsl::TransitionToState::TransitionToState(), and ~Option().

State* xabsl::Option::activeState
 

A pointer to the active state.

If 0, then no state is active

Definition at line 102 of file XabslOption.h.

Referenced by create(), execute(), and getOptionReachedATargetState().

int xabsl::Option::index
 

Index of the option in array options in corresponding engine.

Definition at line 108 of file XabslOption.h.

State* xabsl::Option::initialState [private]
 

A pointer to the initial state.

Definition at line 113 of file XabslOption.h.

Referenced by create(), and execute().

ErrorHandler& xabsl::Option::errorHandler [private]
 

Used for error handling.

Definition at line 116 of file XabslOption.h.

const unsigned& xabsl::Option::time [private]
 

The system time in ms.

Definition at line 119 of file XabslOption.h.


The documentation for this class was generated from the following files:

Up | Main Page | Generated at Wed Aug 19 17:32:31 2009.