← All projects

Private project case study

Ecological Pyramid Simulator

A food-web simulator using a generic ternary tree, dietary constraints, traversal queries, and reversible snapshots.

Java · Data structures · JSON

  • DFS + BFS
  • JSON / snapshots / undo
  • 80+ tests in project notes
Ecological Pyramid Simulator project overview
Project overview. Implementation notes and evidence are detailed below.

01 / Problem

The constraint

Keep parent/child relationships and dietary rules valid as users mutate and restore a tree-based ecosystem model.

02 / Structure

Architecture at a glance

  1. CLI commands
  2. Generic ternary tree + constraint checks
  3. Traversal queries + JSON snapshots

03 / Implementation

Engineering decisions

  1. A generic ternary tree uses bidirectional parent pointers and DFS/BFS traversal.
  2. The constraint engine enforces herbivore, carnivore, and omnivore relationships and checks cycles/orphaned subtrees.
  3. JSON persistence and snapshots support undo/redo and analytical queries.

04 / Evidence

Measurement context

Based on author-supplied project notes. The 80+ test cases and constraint coverage have not been independently verified from public source.

05 / Trade-offs

Limits worth stating

  • A ternary tree is a deliberately constrained model, not a general ecological network.
  • Snapshot-based undo favors straightforward recovery over minimal storage.
  • The simulator models structural rules; it is not a scientific population predictor.