Skip to content

Commit c0c014c

Browse files
committed
Minimize unnecessary actions %12
1 parent c2b1cd0 commit c0c014c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pool_rebalancing_algo.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ For simplicity, let's model:
3333

3434
- **Free Coins:** `O = N + m - M`, which accounts for the total coins available minus the agent's capacity. This way `O` is independent from the coins held by agent.
3535

36-
- **Segmentation Function:** Total segments = `2^(ceil(log2(O)))`. Each segment have the same length and it can be indexed (0,1,2...) starting from an absolute origin that remains unchanged across snapshots. Segmentation is recalculated at every snapshot, so coins placed previously may change immediately the segment they belong to. Segment evaluation cycles modulo `O`: 0, 1, 2, … `O` - 1 and then repeats.
36+
- **Segmentation Function:** Total segments `Q = 2^(ceil(log2(O)))`. Each segment have the same length and it can be indexed (0,1,2...) starting from an absolute origin that remains unchanged across snapshots. Segmentation is recalculated at every snapshot, so coins placed previously may change immediately the segment they belong to. Segment evaluation cycles modulo `O`: 0, 1, 2, … `O` - 1 and then repeats.
3737

3838
- **Segment Priority:**
39-
- **High-Priority Segments:** Odd-numbered segments (indices 1,3...) are High-Priority and at equilibrium each must have exactly one coin.
40-
- **Low-Priority Segments:** Even-numbered segments (indices 0,2...) are Low-Priority and at equilibrium each must have either one or zero coins.
39+
- **High-Priority Segments:** Odd-numbered segments (indices 1,3...) are High-Priority and at equilibrium each must have exactly one coin. There are `Q/2` of them.
40+
- **Low-Priority Segments:** Even-numbered segments (indices 0,2...) are Low-Priority and at equilibrium each must have either one or zero coins. There are `Q/2` of them, but at equilibrium only `O - Q/2` will have one coin, while the rest `Q - O` will have zero coins.
4141
- **Visual Idea:** We can visualize this segmentation prioritization as the alternating colors of the outer rim of a circular Dart Board.
4242

4343
## Strategy and Dynamics
@@ -73,7 +73,7 @@ Given a snapshot, segmentation recalculation always occurs prior to action decis
7373

7474
**Pick-up Strategy:** Follow general rules for multiple coins in one segment.
7575

76-
**Deposit Strategy:** Deposit a coin when a Low-Priority Segment is empty and the agent has coins.
76+
**Deposit Strategy:** Deposit a coin on a empty Low-Priority Segment if there are less than `O - Q/2` Low-Priority Segments with at least a coin and the agent has coins.
7777

7878
### Final Target: Equilibrium
7979

0 commit comments

Comments
 (0)