当前位置: 首页>>代码示例>>Python>>正文


Python CoreObject.CoreObject类代码示例

本文整理汇总了Python中CoreObject.CoreObject的典型用法代码示例。如果您正苦于以下问题:Python CoreObject类的具体用法?Python CoreObject怎么用?Python CoreObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CoreObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, id, name, distribution='Fixed', mean=1, stdev=0.1, min=0, max=5):
     CoreObject.__init__(self, id, name)
     self.type="Dismantle"   #String that shows the type of object
     self.distType=distribution          #the distribution that the procTime follows  
     self.rng=RandomNumberGenerator(self, self.distType)
     self.rng.mean=mean
     self.rng.stdev=stdev
     self.rng.min=min
     self.rng.max=max                    
     self.previous=[]        #list with the previous objects in the flow
     self.previousIds=[]     #list with the ids of the previous objects in the flow
     self.nextPart=[]    #list with the next objects that receive parts
     self.nextFrame=[]    #list with the next objects that receive frames 
     self.nextIds=[]     #list with the ids of the next objects in the flow
     self.nextPartIds=[]     #list with the ids of the next objects that receive parts 
     self.nextFrameIds=[]     #list with the ids of the next objects that receive frames 
     self.next=[]
     
     #lists to hold statistics of multiple runs
     self.Waiting=[]
     self.Working=[]
     self.Blockage=[]
     
     # variable that is used for the loading of machines 
     self.exitAssignedToReceiver = False             # by default the objects are not blocked 
开发者ID:mmariani,项目名称:dream,代码行数:25,代码来源:Dismantle.py

示例2: __init__

    def __init__(self, id, name, processingTime=None):
        if not processingTime:
          processingTime = {'distributionType': 'Fixed',
                            'mean': 0,
                            'stdev': 0,
                            'min': 0,
                            }
        if processingTime['distributionType'] == 'Normal' and\
              processingTime.get('max', None) is None:
          processingTime['max'] = processingTime['mean'] + 5 * processingTime['stdev']

        CoreObject.__init__(self, id, name)
        self.type="Assembly"   #String that shows the type of object
        self.rng=RandomNumberGenerator(self, **processingTime)

        self.next=[]        #list with the next objects in the flow
        self.previous=[]     #list with the previous objects in the flow
        self.previousPart=[]    #list with the previous objects that send parts
        self.previousFrame=[]    #list with the previous objects that send frames 
        self.nextIds=[]     #list with the ids of the next objects in the flow
        self.previousIds=[]   #list with the ids of the previous objects in the flow
        # XXX previousFrameIds and previousPartIds are not used
        self.previousPartIds=[]     #list with the ids of the previous objects in the flow that bring parts  
        self.previousFrameIds=[]     #list with the ids of the previous objects in the flow that bring frames
        
        #lists to hold statistics of multiple runs
        self.Waiting=[]
        self.Working=[]
        self.Blockage=[]
        
         # ============================== variable that is used for the loading of machines =============
        self.exitAssignedToReceiver = False             # by default the objects are not blocked 
开发者ID:mmariani,项目名称:dream,代码行数:32,代码来源:Assembly.py

示例3: initialize

 def initialize(self):
     # using the Process __init__ and not the CoreObject __init__
     CoreObject.initialize(self)
     # initialise the internal Queue (type Resource) of the Queue object 
     self.Res=simpy.Resource(self.env, self.capacity)
     # event used by router
     self.loadOperatorAvailable=self.env.event()
开发者ID:cpcdevelop,项目名称:dream,代码行数:7,代码来源:Queue.py

示例4: __init__

    def __init__(self, id='', name='', processingTime=None,**kw):
        
        self.type='Dismantle'
        self.previous=[]        #list with the previous objects in the flow
        self.previousIds=[]     #list with the ids of the previous objects in the flow
        self.nextPart=[]    #list with the next objects that receive parts
        self.nextFrame=[]    #list with the next objects that receive frames 
        self.nextIds=[]     #list with the ids of the next objects in the flow
        self.nextPartIds=[]     #list with the ids of the next objects that receive parts 
        self.nextFrameIds=[]     #list with the ids of the next objects that receive frames 
        self.next=[]
        
        #lists to hold statistics of multiple runs
        self.Waiting=[]
        self.Working=[]
        self.Blockage=[]
        
        # variable that is used for the loading of machines 
        self.exitAssignedToReceiver = False             # by default the objects are not blocked 
                                                        # when the entities have to be loaded to operatedMachines
                                                        # then the giverObjects have to be blocked for the time
                                                        # that the machine is being loaded 
        CoreObject.__init__(self, id, name)
        from Globals import G
        if not processingTime:
            processingTime = {'distributionType': 'Fixed',
                            'mean': 0,
                            'stdev': 0,
                            'min': 0,
                            }
        if processingTime['distributionType'] == 'Normal' and\
              processingTime.get('max', None) is None:
            processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])

        self.rng=RandomNumberGenerator(self, **processingTime)   
开发者ID:cpcdevelop,项目名称:dream,代码行数:35,代码来源:Dismantle.py

示例5: initialize

 def initialize(self):
     CoreObject.initialize(self)
     self.waitToDispose=False    #flag that shows if the object waits to dispose an entity    
     self.waitToDisposePart=False    #flag that shows if the object waits to dispose a part   
     self.waitToDisposeFrame=False    #flag that shows if the object waits to dispose a frame   
     
     self.Up=True                    #Boolean that shows if the object is in failure ("Down") or not ("up")
     self.currentEntity=None      
       
     self.totalFailureTime=0         #holds the total failure time
     self.timeLastFailure=0          #holds the time that the last failure of the object started
     self.timeLastFailureEnded=0          #holds the time that the last failure of the object Ended
     self.downTimeProcessingCurrentEntity=0  #holds the time that the object was down while processing the current entity
     self.downTimeInTryingToReleaseCurrentEntity=0 #holds the time that the object was down while trying 
                                                   #to release the current entity  
     self.downTimeInCurrentEntity=0                  #holds the total time that the object was down while holding current entity
     self.timeLastEntityLeft=0        #holds the last time that an entity left the object
                                             
     self.processingTimeOfCurrentEntity=0        #holds the total processing time that the current entity required                                               
                                                   
     self.totalBlockageTime=0        #holds the total blockage time
     self.totalWaitingTime=0         #holds the total waiting time
     self.totalWorkingTime=0         #holds the total working time
     self.completedJobs=0            #holds the number of completed jobs   
     
     self.timeLastEntityEnded=0      #holds the last time that an entity ended processing in the object     
     self.timeLastEntityEntered=0      #holds the last time that an entity ended processing in the object   
     self.timeLastFrameWasFull=0     #holds the time that the last frame was full, ie that assembly process started  
     self.nameLastFrameWasFull=""    #holds the name of the last frame that was full, ie that assembly process started
     self.nameLastEntityEntered=""   #holds the name of the last frame that entered processing in the object
     self.nameLastEntityEnded=""     #holds the name of the last frame that ended processing in the object            
     self.Res=simpy.Resource(self.env, capacity='inf')    
     self.Res.users=[]  
开发者ID:cpcdevelop,项目名称:dream,代码行数:33,代码来源:Dismantle.py

示例6: __init__

    def __init__(self, id='', name='', capacity=1, isDummy=False, schedulingRule="FIFO", 
                 level=None, gatherWipStat=False, **kw):
        self.type="Queue"           # String that shows the type of object
        CoreObject.__init__(self, id, name)
        capacity=float(capacity)
        if capacity<0 or capacity==float("inf"):
            self.capacity=float("inf")
        else:
            self.capacity=int(capacity)

        self.isDummy=bool(int(isDummy))                    #Boolean that shows if it is the dummy first Queue
        self.schedulingRule=schedulingRule      #the scheduling rule that the Queue follows
        self.multipleCriterionList=[]           #list with the criteria used to sort the Entities in the Queue
        SRlist = [schedulingRule]
        if schedulingRule.startswith("MC"):     # if the first criterion is MC aka multiple criteria
            SRlist = schedulingRule.split("-")  # split the string of the criteria (delimiter -)
            self.schedulingRule=SRlist.pop(0)   # take the first criterion of the list
            self.multipleCriterionList=SRlist   # hold the criteria list in the property multipleCriterionList
 
        for scheduling_rule in SRlist:
          if scheduling_rule not in self.getSupportedSchedulingRules():
            raise ValueError("Unknown scheduling rule %s for %s" %
              (scheduling_rule, id))

        self.gatherWipStat=gatherWipStat
        # Will be populated by an event generator
        self.wip_stat_list = []
        # trigger level for the reallocation of operators
        if level:
            assert level<=self.capacity, "the level cannot be bigger than the capacity of the queue"
        self.level=level
        from Globals import G
        G.QueueList.append(self)
开发者ID:cpcdevelop,项目名称:dream,代码行数:33,代码来源:Queue.py

示例7: initialize

 def initialize(self):
     CoreObject.initialize(self)                 # using the default CoreObject Functionality
     self.Res=simpy.Resource(self.env, self.numberOfSubBatches)  # initialize the Internal resource (Queue) functionality
     
     self.expectedSignals['isRequested']=1
     self.expectedSignals['interruptionStart']=1
     self.expectedSignals['initialWIP']=1
开发者ID:PanosBarlas,项目名称:dream,代码行数:7,代码来源:BatchReassembly.py

示例8: initialize

    def initialize(self):
#         Process.__init__(self)
        CoreObject.initialize(self)
        self.Res=simpy.Resource(self.env, capacity='inf')             

        self.position=[]            #list that shows the position of the corresponding element in the conveyer
        self.timeLastMoveHappened=0   #holds the last time that the move was performed (in reality it is 
                                        #continued, in simulation we have to handle it as discrete)
                                        #so when a move is performed we can calculate where the entities should go
        self.conveyerMover=ConveyerMover(self)      #process that is triggered at the times when an entity reached the end or
                                                    #a place is freed. It performs the move at this point, 
                                                    #so if there are actions to be carried they will
        self.entityLastReachedEnd=None              #the entity that last reached the end of the conveyer
        self.timeBlockageStarted=self.env.now       #the time that the conveyer reached the blocked state
                                                    #plant considers the conveyer blocked even if it can accept just one entity
                                                    #I think this is false
        self.wasFull=False                          #flag that shows if the conveyer was full. So when an entity is disposed
                                                    #if this is true we count the blockage time and set it to false
        self.currentRequestedLength=0               #the length of the entity that last requested the conveyer
        self.currentAvailableLength=self.length     #the available length in the end of the conveyer
        
        self.predecessorIndex=0     #holds the index of the predecessor from which the Conveyer will take an entity next
        self.successorIndex=0       #holds the index of the successor where the Queue Conveyer dispose an entity next
        
        self.requestingEntities=[]                  # list of the entities requesting space on the conveyer
        # signal that notifies the conveyer that its move is completed
        self.moveEnd=self.env.event()
开发者ID:cpcdevelop,项目名称:dream,代码行数:27,代码来源:Conveyer.py

示例9: __init__

    def __init__(self, id='', name='', processingTime=None, inputsDict=None, **kw):
        self.type="Assembly"   #String that shows the type of object
        self.next=[]        #list with the next objects in the flow
        self.previous=[]     #list with the previous objects in the flow
        self.previousPart=[]    #list with the previous objects that send parts
        self.previousFrame=[]    #list with the previous objects that send frames 
        self.nextIds=[]     #list with the ids of the next objects in the flow
        self.previousIds=[]   #list with the ids of the previous objects in the flow
        
        #lists to hold statistics of multiple runs
        self.Waiting=[]
        self.Working=[]
        self.Blockage=[]

        if not processingTime:
            processingTime = {'Fixed':{'mean': 0 }}
        if 'Normal' in processingTime.keys() and\
                processingTime['Normal'].get('max', None) is None:
            processingTime['Normal']['max'] = float(processingTime['Normal']['mean']) + 5 * float(processingTime['Normal']['stdev'])
    
        CoreObject.__init__(self, id, name)
        self.rng=RandomNumberGenerator(self, processingTime)
        
         # ============================== variable that is used for the loading of machines =============
        self.exitAssignedToReceiver = False             # by default the objects are not blocked 
                                                        # when the entities have to be loaded to operatedMachines
                                                        # then the giverObjects have to be blocked for the time
                                                        # that the machine is being loaded 
        from Globals import G
        G.AssemblyList.append(self)
开发者ID:PanosBarlas,项目名称:dream,代码行数:30,代码来源:Assembly.py

示例10: initialize

 def initialize(self):
     # using the Process __init__ and not the CoreObject __init__
     CoreObject.initialize(self)
      
     # initialize the internal Queue (type Resource) of the Source 
     self.Res=Resource(capacity=infinity)
     self.Res.activeQ=[]                                 
     self.Res.waitQ=[]                                   
开发者ID:mmariani,项目名称:dream,代码行数:8,代码来源:Source.py

示例11: initialize

 def initialize(self):
     self.previous=G.ObjList
     self.next=[]
     CoreObject.initialize(self)                 # using the default CoreObject Functionality
     self.Res=simpy.Resource(self.env, 'inf')    # initialize the Internal resource (Queue) functionality. This is a dummy object so 
                                                 # infinite capacity is assumed
     self.newlyCreatedComponents=[]              # a list to hold components just after decomposition
     self.orderToBeDecomposed=None
开发者ID:Kodextor,项目名称:dream,代码行数:8,代码来源:OrderDecomposition.py

示例12: initialize

 def initialize(self):
     from Globals import G
     G.BatchWaitingList = []                                     # batches waiting to be reassembled
     CoreObject.initialize(self)                                 # using the default CoreObject Functionality
     self.Res=simpy.Resource(self.env, self.numberOfSubBatches)  # initialize the Internal resource (Queue) functionality
     
     self.expectedSignals['isRequested']=1
     self.expectedSignals['interruptionStart']=1
     self.expectedSignals['initialWIP']=1
开发者ID:Kodextor,项目名称:dream,代码行数:9,代码来源:BatchDecomposition.py

示例13: __init__

 def __init__(self, id, name, **kw):
     self.type="Exit" # XXX needed ?
     #lists to hold statistics of multiple runs
     self.Exits=[]
     self.UnitExits=[]
     self.Lifespan=[] 
     self.TaktTime=[]   
     # if input is given in a dictionary
     CoreObject.__init__(self, id, name) 
     from Globals import G
     G.ExitList.append(self)           
开发者ID:cpcdevelop,项目名称:dream,代码行数:11,代码来源:Exit.py

示例14: initialize

 def initialize(self):
     # using the Process __init__ and not the CoreObject __init__
     CoreObject.initialize(self)
     # initialise the internal Queue (type Resource) of the Queue object 
     self.Res=simpy.Resource(self.env, self.capacity)
     # event used by router
     self.loadOperatorAvailable=self.env.event()
     
     self.expectedSignals['isRequested']=1
     self.expectedSignals['canDispose']=1
     self.expectedSignals['loadOperatorAvailable']=1
开发者ID:jerome-nexedi,项目名称:dream,代码行数:11,代码来源:Queue.py

示例15: initialize

 def initialize(self):
     Process.__init__(self)
     CoreObject.initialize(self)
     self.Res=Resource(capacity=infinity)         
     
     self.Up=True                    #Boolean that shows if the object is in failure ("Down") or not ("up")
     self.currentEntity=None      
       
     self.totalBlockageTime=0        #holds the total blockage time
     self.totalFailureTime=0         #holds the total failure time
     self.totalWaitingTime=0         #holds the total waiting time
     self.totalWorkingTime=0         #holds the total working time
     self.completedJobs=0            #holds the number of completed jobs 
     
     self.timeLastEntityEnded=0      #holds the last time that an entity ended processing in the object
     self.nameLastEntityEnded=""     #holds the name of the last entity that ended processing in the object
     self.timeLastEntityEntered=0    #holds the last time that an entity entered in the object
     self.nameLastEntityEntered=""   #holds the name of the last entity that entered in the object
     self.timeLastFailure=0          #holds the time that the last failure of the object started
     self.timeLastFailureEnded=0          #holds the time that the last failure of the object Ended
     self.downTimeProcessingCurrentEntity=0  #holds the time that the object was down while processing the current entity
     self.downTimeInTryingToReleaseCurrentEntity=0 #holds the time that the object was down while trying 
                                                   #to release the current entity  
     self.downTimeInCurrentEntity=0                  #holds the total time that the object was down while holding current entity
     self.timeLastEntityLeft=0        #holds the last time that an entity left the object
                                             
     self.processingTimeOfCurrentEntity=0        #holds the total processing time that the current entity required                                   
                                                   
     self.waitToDispose=False    #shows if the object waits to dispose an entity  
     self.position=[]            #list that shows the position of the corresponding element in the conveyer
     self.timeLastMoveHappened=0   #holds the last time that the move was performed (in reality it is 
                                     #continued, in simulation we have to handle it as discrete)
                                     #so when a move is performed we can calculate where the entities should go
     self.timeToReachEnd=0           #if the conveyer has entities but none has reached the end of it, this calculates
                                     #the time when the first entity will reach the end and so it will be ready to be disposed
     self.timeToBecomeAvailable=0    #if the conveyer has entities on its back this holds the time that it will be again free
                                     #for an entity. of course this also depends on the length of the entity who requests it
     self.conveyerMover=ConveyerMover(self)      #process that is triggered at the times when an entity reached the end or
                                                 #a place is freed. It performs the move at this point, 
                                                 #so if there are actions to be carried they will
     self.call=False                             #flag that shows if the ConveyerMover should be triggered
     self.entityLastReachedEnd=None              #the entity that last reached the end of the conveyer
     self.timeBlockageStarted=now()              #the time that the conveyer reached the blocked state
                                                 #plant considers the conveyer blocked even if it can accept just one entity
                                                 #I think this is false 
     self.wasFull=False                          #flag that shows if the conveyer was full. So when an entity is disposed
                                                 #if this is true we count the blockage time and set it to false
     self.currentRequestedLength=0               #the length of the entity that last requested the conveyer
     self.currentAvailableLength=self.length     #the available length in the end of the conveyer
     
     self.predecessorIndex=0     #holds the index of the predecessor from which the Conveyer will take an entity next
     self.successorIndex=0       #holds the index of the successor where the Queue Conveyer dispose an entity next       
开发者ID:mmariani,项目名称:dream,代码行数:52,代码来源:Conveyer.py


注:本文中的CoreObject.CoreObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。