# nasa/europa architecture

> Architecture diagram of the GitHub repository nasa/europa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nasa/europa
- Repository: https://github.com/nasa/europa

## Overview

Based on our analysis of the file tree and README, EUROPA is a comprehensive planning, scheduling, and constraint programming framework that is intended to be embedded in a host application. It is built using a modular, layered architecture in mainly C++ (with some Java components, especially for the UI and high-level tooling) and is organized into a set of core components that handle plan representation, automated problem solving, and supportive tool sets.

##### Main Components
- Problem Solver – A module that automatically finds and fixes flaws in the plan database. Look for solver components in directories such as src/PLASMA/Solvers, src/PLASMA/RulesEngine, and src/PLASMA/System.
- Constraint Engine and Resource Management – Additional core services that support the overall planning system; these are visible in modules such as src/PLASMA/ConstraintEngine and src/PLASMA/Resource.
- Domain-Specific Languages – Note the support for modeling via NDDL (a modeling language for planning domains) seen in src/PLASMA/NDDL.

##### Relationships and Interactions
- The Plan Database serves as the central repository, interacting with both the Problem Solver and the UI.
- The Problem Solver pulls data from (and writes updates back to) the Plan Database and works closely with the Constraint Engine, Resources, and Temporal Network modules to enforce consistency and solve planning problems.
- Modules like the Constraint Engine and Temporal Network provide specialized services to the solver and plan database to handle constraint propagation and time-related reasoning.

##### Architectural Patterns and Design Principles
- Modular/Plugin Design – EUROPA’s structure (with clearly delineated folders and independent modules like Solvers, RulesEngine, and NDDL) allows customization, extension, and substitution of components.
- Separation of Concerns – Every module has a clear responsibility (e.g., plan storage vs. solving flaws vs. constraint propagation), ensuring that interactions are clearly defined and interfaces are respected.

##### Relevant Technologies, Frameworks, or Libraries
- Build System: CMake is used for compiling both C++ and Java parts (see CMakeLists.txt files in various directories).
- Language and Libraries: C++ for core functionality; Java for UI components, including dependencies like JFreeChart, jcommon, and Beanshell integrated in src/Java/JavaUI.
- Testing and Automation: Tools like JUnit and Ant (files in ext/junit and ext/ant) help support testing; various build scripts (Batch files, build.xml, makerules.mk) suggest an automated build and continuous integration environment (evidenced by Travis CI and Coveralls badges).
- Domain Modeling: The NDDL language is used for planning problem description, visible across many example directories and within the src/PLASMA/NDDL structure.

##### Specific Elements
– Data flow from UI → Solver, and Solver → Plan Database.
– Dependency relationships like “Constraint Engine” → “Solver”.
– Integration of external libraries or services as additional notes.
- Annotations: Provide notes for key processes like automated reasoning, propagation, and problem solving.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Engine Components"
        PD["Plan Database"]:::core
        PS["Problem Solver"]:::core
        CE["Constraint Engine"]:::core
        TM["Temporal Network"]:::core
        RM["Resource Manager"]:::core
        ND["NDDL Interpreter"]:::core
    end

    subgraph "Presentation Layer"
        UI["Tool Box / UI"]:::ui
    end

    %% Interactions between UI and Plan Database
    UI -->|"sendsQueries"| PD
    PD -->|"respondsData"| UI

    %% Interactions between Problem Solver and Plan Database
    PS -->|"updatesPlan"| PD
    PD -->|"providesPlan"| PS

    %% Interactions from Specialized Modules to Problem Solver
    CE -->|"constraintInfo"| PS
    TM -->|"temporalData"| PS
    RM -->|"resourceInfo"| PS

    %% Domain Modeling feeding into core components
    ND -->|"domainModels"| PS
    ND -->|"domainModels"| PD

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef ui fill:#90EE90,stroke:#000,stroke-width:2px;

    %% Click Events
    click PD "https://github.com/nasa/europa/tree/master/src/PLASMA/PlanDatabase"
    click PS "https://github.com/nasa/europa/tree/master/src/PLASMA/Solvers"
    click CE "https://github.com/nasa/europa/tree/master/src/PLASMA/ConstraintEngine"
    click TM "https://github.com/nasa/europa/tree/master/src/PLASMA/TemporalNetwork"
    click RM "https://github.com/nasa/europa/tree/master/src/PLASMA/Resource"
    click ND "https://github.com/nasa/europa/tree/master/src/PLASMA/NDDL"
    click UI "https://github.com/nasa/europa/tree/master/src/Java/JavaUI"
```
