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

Classes

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

Typedefs

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

Typedef Documentation

◆ Edge

An edge is a graph entity with edge traits.

◆ EdgeContainer

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

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.