예제 #1
0
#!/usr/bin/env python

import Rat

# 29.97 is apparently only an approximation
DEFAULT_FRAME_RATE = Rat.rat(30 * 1000, 1001)


def time_to_frame(fnum, rate=DEFAULT_FRAME_RATE):
    return int(fnum * rate)
 def spawn_rat(self):
     x, y = self.gen_rat_starting_pos()
     rat = Rat(self.size, x, y, self.topological_map, self.rat_lifetime, self.initial_rat_energy)
     self.location_matrix[x][y].append(rat)
     self.plot_matrix[x, y] = self.rat_color_index
     self.rat_list.append(rat)
예제 #3
0
def ratio_for_number(num_inputs, num_outputs):
    return Rat.rat(num_outputs, num_inputs)