Dynamical System Framework
Loading...
Searching...
No Matches
dsf::Dynamics< network_t > Class Template Reference

The Dynamics class represents the dynamics of the network. More...

#include <Dynamics.hpp>

Public Member Functions

 Dynamics (network_t &&graph, std::optional< std::uint64_t > seed=std::nullopt)
 Construct a new Dynamics object.
void setSeed (std::uint64_t const seed)
 Set the seed for the random number generators.
void setConcurrency (std::size_t const concurrency)
 Set the maximum number of threads to use for parallel execution.
auto concurrency () const
 Get the current concurrency (number of threads configured in the task arena).
auto const & graph () const
 Get the graph.
auto & graph ()
 Get the graph (mutable).
auto time_step () const
 Get the current simulation time-step.

Protected Member Functions

void m_evolve ()
std::uint64_t seed () const noexcept
 Get the base seed of the random number generators.

Protected Attributes

std::unique_ptr< network_t > m_graph
tbb::task_arena m_taskArena
std::mt19937_64 m_generator
tbb::enumerable_thread_specific< std::mt19937_64 > m_threadGenerators

Detailed Description

template<typename network_t>
class dsf::Dynamics< network_t >

The Dynamics class represents the dynamics of the network.

Template Parameters
network_tThe type of the network

Constructor & Destructor Documentation

◆ Dynamics()

template<typename network_t>
dsf::Dynamics< network_t >::Dynamics ( network_t && graph,
std::optional< std::uint64_t > seed = std::nullopt )

Construct a new Dynamics object.

Parameters
graphThe graph representing the network
seedThe seed for the random number generator (default is std::nullopt)

Member Function Documentation

◆ concurrency()

template<typename network_t>
auto dsf::Dynamics< network_t >::concurrency ( ) const
inline

Get the current concurrency (number of threads configured in the task arena).

Returns
std::size_t, The current concurrency

◆ graph() [1/2]

template<typename network_t>
auto & dsf::Dynamics< network_t >::graph ( )
inline

Get the graph (mutable).

Returns
network_t&, The graph

◆ graph() [2/2]

template<typename network_t>
auto const & dsf::Dynamics< network_t >::graph ( ) const
inline

Get the graph.

Returns
const network_t&, The graph

◆ seed()

template<typename network_t>
std::uint64_t dsf::Dynamics< network_t >::seed ( ) const
inlineprotectednoexcept

Get the base seed of the random number generators.

Returns
std::uint64_t The seed given at construction or with setSeed

◆ setConcurrency()

template<typename network_t>
void dsf::Dynamics< network_t >::setConcurrency ( std::size_t const concurrency)

Set the maximum number of threads to use for parallel execution.

Parameters
concurrencyThe maximum number of threads to use for parallel execution

◆ setSeed()

template<typename network_t>
void dsf::Dynamics< network_t >::setSeed ( std::uint64_t const seed)

Set the seed for the random number generators.

Parameters
seedThe seed to set

With a concurrency of 1 the simulation is reproducible. With more threads it is not, as which thread (thus which engine) processes each node depends on scheduling

◆ time_step()

template<typename network_t>
auto dsf::Dynamics< network_t >::time_step ( ) const
inline

Get the current simulation time-step.

Returns
std::time_t, The current simulation time-step

The documentation for this class was generated from the following file:
  • src/dsf/base/Dynamics.hpp