Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

SSD::DiffDijkstraState Class Reference

state object for the Dijkstra search we are implementing More...

#include <diff.h>

Collaboration diagram for SSD::DiffDijkstraState:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DiffDijkstraState (int c, int u, int l, NodeVec::const_iterator p, NodeAssignments *a, RelCount *cr)
 constructor for a new state
 ~DiffDijkstraState ()
 Destructor that releases referenced data.
const NodeAssignmentsfindNodeAssignment1 (Node *n1) const
 test if node n1 is assigned in the current state
const NodeAssignmentsfindNodeAssignment2 (Node *n2) const
 test if node n2 is assigned in the current state
bool operator< (const DiffDijkstraState &other) const
 ordering operator used for sorting the working queue

Public Attributes

int seq
 for sequence counting - only used for tracing
int cost
 current costs of this state, needed for sorting
int credits_used
 orthogonal to the costs
int length
 how many nodes have been matched
bool complete
 state is a solution state
NodeVec::const_iterator iter
 current node being processed.
NodeAssignmentsass
 Assignments made for the current state.
RelCountcredit
 current "credits" for this search state

Detailed Description

state object for the Dijkstra search we are implementing

Each open end in the Dijkstra Search is represented by such an object. By keeping a reference to the "node assignment", it will keep the matched-nodes list open as long as its needed

Definition at line 85 of file diff.h.


Constructor & Destructor Documentation

SSD::DiffDijkstraState::DiffDijkstraState int  c,
int  u,
int  l,
NodeVec::const_iterator  p,
NodeAssignments a,
RelCount cr
[inline]
 

constructor for a new state

Parameters:
c costs for the new state
u credits used for this state
l "length" of this state, i.e. depth in search tree
p "iterator" to the next node to be processed
a list of node assignments with relcount already increased
cr remaining credits for this state

Definition at line 123 of file diff.h.

SSD::DiffDijkstraState::~DiffDijkstraState  )  [inline]
 

Destructor that releases referenced data.

Definition at line 129 of file diff.h.

References ass, credit, and SSD::NodeAssignments::release().

Here is the call graph for this function:


Member Function Documentation

const NodeAssignments * SSD::DiffDijkstraState::findNodeAssignment1 Node n1  )  const
 

test if node n1 is assigned in the current state

Parameters:
n1 the node to be found
Returns:
the node assignment if found

Definition at line 326 of file diff.cc.

References ass, iter, SSD::NodeAssignments::n1, and SSD::NodeAssignments::next.

Referenced by SSD::process_relations().

const NodeAssignments * SSD::DiffDijkstraState::findNodeAssignment2 Node n2  )  const
 

test if node n2 is assigned in the current state

Parameters:
n2 the node to be found
Returns:
the node assignment if found

Definition at line 335 of file diff.cc.

References ass, iter, SSD::NodeAssignments::n2, and SSD::NodeAssignments::next.

Referenced by SSD::process_relations(), and SSD::DiffDijkstra::step().

bool SSD::DiffDijkstraState::operator< const DiffDijkstraState other  )  const [inline]
 

ordering operator used for sorting the working queue

A state is considered to be better if:

  • his costs are lower or
  • costs are equal, but less credits have yet been used
  • costs and credits used are equal, but length is bigger
    Parameters:
    other state to be compared with
    Returns:
    comparision result

Definition at line 145 of file diff.h.

References cost, credits_used, and length.


Member Data Documentation

NodeAssignments* SSD::DiffDijkstraState::ass
 

Assignments made for the current state.

Definition at line 110 of file diff.h.

Referenced by findNodeAssignment1(), findNodeAssignment2(), SSD::DiffDijkstra::makeState(), SSD::XUpdateWriter::run(), SSD::MergedWriter::run(), SSD::MarkedWriter::run(), SSD::DiffDijkstra::step(), and ~DiffDijkstraState().

bool SSD::DiffDijkstraState::complete
 

state is a solution state

set if there are no unmatched nodes left, so this is in fact a solution

Definition at line 102 of file diff.h.

int SSD::DiffDijkstraState::cost
 

current costs of this state, needed for sorting

Definition at line 92 of file diff.h.

Referenced by SSD::DiffDijkstra::makeState(), operator<(), and SSD::DiffDijkstra::step().

RelCount* SSD::DiffDijkstraState::credit
 

current "credits" for this search state

Definition at line 113 of file diff.h.

Referenced by SSD::DiffDijkstra::makeState(), and ~DiffDijkstraState().

int SSD::DiffDijkstraState::credits_used
 

orthogonal to the costs

how many of the "predicted" costs have been used. This might be useful for pruning the tree.

Definition at line 96 of file diff.h.

Referenced by SSD::DiffDijkstra::makeState(), and operator<().

NodeVec::const_iterator SSD::DiffDijkstraState::iter
 

current node being processed.

C++ will make this iterator class a pointer - 4 bytes is perfect

Definition at line 108 of file diff.h.

Referenced by findNodeAssignment1(), findNodeAssignment2(), and SSD::DiffDijkstra::step().

int SSD::DiffDijkstraState::length
 

how many nodes have been matched

Definition at line 98 of file diff.h.

Referenced by SSD::DiffDijkstra::makeState(), operator<(), and SSD::DiffDijkstra::step().

int SSD::DiffDijkstraState::seq
 

for sequence counting - only used for tracing

Definition at line 89 of file diff.h.

Referenced by SSD::DiffDijkstra::makeState(), and SSD::DiffDijkstra::step().


The documentation for this class was generated from the following files:
Generated on Thu Aug 4 17:58:43 2005 for SSDDiff by  doxygen 1.4.3-20050530