Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PTON_pgk-0.1.2.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PTON_pgk-0.1.2-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file PTON_pgk-0.1.2.tar.gz.

File metadata

  • Download URL: PTON_pgk-0.1.2.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

Hashes for PTON_pgk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d81baa0f531e402d6553a6c398144d3a804a2f6f2d5059c1d0c29fbe523e108b
MD5 33dffc9dd80c2c792b03416f577baad7
BLAKE2b-256 1f3c59d7319bcf322926e34b743c26403409e86cd196b3514014c606d3e6bac0

See more details on using hashes here.

File details

Details for the file PTON_pgk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: PTON_pgk-0.1.2-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

Hashes for PTON_pgk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15a74081b862aa93bfae6a3449d1a013f7740f8d73adbda6555168993967341f
MD5 7cb8fe857733ac625dc70ee99e67cce4
BLAKE2b-256 5926de8f002afcbee087cfbc8ba095074280f48a01ac26a9bcdd71b75c5003a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page