Class IMac

Class Documentation

class IMac

Interactive Markov chain map of dynamics (IMac). This class contains 2 matrices representing the transitions in 2 state Markov chains at every cell on a grid.

Members:

  • _entryMatrix: A matrix where _entryMatrix(x,y) is the (free->occupied) probability for (x,y)

  • _exitMatrix: A matrix where _exitMatrix(x,y) is the (occupied->free) probability for (x,y)

  • _initialBelief: A 2D matrix representing the initial belief over each cell being occupied

  • _staticOccupancy: A 2D matrix estimating the static occupancy of a cell

Public Functions

inline IMac(const Eigen::MatrixXd &entryMatrix, const Eigen::MatrixXd &exitMatrix, const Eigen::MatrixXd &initialBelief)

Constructor initialises the member variables.

Parameters:
  • entryMatrix – The entry matrix

  • exitMatrix – The exit matrix

  • initialBelief – The initial belief matrix

inline IMac(const std::filesystem::path &inDir)

This constructor reads an IMac config in from file.

Parameters:

inDir – The directory where the IMac files are stored

Eigen::MatrixXd estimateStaticOccupancy()

Estimates the static occupancy of the map.

This is the time-abstract probability of the cells being occupied. A probability of 1 represents the cell being occupied.

Returns:

The static occupancy matrix

Eigen::MatrixXd forwardStep(const Eigen::MatrixXd &currentBelief) const

Runs a given belief or state through iMac to get the distribution for the next timestep.

Passing a deterministic state into this function is fine, and it’ll still work. However, note the arg type is double, not int, so casting is probably required first.

Here the probability in each cell represents the probability of occupation.

Parameters:

currentBelief – a 2D matrix of the current map belief or state

Returns:

a 2D matrix of the subsequent map belief

inline Eigen::MatrixXd getEntryMatrix() const

Getter for _entryMatrix. Need to retrieve for experimental purposes.

Returns:

A copy of_entryMatrix

inline Eigen::MatrixXd getExitMatrix() const

Getter for _exitMatrix. Need to retrieve for experimental purposes.

Returns:

A copy of_exitMatrix

inline Eigen::MatrixXd getInitialBelief() const

Return the initial belief over the map of dynamics.

Here the probability in each cell represents the probability of occupation.

Returns:

The initial belief over the map

void writeIMac(const std::filesystem::path &outDir)

Write IMac matrices out to file.

Parameters:

outDir – The directory to write the BIMac matrices to