Exemple #1
0
def _test_create_intermediate_storage_facility(logger):

    # create an arbitrary scheudle for the facility
    schedule =  schedule_full_availability()
    logger.info("Created a test storage schedule with {} days".format(days))

    partial_schedule = schedule_partial_availability()
    logger.info("Created a test storage schedule with {} days".format(partial_schedule.total_available_days))
    logger.debug(partial_schedule.asText())



    # create supply objects for each commodity
	# i don' think we want to create supply and demand objects at intermediate facilities, only processing ratios
    # I don't think there needs to be a schedule for each commodity at an intermediate facility
    # feedstock and product may have schedules, commodity does not
    # specify the name and supply

    # create a facility object
    facility_name       = "Int_Storage_GAMMA"
    facility_description = "a test storage object. requires 1000 bbl each of diesel and gasoline at a time"
    facility_location   = "EARTH"
    # facility_candidate  = 0 default
    # facility_capex      = 0
    facility_storage_slate = _test_create_storage_slate()
    feedstock_storage_slate = _test_create_storage_slate_feedstock_only()
    facility_nameplate_capacity = 1000
    facility_nameplate_capacity_units = "bbl"
    facility_schedule = schedule
    f = xtot_objects.Facility(facility_name,
                                facility_description,
                                facility_location,
                                facility_storage_slate,
                                facility_nameplate_capacity,
                                facility_nameplate_capacity_units,
                                facility_schedule)

    g = xtot_objects.Facility("Int_Storage_DELTA",
                                facility_description,
                                facility_location,
                                feedstock_storage_slate,
                                facility_nameplate_capacity,
                                "tons",
                                facility_schedule)

    h = xtot_objects.Facility("Int_Storage_H",
                                facility_description,
                                facility_location,
                                facility_storage_slate,
                                facility_nameplate_capacity,
                                facility_nameplate_capacity_units,
                                partial_schedule)

    # create a supply facility
    s = xtot_objects.Storage(f)
    t = xtot_objects.Storage(g)
    u = xtot_objects.Storage(h)

    return s, t, u
Exemple #2
0
def _test_create_supply_beta_object(logger):

    # create an arbitrary scheudle.
    schedule = schedule_full_availability()
    logger.info("Created a supply schedule with {} days".format(days))

    #print(f.asText())

    # create a facility object
    facility_name_1 = "Supply_Beta"
    facility_description = "a test supply object produces gas and diesel"
    facility_location = "EARTH"
    # facility_candidate  = 0 default
    # facility_capex      = 0 default
    facility_feedstock_slate_1 = _test_create_feedstock_slate_1(logger)
    facility_nameplate_capacity = 1000  #refers to colocated storage
    facility_nameplate_capacity_units = "bbl"
    facility_schedule = schedule
    f = xtot_objects.Facility(facility_name_1, facility_description,
                              facility_location, facility_feedstock_slate_1,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units,
                              facility_schedule)

    # create a supply facility
    gd = xtot_objects.PreProcessor(f)

    facility_name_2 = "Supply_A"
    facility_description = "a test supply object produces corn and wheat"
    facility_feedstock_slate_2 = _test_create_feedstock_slate_2(logger)
    g = xtot_objects.Facility(facility_name_2, facility_description,
                              facility_location, facility_feedstock_slate_2,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units,
                              facility_schedule)

    cw = xtot_objects.PreProcessor(g)

    # p.log_debug(logger) - todo workout the logger stuff instead of the print

    facility_name_3 = "Supply_C"
    facility_description = "a test supply object produces corn & soy"
    facility_location = "EARTH"
    facility_feedstock_slate_3 = _test_create_feedstock_slate(
        logger, "corn", "tons", 10000, "soy", "tons", 20000)
    facility_nameplate_capacity = 1000  #refers to colocated storage
    facility_nameplate_capacity_units = "bbl"
    facility_schedule = schedule
    h = xtot_objects.Facility(facility_name_3, facility_description,
                              facility_location, facility_feedstock_slate_3,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units,
                              facility_schedule)

    # create a supply facility
    r = xtot_objects.PreProcessor(h)

    return gd, cw, r
Exemple #3
0
def _test_create_processor_facility(logger):

    # create an arbitrary scheudle for the facility
    schedule = schedule_full_availability()
    logger.debug("Created a processor schedule with {} days".format(days))
    partial_schedule = schedule_partial_availability()
    logger.debug(partial_schedule.asText())

    # create supply objects for each commodity
    # i don' think we want to create supply and demand objects at intermediate facilities, only processing ratios
    # I don't think there needs to be a schedule for each commodity at an intermediate facility
    # feedstock and product may have schedules, commodity does not
    # specify the name and supply
    # may need to add separate capacity and units for input storage, currently only
    # specifiying output storage

    # create a facility object
    facility_name = "Processor_P"
    facility_description = "a test processor object. requires 1000 bbl each of diesel and gasoline at a time"
    facility_location = "EARTH"
    facility_processor_slate = _test_create_processor_slate()
    facility_nameplate_capacity = 1000
    facility_nameplate_capacity_units = "bbl"
    facility_schedule = schedule
    f = xtot_objects.Facility(facility_name, facility_description,
                              facility_location, facility_processor_slate,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units,
                              facility_schedule)

    # create a supply facility
    p = xtot_objects.Intermediate_Processing_Facility(f)

    # create a facility object
    facility_name = "Processor_Q"
    facility_description = "a test processor object. requires 1000 bbl each of diesel and gasoline at a time"
    facility_location = "EARTH"
    facility_candidate = 0
    facility_capex = 0
    facility_processor_slate = _test_create_processor_slate_soy()
    facility_nameplate_capacity = 1000
    facility_nameplate_capacity_units = "bbl"
    facility_schedule = schedule
    g = xtot_objects.Facility(facility_name, facility_description,
                              facility_location, facility_processor_slate,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units,
                              facility_schedule)

    # create a supply facility
    q = xtot_objects.Intermediate_Processing_Facility(g)

    return p, q
Exemple #4
0
def _test_create_destination_alpha_object(logger):

    schedule = schedule_full_availability()
    logger.info("Created a demand  schedule with {} days".format(days))

    # create a facility object
    facility_name = "Destination_ALPHA"
    facility_description = "a test destination object."
    facility_location = "EARTH"
    facility_candidate = 0
    facility_capex = 0
    facility_slate = _test_create_final_destination_slate()
    facility_nameplate_capacity = 1000  #refers to co-located storage
    facility_nameplate_capacity_units = "bbl"
    f = xtot_objects.Facility(facility_name, facility_description,
                              facility_location, facility_slate,
                              facility_nameplate_capacity,
                              facility_nameplate_capacity_units, schedule)

    # create a final destination facility
    d = xtot_objects.Final_Destination(f)

    # logger.info("Created a destination facility {}".format(d.asText()))
    # print(d.asText())

    return d