Commit 72a309a8 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

calculation of the processing time for the machine tranfered in another method...

calculation of the processing time for the machine tranfered in another method (calculateProcessingTime). This method should be overriden for machines that read the calculation time from the Entity attribute
parent 07569fd7
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>. # along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# =========================================================================== # ===========================================================================
''' '''
Created on 21 May 2013 Created on 21 May 2013
......
...@@ -121,7 +121,7 @@ class Machine(CoreObject): ...@@ -121,7 +121,7 @@ class Machine(CoreObject):
self.timeLastEntityEntered=now() #this holds the last time that an entity got into Machine self.timeLastEntityEntered=now() #this holds the last time that an entity got into Machine
self.nameLastEntityEntered=self.currentEntity.name #this holds the name of the last entity that got into Machine self.nameLastEntityEntered=self.currentEntity.name #this holds the name of the last entity that got into Machine
timeEntered=now() timeEntered=now()
tinMStart=self.rng.generateNumber() #get the processing time tinMStart=self.calculateProcessingTime() #get the processing time
tinM=tinMStart tinM=tinMStart
self.processingTimeOfCurrentEntity=tinMStart self.processingTimeOfCurrentEntity=tinMStart
interruption=False interruption=False
...@@ -191,6 +191,9 @@ class Machine(CoreObject): ...@@ -191,6 +191,9 @@ class Machine(CoreObject):
def checkIfMachineIsUp(self): def checkIfMachineIsUp(self):
return self.Up return self.Up
def calculateProcessingTime(self):
return self.rng.generateNumber()
#checks if the Machine can accept an entity #checks if the Machine can accept an entity
#it checks also who called it and returns TRUE only to the predecessor that will give the entity. #it checks also who called it and returns TRUE only to the predecessor that will give the entity.
def canAccept(self, callerObject=None): def canAccept(self, callerObject=None):
......
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