All MicroEvals
Act as a Grandmaster competitive AI engineer competing in th...
Create MicroEval

Act as a Grandmaster competitive AI engineer competing in th...

Prompt

Act as a Grandmaster competitive AI engineer competing in the Kaggle "Kaggriculture" multi-agent simulation competition. The competition deadline is in 4 days. My agent currently sits at ~407.2 TrueSkill points (Rank ~8024), while the Top 10 cutoff is 2890+ TrueSkill (with top agents generating 40,000 to 60,000+ in-game gold per match). I need you to write a complete, robust, highly optimized, and bug-free submission script in Python: `agent(observation, configuration)` inside `%%writefile main.py`. Below is the complete context, full environment specifications, exact API schemas, and the detailed history of every bottleneck and failure from our previous 14 versions. You do not need any external files—everything required to solve this game is documented below. --- ### 1. ENVIRONMENT SPECIFICATION & MECHANICS #### A. Board, Coordinates & Expansion * Grid: 10x10 tile grid (x: 0..9, y: 0..9), partitioned into four 5x5 quadrants: - NW: (0..4, 0..4) — Starts UNLOCKED. - NE: (5..9, 0..4) — Buy cost: 1,000 gold. - SW: (0..4, 5..9) — Buy cost: 2,000 gold. - SE: (5..9, 5..9) — Buy cost: 4,000 gold. * Locked Tiles: Marked as "LOCKED". Workers can pathfind and walk across locked tiles, but cannot execute tile actions (PLANT, WATER, HARVEST, DIG, BUILD_*) on them. * Shed: Not a map tile. It is accessed by physically standing on one of the 4 center tiles: (4,4), (5,4), (4,5), (5,5). - Hard Shed Capacity: 100 non-seed items. - End-of-Day Auto-Dump: At midnight (Turn 23 -> Turn 0), all workers auto-deposit all carried items into the shed. CRITICAL RULE: If the shed exceeds 100 items during this dump, all excess items are PERMANENTLY DELETED! #### B. Time & Seasons * Episode Length: Exactly 30 Days (Day 0 to 29). * Day Structure: 24 Turns (Hours) per day (Hour 0 to 23). Total episode length: 720 steps. * Win Condition: The final liquid cash (`money`) of the player at Turn 720. #### C. Workforce & Hiring Mechanics * Starts with 1 main Farmer at (4,4). * Daily Fibonacci Hiring: Hired hands expire at the end of each day. Every morning at Hour 0, hiring costs reset to the Fibonacci sequence: Cost(n-th hire) = fib(n) * farmHandCostMult (1, 1, 2, 3, 5, 8, 13...). (e.g., 4 hands = 7 gold; 5 hands = 12 gold). #### D. Crops, Lifecycle & Weeds * Crop Types: - Single-Harvest: CARROT (lifespan 96), WHEAT (lifespan 120), MELON (lifespan 312). Once harvested, the tile becomes empty (None). - Multi-Harvest (Continuous): STRAWBERRY, TOMATO. Once mature, harvesting yields fruit, but the plant remains and regrows continuously. * Watering & Death Rule: Plants track `consecutive_unwatered`. If a plant hits >= 2, it dies and turns into a WEED. Newly planted seeds start with `consecutive_unwatered = 1`, so they MUST be watered the day they are planted, or they die at midnight! * Weeds: Spawn randomly on empty arable tiles each night with probability 0.005. Weeds and dead plants must be cleared with DIG. #### E. Market Engine & The 10-Order Hard Limit * Strict Limit: maxMarketOrdersPerTurn = 10. Any market orders past index 9 are silently dropped! * Price Curves: Prices dynamically degrade when flooded with excess supply. * Consumption: Town Center buys 1 of every product every 24 steps. Town Shops (up to 8 unlock sequentially) consume specific products every 4 turns, creating price spikes. --- ### 2. EXACT OBSERVATION & ACTION API SCHEMAS # Observation Structure: { "player": int, # 0 or 1 "step": int, "day": int, "hour": int, "farms": [ { "farmer": [x, y], "hands": [[x, y], ...], "money": float, "tiles": [[tile_or_None_or_LOCKED, ...], ...], # 10x10 array [y][x] "unlocked_quadrants": ["NW", "NE", ...], "hires_today": int }, # opponent farm at index 1 - player ], "private": { "shed": {"CARROT": int, "MELON": int, "STRAWBERRY": int, ...}, "inventories": [{"MELON": int, ...}, ...], # dict per worker "seeds": {"CARROT": int, "MELON": int, "STRAWBERRY": int, ...} }, "market": {"inventory": {product: int}, "prices": {product: float}}, "town": {"unlocked_shops": [shop_name, ...]} } # Tile dict when occupied: {"kind": "PLANT"|"WEED", "crop": str, "yield_units": int, "watered_today": bool, "consecutive_unwatered": int, "max_lifespan_step": int} # Action Return Format: { "farmer": [ACTION_NAME, *args], "hands": [[ACTION_NAME, *args], ...], "market": [[ORDER_NAME, *args], ...] } # Worker Actions: ["NORTH"], ["SOUTH"], ["EAST"], ["WEST"], ["PASS"], ["WATER"], ["HARVEST"], ["DIG"], ["PLANT", crop_name], ["DROP"] # Market Orders: ["SELL", product, count], ["BUY_SEED", crop, count], ["BUY_LAND"], ["HIRE"] --- ### 3. CHRONOLOGICAL SUMMARY OF PAST ATTEMPTS & ROOT CAUSE FAILURES * v1 (Livestock): Deadlocked building coops. Score: 0. * v2-v6 (Action Loops): Premature harvesting (yield==1), ignored weeds, tile clumping. Score: ~110. * v7-v12 (Survival): Fixed priorities, but stayed isolated in NW quadrant. Score: ~340. * v13-v14 (Agro-Expansion): Added land buying and dynamic hiring. Score peaked at 407.2 but hit major scaling walls: 1. Day 0 Cash Crash: Overbought seeds on Day 0 (3000 -> 96 gold), crippling early land/labor scaling. 2. Shed Deletion Disaster: 6-9 workers auto-dumped at midnight. Cap is 100, so hundreds of crops were deleted, destroying 50% of profits. 3. The 10-Market-Order Choke: Too many buy/hire/sell orders caused essential SELL orders to be dropped. 4. Missing Multi-Harvest Engine: Top opponents (40,000+ gold) use Strawberries to bypass seed costs and market limits entirely. --- ### 4. CORE ARCHITECTURAL REQUIREMENTS FOR THE 2800+ WINNING AGENT 1. Strict Market Order Prioritization (Max 10 per turn): - Slots 0-5: SELL shed inventory (batch items together). Never let crops linger. - Slots 6-7: HIRE workers at Hour 0 (Exploit Fibonacci: hire 4-5 hands early, up to 7-9 once fully expanded). - Slot 8: BUY_LAND (buy NE at >1200 gold, SW at >2400 gold, SE at >4500 gold). - Slot 9: BUY_SEED (strictly restricted to when cash > 400 gold safety buffer, and NEVER after Day 24). 2. The Strawberry Multi-Harvest Engine: - Plant Strawberries on 60-70% of tiles for continuous yield, 0 seed cost after setup, and 0 replanting turns. Use Melons on 30% for burst value. 3. Shed Overflow Prevention: - Sell shed contents every single turn. If total crops across worker inventories + shed approach capacity late in the day (turns 22-23), prioritize sales or throttle harvesting so the midnight auto-dump NEVER exceeds 100 items. 4. Collision-Free Global Worker Assignment: - Use a greedy distance-based 1-to-1 task claim matching system. Workers must never target the same tile. - Priority: 1) WATER unwatered plants 2) HARVEST ripe crops (Strawberry >0; Melon >=5 or season ending) 3) DIG weeds/dead plants 4) PLANT empty tiles if seeds available 5) Move to nearest unassigned task. 5. Terminal Season Liquidation (Days 27-29): - Day 24+: Halt all seed purchases. - Day 27-29: Trigger a "Panic Harvest" (harvest everything >0 yield). - Day 29 Turn 23: Ensure 100% of shed inventory is sold into liquid money. Generate the complete, self-contained Python script wrapped in `%%writefile main.py`. Do not leave placeholder code or omissions.

Response not available

Drag to resize