# Library Reference

`AlgebraicABMs.Distributions.weibullpar`

— MethodGet the shape and scale parameters for a Weibull distribution with a given mean and variance. This code is a translation of the R "mixdist" package's function

`AlgebraicABMs.ABMs.ABM`

— TypeAn agent-based model.

`AlgebraicABMs.ABMs.ABMFlow`

— TypeContinuous dynamics

`AlgebraicABMs.ABMs.ABMRule`

— TypeA stochastic rewrite rule with a dependent hazard rate

A basis is a subobject of the pattern of the rule for which we want a timer per match. By default, the basis ↣ pattern map is just id(pattern).

`AlgebraicABMs.ABMs.AbsDynamics`

— TypeA type which implements AbsDynamics must be able to compiled to an ODE for some set of variables.

`AlgebraicABMs.ABMs.AbsHomSet`

— TypeA collection of timers associated at runtime w/ an ABMRule

`AlgebraicABMs.ABMs.AbsTimer`

— TypeSomething that can produce a ACSetTransformation × clocktime → hazard_rate

`AlgebraicABMs.ABMs.ClosureState`

— TypeA closure which accepts a match morphism and returns a hazard_rate. This is a timer which cannot depend on the absolute clock time.

`AlgebraicABMs.ABMs.ClosureTime`

— TypeA closure which accepts a clocktime and returns a hazard_rate. This is a timer which cannot depend on the match data nor ACSet state.

`AlgebraicABMs.ABMs.EmptyP`

— TypeEmpty patterns have (one) trivial pattern match

`AlgebraicABMs.ABMs.FullClosure`

— TypeA closure which accepts a ACSetTransformation and returns a function of type clocktime → hazard_rate

`AlgebraicABMs.ABMs.RawODE`

— TypeUse raw Julia functions to define an ODE

`AlgebraicABMs.ABMs.RegularP`

— TypeDefault case, where pattern matches should be found via (incremental) homomorphism search and represented explicitly, each with own events getting scheduled.

`AlgebraicABMs.ABMs.RepresentableP`

— TypeA pattern match from a coproduct of representables is just a choice of parts in the codomain. E.g. matching L = •→• • • is just a random choice of edge and two random vertices.

The vector of ints refers to parts of L which are the counits of the left kan extensions that define the representables (usually this is just wherever the colimit leg sends 1, as there is often just one X part in the representable X).

WARNING: this is only viable if the timer associated with the rewrite rule is symmteric with respect to the disjoint representables and has a simple exponential timer.

`AlgebraicABMs.ABMs.RuntimeABM`

— TypeData structure for maintaining simulation information while running an ABM

`AlgebraicABMs.ABMs.Traj`

— TypeA trajectory of an ABM: each event time and result of `save`

.

`AlgebraicABMs.ABMs.init_homset`

— MethodInitialize runtime hom-set given the rule and the initial state

`AlgebraicABMs.ABMs.is_exp`

— MethodCheck if a hazard rate is a simple exponential

`AlgebraicABMs.ABMs.mk_prob`

— MethodConstruct an ODE for a given ACSet state. Return a mapping which allows to go from index to AttrType+index.

`AlgebraicABMs.ABMs.pattern_type`

— MethodAnalyze a pattern to find the most efficient pattern type for it.

Because ACSet types do not know their own equations, we may have to pass the schema as an argument in order to compute representables that would otherwise be infinite.

Even if the pattern is a coproduct of representables, we cannot use the efficient encoding unless the distribution is either an exponential (or a single dirac delta - not yet supported).

`AlgebraicABMs.ABMs.run!`

— MethodRun an ABM, creating a fresh runtime + trajectory.

save - function applied to the ACSet state to produce the data that gets stored for every change in the model dt - timestep for checking discrete events when running ODE dynamics.

`AlgebraicABMs.ABMs.validate`

— MethodCheck that RuntimeABM incremental hom sets have all valid homs.

`AlgebraicABMs.Upstream.pops!`

— MethodPop the next random event, advance the clock

`AlgebraicRewriting.Rewrite.Utils.get_match`

— MethodGet match returns a randomly chosen morphism for the aggregate rule