complex_systems Package

complex_systems Package

dygraph Module

class complex_systems.dygraph.DyGraph(time_stop=None, time_step=1.0, timeline=None)[source]

DynamicGraph store the time evolution of a graph by saving the snapshot of a graph at a given sampling rate

Example :
>>> import networkx as nx
>>> G = DyGraph()
>>> G.add_graph(nx.Graph(), 10.0)
add_graph(G, slice_time)[source]

Add a new slice or update a slice

avg_degree()[source]
diffusion(slice_time, synergy, states=None, time_stamps=None, nb_steps=1, infected_node=1, cooperator_ratio=0.0, strategies=None, payoffs=None)[source]
generate_mobility_levy_walk(alpha, beta, size_max, f_min, f_max, s_min, s_max, b_c, radius, velocity=1.0, nb_node=1)[source]

Generate a Levy walk for each node where teh sampling interval are defined as follow :

  • time_interval = [time_stop:time_step:time_stop]
  • nb_slices = (time_stop-time_start/time_step)
Parameters :
  • alpha : float

    Levy exponent for flight length distribution, 0 < alpha <= 2

  • beta : float

    Levy exponent for pause time distribution, 0 < beta <= 2

  • size_max : int

    size of simulation area

  • velocity : float

    speed in m/s

  • f_min : int

    min flight length

  • f_max : int

    max flight length

  • s_min : int

    min pause time (second)

  • s_max : int

    max pause time (second)

  • b_c : int
    boundary condition:
    • wrap-around if b_c=1
    • reflection boundary if b_c=2
  • nb_node : int (default 1)

    number of node in the model

generate_weights(inner_radius, outer_radius, alpha)[source]

Generate weigth

get_graph(time_step=0.0)[source]

Return the graph at time_step=time

get_nodes_states()[source]
get_slice(time_step=0.0)[source]

Return the graph slice at time_step=time

get_slice_time()[source]

Return the slice time list

next()[source]

Iterate through the graph of all the slice in the structure

Example :
>>> G = DyGraph()
>>> G.add_graph(nx.Graph(), 10.0)
>>> G.add_graph(nx.Graph(), 10.0)
>>> for g in G: 
>>>     print g.graph('slice_time')
set_nodes_states(nodes_states)[source]

Project Versions

Table Of Contents

Previous topic

complex_systems

Next topic

mobility Package

This Page