Commits

beyzend  committed 33f82aa Draft

-added missing mob.py service file.

  • Participants
  • Parent commits 75ff3e2

Comments (0)

Files changed (1)

File services/mob.py

+'''
+Created on Sep 22, 2012
+
+@author: gnulinux
+'''
+
+"""
+This class defines a Mob controller class.
+"""
+from pyamf import flex
+from pyamf import amf3
+
+from math import log
+from random import *;
+
+XRANGE=32*32 #there are 32 tiles in the first test map
+YRANGE=32*32
+MEAN_TIME=1.0 / 2.0 #6 seconds mean think time using a exp. distribution random process.
+
+def mob(id):
+    #assume currentPos is a tuple representing a vector2 where in the order is x,y
+    #assume a Poisson variable
+    #return {"id":id, "randtime":-log(1.0 - random.random()) / MEAN_TIME}
+    return [id, -log(1.0 - random()) / MEAN_TIME]