# -*- coding: utf-8 -*-
"""
Created on Thu Nov  4 14:44:17 2021

@author: yrc2
"""
from biosteam import MockFeature

(set_juicing_oil_recovery, set_microbial_oil_recovery, set_bagasse_oil_recovery, 
 set_cane_operating_days, set_sorghum_operating_days, 
 set_available_land, set_crude_oil_price, set_baseline_feedstock_price,
 set_cellulosic_ethanol_price, set_advanced_ethanol_price,
 set_biomass_based_diesel_price, set_cellulosic_based_diesel_price,
 set_natural_gas_price, set_electricity_price, 
 set_IRR, set_crude_glycerol_price, set_pure_glycerol_price,
 set_saccharification_reaction_time, set_cellulase_price, 
 set_cellulase_loading, set_reactor_base_cost,
 set_cane_glucose_yield, set_cane_xylose_yield, 
 set_sorghum_glucose_yield, set_sorghum_xylose_yield, 
 set_glucose_to_ethanol_yield, set_xylose_to_ethanol_yield,
 set_cofermentation_ethanol_titer, set_cofermentation_ethanol_productivity,
 set_glucose_to_microbial_oil_yield, set_xylose_to_microbial_oil_yield,
 set_fermentation_microbial_oil_titer, set_fermentation_microbial_oil_productivity,
 set_cane_PL_content, set_sorghum_PL_content, set_cane_FFA_content,
 set_sorghum_FFA_content,  set_cane_oil_content, set_relative_sorghum_oil_content,
 set_TAG_to_FFA_conversion, set_feedstock_GWP, set_methanol_GWP, 
 set_pure_glycerine_GWP, set_cellulase_GWP, set_natural_gas_GWP,
 set_income_tax,
) = all_parameter_mockups = (
    MockFeature('Juicing oil recovery', '%', ''),
    MockFeature('Microbial oil recovery', '%', ''),
    MockFeature('Bagasse oil recovery', '%', ''),
    MockFeature('Cane operating days', 'day/yr', ''),
    MockFeature('Sorghum operating days', 'day/yr', ''),
    MockFeature('Available land', 'ha / yr', ''),
    MockFeature('Price', 'USD/barrel', 'Crude oil'),
    MockFeature('Price', 'USD/kg', 'Feedstock'),
    MockFeature('Price', 'USD/L', 'Cellulosic ethanol'),
    MockFeature('Price', 'USD/L', 'Advanced ethanol'),
    MockFeature('Price', 'USD/L', 'Biomass based diesel'),
    MockFeature('Price', 'USD/L', 'Cellulosic based diesel'),
    MockFeature('Price', 'USD/m3', 'Natural gas'),
    MockFeature('Price', 'USD/kWhr', 'Electricity'),
    MockFeature('IRR', '%', ''),
    MockFeature('Price', 'USD/kg', 'Crude glycerol'),
    MockFeature('Price', 'USD/kg', 'Pure glycerine'),
    MockFeature('Reaction time', 'hr', 'Saccharification'),
    MockFeature('Price', 'USD/kg', 'Cellulase'),
    MockFeature('Cellulase loading', 'wt. % cellulose', 'Cellulase'),
    MockFeature('Base cost', 'million USD', 'Pretreatment reactor system'),
    MockFeature('Cane glucose yield', '%', 'Pretreatment and saccharification'),
    MockFeature('Sorghum glucose yield', '%', 'Pretreatment and saccharification'),
    MockFeature('Cane xylose yield', '%', 'Pretreatment and saccharification'),
    MockFeature('Sorghum xylose yield', '%', 'Pretreatment and saccharification'),
    MockFeature('Glucose to ethanol yield', '%', 'Cofermenation'),
    MockFeature('Xylose to ethanol yield', '%', 'Cofermenation'),
    MockFeature('Ethanol titer', 'g/L', 'Cofermentation'),
    MockFeature('Ethanol productivity', 'g/L', 'Cofermentation'),
    MockFeature('Glucose to microbial oil yield', '%', 'Cofermenation'),
    MockFeature('Xylose to microbial oil yield', '%', 'Cofermenation'),
    MockFeature('Microbial oil titer', 'g/L', 'Fermentation'),
    MockFeature('Microbial oil productivity', 'g/L', 'Fermentation'),
    MockFeature('Cane PL content', '% oil', 'Oilcane'),
    MockFeature('Sorghum PL content', '% oil', 'Oilsorghum'),
    MockFeature('Cane FFA content', '% oil', 'Oilcane'),
    MockFeature('Sorghum FFA content', '% oil', 'Oilsorghum'),
    MockFeature('Cane oil content', 'dry wt. %', 'Oilcane'),
    MockFeature('Relative sorghum oil content', 'dry wt. %', 'Oilsorghum'),
    MockFeature('TAG to FFA conversion', '% oil', ''),
    MockFeature('GWP', 'kg*CO2-eq/kg', 'Sugarcane'),
    MockFeature('GWP', 'kg*CO2-eq/kg', 'Methanol'),
    MockFeature('GWP', 'kg*CO2-eq/kg', 'Pure glycerine'),
    MockFeature('GWP', 'kg*CO2-eq/kg', 'Cellulase'),
    MockFeature('GWP', 'kg*CO2-eq/kg', 'Natural gas'),
    MockFeature('Income tax', '%', ''),
)
     
(MFPP, MESP, MBSP, feedstock_consumption, biodiesel_production, biodiesel_yield, ethanol_production, 
 electricity_production, net_energy_production, natural_gas_consumption, TCI, 
 heat_exchanger_network_error, GWP_economic, GWP_ethanol, GWP_biodiesel, 
 GWP_crude_glycerol, GWP_electricity, GWP_ethanol_displacement, GWP_biodiesel_displacement,
 GWP_biofuel_allocation, GWP_ethanol_allocation,
 GWP_biodiesel_allocation, GWP_crude_glycerol_allocation,
 IRR, MFPP_derivative, 
 biodiesel_production_derivative, ethanol_production_derivative, 
 electricity_production_derivative, natural_gas_consumption_derivative, 
 TCI_derivative, GWP_economic_derivative, 
 GWP_ethanol_derivative, GWP_biodiesel_derivative,
 GWP_crude_glycerol_derivative, GWP_electricity_derivative,
 ROI, competitive_biomass_yield, energy_competitive_biomass_yield,
 # competitive_microbial_oil_yield,
 # energy_competitive_microbial_oil_yield,
 ) = all_metric_mockups = (
    MockFeature('MFPP', 'USD/MT', ''),
    MockFeature('MESP', 'USD/L', ''),
    MockFeature('MBSP', 'USD/L', ''),
    MockFeature('Feedstock consumption', 'MT/yr', ''),
    MockFeature('Biodiesel production', 'L/MT', ''),
    MockFeature('Biodiesel yield', 'L/ha', ''),
    MockFeature('Ethanol production', 'L/MT', ''),
    MockFeature('Electricity production', 'kWhr/MT', ''),
    MockFeature('Net energy production', 'GGE/MT', ''),
    MockFeature('Natural gas consumption', 'm3/MT', ''),
    MockFeature('TCI', '10^6*USD', ''),
    MockFeature('Heat exchanger network error', '%', ''),
    MockFeature('GWP', 'kg*CO2*eq / USD', 'Economic allocation'),
    MockFeature('Ethanol GWP', 'kg*CO2*eq / L', 'Economic allocation'),
    MockFeature('Biodiesel GWP', 'kg*CO2*eq / L', 'Economic allocation'),
    MockFeature('Crude glycerol GWP', 'kg*CO2*eq / kg', 'Economic allocation'),
    MockFeature('Electricity GWP', 'kg*CO2*eq / MWhr', 'Economic allocation'),
    MockFeature('Ethanol GWP', 'kg*CO2*eq / L', 'Displacement allocation'),
    MockFeature('Biodiesel GWP', 'kg*CO2*eq / L', 'Displacement allocation'),
    MockFeature('Biofuel GWP', 'kg*CO2*eq / GGE', 'Energy allocation'),
    MockFeature('Ethanol GWP', 'kg*CO2*eq / L', 'Energy allocation'),
    MockFeature('Biodiesel GWP', 'kg*CO2*eq / L', 'Energy allocation'),
    MockFeature('Crude-glycerol GWP', 'kg*CO2*eq / kg', 'Energy allocation'),
    MockFeature('IRR', '%', ''),
    MockFeature('MFPP derivative', 'USD/MT', ''),
    MockFeature('Biodiesel production derivative', 'L/MT', ''),
    MockFeature('Ethanol production derivative', 'L/MT', ''),
    MockFeature('Electricity production derivative', 'kWhr/MT', ''),
    MockFeature('Natural gas consumption derivative', 'cf/MT', ''),
    MockFeature('TCI derivative', '10^6*USD', ''),
    MockFeature('GWP derivative', 'kg*CO2*eq / USD', 'Economic allocation'),
    MockFeature('GWP derivative', 'kg*CO2*eq / L', 'Ethanol'),
    MockFeature('GWP derivative', 'kg*CO2*eq / L', 'Biodiesel'),
    MockFeature('GWP derivative', 'kg*CO2*eq / kg', 'Crude glycerol'),
    MockFeature('GWP derivative', 'kg*CO2*eq / MWhr', 'Electricity'),
    MockFeature('ROI', '%', ''),
    MockFeature('Competitive biomass yield', 'dry MT/ha', 'Feedstock'),
    MockFeature('Energy competitive biomass yield', 'dry MT/ha', 'Feedstock'),
)

tea_monte_carlo_metric_mockups = (
    MFPP, 
    TCI,
    ethanol_production,
    biodiesel_production,
    electricity_production,
    natural_gas_consumption
)

tea_monte_carlo_derivative_metric_mockups = (
    MFPP_derivative, 
    TCI_derivative,
    ethanol_production_derivative,
    biodiesel_production_derivative,
    electricity_production_derivative,
    natural_gas_consumption_derivative,
)

lca_monte_carlo_metric_mockups = (
    GWP_economic,
    GWP_ethanol,
    GWP_biodiesel,
    GWP_electricity,
    GWP_crude_glycerol,
)

lca_monte_carlo_derivative_metric_mockups = (
    GWP_economic_derivative,
    GWP_ethanol_derivative,
    GWP_biodiesel_derivative, 
    GWP_electricity_derivative,
    GWP_crude_glycerol_derivative,
)