-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jparisu <[email protected]>
- Loading branch information
Showing
16 changed files
with
330 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _elements: | ||
|
||
######## | ||
Elements | ||
######## | ||
|
||
.. toctree:: | ||
:caption: Project | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
terrain | ||
measure | ||
generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _elements_generation: | ||
|
||
################ | ||
Generate Terrain | ||
################ | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _elements_measure: | ||
|
||
###################### | ||
Path and Measure tools | ||
###################### | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _elements_terrain: | ||
|
||
####### | ||
Terrain | ||
####### | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. _tldr: | ||
|
||
##### | ||
TL;DR | ||
##### | ||
|
||
================ | ||
Project Overview | ||
================ | ||
|
||
This project helps you to generate 2D terrains, that are matrix of integers, with a point of origin and a point of destination. | ||
Over these terrains you have several features: | ||
|
||
- You can print it in the console | ||
- You can plot it in a matplotlib 2D plot | ||
- You can plot it in 3D with different angles | ||
- **You can check the total path of a given path** | ||
- You can even draw the paths in the plots previously mentioned | ||
|
||
|
||
============ | ||
Installation | ||
============ | ||
|
||
Just use the following command in your notebook: | ||
|
||
.. code-block:: py | ||
!pip install git+https://github.com/jparisu/sIArena.git | ||
Check the :ref:`installation guide <installation>` for more details. | ||
|
||
|
||
========================= | ||
How to generate a terrain | ||
========================= | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO | ||
|
||
|
||
===================================== | ||
How to write a path finding algorithm | ||
===================================== | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _tutorial: | ||
|
||
######## | ||
Tutorial | ||
######## | ||
|
||
.. warning:: | ||
|
||
Coming soon. | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
from sIArena.terrain.Terrain import Coordinate, Terrain | ||
from sIArena.terrain.generator.Generator import TerrainGenerator | ||
from sIArena.terrain.generator.PernilGenerator import PernilGenerator | ||
from sIArena.terrain.generator.FocusedGenerator import FocusedGenerator | ||
|
||
|
||
def generate_random_terrain( | ||
generator_ctor: TerrainGenerator, | ||
n: int, | ||
m: int, | ||
min_height: int = 0, | ||
max_height: int = 99, | ||
min_step: int = 1, | ||
abruptness: float = 0.2, | ||
seed: int = None, | ||
origin: Coordinate = None, | ||
destination: Coordinate = None | ||
) -> Terrain: | ||
return generator_ctor().generate_random_terrain( | ||
n=n, | ||
m=m, | ||
min_height=min_height, | ||
max_height=max_height, | ||
min_step=min_step, | ||
abruptness=abruptness, | ||
seed=seed, | ||
origin=origin, | ||
destination=destination | ||
) |
Oops, something went wrong.