Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Typedefs
Utopia::Models::CopyMeGraph Namespace Reference

Classes

struct  VertexState
 The vertex state. More...
 
struct  EdgeState
 The edge state. More...
 
class  CopyMeGraph
 The CopyMeGraph Model; a good start for a graph-based model. More...
 

Typedefs

using VertexTraits = Utopia::GraphEntityTraits< VertexState >
 The traits of a vertex are just the traits of a graph entity. More...
 
using Vertex = GraphEntity< VertexTraits >
 A vertex is a graph entity with vertex traits. More...
 
using VertexContainer = boost::vecS
 The vertex container type. More...
 
using EdgeTraits = Utopia::GraphEntityTraits< EdgeState >
 The traits of an edge are just the traits of a graph entity. More...
 
using Edge = GraphEntity< EdgeTraits >
 An edge is a graph entity with edge traits. More...
 
using EdgeContainer = boost::listS
 The edge container type. More...
 
using GraphType = boost::adjacency_list< EdgeContainer, VertexContainer, boost::bidirectionalS, Vertex, Edge >
 The type of the graph. More...
 
using ModelTypes = Utopia::ModelTypes<>
 Type helper to define types used by the model. More...
 

Typedef Documentation

◆ Edge

An edge is a graph entity with edge traits.

◆ EdgeContainer

using Utopia::Models::CopyMeGraph::EdgeContainer = typedef boost::listS

The edge container type.

Here, you can select into which container your edges should be stored in. Common choices are boost::vecS or boost::listS.

◆ EdgeTraits

The traits of an edge are just the traits of a graph entity.

◆ GraphType

using Utopia::Models::CopyMeGraph::GraphType = typedef boost::adjacency_list<EdgeContainer, VertexContainer, boost::bidirectionalS, Vertex, Edge>

The type of the graph.

By providing the structs that contain all properties of a vertex or edge respectively, you take advantage of boost::graph's bundled properties (google it, if not known). This fascilitates setting and accessing vertex and edge properties. :)

Warning
As you can see in the graph type declaration below, when you declare a boost::adjacency_list you first have to specify the container type of the edges and then the container type of the vertices. However, when you specify the structs containing the properties of graph entities the order is vise versa. Why is this the case? We don't know; but take care that you have the correct order!

◆ ModelTypes

Type helper to define types used by the model.

◆ Vertex

A vertex is a graph entity with vertex traits.

◆ VertexContainer

using Utopia::Models::CopyMeGraph::VertexContainer = typedef boost::vecS

The vertex container type.

Here, you select in which container your vertices should be stored in. Common choices are boost::vecS or boost::listS.

◆ VertexTraits

The traits of a vertex are just the traits of a graph entity.