API

EasyABM provides following functions for agent based simulations.

Functions for creating agents

Missing docstring.

Missing docstring for con_2d_agent. Check Documenter's build log for details.

EasyABM.con_2d_agentsFunction
con_2d_agents(n::Int64; pos, space_type, kwargs...) -> Vector{EasyABM.Agent2D{Symbol, Any, Float64, Periodic}}

Creates a list of n 2d agents with properties specified as keyword arguments.

source
EasyABM.grid_2d_agentFunction
grid_2d_agent(; pos, space_type, kwargs...) -> EasyABM.Agent2D{Symbol, Any, Int64, Periodic}

Creates a single 2d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - vel : velocity - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keepsrecordof : list of properties that the agent records during time evolution.

source
EasyABM.grid_2d_agentsFunction
grid_2d_agents(n::Int64; pos, space_type, kwargs...) -> Vector{EasyABM.Agent2D{Symbol, Any, Int64, Periodic}}

Creates a list of n 2d agents with properties specified as keyword arguments.

source
EasyABM.con_3d_agentFunction
con_3d_agent(; pos, space_type, kwargs...) -> EasyABM.Agent3D{Symbol, Any, Float64, Periodic}

Creates a single 3d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - vel : velocity - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keepsrecordof : list of properties that the agent records during time evolution.

source
EasyABM.con_3d_agentsFunction
con_3d_agents(n::Int64; pos, space_type, kwargs...) -> Vector{EasyABM.Agent3D{Symbol, Any, Float64, Periodic}}

Creates a list of n 3d agents with properties specified as keyword arguments.

source
EasyABM.grid_3d_agentFunction
grid_3d_agent(; pos, space_type, kwargs...) -> EasyABM.Agent3D{Symbol, Any, Int64, Periodic}

Creates a single 3d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - vel : velocity - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keepsrecordof : list of properties that the agent records during time evolution.

source
EasyABM.grid_3d_agentsFunction
grid_3d_agents(n::Int64; pos, space_type, kwargs...) -> Vector{EasyABM.Agent3D{Symbol, Any, Int64, Periodic}}

Creates a list of n 2d agents with properties specified as keyword arguments.

source
EasyABM.graph_agentFunction
graph_agent(; node, graph_mort_type, kwargs...) -> EasyABM.GraphAgent{Symbol, Any, Static}

Creates a single graph agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - node : node where the agent is located on the graph. - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keepsrecordof : list of properties that the agent records during time evolution.

source
EasyABM.graph_agentsFunction
graph_agents(n::Int64; node, graph_mort_type, kwargs...) -> Vector{EasyABM.GraphAgent{Symbol, Any, Static}}

Creates a list of n graph agents with properties specified as keyword arguments.

source
EasyABM.create_similarFunction
create_similar(agent::EasyABM.Agent2D{Symbol, Any, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, n::Int64) -> Vector

Returns a list of n 2d agents all having same properties as agent.

source
create_similar(agent::EasyABM.Agent2D{Symbol, Any, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> EasyABM.Agent2D{Symbol, Any}

Returns an agent with same properties as given agent.

source
create_similar(agent::EasyABM.GraphAgent{Symbol, Any, S<:EasyABM.MType}, n::Int64) -> Vector

Returns a list of n 2d agents all having same properties as agent.

source
create_similar(agent::EasyABM.GraphAgent{Symbol, Any, S<:EasyABM.MType}) -> EasyABM.GraphAgent{Symbol, Any}

Returns a list of n 2d agents all having same properties as agent.

source
create_similar(agent::EasyABM.Agent3D{Symbol, Any, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, n::Int64) -> Vector

Returns a list of n 2d agents all having same properties as agent.

source
create_similar(agent::EasyABM.Agent3D{Symbol, Any, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> EasyABM.Agent3D{Symbol, Any}

Returns an agent with same properties as given agent.

source

Functions for defining model

EasyABM.create_2d_modelFunction
create_2d_model(agents::Array{EasyABM.Agent2D{Symbol, Any, S<:Union{Int64, AbstractFloat}, A<:EasyABM.SType}, 1}; graphics, agents_type, size, random_positions, space_type, kwargs...) -> EasyABM.SpaceModel2D{Static, _A, Periodic} where _A<:Union{Int64, AbstractFloat}

Creates a 2d model with

  • agents : list of agents.
  • graphics : if true, properties of shape, color, orientation will be assigned to each agent by default, if not already assigned by the user.
  • fix_agent_num : Set it to true if agents do not die and new agents are not born during simulation.
  • size : A tuple (dimx, dimy) which tells the number of blocks the space is to be divided into along x and y directions. An agent can take

positions from 0 to dimx in x-direction and 0 to dimy in y direction. The agents can move continuously or in discrete steps depending upon how user implements the step rule (unless the agents are of grid type which can only move in dicrete steps). Each unit block of space is called a patch which like agents can be assigned its own properties.

  • periodic: Ifperiodic` is true the grid space will be periodic in both x and y directions. If set to false, agents can not be assigned position outside the

space boundaries

  • random_positions : If this property is true, each agent, will be assigned a random position.
  • kwargs` : Keyword argments used as model parameters.
source
create_2d_model(; graphics, size, random_positions, space_type, kwargs...) -> EasyABM.SpaceModel2D{_A, Float64} where _A
source
EasyABM.create_3d_modelFunction
create_3d_model(agents::Array{EasyABM.Agent3D{Symbol, Any, S<:Union{Int64, AbstractFloat}, A<:EasyABM.SType}, 1}; graphics, agents_type, size, random_positions, space_type, kwargs...) -> EasyABM.SpaceModel3D{Static, _A, Periodic} where _A<:Union{Int64, AbstractFloat}

Creates a 3d model with

  • agents : list of agents.
  • graphics : if true, properties of shape, color, orientation will be assigned to each agent by default, if not already assigned by the user.
  • fix_agent_num : Set it to true if agents do not die and new agents are not born during simulation.
  • size : A tuple (dimx, dimy, dimz) which tells the number of blocks the space is to be divided into along x, y and z directions. An agent can take

positions from 0 to dimx in x-direction, 0 to dimy in y direction and 0 to dimz in z direction. The agents can move continuously or in discrete steps depending upon how user implements the step rule (unless the agents are of grid type which can only move in dicrete steps). Each unit block of space is called a patch which like agents can be assigned its own properties.

  • periodic: Ifperiodic` is true the grid space will be periodic in x, y and z directions. If set to false, agents can not be assigned position outside the

space boundaries

  • random_positions : If this property is true, each agent, will be assigned a random position.
  • kwargs` : Keyword argments used as model parameters.
source
create_3d_model(; graphics, size, random_positions, space_type, kwargs...) -> EasyABM.SpaceModel3D{_A, Float64} where _A
source
EasyABM.create_graph_modelFunction
create_graph_model(agents::Array{EasyABM.GraphAgent{Symbol, Any, A<:EasyABM.MType}, 1}, graph::EasyABM.AbstractPropGraph{S<:EasyABM.MType, G<:EasyABM.GType}; agents_type, decorated_edges, graphics, random_positions, kwargs...) -> EasyABM.GraphModel{_A, Static} where _A<:EasyABM.MType

Creates a model with

  • agents : list of agents.
  • graph : A graph coverted to EasyABM graph from Graph.jl or created with EasyABM graph functionality.
  • graphics : if true properties of pos, shape, color, orientation will be assigned to each agent by default, if not already assigned by user.
  • fix_agent_num : Set it to true if agents do not die and new agents are not born during simulation.
  • decorated_edges : Set it to true if edges are to be assigned weights or any other properties.
  • random_positions : If this property is true, each agent will be assigned a random node on the graph.
  • kwargs : Keyword argments used as model parameters.
source
create_graph_model(graph::EasyABM.AbstractPropGraph{S<:EasyABM.MType, G<:EasyABM.GType}; decorated_edges, graphics, random_positions, kwargs...) -> EasyABM.GraphModel
source

Functions for initialising, running and visualising

EasyABM.init_model!Function
init_model!(model::EasyABM.SpaceModel2D; initialiser, props_to_record, keep_deads_data)

Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model parameters along with agent properties can be set (or modified) from within a user defined function and then sending it as initialiser argument in init_model!. The properties of agents, patches and model that are to be recorded during time evolution can be specified through the dictionary argument props_to_record. List of agent properties to be recorded are specified with key "agents" and value the list of property names as symbols. If a nonempty list of agents properties is specified, it will replace the keeps_record_of list of each agent. Properties of patches and model are similarly specified with keys "patches" and "model" respectively.

source
init_model!(model::EasyABM.SpaceModel3D; initialiser, props_to_record, keep_deads_data)

Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model parameters along with agent properties can be set (or modified) from within a user defined function and then sending it as initialiser argument in init_model!. The properties of agents, patches and model that are to be recorded during time evolution can be specified through the dictionary argument props_to_record. List of agent properties to be recorded are specified with key "agents" and value the list of property names as symbols. If a nonempty list of agents properties is specified, it will replace the keeps_record_of list of each agent. Properties of patches and model are similarly specified with keys "patches" and "model" respectively.

source
init_model!(model::EasyABM.GraphModel; initialiser, props_to_record, keep_deads_data)

Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model parameters along with agent and graph properties can be set (or modified) from within a user defined function and then sending it as initialiser argument in init_model!. The properties of agents, nodes, edges and the model that are to be recorded during time evolution can be specified through the dictionary argument props_to_record. List of agent properties to be recorded are specified with key "agents" and value the list of property names as symbols. If a nonempty list of agents properties is specified, it will replace the keeps_record_of list of each agent. Properties of nodes, edges and model are similarly specified with keys "nodes", "edges" and "model" respectively.

source
EasyABM.run_model!Function
run_model!(model::EasyABM.SpaceModel2D; steps, step_rule)

Runs the simulation for steps number of steps.

source
run_model!(model::EasyABM.SpaceModel3D; steps, step_rule)

Runs the simulation for steps number of steps.

source
run_model!(model::EasyABM.GraphModel; steps, step_rule)

Runs the simulation for steps number of steps.

source
EasyABM.run_model_epochs!Function
run_model_epochs!(model::EasyABM.SpaceModel2D; steps_per_epoch, num_epochs, step_rule, save_to_folder)

Runs the simulation for num_epochs number of epochs where each epoch consists of steps_per_epoch number of steps. The model is saved as .jld2 file and the model.tick is reset to 1 at the end of each epoch.

source
run_model_epochs!(model::EasyABM.SpaceModel3D; steps_per_epoch, num_epochs, step_rule, save_to_folder)

Runs the simulation for num_epochs number of epochs where each epoch consists of steps_per_epoch number of steps. The model is saved as .jld2 file and the model.tick is reset to 1 at the end of each epoch.

source
run_model_epochs!(model::EasyABM.GraphModel; steps_per_epoch, num_epochs, step_rule, save_to_folder)

Runs the simulation for num_epochs number of epochs where each epoch consists of steps_per_epoch number of steps. The model is saved as .jld2 file and the model.tick is reset to 1 at the end of each epoch.

source
EasyABM.animate_simFunction
animate_sim(model::EasyABM.SpaceModel2D) -> Widgets.Widget{:default, Any}
animate_sim(model::EasyABM.SpaceModel2D, frames::Int64; agent_plots, patch_plots, model_plots, plots_only, path, show_grid, backend, tail) -> Widgets.Widget{:default, Any}

Creates an animation from the data collected during model run.

source
animate_sim(model::EasyABM.SpaceModel3D) -> Union{Nothing, MeshCat.DisplayedVisualizer}
animate_sim(model::EasyABM.SpaceModel3D, frames::Int64; show_grid, tail) -> Union{Nothing, MeshCat.DisplayedVisualizer}

Creates a 3d animation from the data collected during the model run.

source
animate_sim(model::EasyABM.GraphModel) -> Widgets.Widget{:default, Any}
animate_sim(model::EasyABM.GraphModel, frames::Int64; agent_plots, node_plots, model_plots, plots_only, path, show_graph, backend) -> Widgets.Widget{:default, Any}

Creates an animation from the data collected during model run.

source
EasyABM.create_interactive_appFunction
create_interactive_app(inmodel::EasyABM.SpaceModel2D; initialiser, props_to_record, step_rule, agent_controls, model_controls, agent_plots, patch_plots, model_plots, plots_only, path, frames, show_grid, backend, tail) -> Widgets.Widget{:default, Any}

Creates an interactive app for the model.

source
create_interactive_app(inmodel::EasyABM.SpaceModel3D; initialiser, props_to_record, step_rule, agent_controls, model_controls, agent_plots, patch_plots, model_plots, plots_only, frames, show_grid, tail) -> Widgets.Widget{:default, Any}

Creates an interactive app for the model.

source
create_interactive_app(inmodel::EasyABM.GraphModel; initialiser, props_to_record, step_rule, agent_controls, model_controls, agent_plots, node_plots, model_plots, plots_only, path, frames, show_graph, backend) -> Widgets.Widget{:default, Any}

Creates an interactive app for the model.

source

Functions for accessing, saving and retrieving data.

EasyABM.get_agent_dataFunction
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Mortal}, EasyABM.AbstractSpaceModel{Mortal}}) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Mortal}, EasyABM.AbstractSpaceModel{Mortal}}, props) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
source
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Static}, EasyABM.AbstractSpaceModel{Static}}) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Static}, EasyABM.AbstractSpaceModel{Static}}, props) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
source
EasyABM.get_patch_dataFunction
get_patch_data(patch, model::EasyABM.AbstractSpaceModel) -> Union{Nothing, NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}}
get_patch_data(patch, model::EasyABM.AbstractSpaceModel, props) -> Union{Nothing, NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}}
source
EasyABM.get_node_dataFunction
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, props) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
source
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, props) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
source
EasyABM.get_edge_dataFunction
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, props) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
source
get_edge_data(edge, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(edge, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, props) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
source
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}})
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, props)
source
get_edge_data(edge, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}})
get_edge_data(edge, model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, props)
source
EasyABM.get_model_dataFunction
get_model_data(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
get_model_data(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}, props) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
source
EasyABM.latest_propvalsFunction
latest_propvals(obj::EasyABM.AbstractPropDict, propname::Symbol, n::Int64) -> Any
source
latest_propvals(agent::EasyABM.AbstractPropDict, model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}, propname::Symbol, n::Int64) -> Any
source
latest_propvals(patch, model::EasyABM.AbstractSpaceModel, propname::Symbol, n::Int64) -> Any
source
latest_propvals(node::Int64, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
source
latest_propvals(i::Int64, j::Int64, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
source
latest_propvals(edge, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
source
EasyABM.propnamesFunction
propnames(obj::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}) -> Vector{Symbol}
source
propnames(obj::EasyABM.GraphAgent) -> Vector{Symbol}
source
propnames(obj::EasyABM.AbstractPropDict) -> Vector{Symbol}
source
EasyABM.get_nums_agentsFunction
get_nums_agents(model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Mortal}, EasyABM.AbstractSpaceModel{Mortal}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
get_nums_agents(model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, Static}, EasyABM.AbstractSpaceModel{Static}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.get_nums_patchesFunction
get_nums_patches(model::EasyABM.AbstractSpaceModel, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.get_nums_nodesFunction
get_nums_nodes(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
get_nums_nodes(model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.get_nums_edgesFunction
get_nums_edges(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
get_nums_edges(model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, conditions::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.get_nodes_avg_propsFunction
get_nodes_avg_props(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, props::Function...; labels, plot_result) -> DataFrames.DataFrame
source
get_nodes_avg_props(model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, props::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.get_edges_avg_propsFunction
get_edges_avg_props(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}, props::Function...; labels, plot_result) -> DataFrames.DataFrame
source
get_edges_avg_props(model::Union{EasyABM.GraphModel{Static, Mortal}, EasyABM.GraphModel{Static, Static}}, props::Function...; labels, plot_result) -> DataFrames.DataFrame
source
EasyABM.save_modelFunction
save_model(model; model_name, save_as, folder) -> Union{Nothing, Int64}

Saves the model on disk as jld2 file.

source

Functions for creating and modifying a graph

EasyABM.static_simple_graphFunction
static_simple_graph(n::Int64) -> EasyABM.SimplePropGraph{Static, EasyABM.SimG}

Creates a simple prop graph with n vertices.

source
static_simple_graph(structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.SimplePropGraph{Static, EasyABM.SimG}}

Creates a simple prop graph with given structure.

source
static_simple_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Static, EasyABM.SimG}}

Creates a simple prop graph for given Adjacency matrix.

source
static_simple_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Static, EasyABM.SimG}}

Creates a simple prop graph for adjacency_matrix given as a Sparse Matrix.

source
static_simple_graph(g::Graphs.SimpleGraphs.SimpleGraph{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Static, EasyABM.SimG}}

Creates a simple prop graph from a given simple graph created with Graphs.jl.

source
EasyABM.static_dir_graphFunction
static_dir_graph(n::Int64) -> EasyABM.DirPropGraph{Static, EasyABM.DirG}

Creates a directed prop graph with n vertices.

source
static_dir_graph(in_structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.DirPropGraph{Static, EasyABM.DirG}}

Creates a directed prop graph with given structure.

source
static_dir_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Static, EasyABM.DirG}}

Creates a directed prop graph for given Adjacency matrix.

source
static_dir_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Static, EasyABM.DirG}}

Creates a directed prop graph for adjacency matrix given as a Sparse Matrix.

source
static_dir_graph(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Static, EasyABM.DirG}}

Creates a directed prop graph for a given directed graph created with Graphs.jl.

source
EasyABM.dynamic_simple_graphFunction
dynamic_simple_graph(n::Int64) -> EasyABM.SimplePropGraph{Mortal, EasyABM.SimG}

Creates a simple prop graph with n vertices.

source
dynamic_simple_graph(structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.SimplePropGraph{Mortal, EasyABM.SimG}}

Creates a simple prop graph with given structure.

source
dynamic_simple_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Mortal, EasyABM.SimG}}

Creates a simple prop graph for given Adjacency matrix.

source
dynamic_simple_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Mortal, EasyABM.SimG}}

Creates a simple prop graph for adjacency_matrix given as a Sparse Matrix.

source
dynamic_simple_graph(g::Graphs.SimpleGraphs.SimpleGraph{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{Mortal, EasyABM.SimG}}

Creates a simple prop graph from a given simple graph created with Graphs.jl.

source
EasyABM.dynamic_dir_graphFunction
dynamic_dir_graph(n::Int64) -> EasyABM.DirPropGraph{Mortal, EasyABM.DirG}

Creates a directed prop graph with n vertices.

source
dynamic_dir_graph(in_structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.DirPropGraph{Mortal, EasyABM.DirG}}

Creates a directed prop graph with given structure.

source
dynamic_dir_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Mortal, EasyABM.DirG}}

Creates a directed prop graph for given Adjacency matrix.

source
dynamic_dir_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Mortal, EasyABM.DirG}}

Creates a directed prop graph for adjacency matrix given as a Sparse Matrix.

source
dynamic_dir_graph(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{Mortal, EasyABM.DirG}}

Creates a directed prop graph for a given directed graph created with Graphs.jl.

source
EasyABM.add_node!Function
add_node!(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}; kwargs...) -> Int64

Adds a node with properties specified in kwargs to the model's graph.

source
EasyABM.add_nodes!Function
add_nodes!(n, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}; kwargs...)

Adds n nodes with properties specified in kwargs to the model's graph.

source
EasyABM.kill_node!Function
kill_node!(node, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> Union{Nothing, Int64}

Removes a node from model graph. For performance reasons the function does not check if the node contains the node so it will throw an error if the user tries to delete a node which is not there. Also the node will not be deleted if the agents in the model can not be killed and the number of agents at the given node is nonzero.

source
EasyABM.create_edge!Function
create_edge!(i, j, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}; kwargs...)

Adds an edge with properties kwargs to model graph.

source
create_edge!(edge, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}; kwargs...)

Adds an edge with properties kwargs to model graph.

source
EasyABM.kill_edge!Function
kill_edge!(i, j, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> Union{Nothing, EasyABM.PropDataDict{Symbol, Any}}

Removes edge from the model graph.

source
kill_edge!(edge, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> Union{Nothing, EasyABM.PropDataDict{Symbol, Any}}

Removes edge from the model graph.

source
EasyABM.kill_all_edges!Function
kill_all_edges!(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}})

Removes all edges from the model graph.

source
EasyABM.flush_graph!Function
flush_graph!(model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Mortal, Static}}) -> Int64

Removes the graph and all of related data completely.

source
EasyABM.is_staticFunction
is_static(g::EasyABM.SimplePropGraph{T<:EasyABM.MType}) -> Bool
source
is_static(g::EasyABM.DirPropGraph{T<:EasyABM.MType}) -> Bool
source

Helper functions for agents

EasyABM.get_grid_locFunction
get_grid_loc(agent::EasyABM.Agent2D{Symbol, Any, <:AbstractFloat}) -> Tuple{Int64, Int64}

Returns grid location of the agent.

source
get_grid_loc(agent::EasyABM.Agent2D{Symbol, Any, Int64}) -> Vect{2, <:Int64}

Returns grid location of the agent.

source
get_grid_loc(agent::EasyABM.Agent3D{Symbol, Any, <:AbstractFloat}) -> Tuple{Int64, Int64, Int64}

Returns grid location of the agent.

source
get_grid_loc(agent::EasyABM.Agent3D{Symbol, Any, Int64}) -> Vect{3, <:Int64}

Returns grid location of the agent.

source
EasyABM.agents_atFunction
agents_at(patch, model::EasyABM.SpaceModel2D) -> Base.Generator

Returns list of agents at a given patch.

source
agents_at(patch, model::EasyABM.SpaceModel3D) -> Base.Generator

Returns list of agents at a given patch.

source
agents_at(node, model::EasyABM.GraphModel{Mortal, T<:EasyABM.MType}) -> Base.Generator

Returns list of agents at a given node.

source
agents_at(node, model::EasyABM.GraphModel{Static, T<:EasyABM.MType}) -> Base.Generator

Returns list of agents at a given node.

source
EasyABM.num_agents_atFunction
num_agents_at(patch, model::EasyABM.AbstractSpaceModel) -> Int64

Returns number of agents at a given patch.

source
num_agents_at(node, model::EasyABM.AbstractGraphModel) -> Int64

Returns number of agents at a given node.

source
EasyABM.agent_with_idFunction
agent_with_id(i::Int64, model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Union{Nothing, EasyABM.Agent2D{Symbol, Any}}

Returns agent having given id.

source
agent_with_id(i::Int64, model::EasyABM.SpaceModel2D{Static}) -> Union{Nothing, EasyABM.Agent2D{Symbol, Any}}

Returns agent having given id.

source
agent_with_id(i::Int64, model::EasyABM.SpaceModel3D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Union{Nothing, EasyABM.Agent3D{Symbol, Any}}

Returns agent having given id.

source
agent_with_id(i::Int64, model::EasyABM.SpaceModel3D{Static}) -> Union{Nothing, EasyABM.Agent3D{Symbol, Any}}

Returns agent having given id.

source
agent_with_id(i::Int64, model::EasyABM.GraphModel{T<:EasyABM.MType, Mortal}) -> Union{Nothing, EasyABM.GraphAgent{Symbol, Any}}

Returns agent having given id.

source
agent_with_id(i::Int64, model::EasyABM.GraphModel{T<:EasyABM.MType, Static}) -> Union{Nothing, EasyABM.GraphAgent{Symbol, Any}}

Returns agent having given id.

source
EasyABM.is_aliveFunction
is_alive(agent::EasyABM.AbstractPropDict) -> Bool

Returns true if agent is alive else returns false.

source
is_alive(node, model::EasyABM.AbstractGraphModel) -> Bool

Returns true if a node is alive else returns false.

source
EasyABM.get_agentsFunction
get_agents(model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Base.Iterators.Filter{EasyABM.var"#176#178"}
source
get_agents(model::EasyABM.SpaceModel2D{Static}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.SpaceModel2D{Static}) -> Base.Generator{_A, typeof(identity)} where _A
source
get_agents(model::EasyABM.SpaceModel3D{Mortal, S<:(Union{Int64, var"#s174"} where var"#s174"<:AbstractFloat), P<:EasyABM.SType}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.SpaceModel3D{Mortal, S<:(Union{Int64, var"#s174"} where var"#s174"<:AbstractFloat), P<:EasyABM.SType}) -> Base.Iterators.Filter{EasyABM.var"#327#329"}
source
get_agents(model::EasyABM.SpaceModel3D{Static}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.SpaceModel3D{Static}) -> Base.Generator{_A, typeof(identity)} where _A
source
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, Mortal}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, Mortal}) -> Base.Iterators.Filter{EasyABM.var"#483#485"}
source
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, Static}, condition::Function) -> Base.Iterators.Filter
source
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, Static}) -> Base.Generator{_A, typeof(identity)} where _A
source
EasyABM.num_agentsFunction
num_agents(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}, condition::Function) -> Any
source
num_agents(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}) -> Int64
source
EasyABM.kill_agent!Function
kill_agent!(agent::EasyABM.AbstractAgent, model::EasyABM.AbstractSpaceModel{Mortal}) -> Union{Nothing, Int64}

Sets the agent as inactive thus effectively removing from the model. However, the removed agents are permanently removed from the list model.agents only twice in one step i) After the agent_step_function has run for all agents and ii) After the step_rule.

source

Sets the agent as inactive thus effectively removing from the model. However, the removed agents are permanently removed from the list model.agents only after each step.

source
EasyABM.add_agent!Function
add_agent!(agent, model::EasyABM.SpaceModel2D{Mortal}) -> Union{Nothing, Int64}

Adds the agent to the model.

source
add_agent!(agent, model::EasyABM.SpaceModel3D{Mortal}) -> Union{Nothing, Int64}

Adds the agent to the model.

source
add_agent!(agent, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Static, Mortal}}) -> Union{Nothing, Int64}

Adds the agent to the model.

source

Functions for getting neighbor agents.

EasyABM.neighborsFunction
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Any
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, dist::Number; metric) -> Any

Returns active neighboring agents to given agent. If the metric is :grid, then with dist =0 only agents present in the current block of the given agent are returned; with dist=1, agents in the current block of the given agent along with agents in the neighbouring 8 blocks are returned; with dist=2 agents in the current block of given agent, along with agents in 24 nearest blocks are returned, and so on. With metric = :euclidean the agents within Euclidean distance dist are returned.

source
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}) -> Any
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}, dist::Number; metric) -> Any

Returns active neighboring agents to given agent. If the metric is :grid, then with dist =0 only agents present in the current block of the given agent are returned; with dist=1, agents in the current block of the given agent along with agents in the neighbouring 8 blocks are returned; with dist=2 agents in the current block of given agent, along with agents in 24 nearest blocks are returned, and so on. With metric = :euclidean the agents within Euclidean distance dist are returned.

source
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Any
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, dist::Number; metric) -> Any

Returns active neighboring agents to given agent. If the metric is :grid, then with dist =0 only agents present in the current block of the given agent are returned; with dist=1, agents in the current block of the given agent along with agents in the neighbouring 8 blocks are returned; with dist=2 agents in the current block of given agent, along with agents in 24 nearest blocks are returned, and so on. With metric = :euclidean the agents within Euclidean distance dist are returned.

source
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}) -> Any
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}, dist::Number; metric) -> Any

Returns active neighboring agents to given agent. If the metric is :grid, then with dist =0 only agents present in the current block of the given agent are returned; with dist=1, agents in the current block of the given agent along with agents in the neighbouring 8 blocks are returned; with dist=2 agents in the current block of given agent, along with agents in 24 nearest blocks are returned, and so on. With metric = :euclidean the agents within Euclidean distance dist are returned.

source
neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Static, Mortal}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}

Returns agents on neighboring nodes of given agent.

source
neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Static}, EasyABM.GraphModel{Static, Static}}) -> Base.Iterators.Flatten

Returns agents on neighboring nodes of given agent.

source
EasyABM.in_neighborsFunction
in_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Static, Mortal}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}

Returns agents on neighboring incoming nodes of given agent.

source
in_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Static}, EasyABM.GraphModel{Static, Static}}) -> Base.Iterators.Flatten

Returns agents on neighboring incoming nodes of given agent.

source
EasyABM.out_neighborsFunction
out_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Mortal}, EasyABM.GraphModel{Static, Mortal}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}

Returns agents on neighboring outgoing nodes of given agent.

source
out_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{Mortal, Static}, EasyABM.GraphModel{Static, Static}}) -> Base.Iterators.Flatten

Returns agents on neighboring outgoing nodes of given agent.

source
EasyABM.grid_neighborsFunction
grid_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Any
grid_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, dist::Int64) -> Any
source
grid_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}) -> Any
grid_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}, dist::Int64) -> Any
source
grid_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}) -> Any
grid_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Mortal, S<:Union{Int64, AbstractFloat}, P<:EasyABM.SType}, dist::Int64) -> Any
source
grid_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}) -> Any
grid_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}, dist::Int64) -> Any
source
EasyABM.euclidean_neighborsFunction
source
euclidean_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}) -> Base.Iterators.Filter
euclidean_neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{Static}, dist::Number) -> Base.Iterators.Filter
source
source
euclidean_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}) -> Base.Iterators.Filter
euclidean_neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{Static}, dist::Number) -> Base.Iterators.Filter
source

Helper functions for patches, nodes, edges

EasyABM.is_occupiedFunction
is_occupied(patch, model::EasyABM.AbstractSpaceModel) -> Any

Returns true if a patch is occupied.

source
is_occupied(node, model::EasyABM.AbstractGraphModel) -> Any

Returns true if a node is occupied.

source
EasyABM.get_nodepropFunction
get_nodeprop(key::Symbol, node::Int64, model::EasyABM.GraphModel) -> Any

Returns the value for given property name for a node.

source
EasyABM.get_edgepropFunction
get_edgeprop(key::Symbol, i::Int64, j::Int64, model::EasyABM.GraphModel) -> Any

Returns the value for given property name for an edge.

source
get_edgeprop(key::Symbol, edge, model::EasyABM.GraphModel) -> Any

Returns the value for given property name for an edge.

source
EasyABM.set_edgeprops!Function
set_edgeprops!(i::Int64, j::Int64, model::EasyABM.GraphModel; kwargs...)

Sets properties of given edge.

source
set_edgeprops!(edge, model::EasyABM.GraphModel; kwargs...)

Sets properties of given edge.

source
EasyABM.get_patchpropFunction
get_patchprop(key, patch, model::EasyABM.AbstractSpaceModel) -> Any

Returns value of given property of a patch.

source
EasyABM.set_patchprops!Function
set_patchprops!(patch, model::EasyABM.AbstractSpaceModel; kwargs...)

Sets properties of the patch given as keyword arguments.

source
EasyABM.neighbor_nodesFunction
neighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes neighboring given node.

source
neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes neighboring node of the given agent.

source
EasyABM.neighbor_patchesFunction
neighbor_patches(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:Periodic}, dist::Int64) -> Vector{Tuple{Int64, Int64}}

Returns patches neighboring the given agent's patch.

source
neighbor_patches(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:NPeriodic}, dist::Int64) -> Vector{Tuple{Int64, Int64}}

Returns patches neighboring the given agent's patch.

source
neighbor_patches(agent::EasyABM.Agent2D{Symbol, Any, <:AbstractFloat}, model::EasyABM.SpaceModel2D, dist::Int64) -> Vector{Tuple{Int64, Int64}}

Returns patches neighboring the given patch.

source
neighbor_patches(agent::EasyABM.Agent2D{Symbol, Any, Int64}, model::EasyABM.SpaceModel2D, dist::Int64)

Returns patches neighboring the given patch.

source
neighbor_patches(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:Periodic}, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}

Returns patches neighboring given agent's patch.

source
neighbor_patches(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:NPeriodic}, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}

Returns patches neighboring given agent's patch.

source
neighbor_patches(agent::EasyABM.Agent3D{Symbol, Any, <:AbstractFloat}, model::EasyABM.SpaceModel3D, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}

Returns patches neighboring the given patch.

source
neighbor_patches(agent::EasyABM.Agent3D{Symbol, Any, Int64}, model::EasyABM.SpaceModel3D, dist::Int64)

Returns patches neighboring the given patch.

source
EasyABM.in_neighbor_nodesFunction
in_neighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes of incoming edges at given node.

source
in_neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes of incoming edges at given agent's node.

source
EasyABM.out_neighbor_nodesFunction
out_neighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes of outgoing edges at given node.

source
out_neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}

Returns nodes of outgoing edges at given agent's node.

source
EasyABM.get_nodesFunction
get_nodes(model::EasyABM.GraphModel, condition::Function) -> Base.Iterators.Filter
source
get_nodes(model::EasyABM.GraphModel) -> Base.Generator{_A, typeof(identity)} where _A
source
EasyABM.num_nodesFunction
num_nodes(model::EasyABM.GraphModel, condition::Function) -> Int64
source
num_nodes(model::EasyABM.GraphModel) -> Int64
source
EasyABM.get_edgesFunction
get_edges(model::EasyABM.GraphModel, condition::Function) -> Base.Iterators.Filter
source
get_edges(model::EasyABM.GraphModel) -> Base.Iterators.Flatten
source
EasyABM.num_edgesFunction
num_edges(model::EasyABM.GraphModel, condition::Function) -> Int64
source
num_edges(model::EasyABM.GraphModel) -> Int64
source
EasyABM.get_patchesFunction
get_patches(model::EasyABM.SpaceModel2D, condition::Function) -> Base.Iterators.Filter

Returns patches satisfying the given condition.

source
get_patches(model::EasyABM.SpaceModel2D) -> Base.Iterators.Flatten

Returns patches satisfying the given condition.

source
get_patches(model::EasyABM.SpaceModel3D, condition::Function) -> Base.Iterators.Filter

Returns patches satisfying given condition.

source
get_patches(model::EasyABM.SpaceModel3D) -> Base.Iterators.Flatten

Returns patches satisfying given condition.

source
EasyABM.num_patchesFunction
num_patches(model::EasyABM.SpaceModel2D, condition::Function) -> Int64

Returns number of patches satisfying the given condition.

source
num_patches(model::EasyABM.SpaceModel2D) -> Int64

Returns number of patches satisfying the given condition.

source
num_patches(model::EasyABM.SpaceModel3D, condition::Function) -> Int64

Returns number of patches satisfying given condition.

source
num_patches(model::EasyABM.SpaceModel3D) -> Int64

Returns number of patches satisfying given condition.

source
EasyABM.random_empty_nodeFunction
random_empty_node(model::EasyABM.AbstractGraphModel) -> Any

Returns an empty node chosen at random. Returns nothing if there is no empty node.

source
EasyABM.random_empty_patchFunction
random_empty_patch(model::EasyABM.SpaceModel2D; search_method, attempts) -> Union{Nothing, Tuple{Int64, Int64}}

Returns a random patch where no agents are present. Rerurns nothing if there is no such patch.

source
random_empty_patch(model::EasyABM.SpaceModel3D; search_method, attempts) -> Union{Nothing, Tuple{Int64, Int64, Int64}}

Returns a random patch where no agents are present. Returns nothing if there is no such patch.

source

Misc. utility functions

EasyABM.dotprodFunction
dotprod(a::Vect{N}, b::Vect{N}) -> Any
source
dotprod(a::Tuple{Vararg{var"#s21", N}} where var"#s21"<:Union{AbstractFloat, Integer}, b::Tuple{Vararg{var"#s20", N}} where var"#s20"<:Union{AbstractFloat, Integer}) -> Any
source
dotprod(a::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}, b::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}) -> Any
source
EasyABM.distanceFunction
distance(a::GeometryBasics.Vec, b::GeometryBasics.Vec) -> Any
source
distance(a::Tuple{Vararg{Union{AbstractFloat, Integer}, N}}, b::Tuple{Vararg{Union{AbstractFloat, Integer}, N}}) -> Any
source
EasyABM.calculate_directionFunction
calculate_direction(vel::Union{Tuple{T<:Real, T<:Real}, Vect{2, T<:Real}}) -> Any
source
calculate_direction(vel::Union{Tuple{T<:Real, T<:Real, T<:Real}, Vect{3, T<:Real}}) -> Union{Float64, Vect}
source

Index