+ int thread_id = id_to_int(tid);
+ if (thread_id < num_threads)
+ return enabled_array[thread_id];
+ else
+ return THREAD_DISABLED;
+}
+
+bool Node::is_enabled(thread_id_t tid) const
+{
+ int thread_id=id_to_int(tid);
+ return thread_id < num_threads && (enabled_array[thread_id] != THREAD_DISABLED);
+}
+
+bool Node::has_priority(thread_id_t tid) const
+{
+ return fairness[id_to_int(tid)].priority;
+}
+
+/**
+ * Add an action to the may_read_from set.
+ * @param act is the action to add
+ */
+void Node::add_read_from(const ModelAction *act)
+{
+ may_read_from.push_back(act);
+}
+
+/**
+ * Gets the next 'future_value' value from this Node. Only valid for a node
+ * where this->action is a 'read'.
+ * @return The first element in future_values
+ */
+uint64_t Node::get_future_value() const
+{
+ ASSERT(future_index >= 0 && future_index<((int)future_values.size()));
+ return future_values[future_index].value;
+}
+
+modelclock_t Node::get_future_value_expiration() const
+{
+ ASSERT(future_index >= 0 && future_index<((int)future_values.size()));
+ return future_values[future_index].expiration;
+}
+
+
+int Node::get_read_from_size() const
+{
+ return may_read_from.size();
+}
+
+const ModelAction * Node::get_read_from_at(int i) {
+ return may_read_from[i];
+}
+
+/**
+ * Gets the next 'may_read_from' action from this Node. Only valid for a node
+ * where this->action is a 'read'.
+ * @return The first element in may_read_from
+ */
+const ModelAction * Node::get_read_from() const
+{
+ if (read_from_index < may_read_from.size())
+ return may_read_from[read_from_index];
+ else
+ return NULL;
+}
+
+/**
+ * Increments the index into the readsfrom set to explore the next item.
+ * @return Returns false if we have explored all items.
+ */
+bool Node::increment_read_from() {
+ DBG();
+ promises.clear();
+ if (read_from_index < may_read_from.size()) {
+ read_from_index++;
+ return read_from_index < may_read_from.size();
+ }
+ return false;