scram::core::Node
An abstract base class that represents a node in a PDAG. More...
#include <pdag.h>
Inherits from scram::core::NodeParentManager, boost::noncopyable
Inherited by scram::core::Constant, scram::core::Gate, scram::core::Variable
Public Functions
| Name | |
|---|---|
| Node(Pdag * graph)<br>Creates a unique graph node as a member of a PDAG. | |
| virtual | ~Node() =0<br>Abstract class. |
| Pdag & | graph() |
| int | index() const |
| int | order() const |
| void | order(int val)<br>Sets the order number for this node. |
| int | opti_value() const |
| void | opti_value(int val)<br>Sets the optimization value for failure propagation. |
| bool | Visit(int time)<br>Registers the visit time for this node upon graph traversal. |
| int | EnterTime() const |
| int | ExitTime() const |
| int | LastVisit() const |
| virtual int | min_time() const |
| virtual int | max_time() const |
| bool | Revisited() const |
| bool | Visited() const |
| void | ClearVisits()<br>Clears all the visit information. Resets the visit times to 0s. |
| int | pos_count() const |
| int | neg_count() const |
| void | AddCount(bool positive)<br>Increases the count of this node. |
| void | ResetCount()<br>Resets positive and negative counts of this node. |
Additional inherited members
Public Types inherited from scram::core::NodeParentManager
| Name | |
|---|---|
| using std::pair< int, GateWeakPtr > | Parent <br>Parent index and ptr. |
| using ext::linear_map< int, GateWeakPtr, ext::MoveEraser > | ParentMap <br>A map type of parent gate positive indices and weak pointers to them. |
Public Functions inherited from scram::core::NodeParentManager
| Name | |
|---|---|
| const ParentMap & | parents() const |
Protected Functions inherited from scram::core::NodeParentManager
| Name | |
|---|---|
| ~NodeParentManager() =default |
Friends inherited from scram::core::NodeParentManager
| Name | |
|---|---|
| class | Gate <br>The main manipulator of parent information. |
Detailed Description
class scram::core::Node;An abstract base class that represents a node in a PDAG.
Precondition: A node does not outlive its PDAG.
The index of the node is a unique identifier for the node. The node holds weak pointers to the parents that are managed by the parents.
Public Functions Documentation
function Node
explicit Node(
Pdag * graph
)Creates a unique graph node as a member of a PDAG.
Parameters:
- graph The graph this node belongs to.
function ~Node
virtual ~Node() =0Abstract class.
function graph
inline Pdag & graph()Return: The host graph of the node.
function index
inline int index() constReturn: The index of this node.
function order
inline int order() constReturn: Assigned order for this node.
function order
inline void order(
int val
)Sets the order number for this node.
Parameters:
- val Positive integer.
The order is interpreted by the assigner.
function opti_value
inline int opti_value() constReturn: Optimization value for failure propagation.
function opti_value
inline void opti_value(
int val
)Sets the optimization value for failure propagation.
Parameters:
- val Value that makes sense to the caller.
function Visit
inline bool Visit(
int time
)Registers the visit time for this node upon graph traversal.
Parameters:
- time The current visit time of this node. It must be positive.
Return:
- true if this node was previously visited.
- false if this is visited and re-visited only once.
This information can be used to detect dependencies.
function EnterTime
inline int EnterTime() constReturn:
- The time when this node was first encountered or entered.
- 0 if no enter time is registered.
function ExitTime
inline int ExitTime() constReturn:
- The exit time upon traversal of the graph.
- 0 if no exit time is registered.
function LastVisit
inline int LastVisit() constReturn:
- The last time this node was visited.
- 0 if no last time is registered.
function min_time
inline virtual int min_time() constReturn:
- The minimum time of the visit.
- 0 if no time is registered.
Reimplemented by: scram::core::Gate::min_time
function max_time
inline virtual int max_time() constReturn:
- The maximum time of the visit.
- 0 if no time is registered.
Reimplemented by: scram::core::Gate::max_time
function Revisited
inline bool Revisited() constReturn:
- false if this node was only visited once upon graph traversal.
- true if this node was revisited at least one more time.
function Visited
inline bool Visited() constReturn:
- true if this node was visited at least once.
- false if this node was never visited upon traversal.
function ClearVisits
inline void ClearVisits()Clears all the visit information. Resets the visit times to 0s.
function pos_count
inline int pos_count() constReturn: The positive count of this node.
function neg_count
inline int neg_count() constReturn: The negative count of this node.
function AddCount
inline void AddCount(
bool positive
)Increases the count of this node.
Parameters:
- positive Indication of a positive node.
function ResetCount
inline void ResetCount()Resets positive and negative counts of this node.
Updated on 2025-11-11 at 16:51:08 +0000
