- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Generators::BFIG::BFIGVariable Class Reference

`#include <BFIGVariable.h>`

Collaboration diagram for Mers::Generators::BFIG::BFIGVariable:

[legend]
List of all members.

## Public Member Functions
bool | operator== (BFIGVariable const &v) const
bool | operator< (BFIGVariable const &v) const
| BFIGVariable (unsigned int index, Mers::Models::Base::BaseModelVariable const *bmVariable, std::vector< double > const &costList, bool probabilityValues=false)
| BFIGVariable (BFIGVariable const &v)
| ~BFIGVariable ()
unsigned int | getName () const
Mers::Utils::Lang::String | getNameString () const
unsigned int | getNameInt () const
BFIGAssignment const * | getAssignmentByValue (Mers::Utils::Lang::String val) const
BFIGAssignment const * | getAssignmentByValue (unsigned int val) const
BFIGAssignment * | getAssignmentByValue (unsigned int val)
Mers::Utils::Containers::IntegerArray | getDomain () const
std::vector< Mers::Utils::Lang::String > | getDomainStrings () const
unsigned int | getDomainSize () const
unsigned int | getDomainTotalSize () const
std::vector< BFIGAssignment const * > | getAssignments () const
std::vector< BFIGAssignment const * > | getAssignmentsSorted () const
Mers::Utils::Containers::IntegerArray | getDomainTotal () const
std::vector< BFIGAssignment const * > const & | getAssignmentsTotal () const
bool | allReachable () const
bool | nullDomain () const
void | setBMVariable (Mers::Models::Base::BaseModelVariable const *newBMVar)
Mers::Models::Base::BaseModelVariable const * | getBMVariable () const
BFIGAssignment const * | getBestAssignment ()
double | getEntropy (bool logProbabilities=true) const
double | getEntropyTotal (bool logProbabilities=true) const
void | setAllCosts (double cost)
void | setAssignmentCostByValue (unsigned int val, double cost)
void | setAssignmentCostByValue (Mers::Utils::Lang::String val, double cost)
void | setAllTrueCosts (double cost)
void | setAssignmentTrueCostByValue (unsigned int val, double cost)
void | setAssignmentTrueCostByValue (Mers::Utils::Lang::String val, double cost)
double | probToCost (double prob)
int | setCost (unsigned int valUID, double cost)
int | setCosts (double costs[])
void | orderCosts ()
void | normalizeCosts ()
BFIGAssignment const * | bestConsistentAssignment (std::vector< BFIGAssignment const * > const &others)
Mers::Utils::Lang::String | toString () const
void | randomizeIndex ()
int | getRandomIndex ()
## Friends
class | BFIGAssignment
std::ostream & | operator<< (std::ostream &os, BFIGVariable const &v)

## Detailed Description

A variable that is used to store information about variables needed by BFIG.

Author:
  John Van Eepoel

Date:
  6.13.01

Definition at line 62 of file BFIGVariable.h.

## Member Function Documentation

BFIGAssignment * BFIGVariable::getAssignmentByValue | ( | unsigned int | val | ) |

Returns the assignment with the associated value UID.

Parameters:

  | val | The UID of the value being sought.

Returns:
  The assignment, if found, or NULL if it doesn not exist.

Definition at line 299 of file BFIGVariable.cpp.

void Mers::Generators::BFIG::BFIGVariable::setBMVariable | ( | Mers::Models::Base::BaseModelVariable const * | newBMVar | ) | `[inline]`

Sets the BaseModelVariable that is associated with this object.

Parameters:

  | newBMVar | The base model variable to which this object corresponds.

Definition at line 133 of file BFIGVariable.h.

Mers::Models::Base::BaseModelVariable const* Mers::Generators::BFIG::BFIGVariable::getBMVariable | ( |  | ) | const`[inline]`

Returns the BaseModelVariable associated with this object, if any.

Returns:
  the base model variable to which this object corresponds.

Definition at line 142 of file BFIGVariable.h.

double BFIGVariable::probToCost | ( | double | prob | ) |

Convers the probability to a cost in the context of this variable.

Parameters:

  | prob | The probability being converted

Returns:
  cost The cost of this probability for this variable.

Definition at line 456 of file BFIGVariable.cpp.

References Mers::Generators::BFIG::c_MinimumProbability.

Referenced by Mers::Generators::BFIG::BFIGGenerator::updateProbabilities(), and Mers::Generators::BFIG::BFIGGenerator::updateProbability().

int BFIGVariable::setCost | ( | unsigned int | valUID,
|  | double | cost |
| ) |  |  |

Sets the cost of the value with UID valUID to cost.

Parameters:

  | valUID | The UID of the value of the assignment being changed.
  | cost | The new cost of this assignment.

Returns:
  0 on success or a positive value if the value could not be found.

Definition at line 472 of file BFIGVariable.cpp.

References getAssignmentByValue(), and Mers::Generators::BFIG::BFIGAssignment::setTrueCost().

Referenced by Mers::Generators::BFIG::BFIGGenerator::updateCost(), and Mers::Generators::BFIG::BFIGGenerator::updateProbability().

Here is the call graph for this function:

int BFIGVariable::setCosts | ( | double | costs[] | ) |

Sets the costs of all the values in this object to the specified value, with one cost from costs per assignment.

Parameters:

  | costs | The new costs of all the assignments of this variable.

Returns:
  0 on success or a positive value if an error occured.

Definition at line 499 of file BFIGVariable.cpp.

Referenced by Mers::Generators::BFIG::BFIGGenerator::updateCosts(), and Mers::Generators::BFIG::BFIGGenerator::updateProbabilities().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/BFIGVariable.h
- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/BFIGVariable.cpp