API
EasyABM provides following functions for agent based simulations.
Functions for creating agents
EasyABM.con_2d_agent
— Functioncon_2d_agent() -> EasyABM.Agent2D{Float64, EasyABM.PeriodicType, EasyABM.StaticType}
Creates a single 2d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keeps_record_of
: Set of properties that the agent records during time evolution.
EasyABM.con_2d_agents
— Functioncon_2d_agents(n::Int64) -> Vector{EasyABM.Agent2D{Float64, EasyABM.PeriodicType, EasyABM.StaticType}}
Creates a list of n 2d agents with properties specified as keyword arguments.
EasyABM.grid_2d_agent
— Functiongrid_2d_agent() -> EasyABM.Agent2D{Int64, EasyABM.PeriodicType, EasyABM.StaticType}
Creates a single 2d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keeps_record_of
: Set of properties that the agent records during time evolution.
EasyABM.grid_2d_agents
— Functiongrid_2d_agents(n::Int64) -> Vector{EasyABM.Agent2D{Int64, EasyABM.PeriodicType, EasyABM.StaticType}}
Creates a list of n 2d agents with properties specified as keyword arguments.
EasyABM.con_3d_agent
— Functioncon_3d_agent() -> EasyABM.Agent3D{Float64, EasyABM.PeriodicType, EasyABM.StaticType}
Creates a single 3d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keeps_record_of
: Set of properties that the agent records during time evolution.
EasyABM.con_3d_agents
— Functioncon_3d_agents(n::Int64) -> Vector{EasyABM.Agent3D{Float64, EasyABM.PeriodicType, EasyABM.StaticType}}
Creates a list of n 3d agents with properties specified as keyword arguments.
EasyABM.grid_3d_agent
— Functiongrid_3d_agent() -> EasyABM.Agent3D{Int64, EasyABM.PeriodicType, EasyABM.StaticType}
Creates a single 3d agent with properties specified as keyword arguments. Following property names are reserved for some specific agent properties - pos : position - shape : shape of agent - color : color of agent - size : size of agent - orientation : orientation of agent - keeps_record_of
: Set of properties that the agent records during time evolution.
EasyABM.grid_3d_agents
— Functiongrid_3d_agents(n::Int64) -> Vector{EasyABM.Agent3D{Int64, EasyABM.PeriodicType, EasyABM.StaticType}}
Creates a list of n 2d agents with properties specified as keyword arguments.
EasyABM.graph_agent
— Functiongraph_agent() -> EasyABM.GraphAgent{EasyABM.StaticType, EasyABM.StaticType}
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 - keeps_record_of
: Set of properties that the agent records during time evolution.
EasyABM.graph_agents
— Functiongraph_agents(n::Int64) -> Vector{EasyABM.GraphAgent{EasyABM.StaticType, EasyABM.StaticType}}
Creates a list of n graph agents with properties specified as keyword arguments.
EasyABM.create_similar
— Functioncreate_similar(agent::EasyABM.Agent2D{S<:Union{Float64, Int64}, P<:EasyABM.SType, T<:EasyABM.MType}, n::Int64) -> Vector
Returns a list of n 2d agents all having same (other than _extras) properties as agent
if agent
is alive.
create_similar(agent::EasyABM.Agent2D{S<:Union{Float64, Int64}, P<:EasyABM.SType, T<:EasyABM.MType}) -> EasyABM.Agent2D
Returns an agent with same (other than _extras) properties as given agent
.
create_similar(agent::EasyABM.GraphAgent{S<:EasyABM.MType, T<:EasyABM.MType}, n::Int64) -> Vector
Returns a list of n 2d agents all having same (other than _extras) properties as agent
.
create_similar(agent::EasyABM.GraphAgent{S<:EasyABM.MType, T<:EasyABM.MType}) -> EasyABM.GraphAgent
Returns a list of n 2d agents all having same (other than _extras) properties as agent
.
create_similar(agent::EasyABM.Agent3D{S<:Union{Float64, Int64}, P<:EasyABM.SType, T<:EasyABM.MType}, n::Int64) -> Vector
Returns a list of n 2d agents all having same properties as agent
.
create_similar(agent::EasyABM.Agent3D{S<:Union{Float64, Int64}, P<:EasyABM.SType, T<:EasyABM.MType}) -> EasyABM.Agent3D
Returns an agent with same properties as given agent
.
Functions for defining model
EasyABM.create_2d_model
— Functioncreate_2d_model() -> EasyABM.SpaceModel2D{EasyABM.StaticType, Int64, EasyABM.PeriodicType}
EasyABM.create_3d_model
— Functioncreate_3d_model(agents::Array{EasyABM.Agent3D{S<:Union{Float64, Int64}, A<:EasyABM.SType, B<:EasyABM.MType}, 1}) -> EasyABM.SpaceModel3D{EasyABM.StaticType, _A, EasyABM.PeriodicType} where _A<:Union{Float64, Int64}
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.agents_type
: Set it to Static if number of agents is fixed during model run. Otherwise set it to Mortal.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.
random_positions
: If this property is true, each agent, will be assigned a random position.space_type
: Set it to Periodic or NPeriodic depending upon if the space is periodic or not.kwargs
` : Keyword argments used as model properties.
create_3d_model() -> EasyABM.SpaceModel3D{EasyABM.StaticType, Int64, EasyABM.PeriodicType}
EasyABM.create_graph_model
— Functioncreate_graph_model(agents::Array{EasyABM.GraphAgent{A<:EasyABM.MType, B<:EasyABM.MType}, 1}, graph::EasyABM.AbstractPropGraph{S<:EasyABM.MType, G<:EasyABM.GType}) -> Union{Nothing, EasyABM.GraphModel{_A, EasyABM.StaticType} where _A<:EasyABM.MType}
Creates a model with
agents
: list of agents.graph
: A graph created with Graphs.jl and converted to EasyABM graph type Or created directly using 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.agents_type
: Set it to Static if number of agents is fixed during model run. Otherwise set it to Mortal.random_positions
: If this property is true, each agent will be assigned a random node on the graph.kwargs
: Keyword argments used as model properties.
create_graph_model(graph::EasyABM.AbstractPropGraph{S<:EasyABM.MType, G<:EasyABM.GType}) -> Union{Nothing, EasyABM.GraphModel{_A, EasyABM.StaticType} where _A<:EasyABM.MType}
Functions for initialising, running and visualising
EasyABM.init_model!
— Functioninit_model!(model::EasyABM.SpaceModel2D)
Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model properties 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.
init_model!(model::EasyABM.SpaceModel3D)
Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model properties 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 set of property names as symbols. If a nonempty set of agents properties is specified, it will override the keeps_record_of
property of each agent. Properties of patches and model are similarly specified with keys "patches" and "model" respectively.
init_model!(model::EasyABM.GraphModel)
Initiates the simulation with a user defined initialiser function which takes the model as its only argument. Model properties 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 set of property names as symbols. If a nonempty set of agents properties is specified, it will override the keeps_record_of
property of each agent. Properties of nodes, edges and model are similarly specified with keys "nodes", "edges" and "model" respectively.
EasyABM.run_model!
— Functionrun_model!(model::EasyABM.SpaceModel2D)
Runs the simulation for steps
number of steps.
run_model!(model::EasyABM.SpaceModel3D)
Runs the simulation for steps
number of steps.
run_model!(model::EasyABM.GraphModel)
Runs the simulation for steps
number of steps.
EasyABM.run_model_epochs
— Functionrun_model_epochs(inmodel::EasyABM.SpaceModel2D)
Runs the simulation for num_epochs
number of epochs where each epoch consists of steps_per_epoch
number of steps. The model for each epoch is a deepcopy of the input model and is saved as .jld2 file.
run_model_epochs(inmodel::EasyABM.SpaceModel3D)
Runs the simulation for num_epochs
number of epochs where each epoch consists of steps_per_epoch
number of steps. The model for each epoch is a deepcopy of the input model and is saved as .jld2 file.
run_model_epochs(inmodel::EasyABM.GraphModel)
Runs the simulation for num_epochs
number of epochs where each epoch consists of steps_per_epoch
number of steps. The model for each epoch is a deepcopy of the input model and is saved as .jld2 file.
EasyABM.draw_frame
— Functiondraw_frame(model::EasyABM.SpaceModel2D) -> Luxor.Drawing
Draws a specific frame.
draw_frame(model::EasyABM.SpaceModel3D) -> MeshCat.DisplayedVisualizer
Draws a specific frame.
draw_frame(model::EasyABM.GraphModel) -> Union{Luxor.Drawing, MeshCat.DisplayedVisualizer}
Draws a specific frame.
EasyABM.animate_sim
— Functionanimate_sim(model::EasyABM.SpaceModel2D) -> Widgets.Widget
animate_sim(model::EasyABM.SpaceModel2D, frames::Int64) -> Widgets.Widget
Creates an animation from the data collected during model run.
animate_sim(model::EasyABM.SpaceModel3D) -> Widgets.Widget
animate_sim(model::EasyABM.SpaceModel3D, frames::Int64) -> Widgets.Widget
Creates a 3d animation from the data collected during the model run.
animate_sim(model::EasyABM.GraphModel) -> Widgets.Widget
animate_sim(model::EasyABM.GraphModel, frames::Int64) -> Widgets.Widget
Creates an animation from the data collected during model run.
EasyABM.create_interactive_app
— Functioncreate_interactive_app(inmodel::EasyABM.SpaceModel2D) -> Widgets.Widget
Creates an interactive app for the model.
create_interactive_app(inmodel::EasyABM.SpaceModel3D) -> Widgets.Widget
Creates an interactive app for the model.
create_interactive_app(model::EasyABM.GraphModel) -> Widgets.Widget
Creates an interactive app for the model.
Functions for accessing, saving and retrieving data.
EasyABM.get_agent_data
— Functionget_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.MortalType}, EasyABM.AbstractSpaceModel{EasyABM.MortalType}}) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.MortalType}, EasyABM.AbstractSpaceModel{EasyABM.MortalType}}, props) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.StaticType}, EasyABM.AbstractSpaceModel{EasyABM.StaticType}}) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
get_agent_data(agent::EasyABM.AbstractAgent, model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.StaticType}, EasyABM.AbstractSpaceModel{EasyABM.StaticType}}, props) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
EasyABM.get_patch_data
— Functionget_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}}}
EasyABM.get_node_data
— Functionget_node_data(node::Int64, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, props) -> NamedTuple{(:birthtime, :deathtime, :record), Tuple{Int64, Int64, DataFrames.DataFrame}}
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
get_node_data(node::Int64, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, props) -> NamedTuple{(:record,), Tuple{DataFrames.DataFrame}}
EasyABM.get_edge_data
— Functionget_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, props) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(edge, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(edge, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, props) -> NamedTuple{(:birth_death_times, :record), Tuple{Vector{Tuple{Int64, Int64}}, DataFrames.DataFrame}}
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
get_edge_data(i::Int64, j::Int64, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, props)
get_edge_data(edge, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
get_edge_data(edge, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, props)
EasyABM.get_model_data
— Functionget_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}}
EasyABM.latest_propvals
— Functionlatest_propvals(obj::EasyABM.AbstractPropDict, propname::Symbol, n::Int64) -> Any
last recorded (not current) property values.
latest_propvals(agent::EasyABM.AbstractPropDict, model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}, propname::Symbol, n::Int64) -> Any
latest_propvals(patch, model::EasyABM.AbstractSpaceModel, propname::Symbol, n::Int64) -> Any
latest_propvals(node::Int64, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
Last recorded property values.
latest_propvals(i::Int64, j::Int64, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
latest_propvals(edge, model::EasyABM.GraphModel, propname::Symbol, n::Int64) -> Any
EasyABM.propnames
— Functionpropnames(obj::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}) -> Vector{Symbol}
propnames(obj::EasyABM.GraphAgent) -> Vector{Symbol}
propnames(obj::EasyABM.AbstractPropDict) -> Vector{Symbol}
EasyABM.get_nums_agents
— FunctionEasyABM.get_nums_patches
— Functionget_nums_patches(model::EasyABM.AbstractSpaceModel, conditions::Function...) -> DataFrames.DataFrame
EasyABM.get_nums_nodes
— Functionget_nums_nodes(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, conditions::Function...) -> DataFrames.DataFrame
get_nums_nodes(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, conditions::Function...) -> DataFrames.DataFrame
EasyABM.get_nums_edges
— Functionget_nums_edges(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, conditions::Function...) -> DataFrames.DataFrame
get_nums_edges(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, conditions::Function...) -> DataFrames.DataFrame
EasyABM.get_agents_avg_props
— Functionget_agents_avg_props(model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.MortalType}, EasyABM.AbstractSpaceModel{EasyABM.MortalType}}, props::Function...) -> DataFrames.DataFrame
get_agents_avg_props(model::Union{EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.StaticType}, EasyABM.AbstractSpaceModel{EasyABM.StaticType}}, props::Function...) -> DataFrames.DataFrame
EasyABM.get_patches_avg_props
— Functionget_patches_avg_props(model::EasyABM.AbstractSpaceModel, props::Function...) -> DataFrames.DataFrame
EasyABM.get_nodes_avg_props
— Functionget_nodes_avg_props(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, props::Function...) -> DataFrames.DataFrame
get_nodes_avg_props(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, props::Function...) -> DataFrames.DataFrame
EasyABM.get_edges_avg_props
— Functionget_edges_avg_props(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}, props::Function...) -> DataFrames.DataFrame
get_edges_avg_props(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}, props::Function...) -> DataFrames.DataFrame
EasyABM.save_model
— Functionsave_model(model)
Saves the model on disk as jld2 file.
EasyABM.open_model
— Functionopen_model() -> Any
Gets the model that was saved before as jld2.
Functions for creating and modifying a graph
EasyABM.static_simple_graph
— Functionstatic_simple_graph(n::Int64) -> EasyABM.SimplePropGraph{EasyABM.StaticType, EasyABM.SimGType}
Creates a simple prop graph with n vertices.
static_simple_graph(structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.StaticType, EasyABM.SimGType}}
Creates a simple prop graph with given structure.
static_simple_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.StaticType, EasyABM.SimGType}}
Creates a simple prop graph for given Adjacency matrix.
static_simple_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.StaticType, EasyABM.SimGType}}
Creates a simple prop graph for adjacency_matrix given as a Sparse Matrix.
static_simple_graph(g::Graphs.SimpleGraphs.SimpleGraph{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.StaticType, EasyABM.SimGType}}
Creates a simple prop graph from a given simple graph created with Graphs.jl.
EasyABM.static_dir_graph
— Functionstatic_dir_graph(n::Int64) -> EasyABM.DirPropGraph{EasyABM.StaticType, EasyABM.DirGType}
Creates a directed prop graph with n vertices.
static_dir_graph(in_structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.StaticType, EasyABM.DirGType}}
Creates a directed prop graph with given structure.
static_dir_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.StaticType, EasyABM.DirGType}}
Creates a directed prop graph for given Adjacency matrix.
static_dir_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.StaticType, EasyABM.DirGType}}
Creates a directed prop graph for adjacency matrix given as a Sparse Matrix.
static_dir_graph(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.StaticType, EasyABM.DirGType}}
Creates a directed prop graph for a given directed graph created with Graphs.jl.
EasyABM.dynamic_simple_graph
— Functiondynamic_simple_graph(n::Int64) -> EasyABM.SimplePropGraph{EasyABM.MortalType, EasyABM.SimGType}
Creates a simple prop graph with n vertices.
dynamic_simple_graph(structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.MortalType, EasyABM.SimGType}}
Creates a simple prop graph with given structure.
dynamic_simple_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.MortalType, EasyABM.SimGType}}
Creates a simple prop graph for given Adjacency matrix.
dynamic_simple_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.MortalType, EasyABM.SimGType}}
Creates a simple prop graph for adjacency_matrix given as a Sparse Matrix.
dynamic_simple_graph(g::Graphs.SimpleGraphs.SimpleGraph{Int64}) -> Union{Nothing, EasyABM.SimplePropGraph{EasyABM.MortalType, EasyABM.SimGType}}
Creates a simple prop graph from a given simple graph created with Graphs.jl.
EasyABM.dynamic_dir_graph
— Functiondynamic_dir_graph(n::Int64) -> EasyABM.DirPropGraph{EasyABM.MortalType, EasyABM.DirGType}
Creates a directed prop graph with n vertices.
dynamic_dir_graph(in_structure::Dict{Int64, Vector{Int64}}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.MortalType, EasyABM.DirGType}}
Creates a directed prop graph with given structure.
dynamic_dir_graph(A::Matrix{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.MortalType, EasyABM.DirGType}}
Creates a directed prop graph for given Adjacency matrix.
dynamic_dir_graph(A::SparseArrays.SparseMatrixCSC{Int64, Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.MortalType, EasyABM.DirGType}}
Creates a directed prop graph for adjacency matrix given as a Sparse Matrix.
dynamic_dir_graph(g::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) -> Union{Nothing, EasyABM.DirPropGraph{EasyABM.MortalType, EasyABM.DirGType}}
Creates a directed prop graph for a given directed graph created with Graphs.jl.
EasyABM.convert_type
— Functionconvert_type(graph::EasyABM.SimplePropGraph, w::EasyABM.MType) -> EasyABM.SimplePropGraph{_A, EasyABM.SimGType} where _A
convert_type(graph::EasyABM.DirPropGraph, w::EasyABM.MType) -> EasyABM.DirPropGraph{_A, EasyABM.DirGType} where _A
EasyABM.hex_grid_graph
— Functionhex_grid_graph(n, k) -> Any
EasyABM.square_grid_graph
— Functionsquare_grid_graph(n, k) -> Any
EasyABM.torus_graph
— Functiontorus_graph(n, k) -> Any
EasyABM.triangular_grid_graph
— Functiontriangular_grid_graph(n, k) -> Any
EasyABM.double_triangular_grid_graph
— Functiondouble_triangular_grid_graph(n, k) -> Any
EasyABM.graph_from_dict
— Functiongraph_from_dict(dict::Dict) -> Any
EasyABM.draw_graph
— Functiondraw_graph(graph) -> Union{Nothing, Luxor.Drawing}
EasyABM.draw_graph3d
— Functiondraw_graph3d(graph) -> Union{Nothing, MeshCat.DisplayedVisualizer}
EasyABM.add_node!
— Functionadd_node!(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> Int64
Adds a node with properties specified in kwargs
to the model's graph.
add_node!(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.add_nodes!
— Functionadd_nodes!(n, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}})
Adds n nodes with properties specified in kwargs
to the model's graph.
add_nodes!(n, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.kill_node!
— Functionkill_node!(node, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> 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.
kill_node!(node, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.create_edge!
— Functioncreate_edge!(i, j, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}})
Adds an edge with properties kwargs
to model graph.
create_edge!(edge, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}})
Adds an edge with properties kwargs
to model graph.
create_edge!(i, j, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
create_edge!(edge, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.kill_edge!
— Functionkill_edge!(i, j, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> Union{Nothing, EasyABM.PropDataDict{Symbol, Any}}
Removes edge from the model graph.
kill_edge!(edge, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> Union{Nothing, EasyABM.PropDataDict{Symbol, Any}}
Removes edge from the model graph.
kill_edge!(i, j, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
kill_edge!(edge, model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.kill_all_edges!
— Functionkill_all_edges!(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}})
Removes all edges from the model graph.
kill_all_edges!(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.flush_graph!
— Functionflush_graph!(model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}}) -> Int64
Removes the graph and all of related data completely.
flush_graph!(model::Union{EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}})
EasyABM.is_digraph
— Functionis_digraph(g::EasyABM.SimplePropGraph) -> Bool
is_digraph(g::EasyABM.DirPropGraph) -> Bool
Missing docstring for is_directed
. Check Documenter's build log for details.
EasyABM.is_static
— FunctionEasyABM.vertices
— Functionvertices(g::EasyABM.SimplePropGraph) -> Base.Generator{Vector{Int64}, typeof(identity)}
vertices(g::EasyABM.DirPropGraph) -> Base.Generator{Vector{Int64}, typeof(identity)}
Missing docstring for edges
. Check Documenter's build log for details.
Missing docstring for recompute_graph_layout
. Check Documenter's build log for details.
Helper functions for agents
EasyABM.get_grid_loc
— Functionget_grid_loc(agent::EasyABM.Agent2D{<:Float64}) -> Tuple{Int64, Int64}
Returns grid location of the agent.
get_grid_loc(agent::EasyABM.Agent2D{Int64}) -> Vect{2, <:Int64}
Returns grid location of the agent.
get_grid_loc(agent::EasyABM.Agent3D{<:Float64}) -> Tuple{Int64, Int64, Int64}
Returns grid location of the agent.
get_grid_loc(agent::EasyABM.Agent3D{Int64}) -> Vect{3, <:Int64}
Returns grid location of the agent.
EasyABM.get_node_loc
— Functionget_node_loc(agent::EasyABM.GraphAgent) -> Int64
Returns node location of the agent.
EasyABM.get_id
— Functionget_id(agent::EasyABM.AbstractAgent) -> Any
Returns agents id.
EasyABM.agents_at
— Functionagents_at(patch, model::EasyABM.SpaceModel2D) -> Base.Generator
Returns list of agents at a given patch.
agents_at(patch, model::EasyABM.SpaceModel3D) -> Base.Generator
Returns list of agents at a given patch.
agents_at(node, model::EasyABM.GraphModel{EasyABM.MortalType, T<:EasyABM.MType}) -> Base.Generator
Returns list of agents at a given node.
agents_at(node, model::EasyABM.GraphModel{EasyABM.StaticType, T<:EasyABM.MType}) -> Base.Generator
Returns list of agents at a given node.
EasyABM.num_agents_at
— Functionnum_agents_at(patch, model::EasyABM.AbstractSpaceModel) -> Int64
Returns number of agents at a given patch.
num_agents_at(node, model::EasyABM.AbstractGraphModel) -> Int64
Returns number of agents at a given node.
EasyABM.agent_with_id
— Functionagent_with_id(i::Int64, model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Union{Nothing, EasyABM.Agent2D{S, P, EasyABM.MortalType} where {S<:Union{Float64, Int64}, P<:EasyABM.SType}}
Returns agent having given id.
agent_with_id(i::Int64, model::EasyABM.SpaceModel2D{EasyABM.StaticType}) -> Union{Nothing, EasyABM.Agent2D{S, P, EasyABM.StaticType} where {S<:Union{Float64, Int64}, P<:EasyABM.SType}}
Returns agent having given id.
agent_with_id(i::Int64, model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Union{Nothing, EasyABM.Agent3D{S, P, EasyABM.MortalType} where {S<:Union{Float64, Int64}, P<:EasyABM.SType}}
Returns agent having given id.
agent_with_id(i::Int64, model::EasyABM.SpaceModel3D{EasyABM.StaticType}) -> Union{Nothing, EasyABM.Agent3D{S, P, EasyABM.StaticType} where {S<:Union{Float64, Int64}, P<:EasyABM.SType}}
Returns agent having given id.
agent_with_id(i::Int64, model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.MortalType}) -> Union{Nothing, EasyABM.GraphAgent{T, EasyABM.MortalType} where T<:EasyABM.MType}
Returns agent having given id.
agent_with_id(i::Int64, model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.StaticType}) -> Union{Nothing, EasyABM.GraphAgent{T, EasyABM.StaticType} where T<:EasyABM.MType}
Returns agent having given id.
EasyABM.is_alive
— Functionis_alive(agent::EasyABM.AbstractPropDict) -> Bool
Returns true if agent is alive else returns false.
is_alive(node, model::EasyABM.AbstractGraphModel) -> Bool
Returns true if a node is alive else returns false.
EasyABM.get_agents
— Functionget_agents(model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Base.Iterators.Filter{EasyABM.var"#176#178"}
get_agents(model::EasyABM.SpaceModel2D{EasyABM.StaticType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.SpaceModel2D{EasyABM.StaticType}) -> Base.Generator{_A, typeof(identity)} where _A
get_agents(model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:(Union{Int64, var"#s210"} where var"#s210"<:Float64), P<:EasyABM.SType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:(Union{Int64, var"#s210"} where var"#s210"<:Float64), P<:EasyABM.SType}) -> Base.Iterators.Filter{EasyABM.var"#301#303"}
get_agents(model::EasyABM.SpaceModel3D{EasyABM.StaticType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.SpaceModel3D{EasyABM.StaticType}) -> Base.Generator{_A, typeof(identity)} where _A
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.MortalType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.MortalType}) -> Base.Iterators.Filter{EasyABM.var"#550#552"}
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.StaticType}, condition::Function) -> Base.Iterators.Filter
get_agents(model::EasyABM.GraphModel{T<:EasyABM.MType, EasyABM.StaticType}) -> Base.Generator{_A, typeof(identity)} where _A
EasyABM.num_agents
— Functionnum_agents(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}, condition::Function) -> Any
num_agents(model::Union{EasyABM.AbstractGraphModel, EasyABM.AbstractSpaceModel}) -> Int64
EasyABM.kill_agent!
— Functionkill_agent!(agent::EasyABM.AbstractAgent, model::EasyABM.AbstractSpaceModel{EasyABM.MortalType}) -> 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 once after the step_rule
.
kill_agent!(agent::EasyABM.AbstractAgent, model::EasyABM.AbstractSpaceModel{EasyABM.StaticType})
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.
kill_agent!(agent::EasyABM.AbstractAgent, model::EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.StaticType})
EasyABM.add_agent!
— Functionadd_agent!(agent, model::EasyABM.AbstractSpaceModel{EasyABM.StaticType})
add_agent!(agent, model::EasyABM.AbstractGraphModel{T<:EasyABM.MType, EasyABM.StaticType})
add_agent!(agent, model::EasyABM.SpaceModel2D{EasyABM.MortalType}) -> Union{Nothing, Int64}
Adds the agent to the model.
add_agent!(agent, model::EasyABM.SpaceModel3D{EasyABM.MortalType}) -> Union{Nothing, Int64}
Adds the agent to the model.
add_agent!(agent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}}) -> Union{Nothing, Int64}
Adds the agent to the model.
Functions for getting neighbor agents.
EasyABM.neighbors
— Functionneighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Any
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, dist::Real) -> Any
Returns active neighboring agents to given agent within euclidean distance dist
.
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType}) -> Base.Iterators.Filter
neighbors(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType}, dist::Real) -> Base.Iterators.Filter
Returns active neighboring agents to given agent within euclidean distance dist
.
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Any
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, dist::Real) -> Any
Returns active neighboring agents to given agent within euclidean distance dist
.
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}) -> Base.Iterators.Filter
neighbors(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}, dist::Real) -> Base.Iterators.Filter
Returns active neighboring agents to given agent within euclidean distance dist
.
neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}
Returns agents on neighboring nodes of given agent.
neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}) -> Base.Iterators.Flatten
Returns agents on neighboring nodes of given agent.
EasyABM.in_neighbors
— Functionin_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}
Returns agents on neighboring incoming nodes of given agent.
in_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}) -> Base.Iterators.Flatten
Returns agents on neighboring incoming nodes of given agent.
EasyABM.out_neighbors
— Functionout_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.MortalType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.MortalType}}) -> Union{Base.Generator{UnitRange{Int64}, typeof(identity)}, Base.Iterators.Flatten}
Returns agents on neighboring outgoing nodes of given agent.
out_neighbors(agent::EasyABM.GraphAgent, model::Union{EasyABM.GraphModel{EasyABM.MortalType, EasyABM.StaticType}, EasyABM.GraphModel{EasyABM.StaticType, EasyABM.StaticType}}) -> Base.Iterators.Flatten
Returns agents on neighboring outgoing nodes of given agent.
EasyABM.neighbors_moore
— Functionneighbors_moore(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Base.Generator{Vector{Int64}}
neighbors_moore(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, dist::Int64) -> Base.Generator{Vector{Int64}}
neighbors_moore(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}) -> Base.Generator{Vector{Int64}}
neighbors_moore(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}, dist::Int64) -> Base.Generator{Vector{Int64}}
EasyABM.neighbors_neumann
— Functionneighbors_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Base.Generator
neighbors_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, dist::Int64) -> Base.Generator
neighbors_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType}) -> Base.Generator{Vector{Int64}}
neighbors_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D{EasyABM.StaticType}, dist::Int64) -> Base.Generator{Vector{Int64}}
neighbors_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}) -> Base.Generator
neighbors_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.MortalType, S<:Union{Float64, Int64}, P<:EasyABM.SType}, dist::Int64) -> Base.Generator
neighbors_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}) -> Base.Generator{Vector{Int64}}
neighbors_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D{EasyABM.StaticType}, dist::Int64) -> Base.Generator{Vector{Int64}}
Helper functions for patches, nodes, edges
EasyABM.is_occupied
— Functionis_occupied(patch, model::EasyABM.AbstractSpaceModel) -> Any
Returns true if a patch is occupied.
is_occupied(node, model::EasyABM.AbstractGraphModel) -> Any
Returns true if a node is occupied.
EasyABM.get_nodeprop
— Functionget_nodeprop(key::Symbol, node::Int64, model::EasyABM.GraphModel) -> Any
Returns the value for given property name for a node.
EasyABM.get_edgeprop
— Functionget_edgeprop(key::Symbol, i::Int64, j::Int64, model::EasyABM.GraphModel) -> Any
Returns the value for given property name for an edge.
get_edgeprop(key::Symbol, edge, model::EasyABM.GraphModel) -> Any
Returns the value for given property name for an edge.
EasyABM.set_nodeprops!
— Functionset_nodeprops!(node::Int64, model::EasyABM.GraphModel)
Sets properties of given node.
EasyABM.set_edgeprops!
— Functionset_edgeprops!(i::Int64, j::Int64, model::EasyABM.GraphModel)
Sets properties of given edge.
set_edgeprops!(edge, model::EasyABM.GraphModel)
Sets properties of given edge.
EasyABM.get_patchprop
— Functionget_patchprop(key, patch, model::EasyABM.AbstractSpaceModel) -> Any
Returns value of given property of a patch.
EasyABM.set_patchprops!
— Functionset_patchprops!(patch, model::EasyABM.AbstractSpaceModel)
Sets properties of the patch given as keyword arguments.
EasyABM.neighbor_nodes
— Functionneighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes neighboring given node.
neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes neighboring node of the given agent.
EasyABM.neighbor_patches_moore
— Functionneighbor_patches_moore(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:EasyABM.PeriodicType}) -> Vector{Tuple{Int64, Int64}}
neighbor_patches_moore(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:EasyABM.PeriodicType}, dist::Int64) -> Vector{Tuple{Int64, Int64}}
Returns patches neighboring the given agent's patch.
neighbor_patches_moore(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:EasyABM.NPeriodicType}) -> Vector{Tuple{Int64, Int64}}
neighbor_patches_moore(patch::Tuple{Int64, Int64}, model::EasyABM.SpaceModel2D{T, S, P<:EasyABM.NPeriodicType}, dist::Int64) -> Vector{Tuple{Int64, Int64}}
Returns patches neighboring the given agent's patch.
neighbor_patches_moore(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D) -> Vector{Tuple{Int64, Int64}}
neighbor_patches_moore(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D, dist::Int64) -> Vector{Tuple{Int64, Int64}}
Returns patches neighboring the given patch.
neighbor_patches_moore(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:EasyABM.PeriodicType}) -> Vector{Tuple{Int64, Int64, Int64}}
neighbor_patches_moore(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:EasyABM.PeriodicType}, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}
Returns patches neighboring given agent's patch.
neighbor_patches_moore(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:EasyABM.NPeriodicType}) -> Vector{Tuple{Int64, Int64, Int64}}
neighbor_patches_moore(patch::Tuple{Int64, Int64, Int64}, model::EasyABM.SpaceModel3D{T, S, P<:EasyABM.NPeriodicType}, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}
Returns patches neighboring given agent's patch.
neighbor_patches_moore(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D) -> Vector{Tuple{Int64, Int64, Int64}}
neighbor_patches_moore(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}
Returns patches neighboring the given patch.
EasyABM.neighbor_patches_neumann
— FunctionReturns patches neighboring the given agent's patch.
Returns patches neighboring the given agent's patch.
neighbor_patches_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D) -> Vector{Tuple{Int64, Int64}}
neighbor_patches_neumann(agent::EasyABM.Agent2D, model::EasyABM.SpaceModel2D, dist::Int64) -> Vector{Tuple{Int64, Int64}}
Returns patches neighboring the given patch.
Returns patches neighboring given agent's patch.
neighbor_patches_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D) -> Vector{Tuple{Int64, Int64, Int64}}
neighbor_patches_neumann(agent::EasyABM.Agent3D, model::EasyABM.SpaceModel3D, dist::Int64) -> Vector{Tuple{Int64, Int64, Int64}}
Returns patches neighboring the given patch.
EasyABM.in_neighbor_nodes
— Functionin_neighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes of incoming edges at given node.
in_neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes of incoming edges at given agent's node.
EasyABM.out_neighbor_nodes
— Functionout_neighbor_nodes(node::Int64, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes of outgoing edges at given node.
out_neighbor_nodes(agent::EasyABM.GraphAgent, model::EasyABM.GraphModel) -> Vector{Int64}
Returns nodes of outgoing edges at given agent's node.
EasyABM.get_nodes
— Functionget_nodes(model::EasyABM.GraphModel, condition::Function) -> Base.Iterators.Filter
get_nodes(model::EasyABM.GraphModel) -> Base.Generator{_A, typeof(identity)} where _A
EasyABM.num_nodes
— Functionnum_nodes(model::EasyABM.GraphModel, condition::Function) -> Int64
num_nodes(model::EasyABM.GraphModel) -> Int64
EasyABM.get_edges
— Functionget_edges(model::EasyABM.GraphModel, condition::Function) -> Base.Iterators.Filter
get_edges(model::EasyABM.GraphModel) -> Base.Iterators.Flatten
EasyABM.num_edges
— Functionnum_edges(model::EasyABM.GraphModel, condition::Function) -> Int64
num_edges(model::EasyABM.GraphModel) -> Int64
EasyABM.get_patches
— Functionget_patches(model::EasyABM.AbstractSpaceModel, condition::Function) -> Base.Iterators.Filter
Returns patches satisfying the given condition.
get_patches(model::EasyABM.AbstractSpaceModel) -> Base.Generator{_A, typeof(identity)} where _A
Returns patches satisfying the given condition.
EasyABM.num_patches
— Functionnum_patches(model::EasyABM.AbstractSpaceModel, condition::Function) -> Int64
Returns number of patches satisfying given condition.
num_patches(model::EasyABM.AbstractSpaceModel) -> Int64
Returns number of patches satisfying given condition.
EasyABM.get_random_patch
— Functionget_random_patch(model::EasyABM.AbstractSpaceModel, condition::Function) -> Any
Returns patches satisfying the given condition.
get_random_patch(model::EasyABM.AbstractSpaceModel) -> Any
Returns patches satisfying the given condition.
EasyABM.random_empty_node
— Functionrandom_empty_node(model::EasyABM.AbstractGraphModel) -> Any
Returns an empty node chosen at random. Returns nothing if there is no empty node.
EasyABM.random_empty_patch
— Functionrandom_empty_patch(model::EasyABM.SpaceModel2D) -> Union{Nothing, Tuple{Int64, Int64}}
Returns a random patch where no agents are present. Rerurns nothing if there is no such patch.
random_empty_patch(model::EasyABM.SpaceModel3D) -> Union{Nothing, Tuple{Int64, Int64, Int64}}
Returns a random patch where no agents are present. Returns nothing if there is no such patch.
Misc. utility functions
EasyABM.dotprod
— Functiondotprod(a::Vect{N}, b::Vect{N}) -> Any
dotprod(a::Tuple{Vararg{var"#s16", N}} where var"#s16"<:Union{Float64, Integer}, b::Tuple{Vararg{var"#s38", N}} where var"#s38"<:Union{Float64, Integer}) -> Any
dotprod(a::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}, b::Union{EasyABM.AbstractAgent2D, EasyABM.AbstractAgent3D}) -> Any
EasyABM.veclength
— Functionveclength(a::GeometryBasics.Vec)
EasyABM.distance
— Functiondistance(a::GeometryBasics.Vec, b::GeometryBasics.Vec) -> Any
distance(a::Tuple{Vararg{Union{Float64, Integer}, N}}, b::Tuple{Vararg{Union{Float64, Integer}, N}}) -> Any
EasyABM.calculate_direction
— Functioncalculate_direction(vel::Union{Tuple{T<:Real, T<:Real}, Vect{2, T<:Real}}) -> Any
calculate_direction(vel::Union{Tuple{T<:Real, T<:Real, T<:Real}, Vect{3, T<:Real}}) -> Any
EasyABM.vector_orientation
— Functionvector_orientation(x::Real) -> Vect{2}
Missing docstring for Col
. Check Documenter's build log for details.
Missing docstring for @cl_str
. Check Documenter's build log for details.
EasyABM.moore_distance
— Functionmoore_distance(patch1::Tuple{Vararg{S<:Real, N}}, patch2::Tuple{Vararg{T<:Real, N}}) -> Any
EasyABM.manhattan_distance
— FunctionEasyABM.set_window_size
— Functionset_window_size(width::Int64, height::Int64)
Sets window size.
Index
EasyABM.add_agent!
EasyABM.add_node!
EasyABM.add_nodes!
EasyABM.agent_with_id
EasyABM.agents_at
EasyABM.animate_sim
EasyABM.calculate_direction
EasyABM.con_2d_agent
EasyABM.con_2d_agents
EasyABM.con_3d_agent
EasyABM.con_3d_agents
EasyABM.convert_type
EasyABM.create_2d_model
EasyABM.create_3d_model
EasyABM.create_edge!
EasyABM.create_graph_model
EasyABM.create_interactive_app
EasyABM.create_similar
EasyABM.distance
EasyABM.dotprod
EasyABM.double_triangular_grid_graph
EasyABM.draw_frame
EasyABM.draw_graph
EasyABM.draw_graph3d
EasyABM.dynamic_dir_graph
EasyABM.dynamic_simple_graph
EasyABM.flush_graph!
EasyABM.get_agent_data
EasyABM.get_agents
EasyABM.get_agents_avg_props
EasyABM.get_edge_data
EasyABM.get_edgeprop
EasyABM.get_edges
EasyABM.get_edges_avg_props
EasyABM.get_grid_loc
EasyABM.get_id
EasyABM.get_model_data
EasyABM.get_node_data
EasyABM.get_node_loc
EasyABM.get_nodeprop
EasyABM.get_nodes
EasyABM.get_nodes_avg_props
EasyABM.get_nums_agents
EasyABM.get_nums_edges
EasyABM.get_nums_nodes
EasyABM.get_nums_patches
EasyABM.get_patch_data
EasyABM.get_patches
EasyABM.get_patches_avg_props
EasyABM.get_patchprop
EasyABM.get_random_patch
EasyABM.graph_agent
EasyABM.graph_agents
EasyABM.graph_from_dict
EasyABM.grid_2d_agent
EasyABM.grid_2d_agents
EasyABM.grid_3d_agent
EasyABM.grid_3d_agents
EasyABM.hex_grid_graph
EasyABM.in_neighbor_nodes
EasyABM.in_neighbors
EasyABM.init_model!
EasyABM.is_alive
EasyABM.is_digraph
EasyABM.is_occupied
EasyABM.is_static
EasyABM.kill_agent!
EasyABM.kill_all_edges!
EasyABM.kill_edge!
EasyABM.kill_node!
EasyABM.latest_propvals
EasyABM.manhattan_distance
EasyABM.moore_distance
EasyABM.neighbor_nodes
EasyABM.neighbor_patches_moore
EasyABM.neighbor_patches_neumann
EasyABM.neighbors
EasyABM.neighbors_moore
EasyABM.neighbors_neumann
EasyABM.num_agents
EasyABM.num_agents_at
EasyABM.num_edges
EasyABM.num_nodes
EasyABM.num_patches
EasyABM.open_model
EasyABM.out_neighbor_nodes
EasyABM.out_neighbors
EasyABM.propnames
EasyABM.random_empty_node
EasyABM.random_empty_patch
EasyABM.run_model!
EasyABM.run_model_epochs
EasyABM.save_model
EasyABM.set_edgeprops!
EasyABM.set_nodeprops!
EasyABM.set_patchprops!
EasyABM.set_window_size
EasyABM.square_grid_graph
EasyABM.static_dir_graph
EasyABM.static_simple_graph
EasyABM.torus_graph
EasyABM.triangular_grid_graph
EasyABM.veclength
EasyABM.vector_orientation
EasyABM.vertices