mixle.task.explore_world module¶
A sequential-exploration world with synthetic ground truth.
This module provides a compact, dependency-free exploration environment inside
core Mixle: hidden true targets, typed actions with costs,
step(action) -> observation revealing noisy evidence, budget-exhaustion
episode end, and score() equal to targets correctly identified. It is
seeded, deterministic, and small enough for fast task-policy tests.
world = ExplorationWorld(n_cells=30, n_targets=4, budget=40, seed=0) obs = world.step({“type”: “survey”, “cell”: 3}) # low-cost: sharpens that cell’s prospectivity read obs = world.step({“type”: “drill”, “cell”: 3}) # costly: reveals ground truth, scores if correct world.score() # targets correctly identified so far world.done # budget exhausted
Two baseline policies are included (random, greedy-by-prospectivity) as the sanity check that the world has learnable signal at all – a policy that reads the evidence should beat one that doesn’t.
- class EpisodeResult(score, n_actions, trace=<factory>)[source]
Bases:
objectScore, action count, and trace captured from one exploration episode.
- class ExplorationWorld(n_cells, n_targets, budget, seed=0)[source]
Bases:
objectOne episode over a synthetic mineral-style exploration world:
n_cellscandidate sites,n_targetsof them hidden true targets, each cell’s TRUE target status correlated with a latent “geology” feature that a survey partially reveals as a noisy prospectivity reading.- prospectivity(cell)[source]
The world’s own current noisy read of
cell– what a policy actually gets to see.
- step(action)[source]
Apply one typed action (plain dict, so a fitted plan model can score/sample over the same action vocabulary):
{"type": "survey", "cell": i}or{"type": "drill", "cell": i}. Returns a plain-dict observation. Raises nothing on an over-budget action – it is simply refused (recorded, zero effect) oncedone, so a policy that keeps acting past budget exhaustion degrades gracefully rather than crashing.
- score()[source]
Targets correctly identified so far: distinct true-target cells actually drilled.
- Return type:
- greedy_prospectivity_policy(world)[source]
Survey every undrilled cell once (low-cost information), then drill highest-read-prospectivity cells first – a fixed heuristic baseline for learned or diagnosis-directed policies.
- random_policy(world)[source]
Choose a random currently valid action from the world’s action menu.