CFeatureStochasticModel Class Reference
Class
for loading and storing a fixed Model.
More...
#include <ctheoreticalmodel.h>
Inheritance diagram for CFeatureStochasticModel:
List of all
members.
|
Public Member Functions
|
|
|
CFeatureStochasticModel
(CActionSet
*actions, int
numFeatures,
FILE *file)
|
| |
Loads the model from file.
|
|
|
CFeatureStochasticModel
(CActionSet
*actions, int
numFeatures)
|
| |
Creates a new model.
|
|
|
CFeatureStochasticModel
(int numActions, int numFeatures)
|
|
virtual
|
~CFeatureStochasticModel
()
|
|
virtual double
|
getPropability (int
oldFeature, int action, int newFeature)
|
| |
returns the Propability of the transition
|
|
virtual double
|
getPropability (int
oldFeature, int action, int duration, int newFeature)
|
|
void
|
setPropability
(double propability, int oldFeature, int action, int
newFeature)
|
|
void
|
setPropability
(double propability, int oldFeature, int action, int duration, int
newFeature)
|
|
virtual CTransitionList *
|
getForwardTransitions
(int action, int state)
|
| |
Just returns thet forward trnasition list
for the given state-action Pair.
|
|
virtual CTransitionList *
|
getBackwardTransitions
(int action, int state)
|
| |
Just returns thet forward trnasition list
for the given state-action Pair.
|
|
virtual void
|
saveASCII (FILE
*stream)
|
Protected Member Functions
|
|
void
|
loadASCII (FILE
*stream)
|
| |
Load the model from file, can only be used
at the constructor of the class.
|
|
CTransition
*
|
getNewTransition
(int startState, int endState, CAction *action, double
propability)
|
| |
Returns a new Transition object for the
specified action.
|
Protected Attributes
|
|
CMyArray2D<
CStateActionTransitions
* > *
|
stateTransitions |
| |
The array of state-action Transitions.
|
Detailed Description
Class for loading and storing a fixed Model.
The class CFeatureStochasticModel implements all functions from
the interface CAbstractFeatureStochasticModel,
therefore it maintains a CStateActionTransitions
for every state-action pair. For storing the CStateActionTransitions
object a 2 dimensional array is used. The class provides additional
functions for setting the probability of a transition. If the
transition doesn't exist, a new transition object is created with
the specified probability, otherwise the probability is just set.
For the semi-MDP case, the duration of the transition can be
specified as well. The given probability is then added to the
existing transition probability and the duration factors are all
adopted so that there sum is again one. The model can only be used
for loading, saving and directly setting the probabilities, its not
able to learn anything from a learning trial.
Constructor & Destructor Documentation
|
CFeatureStochasticModel::CFeatureStochasticModel
|
( |
CActionSet *
|
actions,
|
|
|
int |
numFeatures,
|
|
|
FILE * |
file |
|
) |
|
|
| |
Loads the model from file.
|
|
CFeatureStochasticModel::CFeatureStochasticModel
|
( |
CActionSet *
|
actions,
|
|
|
int |
numFeatures |
|
) |
|
|
|
CFeatureStochasticModel::CFeatureStochasticModel
|
( |
int |
numActions,
|
|
|
int |
numFeatures |
|
) |
|
|
| virtual
CFeatureStochasticModel::~CFeatureStochasticModel
|
( |
|
) |
[virtual] |
|
Member Function Documentation
| virtual CTransitionList*
CFeatureStochasticModel::getBackwardTransitions
|
( |
int |
action,
|
|
|
int |
state |
|
) |
[virtual] |
|
| virtual CTransitionList*
CFeatureStochasticModel::getForwardTransitions
|
( |
int |
action,
|
|
|
int |
state |
|
) |
[virtual] |
|
| CTransition*
CFeatureStochasticModel::getNewTransition
|
( |
int |
startState,
|
|
|
int |
endState,
|
|
|
CAction *
|
action,
|
|
|
double |
propability |
|
) |
[protected] |
|
| |
Returns a new Transition object for the specified action.
If the action is a multistep action, a CSemiMDPTransition is
returned, otherwise a CTransition object. The transition
gets initialised with the given values.
|
| virtual double
CFeatureStochasticModel::getPropability
|
( |
int |
oldFeature,
|
|
|
int |
action,
|
|
|
int |
duration,
|
|
|
int |
newFeature |
|
) |
[virtual] |
|
| |
Looks in the forward transitions of <oldFeature, action>
wether a Transition to newFeature exists with the specified
duration, if not 0 is returned, odtherwise the propybility of the
transition.
Implements CAbstractFeatureStochasticModel.
|
| virtual double
CFeatureStochasticModel::getPropability
|
( |
int |
oldFeature,
|
|
|
int |
action,
|
|
|
int |
newFeature |
|
) |
[virtual] |
|
| |
returns the Propability of the transition
Looks in the forward transitions of <oldFeature, action>
wether a Transition to newFeature exists, if not 0 is returned,
odtherwise the propybility of the transition.
Implements CAbstractFeatureStochasticModel.
|
| void
CFeatureStochasticModel::loadASCII
|
( |
FILE * |
stream |
) |
[protected] |
|
| |
Load the model from file, can only be used at the constructor of
the class.
|
| virtual void
CFeatureStochasticModel::saveASCII
|
( |
FILE * |
stream |
) |
[virtual] |
|
| void
CFeatureStochasticModel::setPropability
|
( |
double |
propability,
|
|
|
int |
oldFeature,
|
|
|
int |
action,
|
|
|
int |
duration,
|
|
|
int |
newFeature |
|
) |
|
|
| void
CFeatureStochasticModel::setPropability
|
( |
double |
propability,
|
|
|
int |
oldFeature,
|
|
|
int |
action,
|
|
|
int |
newFeature |
|
) |
|
|
Member Data Documentation
| |
The array of state-action Transitions.
|
The documentation for this class was generated from the following
file:
|