<<<<<<< HEAD
A real-world-inspired OpenEnv environment for supply chain logistics and disruption response. The agent acts as a Lead Logistics Provider managing a supplier network, customer orders, and alternate sourcing choices under unpredictable market shocks.
- The environment starts with a disruption: supplier downtime, port blockage, bankruptcy, or fuel shock.
- The agent must fulfill customer orders while balancing budget, delivery deadlines, alternate supplier capacity, and reputation.
- Observations include supplier network capabilities, pending order status, alternative sourcing options, budgets, and feedback signals.
- OpenEnv-compliant
SupplyChainEnvwithreset(),step(),state() - Strong type-safety via Pydantic models in
models.py - Rich observation space with supplier network, pending order status, and alternate sourcing details
- Dense reward shaped by delivery performance, budget discipline, negotiation, and reputation
- 7 action types for strategic disruption response decisions
- 3 grader tasks with easy → medium → hard difficulty progression
- FastAPI web service compatible with Hugging Face Spaces
- Docker validation script for quick integration testing
action_type:reroute_order,negotiate,split_order,notify_customer,expedite,cancel_order,querytarget_id: order or supplier identifier, e.g.O1orAlt1value: numeric intensity for the actionparameters: optional metadata such assupplier_idorsupplier_ids
supplier_network: available suppliers, capacity, cost, reliability, and lead timeinventory_levels: current stock forWidgetandGadgetpending_orders: customer orders with deadlines, penalty rates, assigned supplier, and delivery statusdisruption_event: active disruption type, severity, recovery timeline, and affected entityalternative_suppliers: backup source options for rerouting and split orderingbudget_remaining: current cash available for sourcing, expedited delivery, and negotiationfeedback: operational summary and customer communication status
value: dense trajectory rewardon_time_deliveries: positive signal for deliveries meeting due datesbudget_spent: cost pressure penaltycarbon_penalty: environmental impact penaltypending_penalty: overdue shipment penaltyoffset_benefit: credit offset rewardresilience_delta: reward for strengthening the supply chainreputation_delta: reward for improving customer reputation
- Supplier Network Resilience: manage alternate providers, negotiations, and split sourcing
- Customer Communication: notify customers proactively for late or at-risk orders
- Dynamic Disruption Types: support supplier outages, port blockages, bankruptcy, and fuel shocks
- Compound action space: route changes, negotiation, split sourcing, expedited delivery, cancellation, and intelligence queries
- Budget and penalty balancing: trade cost, delay, and reputational outcomes
- Docker validation script:
docker-test.shbuilds, runs, queries endpoints, and cleans up
git clone <this-repo> .
cd d:/supply_chain_openenv
python -m venv .venv
.venv/Scripts/activate
pip install -r requirements.txtpython baseline.pyuvicorn main:app --host 0.0.0.0 --port 8000chmod +x docker-test.sh
./docker-test.shopenenv.yamlcontains environment metadata and action/observation schema
EasyTask: handle a single supplier outage by rerouting a disrupted order to meet its deadline while conserving budget.MediumTask: manage a port blockage with multiple orders, notify affected customers for late shipments, and preserve on-time service.HardTask: survive supplier bankruptcy or fuel shock through negotiation, split sourcing, and minimizing late penalties.
from tasks import EasyTask, MediumTask, HardTask
from engine import SupplyChainEnv
from models import Action
env = SupplyChainEnv(random_seed=42)
obs = env.reset()
action = Action(action_type='reroute_order', target_id='O1', value=1.0, parameters={'supplier_id': 'Alt1'})
obs, reward, done, info = env.step(action)
print('easy', EasyTask.evaluate(env, action))
print('medium', MediumTask.evaluate(env, action))
print('hard', HardTask.evaluate(env))=======
55e89601e7cad36de4f68a1cee21aee6e0e51849