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


Python CoreObject.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    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,代码行数:35,代码来源:Queue.py

示例2: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
 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,代码行数:27,代码来源:Dismantle.py

示例3: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    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,代码行数:34,代码来源:Assembly.py

示例4: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    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,代码行数:37,代码来源:Dismantle.py

示例5: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    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,代码行数:32,代码来源:Assembly.py

示例6: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
 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,代码行数:13,代码来源:Exit.py

示例7: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name=None):
        if not name:
          name = id
        CoreObject.__init__(self, id, name)
        self.predecessorIndex=0         # holds the index of the predecessor from which the Exit will take an entity next
        # general properties of the Exit
        self.type="Exit" # XXX needed ?
#         # list with routing information
#         self.previous=[]                # list with the previous objects in the flow
#         self.nextIds=[]                 # list with the ids of the next objects in the flow. For the exit it is always empty!
#         self.previousIds=[]             # list with the ids of the previous objects in the flow
        
        #lists to hold statistics of multiple runs
        self.Exits=[]
        self.UnitExits=[]
        self.Lifespan=[] 
        self.TaktTime=[]                  
开发者ID:mmariani,项目名称:dream,代码行数:19,代码来源:Exit.py

示例8: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
 def __init__(self, id, name, length, speed,**kw):
     CoreObject.__init__(self, id, name)
     self.type="Conveyer"
     self.speed=float(speed)    #the speed of the conveyer in m/sec
     self.length=float(length)  #the length of the conveyer in meters
     # counting the total number of units to be moved through the whole simulation time
     self.numberOfMoves=0
     
     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
     # ============================== 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.ConveyerList.append(self)
开发者ID:cpcdevelop,项目名称:dream,代码行数:19,代码来源:Conveyer.py

示例9: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name, processingTime=None, numberOfSubBatches=1, operator='None'):
        CoreObject.__init__(self, id, name)
        self.type="BatchDecomposition"              #String that shows the type of object

        if not processingTime:
          processingTime = { 'distributionType': 'Fixed',
                             'mean': 1, }
        if processingTime['distributionType'] == 'Normal' and\
              processingTime.get('max', None) is None:
          processingTime['max'] = processingTime['mean'] + 5 * processingTime['stdev']
        
        # holds the capacity of the object 
        self.numberOfSubBatches=numberOfSubBatches
        # sets the operator resource of the Machine
        self.operator=operator         
        # Sets the attributes of the processing (and failure) time(s)
        self.rng=RandomNumberGenerator(self, **processingTime)
开发者ID:mmariani,项目名称:dream,代码行数:19,代码来源:BatchDecomposition.py

示例10: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name, processingTime=None, numberOfSubBatches=1, operator='None', **kw):
        CoreObject.__init__(self, id, name)
        self.type="BatchDecomposition"              #String that shows the type of object

        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'])
        
        # holds the capacity of the object 
        self.numberOfSubBatches=int(numberOfSubBatches)
        # sets the operator resource of the Machine
        self.operator=operator         
        # Sets the attributes of the processing (and failure) time(s)
        self.rng=RandomNumberGenerator(self, processingTime)
        from Globals import G
        G.BatchDecompositionList.append(self)
开发者ID:PanosBarlas,项目名称:dream,代码行数:20,代码来源:BatchDecomposition.py

示例11: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
 def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None', **kw):
     CoreObject.__init__(self,id, name)
     self.type="BatchRassembly"              #String that shows the type of object
     if not processingTime:
       processingTime = { 'distributionType': 'Fixed',
                          'mean': 1, }
     if processingTime['distributionType'] == 'Normal' and\
           processingTime.get('max', None) is None:
       processingTime['max'] = float(processingTime['mean']) + 5 * float(processingTime['stdev'])
       
     # holds the capacity of the object 
     self.numberOfSubBatches=numberOfSubBatches
     # sets the operator resource of the Machine
     self.operator=operator         
     # Sets the attributes of the processing (and failure) time(s)
     self.rng=RandomNumberGenerator(self, **processingTime)
     from Globals import G
     G.BatchReassemblyList.append(self)
开发者ID:cpcdevelop,项目名称:dream,代码行数:20,代码来源:BatchReassembly.py

示例12: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
 def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None', outputResults=False, **kw):
     CoreObject.__init__(self,id, name)
     self.type="BatchRassembly"              #String that shows the type of object
     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'])
       
     # holds the capacity of the object 
     self.numberOfSubBatches=numberOfSubBatches
     # sets the operator resource of the Machine
     self.operator=operator         
     # Sets the attributes of the processing (and failure) time(s)
     self.rng=RandomNumberGenerator(self, processingTime)
     from Globals import G
     G.BatchReassemblyList.append(self)
     # flag to show if the objects outputs results
     self.outputResults=bool(int(outputResults))
开发者ID:PanosBarlas,项目名称:dream,代码行数:21,代码来源:BatchReassembly.py

示例13: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name, length, speed):
        CoreObject.__init__(self, id, name)
        self.type="Conveyer"
        self.speed=speed    #the speed of the conveyer in m/sec
        self.length=length  #the length of the conveyer in meters
        self.previous=[]    #list with the previous objects in the flow
        self.next=[]    #list with the next objects in the flow
        self.nextIds=[]     #list with the ids of the next objects in the flow. For the exit it is always empty!
        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=[]
        
        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
        # ============================== variable that is used for the loading of machines =============
        self.exitAssignedToReceiver = False             # by default the objects are not blocked 
开发者ID:mmariani,项目名称:dream,代码行数:21,代码来源:Conveyer.py

示例14: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name, processingTime=None, numberOfSubBatches=1, operator="None", **kw):
        CoreObject.__init__(self, id, name)
        self.type = "BatchDecomposition"  # String that shows the type of object

        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"]
            )

        # holds the capacity of the object
        self.numberOfSubBatches = int(numberOfSubBatches)
        # sets the operator resource of the Machine
        self.operator = operator
        # Sets the attributes of the processing (and failure) time(s)
        self.rng = RandomNumberGenerator(self, processingTime)
        from Globals import G

        G.BatchDecompositionList.append(self)
开发者ID:goodhobak,项目名称:dream,代码行数:22,代码来源:BatchDecomposition.py

示例15: __init__

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import __init__ [as 别名]
    def __init__(self, id, name, interArrivalTime=None, entity='Dream.Part',**kw):
        # Default values
        if not interArrivalTime:
          interArrivalTime = {'Fixed': {'mean': 1}}
        if 'Normal' in interArrivalTime.keys() and\
              interArrivalTime['Normal'].get('max', None) is None:
          interArrivalTime['Normal']['max'] = interArrivalTime['Normal']['mean'] + 5 * interArrivalTime['Normal']['stdev']

        CoreObject.__init__(self, id, name)
        # properties used for statistics
        self.totalinterArrivalTime = 0                  # the total interarrival time 
        self.numberOfArrivals = 0                       # the number of entities that were created

        self.type="Source"                              #String that shows the type of object
        self.rng = RandomNumberGenerator(self, interArrivalTime)

        self.item=Globals.getClassFromName(entity)      #the type of object that the Source will generate
               
        self.scheduledEntities=[]       # list of creations that are scheduled. pattern is [timeOfCreation, EntityCounter]     
        from Globals import G
        G.SourceList.append(self)  
开发者ID:PanosBarlas,项目名称:dream,代码行数:23,代码来源:Source.py


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