https://github.com/klus3kk/microsociety
An object-oriented project that represents the simulator of the society with dynamically changing events.
https://github.com/klus3kk/microsociety
2d ai cpp deep-q-learning machine-learning oop python reinforcement-learning sfml simulation tensorflow
Last synced: 7 days ago
JSON representation
An object-oriented project that represents the simulator of the society with dynamically changing events.
- Host: GitHub
- URL: https://github.com/klus3kk/microsociety
- Owner: Klus3kk
- License: mit
- Created: 2024-10-04T08:21:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-23T21:12:59.000Z (3 months ago)
- Last Synced: 2026-01-24T10:16:25.679Z (3 months ago)
- Topics: 2d, ai, cpp, deep-q-learning, machine-learning, oop, python, reinforcement-learning, sfml, simulation, tensorflow
- Language: C++
- Homepage:
- Size: 1.32 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MicroSociety

## Description
MicroSociety is an object-oriented simulation project that models a society with AI-driven behaviors, events and interactions.
The project uses AI to create a lively environment with support for both traditional Q-learning and TensorFlow-based deep learning.
## Platform-specific Setup
### Linux/macOS (Full TensorFlow Support)
**Build with TensorFlow:**
```bash
mkdir build && cd build
cmake ..
make -j$(nproc)
./bin/MicroSociety
```
**Build without TensorFlow:**
```bash
mkdir build && cd build
cmake .. -DUSE_TENSORFLOW=OFF
make -j$(nproc)
./bin/MicroSociety
```
### Windows (Q-Learning Only)
**Note:** Windows automatically disables TensorFlow due to incomplete C API headers. The simulation can use Q-learning instead.
1. Open **Developer Command Prompt** for Visual Studio
2. Build the project:
```cmd
mkdir build && cd build
cmake -G "NMake Makefiles" ..
nmake
bin\MicroSociety.exe
```
### Docker Setup
**For Windows users**
```bash
docker build -t microsociety .
docker run -it microsociety
```
**With X11 forwarding (Linux/macOS):**
```bash
xhost +local:docker
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
microsociety
```
## AI Modes
The simulation offers two AI modes selectable at startup:
1. **Reinforcement learning C++**: NPCs use Q-learning algorithms
2. **Deep Q-learning TensorFlow**: NPCs use neural networks