コード例 #1
0
    def __init__(self, id, name, capacity=1, \
                 processingTime=None, repairman='None',\
                 scrapQuantity={},
                 operatorPool='None',operationType='None',\
                 setupTime=None, loadTime=None,
                 canDeliverOnInterruption=False,
                 **kw):
        if not processingTime:
            processingTime = {'distributionType': 'Fixed', 'mean': 1}
        # initialize using the default method of the object
        Machine.__init__(self,id=id,name=name,\
                                    capacity=capacity,\
                                    processingTime=processingTime,
                                    repairman=repairman,
                                    canDeliverOnInterruption=canDeliverOnInterruption,
                                    operatorPool=operatorPool,operationType=operationType,\
                                    setupTime=setupTime, loadTime=loadTime,
                                    )

        # set the attributes of the scrap quantity distribution
        if not scrapQuantity:
            scrapQuantity = {'Fixed': {'mean': 0}}

        self.scrapRng = RandomNumberGenerator(self, scrapQuantity)
        from Globals import G
        G.BatchScrapMachineList.append(self)
コード例 #2
0
    def __init__(self, id, name, capacity=1, \
                 processingTime=None, repairman='None',\
                 scrapQuantity={},
                 operatorPool='None',operationType='None',\
                 setupTime=None, loadTime=None,
                 canDeliverOnInterruption=False, 
                 technology=None,
                 **kw):
        if not processingTime:
          processingTime = {'distributionType': 'Fixed',
                            'mean': 1}
        # initialize using the default method of the object 
        Machine.__init__(self,id=id,name=name,\
                                    capacity=capacity,\
                                    processingTime=processingTime,
                                    repairman=repairman,
                                    canDeliverOnInterruption=canDeliverOnInterruption,
                                    operatorPool=operatorPool,operationType=operationType,\
                                    setupTime=setupTime, loadTime=loadTime,     
                                    technology=technology              
                                    )

        # set the attributes of the scrap quantity distribution
        if not scrapQuantity:
            scrapQuantity = {'Fixed':{'mean': 0}}
            
        self.scrapRng=RandomNumberGenerator(self, scrapQuantity)
        from Globals import G
        G.BatchScrapMachineList.append(self)
    def __init__(self, numCores):
        """
        initializes a machine object
        :param numCores: number of cores in the CPU
        """

        Machine.__init__(self, numCores)
コード例 #4
0
ファイル: OperatedMachine.py プロジェクト: mmariani/dream
    def __init__(self, id, name, capacity=1, processingTime=None,
                  failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
                  operatorPool='None',operationType='None',
                  setupTime=None, loadTime=None):
        Machine.__init__(self, id, name, capacity=capacity,
                         processingTime=processingTime,
                         failureDistribution=failureDistribution, MTTF=MTTF,
                         MTTR=MTTR, availability=availability,
                         repairman=repairman, operatorPool=operatorPool,
                         operationType=operationType, setupTime=setupTime,
                         loadTime=loadTime,)

        # type of the machine
        self.type = "OperatedMachine"
        # sets the operator resource of the Machine
        #     check if the operatorPool is a List or a OperatorPool type Object
        #     if it is a list then initiate a OperatorPool type object containing
        #     the list of operators provided
        '''
            change! if the  list is empty create operator pool with empty list
        '''
        if (type(operatorPool) is list): #and len(operatorPool)>0:
            id = id+'_OP'
            name=self.objName+'_operatorPool'
            self.operatorPool=OperatorPool(id, name, operatorsList=operatorPool)
        else:
            self.operatorPool=operatorPool
        # update the operatorPool coreObjects list
        if self.operatorPool!='None':
            self.operatorPool.coreObjectIds.append(self.id)
            self.operatorPool.coreObjects.append(self)
        # holds the Operator currently processing the Machine
        self.currentOperator=None
        # define if load/setup/removal/processing are performed by the operator 
        self.operationType=operationType
        # boolean to check weather the machine is being operated
        self.toBeOperated = False

        # examine if there are multiple operation types performed by the operator
        #     there can be Setup/Processing operationType
        #     or the combination of both (MT-Load-Setup-Processing) 
        self.multOperationTypeList=[]   
        if self.operationType.startswith("MT"):
            OTlist = operationType.split('-')
            self.operationType=OTlist.pop(0)
            self.multOperationTypeList = OTlist
        else:
            self.multOperationTypeList.append(self.operationType)
        #     lists to hold statistics of multiple runs
        self.WaitingForOperator=[]
        self.WaitingForLoadOperator=[]
        self.Loading = []
        self.SettingUp =[]
コード例 #5
0
ファイル: BatchScrapMachine.py プロジェクト: Kodextor/dream
    def __init__(self, id, name, capacity=1, \
                 processingTime=None, repairman='None',\
                 scrapQuantity={}, **kw):
        if not processingTime:
          processingTime = {'distributionType': 'Fixed',
                            'mean': 1}
        # initialize using the default method of the object 
        Machine.__init__(self,id=id,name=name,\
                                    capacity=capacity,\
                                    processingTime=processingTime,
                                    repairman=repairman)

        # set the attributes of the scrap quantity distribution
        if not scrapQuantity:
            scrapQuantity = {'distributionType': 'Fixed',
                            'mean': 0}
            
        self.scrapRng=RandomNumberGenerator(self, **scrapQuantity)
        from Globals import G
        G.BatchScrapMachineList.append(self)
コード例 #6
0
ファイル: TwoAddressMachine.py プロジェクト: afranck64/PySam
 def __init__(self, text=None, dynamic=False, **kw):
     Machine.__init__(self, text, dynamic, **kw)
     self.EXCLUDE = ["PUSH", "POP"]
コード例 #7
0
 def __init__(self, age, name, tricks, language, material):
     Person.__init__(self, age, name, tricks, language)
     Machine.__init__(self, material)
コード例 #8
0
    def __init__(self, id, name, capacity=1, processingTime=None,
                  failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
                  operatorPool='None',operationType='None',
                  setupTime=None, loadTime=None):
        Machine.__init__(
            self,
            id,
            name,
            capacity=capacity,
            processingTime=processingTime,
            failureDistribution=failureDistribution,
            MTTF=MTTF,
            MTTR=MTTR,
            availability=availability,
            repairman=repairman,
            operatorPool=operatorPool,
            operationType=operationType,
            setupTime=setupTime,
            loadTime=loadTime,
        )

        # type of the machine
        self.type = "OperatedMachine"
        # sets the operator resource of the Machine
        #     check if the operatorPool is a List or a OperatorPool type Object
        #     if it is a list then initiate a OperatorPool type object containing
        #     the list of operators provided
        '''
            change! if the  list is empty create operator pool with empty list
        '''
        if (type(operatorPool) is list):  #and len(operatorPool)>0:
            id = id + '_OP'
            name = self.objName + '_operatorPool'
            self.operatorPool = OperatorPool(id,
                                             name,
                                             operatorsList=operatorPool)
        else:
            self.operatorPool = operatorPool
        # update the operatorPool coreObjects list
        if self.operatorPool != 'None':
            self.operatorPool.coreObjectIds.append(self.id)
            self.operatorPool.coreObjects.append(self)
        # holds the Operator currently processing the Machine
        self.currentOperator = None
        # define if load/setup/removal/processing are performed by the operator
        self.operationType = operationType
        # boolean to check weather the machine is being operated
        self.toBeOperated = False

        # examine if there are multiple operation types performed by the operator
        #     there can be Setup/Processing operationType
        #     or the combination of both (MT-Load-Setup-Processing)
        self.multOperationTypeList = []
        if self.operationType.startswith("MT"):
            OTlist = operationType.split('-')
            self.operationType = OTlist.pop(0)
            self.multOperationTypeList = OTlist
        else:
            self.multOperationTypeList.append(self.operationType)
        #     lists to hold statistics of multiple runs
        self.WaitingForOperator = []
        self.WaitingForLoadOperator = []
        self.Loading = []
        self.SettingUp = []