Commit e50203c7 authored by Georgios Dagkakis's avatar Georgios Dagkakis

example written in documentation and minor amendmens on code

parent ee20eacb
No preview for this file type
No preview for this file type
...@@ -36,14 +36,12 @@ class InternalProcess(Machine): ...@@ -36,14 +36,12 @@ class InternalProcess(Machine):
# if there is one other machine processing return False # if there is one other machine processing return False
if object.isProcessing: if object.isProcessing:
return False return False
# # if there is one other machine that got signal to dispose return false
# if object.canDispose.triggered:
# return False
return Machine.haveToDispose(self, callerObject) return Machine.haveToDispose(self, callerObject)
# check if all the machines got empty and send signal to QB # check if all the machines got empty and send signal to QB
def removeEntity(self,entity=None): def removeEntity(self,entity=None):
activeEntity=Machine.removeEntity(self, entity) # run the default method # run the default method
activeEntity=Machine.removeEntity(self, entity)
# count the number of parts in the server. # count the number of parts in the server.
# If it is empty have one internal queue to signal the queue before the compound object # If it is empty have one internal queue to signal the queue before the compound object
if not self.countInternalParts(): if not self.countInternalParts():
...@@ -54,8 +52,7 @@ class InternalProcess(Machine): ...@@ -54,8 +52,7 @@ class InternalProcess(Machine):
def countInternalParts(self): def countInternalParts(self):
totalParts=0 totalParts=0
for object in G.InternalProcessList+G.InternalQueueList: for object in G.InternalProcessList+G.InternalQueueList:
if len(object. getActiveObjectQueue()): totalParts+=len(object.getActiveObjectQueue())
totalParts+=1
return totalParts return totalParts
QB=Queue('QB','QueueBefore', capacity=float("inf")) QB=Queue('QB','QueueBefore', capacity=float("inf"))
...@@ -96,7 +93,9 @@ def main(test=0): ...@@ -96,7 +93,9 @@ def main(test=0):
#output the trace of the simulation #output the trace of the simulation
ExcelHandler.outputTrace('CompoundMachine') ExcelHandler.outputTrace('CompoundMachine')
print 1 print G.maxSimTime
if test:
return G.maxSimTime
if __name__ == '__main__': if __name__ == '__main__':
main() main()
......
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