SGSolve
SGProbabilityTableModel Class Reference

Reimplements SGPayoffTable model to specialize to probabilities. More...

#include <sgprobabilitytablemodel.hpp>

Inheritance diagram for SGProbabilityTableModel:
Collaboration diagram for SGProbabilityTableModel:

Public Member Functions

 SGProbabilityTableModel (SGGame *_game, int _state, int _nextState)
 Constructor. More...
 
QVariant data (const QModelIndex &index, int role) const Q_DECL_OVERRIDE
 Reimplements the data method. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role)
 Reimplements the setData method. More...
 
bool setNextState (int newState)
 Sets nextState.
 
- Public Member Functions inherited from SGPayoffTableModel
 SGPayoffTableModel (SGGame *_game, int _state)
 Constructor.
 
QVariant data (const QModelIndex &index, int role) const Q_DECL_OVERRIDE
 Returns formatted data. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE
 Returns formatted header data. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role)
 Sets data. More...
 
- Public Member Functions inherited from SGTableModel
 SGTableModel (SGGame *_game, int _state)
 Constructor.
 
Qt::ItemFlags flags (const QModelIndex &index) const
 Returns flags. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE
 Returns the number of row player actions.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const Q_DECL_OVERRIDE
 Returns the number of column player actions.
 
void emitLayoutChanged ()
 Emits layoutChanged signal.
 
bool setState (int newState)
 Sets the state to newState.
 

Private Attributes

int nextState
 Tomorrow's state. More...
 

Additional Inherited Members

- Protected Attributes inherited from SGTableModel
int state
 The state that the model is associated with.
 
SGGamegame
 Pointer to the associated game.
 

Detailed Description

Reimplements SGPayoffTable model to specialize to probabilities.

An SGSolutionHandler object contains one of these objects for each possible state tomorrow. The nextState member indicates which state this object is associated with.

Constructor & Destructor Documentation

◆ SGProbabilityTableModel()

SGProbabilityTableModel::SGProbabilityTableModel ( SGGame _game,
int  _state,
int  _nextState 
)
inline

Constructor.

Constructor takes an additional argument, which is the nextState whose transition probabilities this model will interface to.

Member Function Documentation

◆ data()

QVariant SGProbabilityTableModel::data ( const QModelIndex &  index,
int  role 
) const

Reimplements the data method.

Retrieves the probability of going to nextState from state, when the action profile indicated by index is played. Retrieves the data using SGGame::getProbabilities.

◆ setData()

bool SGProbabilityTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Reimplements the setData method.

Sets the transition probability from state to nextState to value, using SGGame::setProbability.

Member Data Documentation

◆ nextState

int SGProbabilityTableModel::nextState
private

Tomorrow's state.

This object interfaces with the probabilities of transitioning to nextState tomorrow.


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