Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -208,7 +208,7 @@ def get_llm_prompt(echelon_state_decision_point: dict, week: int, llm_personalit
|
|
| 208 |
|
| 209 |
return f"**You are a perfectly rational supply chain AI with ONLY LOCAL information.**\nYou must use a logical heuristic to make a stable decision. A proven method is \"Anchoring and Adjustment\".\n\n{base_info}\n\n**Rational Calculation (Anchoring & Adjustment):**\n1. **Anchor on Demand:** Your best guess for future demand is your last incoming order: **{anchor_demand} units**.\n2. **Adjust for Inventory:** You want to hold a safety stock of {safety_stock} units. Your current stock (before shipping) is {e_state['inventory'] - e_state['backlog']}. You need to order an extra **{inventory_correction} units** to correct this.\n3. **Account for {supply_line_desc}:** You already have **{supply_line} units** being processed (that you can see). These should be subtracted from your new decision.\n\n**Final Calculation:**\n* Decision = (Anchor Demand) + (Inventory Adjustment) - ({supply_line_desc})\n* Decision = {anchor_demand} + {inventory_correction} - {supply_line} = **{rational_local_order} units**.\n**Your Task:** Confirm this locally rational {task_word}. Respond with a single integer."
|
| 210 |
|
| 211 |
-
|
| 212 |
|
| 213 |
else:
|
| 214 |
DESIRED_INVENTORY = 12 # Matches initial inventory
|
|
@@ -253,10 +253,10 @@ def get_llm_prompt(echelon_state_decision_point: dict, week: int, llm_personalit
|
|
| 253 |
"""
|
| 254 |
|
| 255 |
elif info_sharing == 'full':
|
| 256 |
-
# 1. HUMAN-LIKE / FULL (
|
| 257 |
-
anchor_demand =
|
| 258 |
panicky_order = max(0, int(anchor_demand + stock_correction))
|
| 259 |
-
panicky_order_calc = f"{anchor_demand} (
|
| 260 |
|
| 261 |
# Build the "Full Info" string just for context
|
| 262 |
full_info_str = f"\n**Full Supply Chain Information (State Before Shipping):**\n- End-Customer Demand this week: {current_stable_demand} units.\n"
|
|
@@ -270,15 +270,14 @@ def get_llm_prompt(echelon_state_decision_point: dict, week: int, llm_personalit
|
|
| 270 |
|
| 271 |
**A "Human-like" Flawed Decision:**
|
| 272 |
Even though you have full information, you are judged by *your own* performance (your inventory, your backlog).
|
| 273 |
-
You tend to react to your *local* situation (like the classic Sterman 1989 model)
|
| 274 |
-
A 'rational' player would use a complex formula, but your gut-instinct is to panic about *your* numbers.
|
| 275 |
|
| 276 |
**Your 'Panic' Calculation (Ignoring Full Info and Your Supply Line):**
|
| 277 |
-
1. **Anchor on *
|
| 278 |
2. **Correct for *Your* Stock:** Your desired 'safe' inventory is {DESIRED_INVENTORY}. Your current net inventory is {net_inventory}. You need to order **{stock_correction}** more units.
|
| 279 |
3. **Ignore *Your* Supply Line:** You'll ignore the **{supply_line} units** in your own pipeline ({supply_line_desc}).
|
| 280 |
|
| 281 |
-
**Final Panic Order:** (
|
| 282 |
* Order = {panicky_order_calc} = **{panicky_order} units**.
|
| 283 |
|
| 284 |
**Your Task:** Confirm this 'gut-instinct', locally-focused {task_word}. Respond with a single integer.
|
|
|
|
| 208 |
|
| 209 |
return f"**You are a perfectly rational supply chain AI with ONLY LOCAL information.**\nYou must use a logical heuristic to make a stable decision. A proven method is \"Anchoring and Adjustment\".\n\n{base_info}\n\n**Rational Calculation (Anchoring & Adjustment):**\n1. **Anchor on Demand:** Your best guess for future demand is your last incoming order: **{anchor_demand} units**.\n2. **Adjust for Inventory:** You want to hold a safety stock of {safety_stock} units. Your current stock (before shipping) is {e_state['inventory'] - e_state['backlog']}. You need to order an extra **{inventory_correction} units** to correct this.\n3. **Account for {supply_line_desc}:** You already have **{supply_line} units** being processed (that you can see). These should be subtracted from your new decision.\n\n**Final Calculation:**\n* Decision = (Anchor Demand) + (Inventory Adjustment) - ({supply_line_desc})\n* Decision = {anchor_demand} + {inventory_correction} - {supply_line} = **{rational_local_order} units**.\n**Your Task:** Confirm this locally rational {task_word}. Respond with a single integer."
|
| 210 |
|
| 211 |
+
# --- HUMAN-LIKE (DESCRIPTIVE) PROMPTS ---
|
| 212 |
|
| 213 |
else:
|
| 214 |
DESIRED_INVENTORY = 12 # Matches initial inventory
|
|
|
|
| 253 |
"""
|
| 254 |
|
| 255 |
elif info_sharing == 'full':
|
| 256 |
+
# 1. HUMAN-LIKE / FULL (FIX v5): Anchors on *local* incoming order, despite seeing global info
|
| 257 |
+
anchor_demand = e_state['incoming_order'] # <--- THIS IS THE FIX
|
| 258 |
panicky_order = max(0, int(anchor_demand + stock_correction))
|
| 259 |
+
panicky_order_calc = f"{anchor_demand} (Your Incoming Order) + {stock_correction} (Your Stock Correction)"
|
| 260 |
|
| 261 |
# Build the "Full Info" string just for context
|
| 262 |
full_info_str = f"\n**Full Supply Chain Information (State Before Shipping):**\n- End-Customer Demand this week: {current_stable_demand} units.\n"
|
|
|
|
| 270 |
|
| 271 |
**A "Human-like" Flawed Decision:**
|
| 272 |
Even though you have full information, you are judged by *your own* performance (your inventory, your backlog).
|
| 273 |
+
You tend to **ignore the stable end-customer demand ({current_stable_demand})** and instead react to your *local* situation (like the classic Sterman 1989 model).
|
|
|
|
| 274 |
|
| 275 |
**Your 'Panic' Calculation (Ignoring Full Info and Your Supply Line):**
|
| 276 |
+
1. **Anchor on *Your* Demand:** You just got an order for **{anchor_demand}** units. You panic and react to *this* number, not the stable end-customer demand.
|
| 277 |
2. **Correct for *Your* Stock:** Your desired 'safe' inventory is {DESIRED_INVENTORY}. Your current net inventory is {net_inventory}. You need to order **{stock_correction}** more units.
|
| 278 |
3. **Ignore *Your* Supply Line:** You'll ignore the **{supply_line} units** in your own pipeline ({supply_line_desc}).
|
| 279 |
|
| 280 |
+
**Final Panic Order:** (Your Incoming Order) + (Your Stock Correction)
|
| 281 |
* Order = {panicky_order_calc} = **{panicky_order} units**.
|
| 282 |
|
| 283 |
**Your Task:** Confirm this 'gut-instinct', locally-focused {task_word}. Respond with a single integer.
|