Medieval City
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PTON_pgk-0.1.1.tar.gz.
File metadata
- Download URL: PTON_pgk-0.1.1.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.10 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fce0235b28bb4a8125c949885c45ea53977f6d3a659b04a9318397aa8e0ee414
|
|
| MD5 |
fe4bb1de6f7650e840ffda71251244b0
|
|
| BLAKE2b-256 |
2a3275ab5dddb1f0175c60d189b2c03039a357a888e6b5e24d9aa79bb3ad9668
|
File details
Details for the file PTON_pgk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: PTON_pgk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.10 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1190627047f670860711d6ffe6bd1636f220a01acb59370547649e1c336be28a
|
|
| MD5 |
94e44d0922f599f069424bb7f7162112
|
|
| BLAKE2b-256 |
71bfbfec7a851a66bf29e7c7a34db26172d5a8c303d8e1935db9362edc8d5fe6
|