Commit 469621a6 authored by Ahmad Reza's avatar Ahmad Reza
Browse files

For the sake of clearity the name of some methods in world.py world have been changed.

parent 37d25ae3
......@@ -40,6 +40,7 @@ class Matter:
elif alpha > 1:
self.__alpha = 1
self.touch()
def get_alpha(self):
"""
Returns the alpha value of the particle
......
......@@ -70,17 +70,6 @@ class Tile(matter.Matter):
self.set_alpha(1)
self.touch()
def update_tile_coords(self, tile, new_coords):
"""
Upadtes the tiles new coordinates
:param tile:
:param new_coords: new coorindation points
:return: None
"""
tile.coords = new_coords
self.tile_map_coords[tile.coords] = tile
def touch(self):
"""Tells the visualization that something has been modified and that it shoud changed it"""
self.modified = True
......
......@@ -76,7 +76,7 @@ class World:
particle_csv.write_particle(particle)
particle_csv.csv_file.close()
def success_termination(self):
def set_successful_end(self):
self.csv_round.success()
self.set_end()
......@@ -104,7 +104,7 @@ class World:
"""
return self.config_data.max_round
def set_end(self):
def set_unsuccessful_end(self):
"""
Allows to terminate before the max round is reached
"""
......@@ -116,13 +116,13 @@ class World:
"""
return self.__end
def inc_round_counter(self):
def inc_round_counter_by(self, number=1):
"""
Increases the the round counter by
:return:
"""
self.__round_counter += 1
self.__round_counter += number
def get_solution(self):
"""
......
......@@ -89,7 +89,7 @@ def run_solution(swarm_sim_world):
mod = importlib.import_module('solution.' + swarm_sim_world.config_data.solution)
mod.solution(swarm_sim_world)
swarm_sim_world.csv_round.next_line(swarm_sim_world.get_actual_round())
swarm_sim_world.inc_round_counter()
swarm_sim_world.inc_round_counter_by(number=1)
def generate_data(config_data, swarm_sim_world):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment