def __init__(self, facility, kmp_identifier):
     
     self.batch = batch_class(0, "batch")
     
     self.identifier = kmp_identifier 
     self.measured_weight = 0 # measurement
     self.muf = 0
     
     
     
     self.uncertainty = np.loadtxt(facility.kmps_dir + '/key.measurement.points.inp', usecols=[2])[kmp_identifier] # std = 0.01; uncertainty only associated with measurement
     self.time_delay = np.loadtxt(facility.kmps_dir + '/key.measurement.points.inp', usecols=[1])[kmp_identifier] # kmp measurement time = 30 mins = 0.0208 days.
     #print self.uncertainty
     
     #self.kmp_alarm_threshold = self.alarm_threshold() #expected values: (0.02, 0.101980390272)
     # print self.kmp_alarm_threshold[1]
     # only one standard deviation can be used as a threshold. However, the false alarm probability will be low in this case compared to 0.95.
     # Or, you can use a false alarm probability of 95%. 
     
     self.kmp_alarm_threshold1 = 0.0 
     self.kmp_alarm_threshold2 = 0.0
     self.kmp_alarm_threshold_0_3 = 0.0
     self.kmp_alarm_threshold_3_3 = 0.0
     
     facility_component_class.__init__(self, "key_measurement_point_%i"%(kmp_identifier), "kmp", facility.kmps_odir)
     
     self.muf_data_output1 = open(facility.muf_odir+ '/muf1.out', 'w+') # muf info
     self.muf_data_output2 = open(facility.muf_odir+ '/muf2.out', 'w+')
     self.muf_data_output3 = open(facility.muf_odir+ '/muf3.out', 'w+')        
 def __init__(self,facility):
     self.measured_inventory = 0
     self.edge = edge_transition_class(facility,0)
     self.initial_inventory = facility.initial_inventory
     self.storage_buffer = storage_buffer_class(facility, self.initial_inventory)
     self.kmp = kmp_class(facility,0)
     facility_component_class.__init__(self, 0, 0, 0, "first_storage_unit", "manager", None)
    def __init__(self, facility):

        self.heel = batch_class(0, "heel")  # heel initialization.
        self.batch = batch_class(0, "batch")  # batch initialization.

        self.process_time_delay = np.loadtxt(
            facility.process_states_dir + '/process.operation.time.inp',
            usecols=[1])[1]  # 8 hours = 0.3333 days
        # self.batch = batch_class(self.batch_size, "batch")
        self.failure_rate = np.loadtxt(
            facility.failure_equipment_dir + '/melter.failure.data.inp',
            usecols=[1])  # 0.0333 days-1 = 1/30 days
        self.maintenance_time_delay = np.loadtxt(
            facility.failure_equipment_dir + '/melter.failure.data.inp',
            usecols=[2])  # 0.1667 days = 4 hours
        self.cleaning_time_delay = np.loadtxt(
            facility.failure_equipment_dir + '/melter.failure.data.inp',
            usecols=[3])  # 0.0833 days = 2 hours

        self.time_of_last_failure = 0  # The melter hasn't failed yet.
        self.true_batch_loss = 0
        self.failure_count = 0

        self.failure_data_output = data_output_class(
            "melter_failure_data", facility.equipment_failure_odir)
        facility_component_class.__init__(self, "melter", "processor",
                                          facility.material_flow_odir)

        self.sum = 0.0
 def __init__(self,facility):
     self.inventory = 0
     self.measured_inventory = 0
     self.time_delay = np.loadtxt(facility.process_states_dir+'/process.operation.time.inp',usecols=[1])[3]
     self.inspection_measurement_uncertainty = np.loadtxt(facility.process_states_dir+ \
         '/measurement.uncertainty.inp')
     facility_component_class.__init__(self, 0, 0, 0, "product_storage", "storage", facility.inventory_odir)
Exemplo n.º 5
0
    def __init__(self, facility):

        self.batch = batch_class(0, "batch")
        self.time_delay = np.loadtxt(facility.process_states_dir +
                                     '/process.operation.time.inp',
                                     usecols=[1])[2]  # 0.125 days = 3 hours

        facility_component_class.__init__(self, "trimmer", "processor", None)
 def __init__(self,facility,kmp_identifier):
     self.uncertainty = np.loadtxt(facility.kmps_dir+'/key.measurement.points.inp',usecols=[2])[kmp_identifier]
     self.time_delay = np.loadtxt(facility.kmps_dir+'/key.measurement.points.inp',usecols=[1])[kmp_identifier]
     self.alarm_threshold = np.loadtxt(facility.kmps_dir+'/key.measurement.points.inp',
             usecols=[4])[kmp_identifier]
     self.identifier = kmp_identifier
     self.measured_weight = 0
     facility_component_class.__init__(self, 0, 0,0, "key_measurement_point_%i"%(kmp_identifier), "kmp",
         facility.kmps_odir)
 def __init__(self,facility,initial_inventory):
     self.batch_size = np.loadtxt(facility.process_states_dir+'/batch.inp')
     self.inventory = initial_inventory
     self.measured_inventory = initial_inventory 
     self.time_delay = np.loadtxt(facility.process_states_dir+'/process.operation.time.inp',usecols=[1])[0]
     self.inspection_measurement_uncertainty = np.loadtxt(facility.process_states_dir+ \
         '/measurement.uncertainty.inp')
     facility_component_class.__init__(self, self.inventory, self.batch_size, self.inventory, 
             "storage_buffer", "storage", facility.inventory_odir)
 def __init__(self,facility):
     self.expected_loss = np.loadtxt(facility.process_states_dir+ \
             '/melter.loss.fraction.inp',usecols=[1])[0] 
     self.batch_loss_bounds = np.loadtxt(facility.process_states_dir+'/melter.loss.fraction.inp',
             usecols=[1])[1:3] 
     self.process_time_delay = np.loadtxt(facility.process_states_dir+ \
             '/process.operation.time.inp',usecols=[1])[1] 
     self.heel = batch_class(0,"heel")
     self.failure_rate = np.loadtxt(facility.failure_equipment_dir+'/melter.failure.data.inp',usecols=[1]) 
     self.maintenance_time_delay = np.loadtxt(facility.failure_equipment_dir+ \
             '/melter.failure.data.inp',usecols=[2]) 
     self.cleaning_time_delay = np.loadtxt(facility.failure_equipment_dir+ \
             '/melter.failure.data.inp',usecols=[2]) 
     self.time_of_last_failure = 0
     self.true_batch_loss = 0
     self.failure_count = 0
     self.failure_data_output = data_output_class("melter_failure_data", facility.equipment_failure_odir)
     facility_component_class.__init__(self, 0, 0, 0, "melter", "processor", facility.material_flow_odir)
    def __init__(self, facility):

        self.batch = batch_class(0, "batch")
        self.inventory_muf = 0
        self.inventory_2_melter = 0
        self.measured_inventory = 0
        #self.inventory = 0

        self.time_delay = np.loadtxt(
            facility.process_states_dir + '/process.operation.time.inp',
            usecols=[1])[3]  # 0.0833 days = 2 hours (recycle storage time)
        facility_component_class.__init__(self, "recycle_storage", "storage",
                                          facility.inventory_odir)

        self.inventory_muf_output = open(
            facility.inventory_odir + '/inventory_muf.out', 'w+')
        self.inventory_2_melter_output = open(
            facility.inventory_odir + '/inventory_2_melter.out', 'w+')
    def __init__(self,facility):
        """
        The fabricator initializes all of the objects that are its own constituents.  That includes the melter,
        trimmer, recycle storage, four kmp's, and the edge transitions between such.

        The expected batch and heel weights are changed everytime a component that changes those state variables
        processes a batch.  
        """
        self.edge = edge_transition_class(facility,0)
        self.kmp = []
        for n in range(4):
            self.kmp.append(kmp_class(facility,n))
        self.melter= melter_class(facility)
        self.trimmer = trimmer_class(facility)
        self.recycle_storage = recycle_storage_class(facility)
        self.expected_campaign_muf = 0
        self.measured_campaign_muf = 0
        self.true_campaign_muf = 0
        facility_component_class.__init__(self, 0, 0, 0, "fuel_fabricator", "manager", None)
Exemplo n.º 11
0
    def __init__(self, facility, initial_inventory):
        self.batch_size = np.loadtxt(facility.process_states_dir +
                                     '/batch.inp')  # 20 KG
        self.inventory = initial_inventory  # 10,000 KG

        self.batch = batch_class(self.batch_size, "batch")

        self.measured_inventory = self.measured_inventory_calculation(facility)
        print "Round (measured storage buffer inventory) " + str(
            facility.total_campaign) + " : " + str(self.measured_inventory)

        self.time_delay = np.loadtxt(
            facility.process_states_dir + '/process.operation.time.inp',
            usecols=[
                1
            ])[0]  #Storage buffer batch preparation time: 1 hour = 0.0417
        self.time_inspection = 0.333333  # 8 hours of inspection; an input file for it is needed (two different inventories)

        facility_component_class.__init__(self, "storage_buffer", "storage",
                                          facility.inventory_odir)
    def __init__(self, facility):

        #self.batch_size = np.loadtxt(facility.process_states_dir + '/batch.inp') # 20 KG
        self.batch = batch_class(0, "batch")

        self.inventory = 0
        self.end_time_inspection = 0.166667  # 4 hours

        self.time_delay = np.loadtxt(facility.process_states_dir +
                                     '/process.operation.time.inp',
                                     usecols=[1])[3]  # 0.0833 days; 2 hours

        #if (facility.total_campaign == 1):
        self.measured_inventory = 0

        #self.measured_inventory_calculation(facility)
        #print "Round (storage buffer inventory) " + str(facility.total_campaign) +" : " + str(self.measured_inventory)

        facility_component_class.__init__(self, "product_storage", "storage",
                                          facility.inventory_odir)
 def __init__(self,facility):
     self.measured_inventory = 0
     self.edge = edge_transition_class(facility,0)
     self.product_storage = product_storage_class(facility)
     self.kmp = kmp_class(facility,2)
     facility_component_class.__init__(self, 0, 0, 0, "final_storage_unit", "manager", None)
 def __init__(self,facility):
     self.time_delay = np.loadtxt(facility.process_states_dir+'/process.operation.time.inp',usecols=[1])[2]
     facility_component_class.__init__(self, 0, 0, 0, "trimmer", "processor", None)
 def __init__(self,facility,edge_number):
     self.time_delay = np.loadtxt(facility.edge_transition_dir+'/edge.transition.inp',
             usecols=[1])[edge_number]
     facility_component_class.__init__(self, 0, 0, 0, "edge_transition", "manager", None)
 def __init__(self,facility):
     self.time_delay = np.loadtxt(facility.process_states_dir+'/process.operation.time.inp',usecols=[1])[3]
     self.inventory = 0
     self.measured_inventory = 0
     facility_component_class.__init__(self, 0, 0, 0, "recycle_storage", "storage", facility.inventory_odir)
 def __init__(self, facility, edge_number):
     self.time_delay = np.loadtxt(
         facility.edge_transition_dir + '/edge.transition.inp',
         usecols=[1])[edge_number]  # 30 mins = 0.0208 days
     facility_component_class.__init__(self, "edge_transition", "manager",
                                       None)  #inheritance