This state class encapsulates the current game state. It can output possible actions and select them.
More...
#include <State.h>
|
std::vector< Edge > | edges |
|
std::vector< bool > | selectedSubset |
| Shows whether edge is selected in current subset (true = selected)
|
|
std::vector< bool > | selectable |
| Shows whether edge is selectable in the current subset (true = selectable)
|
|
std::vector< unsigned int > | selectedEdgeIndex |
| contains indices from "edges" for all edges that are selected
|
|
unsigned int | score |
| The score of the State.
|
|
vector< unsigned int > | successorStates |
| The indices of edges that if set are a direct successor State.
|
|
This state class encapsulates the current game state. It can output possible actions and select them.
vector< unsigned int > state::calcSuccessorStates |
( |
| ) |
|
This function determines all direct successor states.
void state::calculate_score |
( |
| ) |
|
update the current score of the state: , where C is the set of connected components and |c| is the number of nodes in connected component c. This function requires that the edges are sorted increasingly by i.
bool state::consistent |
( |
Edge & |
e, |
|
|
Edge & |
f |
|
) |
| |
If edges can both be selected while maintaining consistency, return true. Otherwise return false.
- Parameters
-
This function determines whether state has a selectable edge.
- Returns
- Returns true if it has selectable edge and false otherwise.
This function calculates the beginning state
- Parameters
-
void state::select |
( |
int |
i | ) |
|
Selects edge i if selectable (does nothing otherwise)
- Parameters
-
i | is the index of the edge |
void state::updateSelectability |
( |
int |
i | ) |
|
Checks whether edges in same sequence as edge i are selectable while maintaining consistency in current subset. The first while loop goes through 'previous' edges until it finds one on a different starting sequence. It checks edges on the same sequence as edge i for crossings from right or left. The second loop goes 'forwards' through edge vector doing exactly the same. If it finds any edge crossing our selected ones, it sets selectable for that edge to false.
- Parameters
-
i | is the index of the edge |
std::vector<Edge> state::edges |
Contains Edges as pairs of Nodes ('first' and 'second'). Nodes consist of Sequence index 'i', their index within that sequence 'j' and their k-mer string.
The documentation for this class was generated from the following files:
- src/alignment/State.h
- src/alignment/State.cc