You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add initial project structure and implement core functionality
- Create issue templates for bug reports and feature requests.
- Add a pull request template with a checklist.
- Set up CI workflow with GitHub Actions for testing across multiple Python versions.
- Configure pre-commit hooks with Ruff for linting and formatting.
- Document project changes in a changelog.
- Establish a code of conduct and contributing guidelines.
- Define a security policy for vulnerability reporting.
- Set up project metadata in pyproject.toml, including dependencies and scripts.
- Implement the Space Debris Avoidance environment using Gymnasium.
- Develop CLI for training and evaluating reinforcement learning models.
- Create a self-healing service simulator with anomaly detection.
- Add smoke tests for CLI help and package imports.
Copy file name to clipboardExpand all lines: README.md
+65-27Lines changed: 65 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,49 @@
1
-
# Space-Debris-RL-Python-Script-
2
-
Reinforcement Learning enables satellites to learn optimal maneuvers by trial and error, receiving rewards for avoiding collisions and penalties for risky moves. Applied to constellations like Starlink, AI can minimize fuel use while safely dodging space debris in real time.
1
+
# Space Debris RL
3
2
4
-
## RL demo: space debris collision avoidance
3
+
Reinforcement Learning enables satellites to learn optimal maneuvers by trial and error, receiving rewards for avoiding collisions and penalties for risky moves. This repo packages two demos as an installable Python project:
5
4
6
-
The main RL demo is implemented in `space_debris_rl.py`. It defines a custom (Gym/Gymnasium) environment and trains a PPO agent (Stable-Baselines3) to reach a goal while avoiding moving debris.
5
+
-**RL demo:** 2D space-debris collision avoidance with PPO
Note: `torch`/`stable-baselines3` wheels may not be available for very new Python versions yet. If installation fails, try Python 3.10–3.12.
12
+
Windows (PowerShell):
13
13
14
-
**Run**
14
+
python -m venv .venv
15
+
.\.venv\Scripts\Activate.ps1
15
16
16
-
python space_debris_rl.py
17
+
### 2) Install
17
18
18
-
### What happens
19
+
python -m pip install --upgrade pip
20
+
pip install -e ".[rl]"
19
21
20
-
- The agent is trained for **100,000** time steps (this may take a few minutes on a CPU).
21
-
- After training, **five evaluation episodes** are shown in a Matplotlib window.
22
-
- Each episode displays the spacecraft (blue dot), debris (red dots), and goal (green star). The agent attempts to reach the goal while avoiding collisions.
22
+
### 3) Run
23
23
24
-
### Customisation
24
+
space-debris-rl run
25
25
26
-
- Number of debris: change `self.num_debris` in the environment.
27
-
- Thrust strength: adjust `self.thrust`.
28
-
- Goal position: modify `self.goal_pos`.
29
-
- Training duration: increase `total_timesteps` in `train()` / `model.learn()` for better performance.
30
-
- RL algorithm: replace PPO with DQN, A2C, etc., if desired.
26
+
What happens:
31
27
32
-
This code is intentionally simplified for demonstration. Real-world space debris avoidance would involve 3D dynamics, more precise orbit propagation, sensor noise, and a larger action space.
28
+
- Trains for **100,000** timesteps by default.
29
+
- Evaluates **5 episodes** and renders trajectories in a Matplotlib window.
30
+
31
+
## Training vs evaluation (inference)
32
+
33
+
Train and save a model (Stable-Baselines3 saves `*.zip` automatically):
Out of scope for this sprint: full online learning, deep root-cause analysis, and production integrations (Prometheus/Grafana/PagerDuty) beyond simple adapters.
123
+
124
+
## Development
125
+
126
+
Install dev tooling:
127
+
128
+
pip install -e ".[dev]"
129
+
130
+
Run checks:
131
+
132
+
ruff check .
133
+
ruff format --check .
134
+
pytest
135
+
136
+
Enable pre-commit:
137
+
138
+
pre-commit install
139
+
140
+
## Model artifact storage policy
141
+
142
+
The example trained model is stored as `space_debris_ppo.zip`.
143
+
144
+
For a "product" workflow, it’s usually better to store large artifacts as:
145
+
146
+
- a GitHub Release asset, or
147
+
- Git LFS, or
148
+
- downloaded at runtime (with a checksum).
149
+
150
+
If you distribute a model file, consider publishing a SHA-256 checksum. On Windows:
0 commit comments