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

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

# tut::BFIGGeneratorTester Class Reference

`#include <BFIGGeneratorTester.h>`

Inheritance diagram for tut::BFIGGeneratorTester:

[legend]
Collaboration diagram for tut::BFIGGeneratorTester:

[legend]
List of all members.

## Public Member Functions
| BFIGGeneratorTester ()
virtual | ~BFIGGeneratorTester ()
## Protected Member Functions
void | initBFIGGenTest (unsigned int numDomains, const struct BFIGDomainEntry *domains, bool isProbabilities, unsigned int numVariables, const struct BFIGVariableEntry *variables, double cutoffCost=1e10) throw ()
template<int n>
void | testBFIG (unsigned int numberOfIConf, const unsigned int initialConflictsData[][n], unsigned int numberOfResults, const unsigned int expectedResultsData[][n], const unsigned int runtimeConflictsData[][n], const bool acceptList[], bool verifyTermination=true)
## Protected Attributes
BFIGGenerator * | mGenerator
| The generator for this set of unit tests.

## Detailed Description

This class defines the basic structure needed to setup and test BFIG as well as a set of routines to test BFIG with a minimum amount of work needed to add test cases.

Author:
  Paul Elliott

Definition at line 36 of file BFIGGeneratorTester.h.

## Constructor & Destructor Documentation

tut::BFIGGeneratorTester::BFIGGeneratorTester | ( |  | ) |

Creates a new tester.

Definition at line 17 of file BFIGGeneratorTester.cpp.

tut::BFIGGeneratorTester::~BFIGGeneratorTester | ( |  | ) | `[virtual]`

Destroys this tester.

Definition at line 25 of file BFIGGeneratorTester.cpp.

References mGenerator.

## Member Function Documentation

void tut::BFIGGeneratorTester::initBFIGGenTest | ( | unsigned int | numDomains,
|  | const struct BFIGDomainEntry * | domains,
|  | bool | isProbabilities,
|  | unsigned int | numVariables,
|  | const struct BFIGVariableEntry * | variables,
|  | double | cutoffCost = `1e10` |
| ) |  |  | throw ()`[protected]`

Creates a new BFIG Generator with the specific model data.

Parameters:

  | numDomains | The number of domains being passed into this function.
  | domains | The list of domains used to initialize BFIG.
  | isProbabilities | True if the probsOrCosts field of the variables should be considered probabilities. False if they should be considered costs.
  | numVariables | The number of variables being passed into this function.
  | variables | The list of variables used to initialize BFIG.
  | cutoffCost | The cost above which all candidates will be discarded.

Definition at line 25 of file CDBFIGGeneratorTester.cpp.

Referenced by tut::GenerationOrder1Data::GenerationOrder1Data().

template<int n>

void tut::BFIGGeneratorTester::testBFIG | ( | unsigned int | numberOfIConf,
|  | const unsigned int | initialConflictsData[][n],
|  | unsigned int | numberOfResults,
|  | const unsigned int | expectedResultsData[][n],
|  | const unsigned int | runtimeConflictsData[][n],
|  | const bool | acceptList[],
|  | bool | verifyTermination = `true` |
| ) |  |  | `[inline, protected]`

This function runs BFIG with the specified initial conflicts as well as inserting new conflicts as the test proceeds and compares against the expected output.

Parameters:

  | numberOfIConf | The number of initial conflicts.
  | initialConflictsData | The list of initial conflicts, inserted immediately. The list is organized in BFIG variable order and has a single value index for each variable. A value of ((unsigned int)-1) indicates that this variable is not included in the list.
  | numberOfResults | The number of results expected. This should be the length of expectedResults, runtimeConflicts, and acceptList.
  | expectedResultsData | The list of expected results, in the order expected. The list is organized in BFIG variable order and has a single value index for each variable. A value of ((unsigned int)-1) indicates that this variable is not included in the list.
  | runtimeConflictsData | The list of conflicts generated while running. The list is organized in BFIG variable order and has a single value index for each variable. A value of ((unsigned int)-1) indicates that this variable is not included in the list.
  | acceptList | A boolean list which is true whenever a generated solution should be accepted.
  | verifyTermination | True (default) if this procedure should verify that exactly those results expected are returned and that no further results are available. False if this function is merely testing the first N results and one expects additional results to be available.

Definition at line 115 of file BFIGGeneratorTester.h.

References Mers::Generators::BFIG::BFIGGenerator::addConflict(), Mers::Generators::BFIG::BFIGGenerator::generateBestImplicant(), Mers::Generators::BFIG::BFIGGenerator::getFullAssignmentSize(), Mers::Utils::Containers::DynamicArray::getLength(), tut::BFIGHelper::loadAssignments(), Mers::Generators::BFIG::BFIGGenerator::markBestFeasible(), and mGenerator.

Here is the call graph for this function:

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

- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/unit-tests/BFIGGeneratorTester.h
- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/CDBFIG/unit-tests/CDBFIGGeneratorTester.cpp
- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/unit-tests/BFIGGeneratorTester.cpp