Commit c8dbdb45 authored by Georgios Dagkakis's avatar Georgios Dagkakis

QueueLIFO was deprecated

parent 1d4a885f
......@@ -297,18 +297,7 @@ def createObjects():
objectType=Globals.getClassFromName(objClass)
coreObject=objectType(inputsDict=element)
coreObject.nextIds=getSuccessorList(element['id']) # update the nextIDs list of the machine
elif objClass=='Dream.QueueLIFO':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
successorList=element.get('successorList', 'not found')
capacity=int(element.get('capacity') or 1)
isDummy=bool(int(element.get('isDummy') or 0))
Q=QueueLIFO(id, name, capacity, isDummy)
Q.nextIds=successorList
G.QueueList.append(Q)
G.ObjList.append(Q)
elif objClass=='Dream.Assembly':
A=Assembly(**element)
A.nextIds=getSuccessorList(element['id'])
......
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 15 Feb 2013
@author: George
'''
'''
Models a LIFO queue where entities can wait in order to get into a server
'''
from Queue import Queue
class QueueLIFO(Queue):
#gets an entity from the predecessor
def getEntity(self):
activeObject=self #use this to refer to the current object which receives the Entity
activeEntity=[self.previous[self.predecessorIndex].Res.activeQ[0]] #use this to refer to the Entity that is received
giverObject=self.previous[self.predecessorIndex] #use this to refer to the object that disposes the entity
activeObject.Res.activeQ=activeEntity+activeObject.Res.activeQ #get the entity from the previous object
#and put it in front of the activeQ
giverObject.removeEntity() #remove the entity from the previous object
\ No newline at end of file
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