PTON Project : City Generator
Marius PON et Tom THIL, EPITA Promo 2023
This projects consists in a medieval city generator in python. The generated city depends on attributes as the number of population and its density.
Features
- Generate a medieval city depending on the number of population and the density of the population
- It is possible to generate or not a castle, a wall and a lake in the city
- The result is stored in a .json file
- The user has to possibility to use a city viewer
How to use
Instantiate a 'City' object
This project can be executed with your Pycharm IDE. You have to run the city.py file, located in the src/ repository.
A city object is instanciated as follows :
city = City(population, density, has_walls, has_castle, has_lake)
A City object has already been created in city.py with values giving good results. You can custom the generated cities by replacing them by your own values.
There is a last 'seed' parameter, none as default. 2 cities generated with the same parameters and the same seeds will be identical.
Generating a .json file
You can generate a .json file for your 'city' object as follows :
tools.json(city, 'path/to/your/file/.json')
Use the city viewer
To use the city viewer, you have to run run viewer.py. There is a view function taking as parameter a .json file corresponding to a generated city. By default, the fonction takes tmp/city.json as argument.
Documentation
A documentation has already been generated (in docs/_build/html/tml/index.html).
However, if you want to generate it again for some reason, you must run the command make html in the docs folder.
Metadata
Release files for pton-pgk 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PTON_pgk-0.1.2.tar.gz | 1.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PTON_pgk-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.8 MB
Release files / PTON_pgk-0.1.2.tar.gz
| Download URL | PTON_pgk-0.1.2.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d81baa0f531e402d6553a6c398144d3a804a2f6f2d5059c1d0c29fbe523e108b
|
|
BLAKE2b-256 checksum How to use checksums |
1f3c59d7319bcf322926e34b743c26403409e86cd196b3514014c606d3e6bac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Windows/10
|
Release files / PTON_pgk-0.1.2-py3-none-any.whl
| Download URL | PTON_pgk-0.1.2-py3-none-any.whl |
|---|---|
| Size | 1.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15a74081b862aa93bfae6a3449d1a013f7740f8d73adbda6555168993967341f
|
|
BLAKE2b-256 checksum How to use checksums |
5926de8f002afcbee087cfbc8ba095074280f48a01ac26a9bcdd71b75c5003a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Windows/10
|