# visheshv/settlers_of_galaxy architecture

> Architecture diagram of the GitHub repository visheshv/settlers_of_galaxy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/visheshv/settlers_of_galaxy
- Repository: https://github.com/visheshv/settlers_of_galaxy

## Overview

This MATLAB repository plans a GTOC X settlement spread over 90 million years. The documented user workflow is to run preprocessing and then strategy10. The tree names additional search, transfer, dynamics, and analysis modules, but no source excerpts were provided, so their call relationships and the role of the data files cannot be verified. Those components are shown without inferred connections.

Main entry points: [`preprocess.m`](https://github.com/visheshv/settlers_of_galaxy/blob/master/preprocess.m) (Preprocessing), [`strategy10.m`](https://github.com/visheshv/settlers_of_galaxy/blob/master/strategy10.m) (Strategy 10)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Planning workflow"]
  node_preprocess["Preprocessing<br/>[preprocess.m]"]
  node_strategy10["Strategy 10<br/>[strategy10.m]"]
  node_main["Main script<br/>[main.m]"]
end

subgraph group_search["Target search"]
  node_strategy8["Strategy 8<br/>[strategy8.m]"]
  node_find_n_best["N-best search"]
  node_find_grid["Grid search"]
  node_closest_grid["Closest grid star"]
  node_closest_momentum_ss["Closest momentum star"]
  node_closest_momentum_ms["Mothership momentum search"]
  node_target_stars["Target generation"]
end

subgraph group_transfer["Transfer and dynamics"]
  node_shooting["Shooting<br/>[shooting.m]"]
  node_shooting_solver["Shooting solver<br/>[shooting_solver.m]"]
  node_single_hop["Single-star targeting"]
  node_optimal_hop["Optimal shooter hop"]
  node_mothership_transfer["Mothership transfer"]
  node_fast_transfer["Fast ship transfer"]
  node_intercepts["Intercept solutions"]
  node_dynamics["Dynamics<br/>[dynamics.m]"]
  node_state_dynamics["State dynamics<br/>[state_dynamics.m]"]
  node_events["State events<br/>[statesEvents.m]"]
  node_f_eval["F evaluation<br/>[f_eval.m]"]
  node_g_eval["G evaluation<br/>[g_eval.m]"]
  node_jacobian["Jacobian<br/>[jacobianreturn.m]"]
  node_jacobian_derivation["Jacobian derivation"]
  node_angle_sign["Angle sign<br/>[angle_sign.m]"]
  node_atan3["Three-argument atan<br/>[atan3.m]"]
end

subgraph group_analysis["Analysis and constraints"]
  node_mothership_analysis["Mothership analysis"]
  node_mothership_mc["Mothership Monte Carlo"]
  node_multi_intercept["Multi-intercept check"]
  node_multi_intercept1["Multi-intercept check 1"]
  node_multi_intercept2["Multi-intercept check 2"]
  node_multiple_hop_objective["Multiple-hop objective"]
  node_multiple_hop_constraint["Multiple-hop constraints"]
end

node_user(("Planner"))

node_user -->|"runs first"| node_preprocess
node_preprocess -->|"run next"| node_strategy10

click node_preprocess "https://github.com/visheshv/settlers_of_galaxy/blob/master/preprocess.m"
click node_strategy10 "https://github.com/visheshv/settlers_of_galaxy/blob/master/strategy10.m"
click node_main "https://github.com/visheshv/settlers_of_galaxy/blob/master/main.m"
click node_strategy8 "https://github.com/visheshv/settlers_of_galaxy/blob/master/strategy8.m"
click node_find_n_best "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_n_best_stars_strategy2.m"
click node_find_grid "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_grid_stars_strategy3.m"
click node_closest_grid "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_grid_star_strategy6.m"
click node_closest_momentum_ss "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_momentum_star_ss_strategy6.m"
click node_closest_momentum_ms "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_momentum_star_mothership_strategy9.m"
click node_target_stars "https://github.com/visheshv/settlers_of_galaxy/blob/master/generate_target_stars.m"
click node_shooting "https://github.com/visheshv/settlers_of_galaxy/blob/master/shooting.m"
click node_shooting_solver "https://github.com/visheshv/settlers_of_galaxy/blob/master/shooting_solver.m"
click node_single_hop "https://github.com/visheshv/settlers_of_galaxy/blob/master/one_star_targeting_mothership.m"
click node_optimal_hop "https://github.com/visheshv/settlers_of_galaxy/blob/master/optimal_shooter_hop_ss_strategy5.m"
click node_mothership_transfer "https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_transfer.m"
click node_fast_transfer "https://github.com/visheshv/settlers_of_galaxy/blob/master/fast_ship_transfer_strategy7.m"
click node_intercepts "https://github.com/visheshv/settlers_of_galaxy/blob/master/find_solution_intercepts_ms.m"
click node_dynamics "https://github.com/visheshv/settlers_of_galaxy/blob/master/dynamics.m"
click node_state_dynamics "https://github.com/visheshv/settlers_of_galaxy/blob/master/state_dynamics.m"
click node_events "https://github.com/visheshv/settlers_of_galaxy/blob/master/statesEvents.m"
click node_f_eval "https://github.com/visheshv/settlers_of_galaxy/blob/master/f_eval.m"
click node_g_eval "https://github.com/visheshv/settlers_of_galaxy/blob/master/g_eval.m"
click node_jacobian "https://github.com/visheshv/settlers_of_galaxy/blob/master/jacobianreturn.m"
click node_jacobian_derivation "https://github.com/visheshv/settlers_of_galaxy/blob/master/jacobian_derivation.m"
click node_angle_sign "https://github.com/visheshv/settlers_of_galaxy/blob/master/angle_sign.m"
click node_atan3 "https://github.com/visheshv/settlers_of_galaxy/blob/master/atan3.m"
click node_mothership_analysis "https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_analysis.m"
click node_mothership_mc "https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_analysis_mc.m"
click node_multi_intercept "https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check.m"
click node_multi_intercept1 "https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check1.m"
click node_multi_intercept2 "https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check2.m"
click node_multiple_hop_objective "https://github.com/visheshv/settlers_of_galaxy/blob/master/obj_fn_multiple_hop.m"
click node_multiple_hop_constraint "https://github.com/visheshv/settlers_of_galaxy/blob/master/nonlcon_multiple_hop.m"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_preprocess,node_strategy10,node_main toneBlue
class node_strategy8,node_find_n_best,node_find_grid,node_closest_grid,node_closest_momentum_ss,node_closest_momentum_ms,node_target_stars toneAmber
class node_shooting,node_shooting_solver,node_single_hop,node_optimal_hop,node_mothership_transfer,node_fast_transfer,node_intercepts,node_dynamics,node_state_dynamics,node_events,node_f_eval,node_g_eval,node_jacobian,node_jacobian_derivation,node_angle_sign,node_atan3 toneMint
class node_mothership_analysis,node_mothership_mc,node_multi_intercept,node_multi_intercept1,node_multi_intercept2,node_multiple_hop_objective,node_multiple_hop_constraint toneRose
class node_user toneIndigo
```

## Components

### Planning workflow

- [Preprocessing](https://github.com/visheshv/settlers_of_galaxy/blob/master/preprocess.m): `preprocess.m`
- [Strategy 10](https://github.com/visheshv/settlers_of_galaxy/blob/master/strategy10.m): `strategy10.m`
- [Main script](https://github.com/visheshv/settlers_of_galaxy/blob/master/main.m): `main.m`

### Target search

- [Strategy 8](https://github.com/visheshv/settlers_of_galaxy/blob/master/strategy8.m): `strategy8.m`
- [N-best search](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_n_best_stars_strategy2.m): `find_n_best_stars_strategy2.m`
- [Grid search](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_grid_stars_strategy3.m): `find_grid_stars_strategy3.m`
- [Closest grid star](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_grid_star_strategy6.m): `find_closest_grid_star_strategy6.m`
- [Closest momentum star](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_momentum_star_ss_strategy6.m): `find_closest_momentum_star_ss_strategy6.m`
- [Mothership momentum search](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_closest_momentum_star_mothership_strategy9.m): `find_closest_momentum_star_mothership_strategy9.m`
- [Target generation](https://github.com/visheshv/settlers_of_galaxy/blob/master/generate_target_stars.m): `generate_target_stars.m`

### Transfer and dynamics

- [Shooting](https://github.com/visheshv/settlers_of_galaxy/blob/master/shooting.m): `shooting.m`
- [Shooting solver](https://github.com/visheshv/settlers_of_galaxy/blob/master/shooting_solver.m): `shooting_solver.m`
- [Single-star targeting](https://github.com/visheshv/settlers_of_galaxy/blob/master/one_star_targeting_mothership.m): `one_star_targeting_mothership.m`
- [Optimal shooter hop](https://github.com/visheshv/settlers_of_galaxy/blob/master/optimal_shooter_hop_ss_strategy5.m): `optimal_shooter_hop_ss_strategy5.m`
- [Mothership transfer](https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_transfer.m): `mothership_transfer.m`
- [Fast ship transfer](https://github.com/visheshv/settlers_of_galaxy/blob/master/fast_ship_transfer_strategy7.m): `fast_ship_transfer_strategy7.m`
- [Intercept solutions](https://github.com/visheshv/settlers_of_galaxy/blob/master/find_solution_intercepts_ms.m): `find_solution_intercepts_ms.m`
- [Dynamics](https://github.com/visheshv/settlers_of_galaxy/blob/master/dynamics.m): `dynamics.m`
- [State dynamics](https://github.com/visheshv/settlers_of_galaxy/blob/master/state_dynamics.m): `state_dynamics.m`
- [State events](https://github.com/visheshv/settlers_of_galaxy/blob/master/statesEvents.m): `statesEvents.m`
- [F evaluation](https://github.com/visheshv/settlers_of_galaxy/blob/master/f_eval.m): `f_eval.m`
- [G evaluation](https://github.com/visheshv/settlers_of_galaxy/blob/master/g_eval.m): `g_eval.m`
- [Jacobian](https://github.com/visheshv/settlers_of_galaxy/blob/master/jacobianreturn.m): `jacobianreturn.m`
- [Jacobian derivation](https://github.com/visheshv/settlers_of_galaxy/blob/master/jacobian_derivation.m): `jacobian_derivation.m`
- [Angle sign](https://github.com/visheshv/settlers_of_galaxy/blob/master/angle_sign.m): `angle_sign.m`
- [Three-argument atan](https://github.com/visheshv/settlers_of_galaxy/blob/master/atan3.m): `atan3.m`

### Analysis and constraints

- [Mothership analysis](https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_analysis.m): `mothership_analysis.m`
- [Mothership Monte Carlo](https://github.com/visheshv/settlers_of_galaxy/blob/master/mothership_analysis_mc.m): `mothership_analysis_mc.m`
- [Multi-intercept check](https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check.m): `multi_intercept_check.m`
- [Multi-intercept check 1](https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check1.m): `multi_intercept_check1.m`
- [Multi-intercept check 2](https://github.com/visheshv/settlers_of_galaxy/blob/master/multi_intercept_check2.m): `multi_intercept_check2.m`
- [Multiple-hop objective](https://github.com/visheshv/settlers_of_galaxy/blob/master/obj_fn_multiple_hop.m): `obj_fn_multiple_hop.m`
- [Multiple-hop constraints](https://github.com/visheshv/settlers_of_galaxy/blob/master/nonlcon_multiple_hop.m): `nonlcon_multiple_hop.m`

### Other components

- **Planner**

## Connections

- Planner → Preprocessing: runs first (evidence: `README.md`)
- Preprocessing → Strategy 10: run next (evidence: `README.md`)
