Commit f77326a3278b5de330be57afa85983c4412ff692

Authored by Anthex
1 parent 278b1a4f

slight improvement on main() usage

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
1 from structure import RSSVector, Location, Cell, newCell, KNeighbors, resolve_barycenter, MarkovModel, MarkovValue 1 from structure import RSSVector, Location, Cell, newCell, KNeighbors, resolve_barycenter, MarkovModel, MarkovValue
2 -import sys  
3 from random import random 2 from random import random
4 from math import floor 3 from math import floor
5 4
@@ -24,7 +23,7 @@ Tf[2][0] = newCell(-17,-50,-44,-33,10,2) @@ -24,7 +23,7 @@ Tf[2][0] = newCell(-17,-50,-44,-33,10,2)
24 Tf[2][1] = newCell(-27,-28,-32,-45,10,6) 23 Tf[2][1] = newCell(-27,-28,-32,-45,10,6)
25 Tf[2][2] = newCell(-30,-20,-60,-40,10,10) 24 Tf[2][2] = newCell(-30,-20,-60,-40,10,10)
26 25
27 -def main(args): 26 +def main():
28 #### K neighbours #### 27 #### K neighbours ####
29 print("\nk neighbors of test sample : ") 28 print("\nk neighbors of test sample : ")
30 neighborsCells = KNeighbors(Tf, testSample) 29 neighborsCells = KNeighbors(Tf, testSample)
@@ -69,4 +68,6 @@ def main(args): @@ -69,4 +68,6 @@ def main(args):
69 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") 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 else: 69 else:
71 print("invalid ID") 70 print("invalid ID")
72 -main(sys.argv)  
73 \ No newline at end of file 71 \ No newline at end of file
  72 +
  73 +if __name__ == '__main__':
  74 + main()
74 \ No newline at end of file 75 \ No newline at end of file