+/** This method sets a promise to explore meeting with the given
+ * node.
+ * @param i is the promise index.
+ */
+
+void Node::set_promise(uint32_t i) {
+ if (i>=promises.size())
+ promises.resize(i+1,0);
+ promises[i]=1;
+}
+
+/** This method looks up whether a given promise should be satisfied
+ * by this node.
+ *
+ * @param i is the promise index.
+ * @return true if the promise should be satisfied by the given model action.
+ */
+
+bool Node::get_promise(uint32_t i) {
+ return (i<promises.size())&&(promises[i]==2);
+}
+
+/** This method increments to the next combination of promises.
+ *
+ * @return true if we have a valid combination.
+ */
+
+bool Node::increment_promise() {
+ for (unsigned int i=0;i<promises.size();i++) {
+ if (promises[i]==1) {
+ promises[i]=2;
+ while (i>0) {
+ i--;
+ if (promises[i]==2)
+ promises[i]=1;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+/** This method returns whether the promise set is empty.
+ *
+ * @return true if we have explored all promise combinations.
+ */
+
+bool Node::promise_empty() {
+ for (unsigned int i=0;i<promises.size();i++)
+ if (promises[i]==1)
+ return false;
+ return true;
+}
+