anpcpp 0.1.0
Analytic Network Process computational library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
anpcpp::AnpNode Class Reference

A decision element within a cluster (may own a subnetwork). More...

#include <network.hpp>

Public Member Functions

 AnpNode (AnpNetwork *network, AnpCluster *cluster, std::string name)
 Constructs a node (normally called via AnpCluster::add_node).
 
const std::string & name () const noexcept
 
const std::string & description () const noexcept
 
void set_description (std::string description)
 Sets the node description.
 
AnpClustercluster () const noexcept
 
AnpNetworknetwork () const noexcept
 
bool invert () const noexcept
 
void set_invert (bool value)
 Sets invert flag for subnet synthesis.
 
void connect_to (AnpNode *dest)
 Creates node-to-node connection (and cluster-level link).
 
void disconnect_from (AnpNode *dest)
 Removes connection to dest.
 
bool is_connected_to (const AnpNode *dest) const
 
bool is_connected_to_cluster (const std::string &cluster_name) const
 
PairwiseJudgmentsnode_pairwise (const std::string &dest_cluster)
 Pairwise judgments of this node w.r.t.
 
const PairwiseJudgmentsnode_pairwise (const std::string &dest_cluster) const
 Const overload of node_pairwise.
 
RatingsPrioritizernode_ratings (const std::string &dest_cluster)
 Ratings judgments of this node w.r.t.
 
const RatingsPrioritizernode_ratings (const std::string &dest_cluster) const
 Const overload of node_ratings.
 
NodePrioritizerKind node_prioritizer_kind (const std::string &dest_cluster) const
 Prioritizer kind for dest_cluster.
 
void set_node_prioritizer_kind (const std::string &dest_cluster, NodePrioritizerKind kind)
 Sets prioritizer kind for an existing link to dest_cluster.
 
NodePrioritizerSlotnode_prioritizer (const std::string &dest_cluster)
 Mutable prioritizer slot for dest_cluster, if present.
 
const NodePrioritizerSlotnode_prioritizer (const std::string &dest_cluster) const
 Const overload of node_prioritizer.
 
Vector unscaled_column () const
 Column of the unscaled supermatrix for this node.
 
AnpNetworksubnetwork () const noexcept
 
bool has_subnetwork () const noexcept
 
AnpNetworkensure_subnetwork ()
 Creates subnetwork if absent and returns it.
 

Detailed Description

A decision element within a cluster (may own a subnetwork).

Constructor & Destructor Documentation

◆ AnpNode()

anpcpp::AnpNode::AnpNode ( AnpNetwork network,
AnpCluster cluster,
std::string  name 
)

Constructs a node (normally called via AnpCluster::add_node).

Parameters
networkOwning network.
clusterParent cluster.
nameNode name (unique within the network).

Member Function Documentation

◆ cluster()

AnpCluster * anpcpp::AnpNode::cluster ( ) const
inlinenoexcept
Returns
Parent cluster.

◆ description()

const std::string & anpcpp::AnpNode::description ( ) const
inlinenoexcept
Returns
Optional description text.

◆ has_subnetwork()

bool anpcpp::AnpNode::has_subnetwork ( ) const
inlinenoexcept
Returns
True if a subnetwork exists.

◆ invert()

bool anpcpp::AnpNode::invert ( ) const
inlinenoexcept
Returns
True if this node's priority is inverted when synthesizing upward.

◆ is_connected_to()

bool anpcpp::AnpNode::is_connected_to ( const AnpNode dest) const
Returns
True if connected to dest.

◆ is_connected_to_cluster()

bool anpcpp::AnpNode::is_connected_to_cluster ( const std::string &  cluster_name) const
Returns
True if connected to any node in cluster_name.

◆ name()

const std::string & anpcpp::AnpNode::name ( ) const
inlinenoexcept
Returns
Node name.

◆ network()

AnpNetwork * anpcpp::AnpNode::network ( ) const
inlinenoexcept
Returns
Owning network.

◆ node_pairwise()

PairwiseJudgments * anpcpp::AnpNode::node_pairwise ( const std::string &  dest_cluster)

Pairwise judgments of this node w.r.t.

nodes in dest_cluster.

Returns
nullptr if no link, or if the link uses ratings.

◆ node_prioritizer()

NodePrioritizerSlot * anpcpp::AnpNode::node_prioritizer ( const std::string &  dest_cluster)

Mutable prioritizer slot for dest_cluster, if present.

Returns
nullptr if there is no link to that cluster.

◆ node_prioritizer_kind()

NodePrioritizerKind anpcpp::AnpNode::node_prioritizer_kind ( const std::string &  dest_cluster) const

Prioritizer kind for dest_cluster.

Exceptions
std::out_of_rangeif there is no link to that cluster.

◆ node_ratings()

RatingsPrioritizer * anpcpp::AnpNode::node_ratings ( const std::string &  dest_cluster)

Ratings judgments of this node w.r.t.

nodes in dest_cluster.

Returns
nullptr if no link, or if the link uses pairwise.

◆ set_node_prioritizer_kind()

void anpcpp::AnpNode::set_node_prioritizer_kind ( const std::string &  dest_cluster,
NodePrioritizerKind  kind 
)

Sets prioritizer kind for an existing link to dest_cluster.

Exceptions
std::out_of_rangeif there is no link to that cluster.

◆ subnetwork()

AnpNetwork * anpcpp::AnpNode::subnetwork ( ) const
inlinenoexcept
Returns
Owned subnetwork, or nullptr.

◆ unscaled_column()

Vector anpcpp::AnpNode::unscaled_column ( ) const

Column of the unscaled supermatrix for this node.

Returns
Vector indexed by global node order.

The documentation for this class was generated from the following file: