CCR/python/README.md

69 lines
1.8 KiB
Markdown

# CCR Python Simulations
## 🥖 Bakery
A computational model of decentralized bread production/distribution commune (type 1) inspired by Project Cybersyn.
Key Features
- Decentralized Voting System with consensus-based production decisions
- Resource Cybernetics (Real-time flour/energy tracking)
- Variable distribution priority
- Community Trust Metrics : Feedback-loop driven scores that influence donations
### ⚙️ Installation
```bash
git clone https://github.com/your-org/CCR.git
cd CCR/python
# Using Nix (recommended):
`nix develop`
# Manual setup:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
### 🚦 Running the Simulation
```bash
python run.py
# Expected terminal output:
Day 0: Produced 94 loaves (Consensus: 3/4)
Day 2: Distributed 82 loaves
Community trust: 58.3 → 64.1
```
### 📁 Code Structure
```
python/
├── classes.py # Core models (Bakery, Member)
├── simulation.py # Main simulation loop
├── run.py # Visualization script using matplotlib
├── tests/ # Unit tests (upcoming)
└── analysis/ # Data processing notebooks (upcoming)
```
### 🌱 Future Development
-[ ] Add crisis scenarios (resource shortages)
-[ ] Implement skill-based task allocation
-[ ] Connect to real data
-[ ] Develop web interface
-[ ] Generalize to other type 1 communes
### 📊 Example Output
|Day | Bread Stock | Trust Score | Production Runs
|----|------------|-------------|-----------------
|0 | 94 | 50.0 | 1
|3 | 132 | 63.4 | 2
|7 | 87 | 71.2 | 1
### 📝 Contributing
1. Fork the repository
2. Create feature branch:
```bash
git checkout -b feature/new-voting-system
```
3. Submit pull request with:
- Code changes
- Updated tests
- Documentation additions