How andrew-hsu-6/coms4444-playpen-group-2 works
Playpen is a Python simulator for constructing and evaluating baby enclosures from a room polygon, piece inventory, and scoring weights. A user selects a player and scenario (or requests generation); the game gives the player its inputs, runs its construction, validates and scores the result, then reports it headlessly or in the GUI. The graph includes scenario generation, player selection, validation/scoring, and the documented GUI and run logging. Some links rely on README documentation or the SOURCE INDEX because the relevant source excerpts are partial.
Main entry points: game.py Game orchestration · scenario.py Scenario loading and generation · example_player.py Player strategies · enclosure.py Rule validation
Components 19
Run entry
- CLI arguments
src/args.py - Run launcher
main.py - Run logs
src/runlog.py
Scenario inputs
- Scenario files
scenarios - Scenario loading and generation
src/scenario.py - Room geometry
src/room.py - Piece inventory
src/inventory.py - Pieces and connectors
src/pieces.py - Scoring weights
src/weights.py
Player strategies
- Player registry
players/registry.py - Player interface
players/player0.py - Player strategies
players/example_player.py
Game engine
- Game orchestration
src/game.py - Enclosure construction
src/enclosure.py - Rule validation
src/enclosure.py - Score calculation
src/enclosure.py - CPU time limit
src/limits.py - Interactive GUI
src/game.py
Other components
- Simulator user
Connections 26
- Simulator user → CLI arguments: sets options
README.md - Run launcher → CLI arguments: parses options
main.py - Run launcher → Game orchestration: starts game
main.py - Run launcher → Run logs: captures output
main.py - Simulator user → Scenario files: provides scenario
README.md - Game orchestration → Scenario loading and generation: loads or generates
src/game.py - Scenario loading and generation → Scenario files: reads and writes
README.md - Scenario loading and generation → Room geometry: builds room
src/scenario.py - Scenario loading and generation → Piece inventory: builds inventory
src/scenario.py - Scenario loading and generation → Scoring weights: builds weights
src/scenario.py - Piece inventory → Pieces and connectors: uses piece types
src/inventory.py - Game orchestration → Player registry: selects player
src/game.py - Player registry → Player strategies: loads strategy
players/registry.py - Player strategies → Player interface: implements
players/example_player.py - Game orchestration → Player interface: provides inputs
README.md - Player interface → Enclosure construction: returns proposal
players/player0.py - Player strategies → Room geometry: checks placement
players/example_player.py - Player strategies → Rule validation: tests candidates
players/example_player.py - Enclosure construction → Pieces and connectors: uses components
src/enclosure.py - Game orchestration → Rule validation: validates proposal
src/game.py - Rule validation → Room geometry: checks containment
src/enclosure.py - Rule validation → Piece inventory: checks availability
src/enclosure.py - Game orchestration → Score calculation: scores result
README.md - Score calculation → Scoring weights: applies weights
src/enclosure.py - Game orchestration → CPU time limit: limits player run
src/game.py - Game orchestration → Interactive GUI: renders results
README.md