Commit f77326a3278b5de330be57afa85983c4412ff692
1 parent
278b1a4f
slight improvement on main() usage
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
main.py
1 | 1 | from structure import RSSVector, Location, Cell, newCell, KNeighbors, resolve_barycenter, MarkovModel, MarkovValue |
2 | -import sys | |
3 | 2 | from random import random |
4 | 3 | from math import floor |
5 | 4 | |
... | ... | @@ -24,7 +23,7 @@ Tf[2][0] = newCell(-17,-50,-44,-33,10,2) |
24 | 23 | Tf[2][1] = newCell(-27,-28,-32,-45,10,6) |
25 | 24 | Tf[2][2] = newCell(-30,-20,-60,-40,10,10) |
26 | 25 | |
27 | -def main(args): | |
26 | +def main(): | |
28 | 27 | #### K neighbours #### |
29 | 28 | print("\nk neighbors of test sample : ") |
30 | 29 | neighborsCells = KNeighbors(Tf, testSample) |
... | ... | @@ -69,4 +68,6 @@ def main(args): |
69 | 68 | print("\r\ncurrent cell is \033[0;32;40m#" + str(MM.previousCell) + "\033[1;37;40m , most likely next cell is \033[1;32;40m#" + str(MM.getMostLikely()) + "\033[1;37;40m which is located at \033[1;32;40m" + str(Location.fromID(MM.getMostLikely()).toString()) + "\033[1;37;40m") |
70 | 69 | else: |
71 | 70 | print("invalid ID") |
72 | -main(sys.argv) | |
73 | 71 | \ No newline at end of file |
72 | + | |
73 | +if __name__ == '__main__': | |
74 | + main() | |
74 | 75 | \ No newline at end of file | ... | ... |