Maximum Acyclic Subgraph - Multiple Sequence Alignment
MaximumAcyclicSubgraph
Public Member Functions | Public Attributes | List of all members
state Class Reference

This state class encapsulates the current game state. It can output possible actions and select them. More...

#include <State.h>

Collaboration diagram for state:
Collaboration graph
[legend]

Public Member Functions

 state (Graph &graph)
 Constructor with a Graph.
 
 state (std::vector< Edge > e)
 Constructor with an Edge vector.
 
void select (int i)
 
void updateSelectability (int i)
 
bool consistent (Edge &e, Edge &f)
 
bool hasEdge ()
 
void reset ()
 
vector< unsigned int > calcSuccessorStates ()
 
void calculate_score ()
 

Public Attributes

std::vector< Edgeedges
 
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.
 

Detailed Description

This state class encapsulates the current game state. It can output possible actions and select them.

Member Function Documentation

vector< unsigned int > state::calcSuccessorStates ( )

This function determines all direct successor states.

void state::calculate_score ( )

update the current score of the state: $ \textrm{score} = \sum_{c \in C} |c| (|c| - 1) / 2$, 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
eis an Edge
fis an Edge
bool state::hasEdge ( )

This function determines whether state has a selectable edge.

Returns
Returns true if it has selectable edge and false otherwise.
void state::reset ( )

This function calculates the beginning state

Parameters
eis vector of edges
void state::select ( int  i)

Selects edge i if selectable (does nothing otherwise)

Parameters
iis 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
iis the index of the edge

Member Data Documentation

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: