Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b967696a71
Fetching contributors…

Cannot retrieve contributors at this time

file 32 lines (26 sloc) 0.863 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
/*
* Author: Ricardo Garcia Gonzalez
* License: Public domain code
*/
#ifndef __NODE_HEADER__
#define __NODE_HEADER__

// Node class. Builds full solution graph in constructor.
class Node {
private:
std::list<const Operation *> thesteps;
std::list<Node *> successors;
long thevalue;
Node *best_child;

public:
Node(const std::list<const Operation *> &prev_steps, long new_num,
long target, const std::list<long> &usable_nums,
std::set<std::list<long> > &explored_nodes, Node *parent);

long value() const { return thevalue; }
const std::list<const Operation *> &steps() const { return thesteps; }
const Node &best() const { return *best_child; }
};

// Best of two nodes.
Node *best_node(Node *first, Node *second, const long &target);

// Print node to output stream.
std::ostream &operator<<(std::ostream &out, const Node &node);

#endif
Something went wrong with that request. Please try again.