Update Readme
This commit is contained in:
104
Readme.md
104
Readme.md
@@ -1,26 +1,90 @@
|
||||
# Treender
|
||||
|
||||
# Code style
|
||||
A genetic algorithm visualization tool with interactive evolution simulation.
|
||||
|
||||
## Naming Conventions:
|
||||
- PascalCase:
|
||||
- Functions
|
||||
- Class names
|
||||
- Struct names
|
||||
## Overview
|
||||
|
||||
- camelCase:
|
||||
- Class attributes
|
||||
- Class methods
|
||||
- Struct attributes
|
||||
- Variables
|
||||
Treender is a C++ application that simulates genetic algorithms through an interactive visual interface. Users can observe and influence the evolution of digital organisms represented as visual patterns.
|
||||
|
||||
## Class Structure:
|
||||
## Features
|
||||
|
||||
- Header (.h) Files:
|
||||
- Declare public methods and attributes first, followed by private members.
|
||||
- Implementation (.cpp) Files:
|
||||
- Implement methods in the same order as declared in the corresponding header file.
|
||||
- **Interactive Evolution**: Like/dislike organisms to guide evolution
|
||||
- **Genetic Algorithm**: DNA-based reproduction with mutation
|
||||
- **Visual Representation**: Organisms displayed as colorful patterns
|
||||
- **Client-Server Architecture**: Separate app and server components
|
||||
- **Cross-Platform**: Supports Web, Android, and Desktop platforms
|
||||
|
||||
## Include order
|
||||
- Std
|
||||
- local ( form inc dir )
|
||||
- external raylib
|
||||
## Architecture
|
||||
|
||||
```
|
||||
Treender
|
||||
├── app/ # Main application (Raylib + Dear ImGui)
|
||||
├── server/ # TCP server for data management
|
||||
├── shared/ # Shared code (DNA logic, networking)
|
||||
├── external/ # Third-party libraries
|
||||
└── data.db # SQLite database
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
### Application
|
||||
- **Main Entry**: `app/src/main.cpp`
|
||||
- **Core Class**: `App` class handles rendering, input, and evolution logic
|
||||
- **Visualization**: Uses Raylib for graphics and Dear ImGui for UI
|
||||
|
||||
### Server
|
||||
- **TCP Server**: Handles client connections and data persistence
|
||||
- **Database**: SQLite for storing organism data and user preferences
|
||||
- **Block Management**: Tracks warnings and blocked organisms
|
||||
|
||||
### Shared Library
|
||||
- **DNA System**: Genetic algorithm implementation (`Dna.cpp`)
|
||||
- **Networking**: TCP socket communication
|
||||
- **Data Structures**: Shared between app and server
|
||||
|
||||
## Building
|
||||
|
||||
### Prerequisites
|
||||
- CMake 3.10+
|
||||
- C++17 compiler
|
||||
- Raylib
|
||||
- Dear ImGui
|
||||
- SQLite3
|
||||
|
||||
### Build Instructions
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
## Running
|
||||
|
||||
1. Start the server:
|
||||
```bash
|
||||
./build/server
|
||||
```
|
||||
|
||||
2. Run the application:
|
||||
```bash
|
||||
./build/app
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
- **Like/Disike**: Click on organisms to influence evolution
|
||||
- **Rotation**: Drag to rotate the view
|
||||
- **Statistics**: View similarity scores and generation information
|
||||
|
||||
## Database
|
||||
|
||||
The application uses SQLite database (`data.db`) to store:
|
||||
- Organism DNA data
|
||||
- User preferences
|
||||
- Blocked/warned organisms
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||
|
||||
Reference in New Issue
Block a user