Commit Graph

29 Commits

Author SHA1 Message Date
ff5742b08c Update 'point.py'
Some checks failed
continuous-integration/drone/push Build is failing
Add __eq__ operator to class point
2020-03-11 12:50:22 +01:00
3bfdab784b Update 'point.py'
All checks were successful
continuous-integration/drone/push Build is passing
Random coordinates are now float values.
2020-03-11 12:35:01 +01:00
0d30b0b123 Update README.md
All checks were successful
continuous-integration/drone/push Build is passing
Added drone build status.
2020-03-11 09:07:09 +01:00
916cd60424 Update 'requirements.txt'
All checks were successful
continuous-integration/drone/push Build is passing
2020-03-10 13:45:58 +01:00
e0a76612f4 Add test_setup.py
All checks were successful
continuous-integration/drone/push Build is passing
This file makes sure that the test files in test/ can import the
submodules.

To run a single test file run:

pytest test_setup.py test/test_module.py
2020-03-10 12:41:48 +01:00
a94c5f9840 Move tests to a subdirectory
Some checks failed
continuous-integration/drone/push Build is failing
2020-03-10 12:33:00 +01:00
76aff48b34 Add test_point.py
All checks were successful
continuous-integration/drone/push Build is passing
2020-03-10 12:10:52 +01:00
9627ae1309 Add requirements.txt
Some checks failed
continuous-integration/drone/push Build is failing
2020-03-10 12:05:40 +01:00
afb8ad24a3 Add drone ci configuration
Some checks failed
continuous-integration/drone/push Build was killed
2020-03-10 12:01:11 +01:00
b0d83a9116 Update algorithm.py
Methods str of point and linesegment are now operators
2020-03-10 08:38:33 +01:00
6bf4368c60 Update linesegment.py
Make method str() to an overwritten operator __str__()
2020-03-10 08:36:47 +01:00
e3aad40d1d Update point.py
Remove type checking and make an overwritten operator from method str()
2020-03-10 08:35:45 +01:00
048f6a08e6 Add function intersection for line segments 2020-03-09 20:15:56 +01:00
5fc13e0e07 Fix method set_y 2020-03-09 20:14:39 +01:00
70bb80e445 FIx comments 2020-03-09 19:18:07 +01:00
978bb9b789 Add function to generate random line segments 2020-03-09 18:51:41 +01:00
c96c1fc8bc Rename sort method for points 2020-03-09 18:43:24 +01:00
2d4ee80b4c Move set_random() out of class
As generating a random Point is mostly not used on an existing object,
the method is now an independent function get_random() instead of a
class method.
2020-03-09 18:42:46 +01:00
f19dcee20b Modify algorithm module to be more common to use
Method exec() is now in base class algorithm and called run().
The algorithm class should now be better to use for various algorithms.
2020-03-09 18:18:52 +01:00
7210a94995 Convert sweep module and class to algorithm
Since an algorithm can use more than one sweep, the sweep class doesn't
fit very good as it is right now. For this reasen it got converted to a
more general class named algorithm, that shall be used as parent for
every individual algorithm. The exact behaviour of the algorithm is
then defined in the child classes.
2020-03-09 17:41:37 +01:00
0065733bcf Add MIT license to the project 2020-03-09 09:47:03 +01:00
Pascal Lais
1a53f7aaa1 Enable unsafe-load-any-extension for pylint 2020-03-09 07:51:13 +01:00
Pascal Lais
d8cc7fc6f9 Add sweep module
The sweep module contains a sweep class and a class for the nearest
neighbor sweep alorithm.
2020-03-09 07:50:28 +01:00
Pascal Lais
4a483b939a Add method str to linesegment
The method str returns the line segment coordinates as string.
2020-03-09 07:49:10 +01:00
Pascal Lais
6f83b57ffb Add sort function and class methods to class Point
The sort function takes a list of Point objects and sorts them either
by their x or y coordinate using merge sort.
Also added a method set_random, that sets the coordinates to random
values and a method str, that returns the coordinates as string.
2020-03-09 07:48:07 +01:00
Pascal Lais
778240a1d3 Add linesegment module
The module defines a LineSegment class that displays a line segment in
two-dimensional coordinate system. It is defined by a start- and an
endpoint. It also contains a method to calculate the length.
2020-03-08 11:00:14 +01:00
Pascal Lais
a14f96ab2a Add point module
The point module defines a Point class, that displays a Point in a
two-dimensional coordinate system. An object of the class contains a x-
and y-coordinate and a setter and getter method for each at this point.
2020-03-08 10:57:40 +01:00
Pascal Lais
5df3f47563 Add code-vorkspace files to .gitignore 2020-03-07 12:00:23 +01:00
87ab6091b3 Initial commit 2020-03-07 08:39:25 +01:00