Change Log
v1.4.2
Fixes
- Fixed a bug in the
with_edgekeyword parameter of theapply!function. Previously, the transition function failed when the specified edge type connected to multiple different agent types at the target position. The function now correctly handles edges that connect to heterogeneous target agent types.
v1.4.1
Fixes
read_agentsandread_edgesreturned wrong results when used in parallel simulations.
v1.4
Improvements
create_string_converterincl.VString{N}definitionset_param!can be called for an unknown parameter (this will show a warning)Enhanced type stability in the implementation of the
neighborstatesfunction
Fixes
An invalid assertion occured when all of the following conditions are met:
- The
:Immortalhint is active for the agent type - The agent type is not included in the
readargument - The
with_edgekeyword is being utilized
v1.3
New features
- Added the
only_surroundingkeyword argument tomove_to!, which restricts edge creation to adjacent cells only.
Improvements
read_paramsandread_globalsno longer require predefined struct definitionsAdded automatic simulation cleanup through finalizers that invoke
finish_simulation!(Note: For parallel simulationsfinish_simulation!calls are still mendentory)Implemented PrettyTables integration for DataFrames, now displaying Agent IDs in hexadecimal format
Enhanced GraphMakie compatibility and support
v1.2.1
New feature
- Added workaround for strings in structs stored to a HDF5-file. Check the documentation of
create_string_converterfor details.
v1.2
Breaking changes
- The
all_ranksdefault value fornum_agentschanged to true.
New features
The functions
all_agentidsandall_edgesallows to get the ids of all agents or the edges on the rank or the complete simulation.The functions
write_metadata,write_sim_metadata,read_sim_metadataandread_metadataallows to attach Metadata to the simulation or individual parts of the model.Instead of writing structs for Parameters and Globals it is now also possible to use
register_param!andregister_global!.Random cells or positions of a grid can be obtained via
random_posandrandom_cellThe function
cellidallows to retrieve the id of a cell on a given position.The functions
remove_edges!allows to remove edges between to agents, or all edges to an agent.The new function
rastervaluescan be sometimes a useful shorter version thencalc_rasterstate.New functions
set_log_pathallows to set the path for log files.The keyword
with_edgeof the functionapplyallows to restrict the called agents to those agents that have an edge of typewith_edge. - The new:Independethint can be given to agent types if agents of this type never access the state of other agents of this type. This allows Vahana to directly modify the state of an agent in its transition functions without having to copy all agents of that type.The new hint
:Independentcan be given to agent types if agents of this type never access the state of other agents of this type. This allows Vahana to change the state of an agent directly in the corresponding vector in a transition functions without copying all agents of this type.For
neighborstates,neighborstates_flexible,neighboridsandedgestatesthere are now also functions that return an iterator for of states/ids instead of a vector these states/ids. They have the same function name, extended with_iter, e.g.neighborstates_iter.The function
add_agent_per_process!allows you to add a single agent of an agent type to each process of a parallel simulation.New function
modify_global!which is a combination ofset_global!andget_global.
Improvements
read_snapshot!can be also used to read data that was written via calls towrite_agents,write_edgesetc..calc_rasterstatetries to retrieve the returned type automatically by default.When
show_agentis called with an id, it is no longer necessary to give also the agent type.Improved error messages.
Julia 1.11 introduced a breaking change in Stateful Iterators. Vahana's edge iterators have now been adapted to accommodate this breaking change.
Performance Improvements
move_to!improvements.Removed an unnecessary memcpy of edges for the case that the type is in the
add_existingargument, but not in thereadargument of a transition function.
Fixes
When edges were removed as a consequence of removing agents, this change was not written to the hdf5 file until also other changes to the edges of this type happen.
In a parallel simulation, sometime not all edges were written to the hdf5 file.
Fixed a compability issue with Microsofts MPI implementation.
log folder was also created when no log file was written.
show_agentdidn't work for all agent hint combinations.It was necessary (and not documented) that
add_raster!was called from all ranks. Now it is possible to call it only from rank 0 (likeadd_agent!etc.).
v1.1
New features
- New functions
set_hdf5_pathallows to set the path for hdf5 files.
Improvements
Removed usage of Base.memcpy! do be compatible with Julia 1.10.
Improved error messages.
Performance Improvements
- For
calc_rasterandcalc_rasterstate.
Fixes
- Empty arrays where not supported for parameters or globals when they where writted to a hdf5 file.