ActionList safe = safeActions(temp);
if (safe.size() > 0){
safe[0](temp);
+ cout << "Action: " << safe[0].toString() << " ";
al.push_back(safe[0]);
}else
return ActionList(); //TODO: Need to handle hurdles.
#include "genealgorithms.h"
#include <algorithm>
+#include <sstream>
/**
* Reverses an interval
}
return false;
}
+
+ /**
+ * Gives a string representation of the action, for output
+ */
+ virtual std::string toString() const{
+ std::ostringstream os;
+ os << "[" << _i << "," << _j << "]";
+ return os.str();
+ }
private:
size_t _i;
size_t _j;
#define __SORTACTION_H__
#include <tr1/memory>
+#include <string>
class GeneOrder;
/**
* Abstraction of a sort action, all child actions has to be immutable.
virtual bool operator==(const SortAction& sa) const{
return (*_action) == (sa._action.get() == 0 ? sa : *sa._action);
}
+
+ /**
+ * Gives a string representation of the action, for output
+ */
+ virtual std::string toString() const{
+ return _action->toString();
+ }
private:
ActionPointer _action;