You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs: Update outdated examples: auto-generated agent IDs, updated initialization, and minor fixes (#170)
* Update dependencies: add 'mesa>=3.2.0' and retain existing versions for 'boto3' in pyproject.toml
* update uv.lock
* Refactor MoneyAgent initialization and agent addition in MoneyModel for improved clarity and efficiency
* Update introductory tutorial notebook: fix installation command, adjust execution counts, and improve wealth distribution output
* Refactor MoneyModel initialization loop to use underscore for unused variable
* Remove unused 'unique_id' field from DataFrame initialization in agent class
* Remove 'unique_id' field from MoneyAgentPolars DataFrame initialization
* Remove 'unique_id' field from MoneyAgentPolars DataFrame initialization
* Update AgentSetDF documentation to clarify 'unique_id' column requirement and remove it from MoneyAgent initialization
* Refactor SugarscapeMesa to use set for agents instead of list for mesa3.0
* Remove 'unique_id' parameter from AntMesa and Sugar class initializers
* Refactor SugarscapeMesa to remove agent_id and simplify Sugar initialization
* Remove 'unique_id' from AntPolarsBase initialization and update null handling in AntPolarsLoop
* Update display name in introductory tutorial to 'mesa-frames'
* Refactor AntPolarsLoop to improve readability by consolidating method chaining in get_best_moves
* Remove agent_id from AntMesa initialization in SugarscapeMesa
Copy file name to clipboardExpand all lines: docs/general/user-guide/1_classes.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
To create your own AgentSetDF class, you need to subclass the AgentSetPolars class and make sure to call `super().__init__(model)`.
6
6
7
-
Typically, the next step would be to populate the class with your agents. To do that, you need to add a DataFrame to the AgentSetDF. You can do `self += agents` or `self.add(agents)`, where `agents` is a DataFrame or something that could be passed to a DataFrame constructor, like a dictionary or lists of lists. You need to make sure your DataFrame has a 'unique_id' column and that the ids are unique across the model, otherwise you will get an error raised. In the DataFrame, you should also put any attribute of the agent you are using.
7
+
Typically, the next step would be to populate the class with your agents. To do that, you need to add a DataFrame to the AgentSetDF. You can do `self += agents` or `self.add(agents)`, where `agents` is a DataFrame or something that could be passed to a DataFrame constructor, like a dictionary or lists of lists. You need to make sure your DataFrame doesn't have a 'unique_id' column because IDs are generated automatically, otherwise you will get an error raised. In the DataFrame, you should also put any attribute of the agent you are using.
8
8
9
9
How can you choose which agents should be in the same AgentSet? The idea is that you should minimize the missing values in the DataFrame (so they should have similar/same attributes) and mostly everybody should do the same actions.
10
10
@@ -16,7 +16,6 @@ class MoneyAgent(AgentSetPolars):
0 commit comments