Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update paper.md #2566

Merged
merged 9 commits into from
Dec 24, 2024
Merged

Update paper.md #2566

merged 9 commits into from
Dec 24, 2024

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Dec 23, 2024

This is WIP, but I put it here so others can see the changes I am making to the manuscript.

At present, I have partially done

  1. add a short theory paragraph
  2. Restructured the ABM components parts
  3. Updated the time part
  4. started reworking the space part

I find it virtually impossible to turn all these changes into separate atomic commits. Code and paper writing are just different activities in my brain.

@EwoutH
Copy link
Member

EwoutH commented Dec 23, 2024

Thanks, a PR like this is fine for me. I like to be able to view a diff.

For JOSS we have to prioritize a bit, since they target a 1000-word length. With these changes we will be around 1500 words.

@quaquel
Copy link
Member Author

quaquel commented Dec 23, 2024

For JOSS we have to prioritize a bit, since they target a 1000-word length. With these changes we will be around 1500 words.

Ok, I can easily trim it down again

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements! I made a few suggestions on where/what to trim down.

paper/paper.md Show resolved Hide resolved
paper/paper.md Outdated Show resolved Hide resolved
paper/paper.md Outdated Show resolved Hide resolved
paper/paper.md Outdated Show resolved Hide resolved
paper/paper.md Outdated
Comment on lines 92 to 98
### Spaces
Mesa offers a variaty of spaces within which agents can be located. A basic distinction is between discrete or cell-based spaces, and continous space. In discrete spaces, the space consists of a collection of cells and agents occupy a cell. Examples of this include orthogonal grids, hexgrids, voroinoi meshes, or networks. In a continous space, in constrast, an agent has a location.

Mesa comes with a wide variety of discrete spaces, including OrthogonalMooreGrid, OrthogonalVonNeumanGrid, Hexgrid, Network, and VoroinoiMesh. These are all implemented using a doubly linked data structure where each cell has connections to its neighboring cells. The different discrete spaces differ with respect to how they are "wired-up", but the API is uniform across all of them.

Mesa also offers 3 subclasses of the Agent class that are designed to be used in conjunction with these discrete spaces: FixedAgent, CellAgent, and Grid2DMovingAgent. FixedAgent is assigned to a given cell and can access this cell via `self.cell`. However, once assigned to a given cell, it can not be moved. A CellAgent, like a FixedAgent, has access to the cell it currently occupies. However, it can update this attribute making it possible to move around. A Grid2DMovingAgent extends CellAgent by offering a move method with short hand for the direction of movement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, since all this is experimental, I would save it for a Mesa 4 paper when it's stable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or make it significantly shorter, as a "we're working on"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. From 3.2 onwards, cell spaces are stable, and old-style spaces raise a pending deprecation warning. It is plausible that by the time this paper is accepted 3.2 is out.

paper/paper.md Outdated Show resolved Hide resolved
paper/paper.md Outdated
Comment on lines 182 to 205
A more advanced alternative to discrete time advancement is discrete event simulation. Here, the simulation consists of a series of time stamped events. The simulation executes the events for a given timestep, Next, the simulation clock is advancent to the time stamp of the next event. Mesa offers basic support for discrete event simulation using a Discrete event simulator. The design is inspired by Ziegler (add ref), and the java-based DSOL library (add ref).


1. Event-based scheduling for non-uniform time steps:
```python
devs_simulator = DiscreteEventSimulator()
model = Model(seed=42, simulator=devs_simulator)

devs_simulator.schedule_event_relative(some_function_to_execute, 3.1415)
devs_simulator.run_until(end_time)
```

It is also possible to create hybrid models that combine discrete time advancement as typically seen in agent based models, with event scheduling. For this, MESA comes with an ABMSimulator. This simulator has integer based time steps. It automatically schedules the step method of the model for each time tick. However, it is also possible to schedule events on these ticks. This allows for hybrid models combining the ease of discrete time advancement seen in typical ABMs, with the power, flexibility, and potential for substantial runtime reductions of event scheduling.

1. Hybrid discrete time advancement with event scheduling
```python
abm_simulator = ABMSimulator()
model = Model(seed=42, simulator=abm_simulator)

abm_simulator.schedule_event_next_tick(some_function_to_execute)
abm_simulator.run_until(end_time)
```


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is also experimental I would suggest also keeping this concise.

Co-authored-by: Ewout ter Hoeven <[email protected]>
@EwoutH
Copy link
Member

EwoutH commented Dec 24, 2024

I'm fine with you putting in what you want, we can trim down later.

@quaquel
Copy link
Member Author

quaquel commented Dec 24, 2024

I have adopted or at least addressed most of @EwoutH feedback. I am merging this now, so @jackiekazil can move it over to overleaf.

@quaquel quaquel merged commit 3662bb5 into projectmesa:paper_2024 Dec 24, 2024
2 of 3 checks passed
@quaquel quaquel deleted the paper_jan branch December 24, 2024 15:42
@EwoutH
Copy link
Member

EwoutH commented Dec 24, 2024

Awesome! I created a Google Doc: https://docs.google.com/document/d/1HdoNDecjRvvmYhMyr9lZqPj3mmTOa3lrFv1a8_NCk38/edit?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants