Skip to content

Commit 63d57dc

Browse files
committed
Finalize specs
1 parent d37218b commit 63d57dc

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

simulations/cat_sim_2/docs/architecture.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
## Simulation Phases (per tick)
77

8-
1. **Decision** — each cat scores all candidate nodes and decides: move or act
9-
2. **Movement** — moving cats traverse one edge
10-
3. **Event** — probabilistic events fire per cat at their current node
11-
4. **Action** — stationary cats execute their chosen action
8+
1. **Decision** — each cat scores all candidate nodes and decides: move or act or explore
9+
EITHER:
10+
2. **Movement** — moving cats traverse one edge
11+
OR
12+
3. **Event** — probabilistic events fire per cat at their current node
13+
4. **Action** — stationary cats execute their chosen action
1214
5. **Memory update** — cats update their memory maps
1315
6. **Drain** — need drain rates applied to all cats
1416

@@ -46,8 +48,13 @@
4648

4749
## Decision Phase
4850

49-
- Cat scores all known nodes + adjacent unvisited nodes
51+
- Cat identifies the first two most pressing need, based on thresholds, trait scale multipliers and need prioritization rules
52+
- Cat scores all known nodes + adjacent unvisited nodes (if exploration is primary need)
53+
- Conditional or uncertain actions get a probability score
54+
- event effect are considered based on their probabilities
55+
- edge tax is subtracted
5056
- Highest scoring node wins
57+
- Node score = Primary node effect * 3 + secondary node effect
5158
- If winner = current node → cat acts this tick
5259
- If winner = other node → cat moves one edge in that direction this tick (BFS determines which adjacent node to move to)
5360

simulations/cat_sim_2/docs/specs.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ To decide, a cat scores all known nodes (including its current one) and picks th
153153

154154
Each tick a cat makes one decision: **move** to an adjacent node, or **act** at its current node. A cat cannot do both in the same tick.
155155

156-
A cat moves to(wards) the node which can satisfy its needs best. There is a `edge tax` - the more edges we have to cross to get to the node, the higher is the tax (additive). The node with the highest node score wins.
156+
A cat moves to(wards) the node which can satisfy its needs best. There is an `edge tax` - the more edges we have to cross to get to the node, the higher is the tax (additive). The node with the highest node score wins.
157157
- node score = need satisfaction value - (edge tax × distance)
158-
- need satisfaction value: weighted sum across all needs (how will the needs be affected at this node?), primary need gets highest weight
159-
-formula: planned action effects on needs (where highest priority need gets higher weight multiplier and maybe second highes too)+ event-effect on need * probability (if even has no fixed probability, but depends on actions of another cat, probability is assumed to be 0.1)
158+
- need satisfaction value: sum across all needs (how will the needs be affected at this node?)
159+
-formula: planned action effects on needs + event-effect on need * probability (if even has no fixed probability, but depends on actions of another cat, probability is assumed to be 0.1)
160160

161161
Each tick a cat makes one decision: **move** to an adjacent node, or **act** at its current node — not both.
162162
- If the highest scoring node is the current node → cat acts there this tick
@@ -165,11 +165,12 @@ Each tick a cat makes one decision: **move** to an adjacent node, or **act** at
165165

166166
### Pathfinding & Spatial Memory
167167
- A cat has an internal memory map of nodes it has visited — append-only, never forgotten
168-
- Unvisited nodes do not exist in the cat's decision space
168+
- Unvisited nodes do not exist in the cat's decision space (except ajdacent univisited nodes - there we only know they exist, but no other qualities of the node)
169169
- New nodes are discovered by physically moving to an adjacent unvisited node
170170
- Each known node stores:
171171
- **Last seen cats**: which cats were present on last visit — persists indefinitely until updated by a new visit
172172
- **Novelty score**: familiarity with the node (see below)
173+
- **Adjacent nodes**: known and unknown next nodes
173174
- Movement decisions only consider nodes in the cat's memory map
174175
- Remembered cats feed into node scoring:
175176
- Nodes with remembered friendly cats: `greet cat` and `play with/groom cat` count towards the node's need satisfaction value
@@ -203,6 +204,7 @@ Performing an action means the cat stays at its current node that tick (no movem
203204
- need effects:
204205
- energy: -5
205206
- hunt: +20
207+
- food: +20 (*hunt success probability)
206208
- investigate
207209
- need effects:
208210
- exploration: +20 (*novelty score of node)
@@ -254,7 +256,9 @@ Performing an action means the cat stays at its current node that tick (no movem
254256
- Passive effects: Health: +0.1/tick
255257

256258
#### Garden/Woods
257-
- Available actions: sleep/rest, hunt, investigate, play, groom, mark territory, greet cat, play with/groom cat, attack cat, go to toilet
259+
- Available actions: sleep/rest, investigate, play, groom, mark territory, go to toilet
260+
- conditional actions: greet cat, play with/groom cat, attack cat
261+
- uncertain actions: hunt (availability prob)
258262
- Not available: eat, get pet by human
259263

260264

@@ -298,4 +302,9 @@ Are probabilistic or deterministic (actions by other cats, which have a fixed as
298302
- Energy: -10
299303

300304
## Relationships
301-
-10 to 10
305+
- 10 to 10
306+
- mechanics basically as in cat_sim_1
307+
308+
309+
## Glossar
310+
- `Scale Multiplier`: It's the number you multiply the trait value by before adding it to the need's urgency score. I permanently shifts a cats need levels based on its traits

0 commit comments

Comments
 (0)