This new version brings two powerful, but both experimental features:
- Allowing the agent container to be based on
StructVectors, using a Struct-of-Arrays internal layout. Currently it only supports single agent types. To use this, passcontainer = StructVectortoStandardABMorEventQueueABMconstructors, as well as use the helper constructSoAType{A}for dispatch purposes instead of your agent typeA(read the docstring ofSoAType). - Native integration of ABMs with Reinforcement Learning is now provided by the new model type
ReinforcementLearningABM. To learn how to use this functionality checkout the new tutorial on the Boltzmann Wealth Model with Reinforcement Learning.
These two features are labelled experimental because they did not yet undergo extensive testing by a broader pool of users. As versions progress and bug reports come in, and get solved, the features will mature to fully stable.
The experimental status allows us as developers to make breaking changes, if need be, to either feature, in order to fully stabilize them.
This new version also brings some breaking changes that we believe will not affect typical usage of Agents.jl:
- All deprecations existing in Agents.jl v6 have been removed. Use version v6.2 if you are not comfortable with this.
- All plotting related source code has been completely overhauled.
- Main reason was the difficulty of maintaining the previous version which was relying on advanced Makie.jl features and was also significantly over-engineered.
- Data inspection is currently unavailable, and we welcome PRs to enable again data inspection in the new plotting code which plots directly on
Axis/Axis3. - All plotting-related deprecations have been removed. Incorrect code will now error.
- The dev-user-facing interface for how to extend plotting for a new space has also been reworked. It is dramatically simplified.
- The function
check_space_visualization_APIhas been removed. Instead, well structured developer docs exist.
- The
OpenStreetMapSpaceis now not available immediately afterusing Agents.- It is now a package extension. You need to be doing
using LightOSMto access it. - The submodule
OSMstill exists to enable as much backwards compatibility as possible, soOSM.test_map()will work as usual afterusing LightOSM. - Additionally, now all functionality that is exclusive to OSM is behind the
OSMmodule, with the exception of the core typesOpenStreetMapSpace, OpenStreetMapPath, OSMAgent. Thus you must now doOSM.is_stationary,OSM.plan_route!, etc. Route-planning shared the same API with A-star pathfinding, but this is no longer possible due to package extensions. So nowAgents.plan_route!is pathfinding, whileAgents.OSM.plan_route!is open street map route finding. - This change was done because
LightOSMhas been an abandoned package for a long time now. We need to limit its hold over normal Agents.jl usage. - We are currently debating amongst options to counteract this problem, such as porting the LightOSM.jl source code directly into Agents.jl, or forking the project and registering it under a new name, or trying to get ownership of the project.
- Function
download_osm_networkis no longer re-exported from LightOSM.jl. - At least making this current breaking change means that whatever the future solution for
OpenStreetMapSpaceis, it will be non breaking.
- It is now a package extension. You need to be doing
- The functions
plan_route!, plan_best_route!, move_along_route!are no longer top-levelAgentsfunctions. You have to preface the with eitherOSM.orPathfinding.to use them in their respective submodule. Or dousing Agents.OSM/Agents.Pathfindingrespectively to bring the functions into scope. ByKindscheduler removed, which should have happened already in v6.1, but was forgotten.
The EventQueueABM which was previously considered experimental is now considered to be stable.
All references to the obsolete 'kind' concept have been removed, now everything is based on different agent types.
The @multiagent macro introduced in Agents.jl v6.0 has been completely overhauled. We found a better methodology to create performant multi-agent types that can re-use existing agent types. Please read the docstring of the new @multiagent and consult the updated tutorial in v6.1 for more details.
All @multiagent-specific functions that were introduced in v6.0, such as kindof, have also been deprecated, see the main tutorial.
For EventQueueABM, that was an experimental feature that used to work only with kindof, it is also now changed to work with the standard typeof of the base Julia language.
We tried to deprecate every major change, resulting in practically no breakage from v5 to v6. However, in version v6.2 we will remove all deprecations (and hence un-updated code will break)
- The
@agentmacro has been rewritten to support fields with default and const values. It has a new usage syntax now that parallelizes more Julia's nativestructdeclaration. The old macro version still works but it's deprecated. Since now the macro supports these features, using@agentis the only supported way to create agent types for Agents.jl. - Manually setting or altering the ids of agents is no longer allowed. The agent id is now considered a read-only field, and is set internally by Agents.jl to enable hidden optimizations in the future. Due to this, the
nextidfunction is no longer public API. As a consequence, new constructor of agents which accept the model as first argument have been created with the agent macro e.g.A(model, pos; kwargs...), so that to handle the id assignment automatically.- We anyways recommend using exclusively the API function
add_agent!to create new model agents. This means you never have to care about the id!
- We anyways recommend using exclusively the API function
- Agent types in
ContinuousSpacenow useSVectorfor theirposandvelfields rather thanNTuple.NTupleusage inContinuousSpaceis officially deprecated, but backward compatibility is mostly maintained. Known breakages include the comparison of agent position and/or velocity with user-defined tuples, e.g., doingagent.pos == (0.5, 0.5). This will always befalsein v6 asagent.posis anSVector. The rest of the functionality should all work without problems, such as moving agents to tuple-based positions etc. - The
:stepcolumn name of the dataframes resulting fromrun!has been renamed to:time, to accommodate for the fact that now both discrete time and continuous time models are possible in Agents.jl.
AgentBasedModeldefines an API that new model types may extend. This opens the door for making new types of models as well as better integration of other agent based modelling frameworks with Agents.jl.- Every aspect of Agents.jl is orthogonal to
AgentBasedModel: movement and neighbor searching in any space, data collection, visualizations, etc., are independent of the specific type ofAgentBasedModeland work out of the box with any model. - Logic of when to collect data in
run!has been improved to accommodate both discrete and continuous time models. This is reflected in the new options for the keywordwhen.- A new keyword
initis now available forrun!to data collect from the model before evolving it. Whether data were collected at time 0 or not was not really obvious in the original version ofrun!due to the ambiguity of the previous handling ofwhen.
- A new keyword
- A new
@multiagentmacro allows to run multi-agent simulations much more efficiently. It has two version: In:opt_speedthe created agents are optimized such as there is virtually no performance difference between having 1 agent type at the cost of each agent occupying more memory that in theUnioncase. In:opt_memoryeach agent is optimized to occupy practically the same memory as theUnioncase, however this comes at a cost of performance versus having 1 type.@multiagentkinds support multiple dispatch like syntax with the@dispatchmacro. - A new experimental model type
EventQueueABMhas been implemented. It operates in continuous time through the scheduling of events at arbitrary time points, in contrast with the discrete time nature of aStandardABM. - Both the visualization and the model abstract interface have been refactored to improve the user experience to conform to the Agents.jl API when creating a new model type and its visualizations.
- Grid and continuous spaces support boundaries with mixed periodicity, specified by tuples with a
Boolvalue for each dimension, e.g.GridSpace((5,5); periodic=(true,false))is periodic along the first dimension but not along the second. Arrowbackend inoffline_run!is now supported also for Windows users.- The model time is now tracked automatically, accessible through
abmtime(model). This is part of the newAgentBasedModelAPI. - Two new functions
random_id_in_positionandrandom_agent_in_positioncan be used to select a random id/agent in a position in discrete spaces (even with filtering). - A new function
swap_agentscan be used to swap the positions of a pair of agents, which works even in spaces which allow 1 agent per position. - New function
hasidto check if a model has an agent with a given id.
- A new argument
alloccan be used to select a more performant version in relation to the expensiveness of the filtering for all random methods selecting ids/agents/positions. - The
random_agentfunction is now much faster than before. The functionsrandom_nearby_position,random_nearby_idandrandom_nearby_agentare much faster thanks to a faster sampling function. - The
nearby_agentsfunction forContinuousSpaceandGridSpaceis now 1.5x faster than before. - The
sample!function is much faster than before.
- The way the evolution rule (
agent_step!, model_step!) is handled has changed. Now, the stepping functions must be given to the agent based model during construction of the model instead of given tostep!, run!, abmplot, .... This change is important and allows us to:- Have Agents.jl have the same mental model as DifferentialEquations.jl, DynamicalSystems.jl, and other dynamical modelling packages, where the evolution rules are part of the central simulation struct.
- Allows us to develop new types of models that may have rules that are defined differently, without being based on e.g., two particular functions.
- Allows us to develop (in the future) a new model type that is optimized for multi-agent simulations.
- Allows other developers of agent based modelling packages to integrate with Agents.jl by extending the established API.
- The
UnremovableABMtype is deprecated, insteadcontainer = Vectorshould be passed when creating the model. - Passing the
stepargument tocollect_model_data!, collect_agent_data!is deprecated since the time of the model is used automatically. add_agent_pos!has been deprecated in favor of the more descriptiveadd_agent_own_pos!.schedule(model, scheduler)is deprecated. Usescheduler(model)together withhasid(model).- Deprecations that were in place in v5 (see section
# v5of this CHANGELOG) have been removed. nearby_ids_exactis deprecated in favour of setting thesearchkeyword to:exact- Keyword
spfis deprecated in favor ofdtinabmvideo.
- New function
replicate!allows to create a new instance of a given agent at the same position with the possibility to specify some fields with new values. - The
sample!function is 3x faster than before.
- New function
offline_run!allows writing data to file at predefined intervals duringrun!instead of storing it in memory. Currently supports CSV and Arrow files.
- Agents.jl moved to Julia 1.9+, and now exports visualization and interactive applications automatically once Makie (or Makie backends such as GLMakie) come into scope, using the new package extension system. The only downside of this is that now to visualize ABMs on open street maps, the package OSMMakie.jl must be explicitly loaded as well.
- Nearby look-ups with
nearby_positions,nearby_idsand derivatives are now incrementally faster than before more the radius increases. - The
randomwalk!function is now supported for any number of dimensions in ContinuousSpace when used to create isotropic/uniform random walks. For all type ofAbstractGridSpace, therandomwalk!function supports a new keywordforce_motion, which is false by default. See the docs to be informed on the effect of setting this keyword. Besides, in the continuous space default case random walks are up to 2 times faster than before. - Adding agents through
properties...is an order of magnitude faster, now matching the performance of the other versions. - The
ByPropertyscheduler can now accept any type of (ordered) properties, while before it was restricted to only floats. TheByIDscheduler of anUnremovableABMis now as fast as theFastestscheduler since in this case they are actually equivalent.
- New optional filtering functionality to restrict the sampling added to
random_nearby_position,random_nearby_idandrandom_nearby_agent.
random_nearby_position,random_nearby_idandrandom_nearby_agentare up to 2 times faster thanks to a faster sampling function.
- The
random_nearby_positionfunction is now much faster for GridSpaces.
- Iterating in neighborhood searches (with
nearby_idsand derivative functions) inGridSpaceandContinuousSpaceis now about 2 times faster than before.
FixedMassABMis now deprecated and will be removed in future versions. Turns out, there is no performance benefit of using it overUnremovableABM. In fact, there is a performance deficit in doing so.
sample!is now much faster than before when the size of the sample is big, with a size of 1 million agents the function is now 1000x faster.- A memory bug about offsets calculation has been solved; besides, the
calculate_offsetsfunction has been sped-up by a significant amount. - The following renames have been done (with deprecations):
genocide! -> remove_all!kill_agent! -> remove_agent!UnkillableABM -> UnremovableABM
- New function
random_nearby_positionthat returns a random neighbouring position. - New function
empty_nearby_positionsthat returns an iterable of all empty neighboring positions.
random_agentis now faster and has two options on how to find a random agent, each of which can offer a different performance benefit depending on the density of agents that satisfy the clause.- New function
randomwalk!replaceswalk!(agent, rand, model)(now deprecated), allowing easier creation of random walks in both discrete and continuous spaces. Random walks in continuous space also allow users to specify the reorientation distributions:polarin 2D;polarandazimuthalin 3D. This way, correlated random walks can be produced. - Thanks to the use of a new algorithm, the
nearby_positionsfunction for graphspaces is now much faster. - Huge improvement of performance of the
get_directionfunction in the periodic case. normalize_positionis now 50x faster for the case of a non-periodic grid.
- Internals of
AgentBasedModelgot reworked. It is now an abstract type, defining an abstract interface that concrete implementations may satisfy. This paves the way for flexibly defining new variants ofAgentBasedModelthat are more specialized in their applications. - The old
AgentBasedModelis nowStandardABM. - Two new variants of agent based models:
UnkillableABMandFixedMassABM: they yield huge performance benefits (up to twice the speed!!!) on iterating over agents if the agents can't get killed, or even added, during model evolution! - Huge memory performance increase in continuous space by fixing a memory leak bug.
multi_agents_type!has been updated to handle edge case where agents of one (or more) type are absent at the beginning of the simulation.- New function
npositionsthat returns the number of positions of a model with a discrete space.
add_node!andrem_node!have been renamed toadd_vertex!andrem_vertex!extending Graphs.jl homonymous methods to help standardise names across ecosystems. Thereforeadd_node!andrem_node!have been deprecated.- The signature of
add_edge!has been generalised withargs...andkwargs...to be compatible with all the implementations the underlying graph supports. - New function
rem_edge!that removes an edge from the graph.
- The
@agentmacro has been re-written and is now more general and more safe. It now also allows inheriting fields from any other type. - The
@agentmacro is now THE way to create agent types for Agents.jl simulations. Directly creating structs by hand is no longer mentioned in the documentation at all. This will allow us in the future to utilize additional fields that the user does not have to know about, which may bring new features or performance gains by being part of the agent structures.- EDIT: This has been retracted in future versions.
@agentis the recommended way, but manual creation is also valid.
- EDIT: This has been retracted in future versions.
- The minimal agent types like
GraphAgentcan be used normally as standard agent types that only have the mandatory fields. This is now clear in the docs. (this was possible also before v5.4, just not clear) - In the future, making agent types manually (without
@agent) may be completely disallowed, resulting in error. Therefore, making agent types manually is considered deprecated. - New function
normalize_positionthat normalizes a position according to the model space. - New function
spacesizethat returns the size of the space.
This is a huge release!
- Internal representation of grid spaces has been completely overhauled. For
GridSpacethis lead to about 30% performance increase innearby_stuffand 100% decrease in memory allocations. - Significant performance increase for
nearest_neighborinContinuousSpace. - Because of the new grid spaces internals,
nearby_stuffsearches inContinuousSpaceare 2-5 times faster. - Much more efficient distributed computing in
ensemblerun!andparamscanfunctions, like 5x performance gain. Thanks to user Matt Turnermt-digital. #624
- New space
GridSpaceSinglethat is the same asGridSpacebut only allows for one agent per position only. It utilizes this knowledge for massive performance benefits overGridSpace, being about 3x faster than the newGridSpace, all across the board. ID = 0 is a reserved ID for this space and cannot be used by users.
- New keyword
showprogressinrun!function that displays a progress bar. - New keyword
showprogressinensemblerun!andparamscanthat displays a progress bar over total amount of simulations done. - New function
OSM.route_length. - New
:manhattanmetric forGridSpacemodels. - New
manhattan_distanceutility function. - New keyword
nearby_f = nearby_ids_exactininteracting_pairswhich decides whether to use the exact or approximate algorithm for nearest neighbors.
- [Will be breaking] In the near future, agent ID = 0 will be a reserved ID by Agents.jl. This means that users should not use ID = 0 for any agent. They can use all the negative and positive integers as usual. If you were adding agents with any of the default ways that Agents.jl provides, such as
add_agents!(pos, model, agent_properties...), then you were already using only the positive integers. - [Maybe breaking?] In
ContinuousSpacespacingwas documented to be a keyword but in code it was specified as a positional argument. Now it is also a keyword in code as intended. - [Maybe breaking?] Keyword
spacinginContinuousSpaceis nowminimum(extent)/20from/10by default, increasing accuracy ofnearby_ids(which is the fastest way to iterate over neighbors). This decreases a bit the performance ofmove_agent!, but in the typical scenario a neighbor search is much more costly than moving an agent. - [Maybe breaking?] There was an ambiguity in the function
move_agent!(agent, model). It typically means to move an agent to a random position. However, inContinuousSpacethis function was overwritten by the signaturemove_agent(agent, model, dt::Real = 1). To resolve the ambiguity, nowmove_agent!(agent, model)always moves the agent to a random position even inContinuousSpace. To use the continuous space version that moves an agent using its velocity, users must explicitly provide the third argumentdt. - [Will be breaking] Keyword
exactinnearby_idsforContinuousSpaceis deprecated, because now the exact version returns different type than the non-exact, hence leading to type instabilities. Usenearby_ids_exactinstead. Same fornearby_agents.
- Rework schedulers to prefer returning iterators over arrays, resulting in fewer allocations and improved performance. Most scheduler names are now types instead of functions:
Schedulers.by_idis nowSchedulers.ByIDSchedulers.randomlyis nowSchedulers.RandomlySchedulers.partiallyis nowSchedulers.PartiallySchedulers.by_propertyis nowSchedulers.ByPropertySchedulers.by_typeis nowSchedulers.ByType
- Add
random_nearby_idandrandom_nearby_agentfor efficient random agent access - Stop condition for
step!allows usingIntegers
- Agents.jl + InteractiveDynamics.jl now support native plotting for open street map spaces, which is integrated in all interactive apps as well!
- Most examples have been moved to AgentsExampleZoo.jl. Additional examples will now be added there.
- Plotting, animating, and interacting GUIs based on InteractiveDynamics.jl have changed. Please see online docs for the new format.
- LightGraphs.jl dependency is now replaced by Graphs.jl
- OpenStreetMapX.jl dependency now replaced by LightOSM.jl. This mean initializing the space is different, and some API methods have changed. Check documentation for more details. Note that this also means checkpoints using the old
OpenStreetMapSpacecannot be read in this version. - Functions for planning and moving along routes have had their names unified across Pathfinding and OpenStreetMap modules. The names now are
plan_route!andmove_along_route!and are accessible from the top level scope. OSM.intersectionis renamed toOSM.nearest_nodeOSM.roadis renamed toOSM.nearest_roadlatlonis removed in favor ofOSM.lonlat
- Previously
nearby_idswithr=0forGraphSpacewas undefined. Now it returns ids only in the same position as given.
- Performance enhancements for
random_empty.
- Add
get_spatial_propertyandget_spatial_indexfor easier usage of spatially distributed properties inContinuousSpace. - Rework the pathfinding system to be more streamlined and offer greater control over the its details.
- Add support for pathfinding in
ContinuousSpace. - New utility functions
nearby_walkableandrandom_walkablefor use in models with pathfinding. - Fixed bug where there was no differentiation between empty paths and paths to unreachable nodes.
- The old pathfinding system is now deprecated. Pathfinding structs are not saved as part of the space, and instead are stored by the user.
- Provide a generator function to collect
mdatainrun!andensemblerun!. - Save/load entire models using
save_checkpointandload_checkpoint - New functions
get_spatial_propertyandget_spatial_indexthat allows better handling of spatial fields present inContinuousSpacethat are represented via the forms of discretization over the space.
- Save and load agent information from CSV files.
- Self-contained features of Agents.jl will from now own exist in their own submodules. This will make the public API less cluttered and functionality more contained. Currently the new submodules are
Schedulers, Pathfinding, OSM. - Pathfinding using the A* algorithm is now possible! Available for
GridSpace. - Extend
dataname(formerlyaggname) to provide unique column names in collection dataframes when using anonymous functions - Fixed omission which did not enable updating properties of a model when
model.propertiesis astruct. - New function
ensemblerun!for running ensemble model simulations. - Scheduler
Schedulers.by_property(previouslyproperty_activation) now allows as input arbitrary functions besides symbols.
- Deprecate
aggnamein favor ofdatanamefor naming of columns in collection dataframes - Keyword
replicatesofrun!is deprecated in favor ofensemblerun!. paramscanwithreplicatesis deprecated. If you want to parameter scan and at the same time run multiple simulations at each parameter combination, simply useseedas a parameter, which tunes the model's initial random seed.- All the scheduler names have been deprecated in favor of a
Schedulersmodule:fastesttoSchedulers.fastest,by_idtoSchedulers.by_id,random_activationtoSchedulers.randomly,partial_activationtoSchedulers.partially,property_activationtoSchedulers.by_property,by_typetoSchedulers.by_type.
- Plotting with Plots.jl and
plotabmis deprecated in favor of InteractiveDynamics.jl, Makie.jl andabm_plot.
- A new example: Fractal Growth, explores
ContinuousSpaceand interactive plotting. - Models now supply a random number generator pool that is used in all random-related functions like
random_position. Access it withmodel.rngand seed it withseed!(model, seed). - Higher-order agent grouping utilities to facilitate complex interactions, see e.g.
iter_agent_groups. - Several documentation improvements targeting newcomers.
This new release brings not only a lot of new features but also a lot of performance improvements and quality of life improvements. Worth seeing is also the new Comparison section of our docs, which compares Agents.jl with other existing software, showing that Agents.jl outmatches all current standards.
GridSpacehas been re-written from scratch! It now supports any dimensionality and is about a full order of magnitude faster than the previous version!ContinuousSpacehas been re-written from scratch! It is now at least 3 times faster!- A new, continuous
OpenStreetMapSpacewhich lets agents traverse real world locations via planned routes based on the Open Street Map initiative. GraphSpacenow allows to dynamically mutate the underlying graph viaadd_node!,rem_node!.- Agents.jl now defines a clear API for new spaces types. To create a fundamentally different type of space you have to define the space structure and extend only 5 methods.
GraphSpaceandGridSpaceare completely separated entities, reducing complexity of source code dramatically, and removing unnecessary functions likevertex2coordandcoord2vertex.- Many things have been renamed to have clearer name that indicates their meaning (see Breaking changes).
- Performance increase of finding neighbors in GraphSpace with r > 1.
- New wrapping function
nearby_agentsthat returns an iterable of neighboring agents. - Positions and neighbors on
GridSpacecan now be searched in each direction separately by acceptingras a tuple. - Neighbors on non-periodic chebyshev spaces can also be searched per dimension over a specific range.
- New public
schedulefunction for writing custom loops. - Mixed models are supported in data collection methods.
random_agent(model, condition)allows obtaining random agents that satisfy given condition.- New
walk!utility function forGridSpaceandContinuousSpaces, providing turtle-like agent movement and random walks. - The Battle Royal example explores using categorical neighbor searching in a high dimensional
GridSpace. - An
@agentmacro provides a quick way of creating agent structs for any space.
Most changes in this section (besides changes to default values) are deprecated and therefore are not "truly breaking".
- New
ContinuousSpacenow only supports Euclidean metric. - Keyword
mooreofGridSpacedoesn't exist anymore. Usemetricinstead. - Default arguments for
GridSpaceare nowperiodic = true, metric = :chebyshev. - Internal structure of the fundamental types like
ABM, GraphSpace, etc. is now explicitly not part of the public API, and the provided functions likegetindexandgetpropertyhave to be used. This will allow performance updates in the future that may change internals but not lead to breaking changes. vertex2coord, coord2vertexdo not exist anymore because they are unnecessary in the new design.- API simplification and renaming:
space_neighbors->nearby_idsnode_neighbors->nearby_positionsget_node_contents->ids_in_positionget_node_agents->agents_in_positionpick_empty->random_emptyfind_empty_nodes->empty_positionshas_empty_nodes->has_empty_positionsnodes->positions
GridSpaceagents now useDimsrather thanTuple{N,Int}for theirposition in all examples and pre-defined models.
- Add the ability to decide whether the agent step or the model step should be performed first using the
agents_firstargument.
- Add ability to customise
run!such that mutation on containers and nested structures does not affect data collection.
- Aggregation data for agents is now possible to do conditionally.
- Example on how to integrate Agents.jl with BlackBoxOptim.jl.
- Added interactivity examples for Schelling and Daisyworld.
- Example on how to integrate Agents.jl with DifferentialEquations.jl.
- Dropped support for Julia 1.0, will be targeting LTS for v1.6 in the future.
- New
fill_space!function for discrete spaces. - The Daisyworld example now uses multi-agent approach (surface is agent).
- New
allidsfunction.
- New
Modelssubmodule, that conveniently allows loading a model from the examples.
- Extend
interacting_pairsto allow interactions of disparate types when using mixed models.
- Added
ContinuousSpaceas a space option. Supports Euclidean and Cityblock metrics. Several new API functions were added for continuous space. - Universal plotting function
plotabmthat works for models with any kind of space. - new function
space_neighbors, which works for any space. It always and consistently returns the IDs of neighbors irrespectively of the spatial structure. AgentBasedModelnow allows you to pass in anAbstractAgenttype, or an instance of your agent.- New convenience function
allagents. - New continuous space functions
nearest_neighborandelastic_collision!. - New iterator
interacting_pairs. - Agents can be accessed from the model directly.
model[id]is equivalent withmodel.agents[id]and replacesid2agent. - If
model.propertiesis a dictionary with key type Symbol, then the convenience syntaxmodel.propreturnsmodel.properties[:prop]. - Version of
add_agent!now has keyword propagation as well (in case you make your types with@kwdefor Parameters.jl). - New function
nextid - Cool new logo.
node_neighborsnow accepts aneighbor_typekeyword for working with directed graphs.- Added examples of flocking birds and bacterial growth in
ContinuousSpace, daisyworld and predator-prey inGridSpace.
- Collection of model and agent data simultaneously is now possible using the
mdataandadatakeywords (respectively) used in conjunction with the revamped data collection scheme (see below). - Better support for mixed-ABMs and a new
by_typescheduler.
- Deprecated
Spacein favor of the individual spaces:Nothing, GridSpace, GraphSpace, ContinuousSpace. - Reworked the public API of
GridSpaceto be simpler: position must beNTuple{Int}. As a resultvertex2coordand stuff no longer exported, since they are obsolete.
- Data collection has been completely overhauled. The main function to evolve an ABM and collect data is now
run!. This function serves most situations, however multiple low level functions are exposed via the API for power users. See the Data Collection section in the documentation for full details. AgentBasedModelchecks the construction of your agent and will return errors when it is malformed (noidorposwhen required, incorrect types). Warnings when possible problems may occur (immutable agents, types which are not concrete,velnot of the correct type when usingContinuousSpace).id2agentis deprecated in favor ofgetindex(model, id) == model[id].
- Function
plot2Ddoesn't exist any more in favor ofplotabm.
- Renamed the old scheduler
as_addedtoby_id, to reflect reality. - Added a scheduler public API.
- Added two new schedulers:
partial_activation,property_activation. - It is now possible to
step!until a boolean condition is met.
Changelog is kept with respect to version 2.0.