Evo tpp solver

From OpenLAIR/OpenSkill · View interactive version

Evo tpp solver is an AI agent skill from the GitHub repository OpenLAIR/OpenSkill. Solve TPP (Travelling Purchase Problem) PDDL planning tasks. Use when you need to read a problem.json config file, parse PDDL domain/problem files, generate valid plans using pyperplan via unified_planning, format actions as function-call strings, write plan output files, and serialize plans as pick

How to use this skill

Skill file

TPP PDDL Solver

Solves Travelling Purchase Problem (TPP) planning tasks encoded in PDDL using pyperplan via the unified_planning framework.

When to use this skill

Quick Start

Run the solver script directly:

cd /app
python -m environment.skills.evo-tpp-solver.scripts.solve

Or use the solver from Python:

from pathlib import Path
import sys
sys.path.insert(0, "/app/environment/skills/evo-tpp-solver")
from scripts.solve import solve_all_tasks

solve_all_tasks(Path("/app/problem.json"), Path("/app"))

Pipeline Overview

  1. Load config — Read problem.json to get the list of tasks (each has domain path, problem path, output filename)
  2. Parse PDDL — Use unified_planning.io.PDDLReader to parse domain + problem files into a Problem object
  3. Solve — Use OneshotPlanner(name="pyperplan") with configurable search/heuristic. Default: gbf/hff for speed. Falls back to wastar/hadd if the fast config fails.
  4. Format actions — Each action is formatted as action_name(arg1, arg2, ...) using str(action_instance) which already produces this format
  5. Write plan — One action per line to the output text file
  6. Serialize — Pickle the plan actions list for validation compatibility

Key Implementation Details

Action Format

The str() representation of a unified_planning ActionInstance already produces the required format:

drive(truck1, depot1, market1)
buy(truck1, goods1, market1, level0, level1, level0, level1)

All identifiers are lowercase (PDDL is case-insensitive; PDDLReader normalizes to lowercase).

Solver Configuration

pyperplan supports these search/heuristic combinations via OneshotPlanner params:

The default UP-pyperplan config is wastar/hadd. For faster solving, use gbf/hff.

Fallback Strategy

If the primary solver config fails or times out:

  1. Try gbf/hff (fast, satisficing)
  2. Try wastar/hadd (UP default)
  3. Try astar/hff (optimal but slower)
  4. Try bfs/blind (complete but slowest)

TPP Domain Structure

The TPP domain uses :strips :typing requirements with these actions:

Levels (level0, level1, ...) encode quantities propositionally since pyperplan only supports STRIPS.

Script Reference

Key Functions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.