diff --git a/.gitignore b/.gitignore index 3a6fb92c..5ad1217c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ */.project */.settings facedb.lck -doxygenDoc \ No newline at end of file +doxygenDoc +*/.Rapp.history \ No newline at end of file diff --git a/AgentSpring b/AgentSpring index 7404fba2..ee4ecb7d 160000 --- a/AgentSpring +++ b/AgentSpring @@ -1 +1 @@ -Subproject commit 7404fba2e9632344376becfcacc26cf070a21d3c +Subproject commit ee4ecb7dcdb3b826bda6cf19cd35fcf62f890228 diff --git a/emlab-generation/.gitignore b/emlab-generation/.gitignore index 2bccf602..9d9d5d04 100644 --- a/emlab-generation/.gitignore +++ b/emlab-generation/.gitignore @@ -2,3 +2,4 @@ *.log log.roo facedb.properties +/target/ diff --git a/emlab-generation/.settings/org.eclipse.jdt.core.prefs b/emlab-generation/.settings/org.eclipse.jdt.core.prefs index 62f2a6ac..496aa72b 100644 --- a/emlab-generation/.settings/org.eclipse.jdt.core.prefs +++ b/emlab-generation/.settings/org.eclipse.jdt.core.prefs @@ -9,6 +9,10 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/emlab-generation/.settings/org.eclipse.jdt.ui.prefs b/emlab-generation/.settings/org.eclipse.jdt.ui.prefs index 12da70c5..912ea7cc 100644 --- a/emlab-generation/.settings/org.eclipse.jdt.ui.prefs +++ b/emlab-generation/.settings/org.eclipse.jdt.ui.prefs @@ -78,10 +78,12 @@ sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=false sp_cleanup.always_use_this_for_non_static_field_access=false sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false sp_cleanup.convert_to_enhanced_for_loop=false sp_cleanup.correct_indentation=true sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false sp_cleanup.make_private_fields_final=true @@ -89,7 +91,7 @@ sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=true sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.on_save_use_additional_actions=false sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true @@ -97,6 +99,7 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class= sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=false sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false @@ -110,10 +113,13 @@ sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false sp_cleanup.use_blocks=false sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=false sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true sp_cleanup.use_this_for_non_static_method_access=false sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +sp_cleanup.use_type_arguments=false diff --git a/emlab-generation/queries-Ranalysis.properties b/emlab-generation/queries-Ranalysis.properties index bb8edd63..12b65fdc 100644 --- a/emlab-generation/queries-Ranalysis.properties +++ b/emlab-generation/queries-Ranalysis.properties @@ -831,4 +831,16 @@ segmentID=s.out('SEGMENTLOAD_SEGMENT').collect{it.segmentID}[0] hours=s.out('SEGMENTLOAD_SEGMENT').collect{it.lengthInHours}[0] finalResult.add([tick, s.baseLoad*growthfactor, market, segmentID, hours]) } -return finalResult", \ No newline at end of file +return finalResult", + +"TABLE_FinancialReports", "DecarbonizationModel", "financialReports=g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.FinancialPowerPlantReport']].filter{it.time==tick}; +finalResult = []; +columnNames=['tick', 'spotMarketRevenue', 'capacityMarketRevenue', 'strategicReserveRevenue', 'co2HedgingRevenue', 'overallRevenue','commodityCosts','co2Costs','variableCosts','fixedCosts','fullLoadHours','production','powerPlantName','technology','location','powerPlantOwner','operationalStatus','firstYearOfPowerPlantOperation','nominalCapacity','investedCapital']; +finalResult.add(columnNames); +for(v in financialReports){ +firstYearOfOperation=v.out('FINANCIALREPORT_POWERPLANT').constructionStartTime.next()+v.out('FINANCIALREPORT_POWERPLANT').actualPermittime.next()+v.out('FINANCIALREPORT_POWERPLANT').actualLeadtime.next() +powerPlantSize=v.out('FINANCIALREPORT_POWERPLANT').actualNominalCapacity.next() +actualInvestedCapital=v.out('FINANCIALREPORT_POWERPLANT').actualInvestedCapital.next() +finalResult.add([v.time, v.spotMarketRevenue, v.capacityMarketRevenue, v.strategicReserveRevenue, v.co2HedgingRevenue, v.overallRevenue, v.commodityCosts, v.co2Costs, v.variableCosts, v.fixedCosts, v.fullLoadHours, v.production, v.out('FINANCIALREPORT_POWERPLANT').name.next(),v.out('FINANCIALREPORT_POWERPLANT').out('TECHNOLOGY').name.next(),v.out('FINANCIALREPORT_POWERPLANT').out('LOCATION').name.next(),v.out('FINANCIALREPORT_POWERPLANT').out('POWERPLANT_OWNER').name.next(),v.powerPlantStatus,firstYearOfOperation,powerPlantSize,actualInvestedCapital]); +}; +return finalResult;", diff --git a/emlab-generation/queries.properties b/emlab-generation/queries.properties index 1d5c147a..33c25833 100644 --- a/emlab-generation/queries.properties +++ b/emlab-generation/queries.properties @@ -38,62 +38,10 @@ return productionsum;", "MarketStabilityReserve", "Government", "return v.stabilityReserve", -"MsrUpperTriggerinTonPA", "Government", "try{cap = v.out('STABILITY_RESERVE_UPPER_TRIGGER').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ -cap=v.out('STABILITY_RESERVE_UPPER_TRIGGER').timeSeries.next()[tick.toInteger()]} -model = points = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationModel']].next() -msrActive = model.stabilityReserveIsActive && (tick >= model.stabilityReserveFirstYearOfOperation) -if(msrActive){ - return cap -} else{ - return 'NA' -}", - -"MsrAddingPercentage", "Government", "try{cap = v.out('STABILITY_RESERVE_ADDING_PERCENTAGE').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ -cap=v.out('STABILITY_RESERVE_ADDING_PERCENTAGE').timeSeries.next()[tick.toInteger()]} -model = points = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationModel']].next() -msrActive = model.stabilityReserveIsActive && (tick >= model.stabilityReserveFirstYearOfOperation) -if(msrActive){ - return cap -} else{ - return 'NA' -}", - -"MsrLowerTriggerinTonPA", "Government", "try{cap = v.out('STABILITY_RESERVE_LOWER_TRIGGER').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ -cap=v.out('STABILITY_RESERVE_LOWER_TRIGGER').timeSeries.next()[tick.toInteger()]} -model = points = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationModel']].next() -msrActive = model.stabilityReserveIsActive && (tick >= model.stabilityReserveFirstYearOfOperation) -if(msrActive){ - return cap -} else{ - return 'NA' -}", - -"MsrReleaseQuantityTonPA", "Government", "try{cap = v.out('STABILITY_RESERVE_RELEASE_QUANTITY').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ -cap=v.out('STABILITY_RESERVE_RELEASE_QUANTITY').timeSeries.next()[tick.toInteger()]} -model = points = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationModel']].next() -msrActive = model.stabilityReserveIsActive && (tick >= model.stabilityReserveFirstYearOfOperation) -if(msrActive){ - return cap -} else{ - return 'NA' -}", - "CO2CapinTonpA", "Government", "try{cap = v.out('CO2CAP_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ cap = v.out('CO2CAP_TREND').timeSeries.next()[tick.toInteger()];} return ['CO2_cap', cap]", -"OriginalCO2CapinTonpA", "Government", "cap=0 -try{cap = v.out('CO2CAP_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ -cap=v.out('CO2CAP_TREND').timeSeries.next()[tick.toInteger()];} -try{capReduction = v.out('CO2CAPADJUSTMENT_TIMESERIES').timeSeries.next()[tick.toInteger()]} catch(Exception e){ - capReduction=0 -} -return ['OriginalCO2Cap', cap+capReduction]", - -"CO2CapReductioninTonpA", "Government", "try{capReduction = v.out('CO2CAPADJUSTMENT_TIMESERIES').timeSeries.next()[tick.toInteger()]} catch(Exception e){ - capReduction=0} -return ['Co2CapReductioninTonpA', capReduction]", - "NationalMinCO2PriceinEURpTon", "NationalGovernment","try{price = v.out('MINCO2PRICE_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ price = v.out('MINCO2PRICE_TREND').timeSeries.next()[tick.toInteger()];} return [v.out('GOVERNED_ZONE').collect{it.name}[0], price];", @@ -131,15 +79,7 @@ return [v.name, sum]", if(!point.hasNext()){price = 0} else {price=point.next().getProperty('price')} return price", -"MsrEmergencyTrigger", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick && it.forecast==false} -if(!point.hasNext()){emergencyTrigger=false} else {emergencyTrigger=point.next().getProperty('emergencyTriggerActivated')} -return emergencyTrigger", - -"MsrEmergencyTriggerOutflow", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick && it.forecast==false} -if(!point.hasNext()){outflow = 0} else {outflow=point.next().getProperty('emergencyTriggerOutflow')} -return outflow", - -"Forc_CO2Auction", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick+3 && it.forecast==true} +"Forc_CO2Auction", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick && it.forecast==true} if(!point.hasNext()){price = 0} else {price=point.next().getProperty('price')} return price", diff --git a/emlab-generation/queriesOld.properties b/emlab-generation/queriesOld.properties new file mode 100644 index 00000000..4fea9b91 --- /dev/null +++ b/emlab-generation/queriesOld.properties @@ -0,0 +1,771 @@ +"CapacityClearingPointPriceinEur", "DecarbonizationModel", "price = g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityClearingPoint']].filter{it.time==tick}.price; +result=[] +for(p in price) result.add(p) +if(result.isEmpty()){return 0}; +return result[0]", + +"CapacityClearingPointVolumeinEur", "DecarbonizationModel", "volume = g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityClearingPoint']].filter{it.time==tick}.volume; +result=[] +for(vl in volume) result.add(vl) +if(result.isEmpty()){return 0}; +return result[0]", + +"CapacityMarketShortageIndicator", "DecarbonizationModel", "price = g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityClearingPoint']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick).price; +priceCap = g.idx('__types__')[[className:'emlab.gen.domain.agent.Regulator']].capacityMarketPriceCap; +value = 0 +if (price == null) value = 0; +if (price == priceCap) value = 1; +else value = 0; +return value", + +"ConsumerExpenditure", "ElectricitySpotMarket", "[v.name, -v.cash]", + +"TABLE_CapacityDispatchPlans", "DecarbonizationModel", "cdp=g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityDispatchPlan']].filter{it.time==tick}; + finalResult = []; + columnNames=['tick','bidder', 'market','volume', 'price', 'technology', 'status'] + finalResult.add(columnNames); + for (v in cdp){ + tick=v.time; + volume=v.amount; + technology=v.out('CAPACITY_DISPATCHPLAN').out('TECHNOLOGY').collect{it.name}[0]; status=v.status; + price=v.price; + bidder=v.in('BIDDER').collect{it.name}[0]; + market=v.out('BIDDINGMARKET').collect{it.name}[0]; + tempResult=[tick,bidder,market,volume, price, technology, status] + finalResult.add(tempResult); + } + return finalResult;", + + +"CapacityinMW", "PowerGeneratingTechnology", "capacity= v.in().filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.sum{it.actualNominalCapacity} +if(capacity == null) capacity = 0 +[v.name, capacity]", + +"CapacityinMWinA", "PowerGeneratingTechnology", "capacity = v.in('TECHNOLOGY').as('x').out('LOCATION').out('REGION').filter{it.name=='Country A'}.back('x').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.sum{it.actualNominalCapacity} +if(capacity == null) capacity = 0 +[v.name, capacity]", + +"CapacityinMWinB", "PowerGeneratingTechnology", "capacity = v.in('TECHNOLOGY').as('x').out('LOCATION').out('REGION').filter{it.name=='Country B'}.back('x').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.sum{it.actualNominalCapacity} +if(capacity == null) capacity = 0 +[v.name, capacity]", + +"PeakDemandPerZoneInMW", "ElectricitySpotMarket", "topsegments = v.out('SEGMENT_LOAD').max{it.baseLoad}.baseLoad; +try{growthfactors = v.out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ +growthfactors=v.out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} +adjustedTopSegments = topsegments*growthfactors; +return [v.outE('ZONE').inV.collect{it.name}[0], adjustedTopSegments]", + +"TotalOperationalCapacityPerZoneInMW", "Zone", "t = new Table(); +pp = v.in('REGION').in('LOCATION') +pp.filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.as('powerPlantCapacity').out('TECHNOLOGY').as('peakSegmentDependentAvailability').table(t){it.actualNominalCapacity}{it.peakSegmentDependentAvailability}.cap().next(); +capacitySum = 0; for (row in t){capacitySum += row.getColumn('powerPlantCapacity') * row.getColumn('peakSegmentDependentAvailability')} +return [v.name, capacitySum]", + +"TotalConsumptioninMWh", "DecarbonizationModel", "segmentloads = g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.SegmentLoad']]; +productionsum = 0; +for(segmentload in segmentloads){ + //productionsum += segmentload.baseLoad; + try{growthfactor = segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} + productionsum += segmentload.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentload.baseLoad * growthfactor; +} +return productionsum;", + + + +"CO2CapinTonpA", "Government", "try{cap = v.out('CO2CAP_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ +cap = v.out('CO2CAP_TREND').timeSeries.next()[tick.toInteger()];} +return ['CO2_cap', cap]", + +"NationalMinCO2PriceinEURpTon", "NationalGovernment","try{price = v.out('MINCO2PRICE_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ +price = v.out('MINCO2PRICE_TREND').timeSeries.next()[tick.toInteger()];} +return [v.out('GOVERNED_ZONE').collect{it.name}[0], price];", + +"NationalGovernmentCash", "NationalGovernment"," +return [v.out('GOVERNED_ZONE').collect{it.name}[0], v.cash];", + +"EUGovernmentCash", "Government"," +return v.cash;", + +"SpotMarketCash", "ElectricitySpotMarket"," +return [v.name, v.cash];", + +"GenerationinMWh", "PowerGeneratingTechnology", "sum = 0; +ppdps = v.in('TECHNOLOGY').in('POWERPLANT_DISPATCHPLAN').filter{it.time==tick && it.status>=2 && it.forecast==false}; +for(ppdp in ppdps){ + totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract'); + hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours'); + production = totalAmount * hoursInSegment; + sum = sum + production; +} +return [v.name, sum]", + +"GenerationinMWhPerProducer", "EnergyProducer", "sum = 0; +ppdps = v.out('BIDDER').filter{it.__type__.contains('PowerPlantDispatchPlan')}.filter{it.time==tick && it.status>=2 && it.forecast==false}; +for(ppdp in ppdps){ + totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract'); + hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours'); + production = totalAmount * hoursInSegment; + sum = sum + production; +} +return [v.name, sum]", + +"CO2Auction", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick && it.forecast==false} +if(!point.hasNext()){price = 0} else {price=point.next().getProperty('price')} +return price", + + +"Forc_CO2Auction", "CO2Auction", "point=v.in('MARKET_POINT').filter{it.time==tick+3 && it.forecast==true} +if(!point.hasNext()){price = 0} else {price=point.next().getProperty('price')} +return price", + +"Avg_El_PricesinEURpMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick && it.forecast==false}.toList(); +[v.name, cp.sum{it.price * it.volume} / cp.sum{it.volume}]; +", + +"Forc_Avg_El_PricesinEURpMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick+3 && it.forecast==true}.toList(); +[v.name, cp.sum{it.price * it.volume} / cp.sum{it.volume}]; +", + +"NationalTotalProductioninMWh", "Zone", "powerplants = v.in('REGION').in('LOCATION') +return [v.name, powerplants.in('POWERPLANT_DISPATCHPLAN').filter{it.forecast==false}.sum{f.determineProductionOfDispatchPlanInMWh(it, tick)}]", + +"Total_EnergyServedinMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick && it.forecast==false}; +return [v.name, cp.sum{it.volume}]; +", + +"Total_DemandinMWh", "Zone", "segmentloads = v.in('ZONE').out('SEGMENT_LOAD') +demandsum = 0; +for(segmentload in segmentloads){ + try{growthfactor = segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} + demandsum += segmentload.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentload.baseLoad * growthfactor; +}; +return [v.name, demandsum]; +", + +"WelfareLossThroughENS", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick && it.forecast==false}.toList(); +energyServed = cp.sum{it.volume}; +segmentloads = v.in('ZONE').out('SEGMENT_LOAD') +demandSum = 0; +for(segmentload in segmentloads){ + try{growthfactor = segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} + demandSum += segmentload.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentload.baseLoad * growthfactor; +}; +energyNotServed = demandSum - energyServed; +voll = v.in('ZONE').next().valueOfLostLoad +return [v.name, energyNotServed*voll]; +", + +"EnergyNotServedinMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick && it.forecast==false}.toList(); +energyServed = cp.sum{it.volume}; +segmentloads = v.in('ZONE').out('SEGMENT_LOAD') +demandSum = 0; +for(segmentload in segmentloads){ + try{growthfactor = segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} + demandSum += segmentload.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentload.baseLoad * growthfactor; +}; +energyNotServed = demandSum - energyServed; +return [v.name, energyNotServed]; +", + +"Forc_Total_DemandinMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick+3 && it.forecast==true}.toList(); +[v.name, cp.sum{it.volume}]; +", + +"CO2Emissions_inTonpA", "DecarbonizationModel", "ppdps=g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.PowerPlantDispatchPlan']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick).filter{it.status>=1 && it.forecast==false}.collect(); +co2Emissions = 0 +for(plan in ppdps){ +fuelMix=plan.out('POWERPLANT_DISPATCHPLAN').out('FUEL_MIX').collect() +singleEmission=0 + for(fuelMixElement in fuelMix){ + //fuelMixElement=fuelMix[1] + share=fuelMixElement.share + co2Density=fuelMixElement.out('SUBSTANCE').collect{it.co2Density}[0]*(1-plan.out('POWERPLANT_DISPATCHPLAN').out('TECHNOLOGY').collect{it.co2CaptureEffciency}[0]) + singleEmission+=share*co2Density + } + co2Emissions+=plan.acceptedAmount*singleEmission*plan.out('SEGMENT_DISPATCHPLAN').collect{it.lengthInHours}[0] +} +return co2Emissions", + +"Forc_CO2Emissions_inTonpA", "DecarbonizationModel", "ppdps=g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.PowerPlantDispatchPlan']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick+3).filter{it.status>=1 && it.forecast==true}.collect(); +co2Emissions = 0 +for(plan in ppdps){ +fuelMix=plan.out('POWERPLANT_DISPATCHPLAN').out('FUEL_MIX').collect() +singleEmission=0 + for(fuelMixElement in fuelMix){ + //fuelMixElement=fuelMix[1] + share=fuelMixElement.share + co2Density=fuelMixElement.out('SUBSTANCE').collect{it.co2Density}[0]*(1-plan.out('POWERPLANT_DISPATCHPLAN').out('TECHNOLOGY').collect{it.co2CaptureEffciency}[0]) + singleEmission+=share*co2Density + } + co2Emissions+=plan.acceptedAmount*singleEmission*plan.out('SEGMENT_DISPATCHPLAN').collect{it.lengthInHours}[0] +} +return co2Emissions", + +"EUCO2PriceFloor", "Government", "try{price = v.out('MINCO2PRICE_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ +price = v.out('MINCO2PRICE_TREND').timeSeries.next()[tick.toInteger()];}; +return ['EU CO2 price floor', price];", + +"CO2Tax", "Government", "try{price = v.out('CO2TAX_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ +price = v.out('CO2TAX_TREND').timeSeries.next()[tick.toInteger()];} +return price", + +"FuelPricesPerGJ", "DecarbonizationModel", "fuels = g.idx('__types__')[[className:'emlab.gen.domain.technology.Substance']].filter{it.name != 'Electricity' && it.name != 'CO2'} +result = [] +for(v in fuels){ + price = v.in('SUBSTANCE_MARKET').in('MARKET_POINT').filter{it.time == tick}.collect{it.price}; + density = v.energyDensity; + inGJ = price[0] / density; + result.add([v.name,inGJ]);} + return result", + +"ProducerCash", "EnergyProducer", "[v.name, v.cash]", + +"AggregateFinances", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +totalCosts = 0; +totalRevenue = 0; +totalSpotRevenue = 0; +totalLTCRevenue = 0; +totalCMRevenue = 0; +totalRESRevenue=0; +totalCO2HedgingRevenue=0; +totalTargetInvCosts = 0; +totalTargetInvRevenue = 0; +totalTargetInvSpotRevenue = 0; +totalTargetInvLTCRevenue = 0; +totalTargetInvCMRevenue = 0; +totalTargetInvRESRevenue=0; +totalTargetInvCO2HedgingRevenue=0; +hedgingFlows=[] +for (key in groups.keySet()) { + if (key<3 || (key>9 && key!=12)) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvRevenue += flow.money; + } + } + + } else if(key!=12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalCosts += flow.money; + } else if(flow.out('FROM_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvCosts += flow.money; + } + } + } + + if (key==1) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalSpotRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvSpotRevenue += flow.money; + } + } + + } + + if (key==2) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalLTCRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvLTCRevenue += flow.money; + } + } + + } + + if (key==11) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalCMRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvCMRevenue += flow.money; + } + } + + } + + + if (key==10) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalRESRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvRESRevenue += flow.money; + } + } + + } + +if (key==12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + hedgingFlows.add(flow) + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + totalCO2HedgingRevenue += flow.money; + totalRevenue+= flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor')}[0]){ + totalTargetInvCO2HedgingRevenue += flow.money; + } + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer') }[0]) { + //totalCO2HedgingRevenue -= flow.money; + totalCosts+= flow.money; + } + } + } + +} +result.add(['Total Revenue', totalRevenue]); +result.add(['Revenue LTC', totalLTCRevenue]); +result.add(['Revenue Spot', totalSpotRevenue]); +result.add(['Revenue CM', totalCMRevenue]) +result.add(['Revenue RES',totalRESRevenue]) +result.add(['Revenue CO2Hedge', totalCO2HedgingRevenue]); +result.add(['Profit', totalRevenue - totalCosts]); +result.add(['TI Revenue', totalTargetInvRevenue]); +result.add(['TI Revenue LTC', totalTargetInvLTCRevenue]); +result.add(['TI Revenue Spot', totalTargetInvSpotRevenue]); +result.add(['TI Revenue CM', totalTargetInvCMRevenue]) +result.add(['TI Revenue RES',totalTargetInvRESRevenue]) +result.add(['TI Revenue CO2Hedge', totalTargetInvCO2HedgingRevenue]); +result.add(['TI Profit', totalTargetInvRevenue - totalTargetInvCosts]); +return result; +", + +"CountryAProdFinances", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +totalCosts = 0; +totalRevenue = 0; +totalSpotRevenue = 0; +totalLTCRevenue = 0; +totalCMRevenue = 0; +totalRESRevenue=0; +totalCO2HedgingRevenue=0; +totalTargetInvCosts = 0; +totalTargetInvRevenue = 0; +totalTargetInvSpotRevenue = 0; +totalTargetInvLTCRevenue = 0; +totalTargetInvCMRevenue = 0; +totalTargetInvRESRevenue=0; +totalTargetInvCO2HedgingRevenue=0; +hedgingFlows=[] +for (key in groups.keySet()) { + if (key<3 || (key>9 && key!=12)) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvRevenue += flow.money; + } + } + + } else if(key!=12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalCosts += flow.money; + } else if(flow.out('FROM_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvCosts += flow.money; + } + } + } + + if (key==1) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalSpotRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvSpotRevenue += flow.money; + } + } + + } + + if (key==2) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalLTCRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvLTCRevenue += flow.money; + } + } + + } + + if (key==11) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalCMRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvCMRevenue += flow.money; + } + } + + } + + + if (key==10) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalRESRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvRESRevenue += flow.money; + } + } + + } + +if (key==12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + hedgingFlows.add(flow) + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalCO2HedgingRevenue += flow.money; + totalRevenue+= flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]){ + totalTargetInvCO2HedgingRevenue += flow.money; + } + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer') }[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + totalCO2HedgingRevenue -= flow.money; + totalCosts+= flow.money; + } + } + } + +} +result.add(['Total Revenue', totalRevenue]); +result.add(['Revenue LTC', totalLTCRevenue]); +result.add(['Revenue Spot', totalSpotRevenue]); +result.add(['Revenue CM', totalCMRevenue]) +result.add(['Revenue RES',totalRESRevenue]) +result.add(['Revenue CO2Hedge', totalCO2HedgingRevenue]); +result.add(['Profit', totalRevenue - totalCosts]); +result.add(['TI Revenue', totalTargetInvRevenue]); +result.add(['TI Revenue LTC', totalTargetInvLTCRevenue]); +result.add(['TI Revenue Spot', totalTargetInvSpotRevenue]); +result.add(['TI Revenue CM', totalTargetInvCMRevenue]) +result.add(['TI Revenue RES',totalTargetInvRESRevenue]) +result.add(['TI Revenue CO2Hedge', totalTargetInvCO2HedgingRevenue]); +result.add(['TI Profit', totalTargetInvRevenue - totalTargetInvCosts]); +return result; +", + +"CountryBProdFinances", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +totalCosts = 0; +totalRevenue = 0; +totalSpotRevenue = 0; +totalLTCRevenue = 0; +totalCMRevenue = 0; +totalRESRevenue=0; +totalCO2HedgingRevenue=0; +totalTargetInvCosts = 0; +totalTargetInvRevenue = 0; +totalTargetInvSpotRevenue = 0; +totalTargetInvLTCRevenue = 0; +totalTargetInvCMRevenue = 0; +totalTargetInvRESRevenue=0; +totalTargetInvCO2HedgingRevenue=0; +hedgingFlows=[] +for (key in groups.keySet()) { + if (key<3 || (key>9 && key!=12)) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvRevenue += flow.money; + } + } + + } else if(key!=12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalCosts += flow.money; + } else if(flow.out('FROM_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvCosts += flow.money; + } + } + } + + if (key==1) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalSpotRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvSpotRevenue += flow.money; + } + } + + } + + if (key==2) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalLTCRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvLTCRevenue += flow.money; + } + } + + } + + if (key==11) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalCMRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvCMRevenue += flow.money; + } + } + + } + + + if (key==10) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalRESRevenue += flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvRESRevenue += flow.money; + } + } + + } + +if (key==12) { + for (flow in groups[key]) { + if (flow.time != tick) continue; + hedgingFlows.add(flow) + if (flow.out('TO_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalCO2HedgingRevenue += flow.money; + totalRevenue+= flow.money; + } else if(flow.out('TO_AGENT').collect{it.__type__.contains('TargetInvestor') }[0] && flow.out('TO_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]){ + totalTargetInvCO2HedgingRevenue += flow.money; + } + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer') }[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + totalCO2HedgingRevenue -= flow.money; + totalCosts+= flow.money; + } + } + } + +} +result.add(['Total Revenue', totalRevenue]); +result.add(['Revenue LTC', totalLTCRevenue]); +result.add(['Revenue Spot', totalSpotRevenue]); +result.add(['Revenue CM', totalCMRevenue]) +result.add(['Revenue RES',totalRESRevenue]) +result.add(['Revenue CO2Hedge', totalCO2HedgingRevenue]); +result.add(['Profit', totalRevenue - totalCosts]); +result.add(['TI Revenue', totalTargetInvRevenue]); +result.add(['TI Revenue LTC', totalTargetInvLTCRevenue]); +result.add(['TI Revenue Spot', totalTargetInvSpotRevenue]); +result.add(['TI Revenue CM', totalTargetInvCMRevenue]) +result.add(['TI Revenue RES',totalTargetInvRESRevenue]) +result.add(['TI Revenue CO2Hedge', totalTargetInvCO2HedgingRevenue]); +result.add(['TI Profit', totalTargetInvRevenue - totalTargetInvCosts]); +return result;", + +"PriceInEURperMWh", "DecarbonizationModel", "results = [] +points = g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.SegmentClearingPoint']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick).propertyFilter('forecast', FilterPipe.Filter.EQUAL, false) +for(scp in points){ + results.add(['Segment ' + scp.out('MARKET_POINT').out('ZONE').name.next() + ' ' + scp.out('SEGMENT_POINT').segmentID.next(), scp.price]) +} +return results", + +"ShortagesInHoursUnserved", "DecarbonizationModel", "powerplants = g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)} +production= powerplants.in('POWERPLANT_DISPATCHPLAN').sum{f.determineProductionOfDispatchPlanInMWh(it, tick)}; +segmentloads = g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.SegmentLoad']] +productionsum = 0; +for(segmentload in segmentloads){ + try{growthfactor = segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentload.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]} + productionsum += segmentload.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentload.baseLoad * growthfactor; +} +return (production-productionsum)/productionsum*8760;", + +"ProducerCosts", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +allKeys = [] +for(i in 0..12) + allKeys.add(i) +usedKeys=[] +for (key in allKeys) { + usedKeys.add(key) + sum = 0; + if(key in groups.keySet()){ + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0]) { + sum += flow.money; + } + } + } + name='Unspecified'; + if(key==0){name='Unclassified';} + if(key==1){name='Electricity spot';} + if(key==2){name='Electricity ltc';} + if(key==3){name='Fixed O&M';} + if(key==4){name='Commodity';} + if(key==5){name='CO2 tax';} + if(key==6){name='CO2 auction';} + if(key==7){name='Loan';} + if(key==8){name='Downpayment';} + if(key==9){name='National CO2 MinPrice';} + if(key==10){name='Strategic Reserve';} + if(key==11){name='Capacity Market';} + if(key==12){name='CO2 Hedging';} + result.add([name, sum]); +} +return result;", + +"CountryAProdCosts", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +allKeys = [] +for(i in 0..12) + allKeys.add(i) +usedKeys=[] +for (key in allKeys) { + usedKeys.add(key) + sum = 0; + if(key in groups.keySet()){ + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country A')}[0]) { + sum += flow.money; + } + } + } + name='Unspecified'; + if(key==0){name='Unclassified';} + if(key==1){name='Electricity spot';} + if(key==2){name='Electricity ltc';} + if(key==3){name='Fixed O&M';} + if(key==4){name='Commodity';} + if(key==5){name='CO2 tax';} + if(key==6){name='CO2 auction';} + if(key==7){name='Loan';} + if(key==8){name='Downpayment';} + if(key==9){name='National CO2 MinPrice';} + if(key==10){name='Strategic Reserve';} + if(key==11){name='Capacity Market';} + if(key==12){name='CO2 Hedging';} + result.add([name, sum]); +} +return result;", + +"CountryBProdCosts", "DecarbonizationModel", "flows = n.getNodes('CashFlow'); +groups = flows.groupBy{it.type} +result = []; +allKeys = [] +for(i in 0..12) + allKeys.add(i) +usedKeys=[] +for (key in allKeys) { + usedKeys.add(key) + sum = 0; + if(key in groups.keySet()){ + for (flow in groups[key]) { + if (flow.time != tick) continue; + if (flow.out('FROM_AGENT').collect{it.__type__.contains('EnergyProducer')}[0] && flow.out('FROM_AGENT').out('INVESTOR_MARKET').out('ZONE').collect{it.name.equals('Country B')}[0]) { + sum += flow.money; + } + } + } + name='Unspecified'; + if(key==0){name='Unclassified';} + if(key==1){name='Electricity spot';} + if(key==2){name='Electricity ltc';} + if(key==3){name='Fixed O&M';} + if(key==4){name='Commodity';} + if(key==5){name='CO2 tax';} + if(key==6){name='CO2 auction';} + if(key==7){name='Loan';} + if(key==8){name='Downpayment';} + if(key==9){name='National CO2 MinPrice';} + if(key==10){name='Strategic Reserve';} + if(key==11){name='Capacity Market';} + if(key==12){name='CO2 Hedging';} + result.add([name, sum]); +} +return result;", + +"TABLE_SegmentClearingPoints", "DecarbonizationModel", "points = g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.SegmentClearingPoint']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick).propertyFilter('forecast', FilterPipe.Filter.EQUAL, false) +finalResult = [] +headers=['tick','volume','price','market','segmentID','segmentLength','interconectorFlow','demand','energynotserved'] +finalResult.add(headers) +for(v in points){ +market=v.out('MARKET_POINT') +segment=v.out('SEGMENT_POINT').next() +segmentId=segment.segmentID +segmentLoad=market.out('SEGMENT_LOAD').as('x').out('SEGMENTLOAD_SEGMENT').filter{it.segmentID==segmentId}.back('x').next(); +//return segmentLoad.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()] +//return segmentLoad.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').next().timeSeries[tick.toInteger()] +growthfactor=1 +try{growthfactor = segmentLoad.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){ + growthfactor=segmentLoad.in('SEGMENT_LOAD').out('DEMANDGROWTH_TREND').next().timeSeries[tick.toInteger()]} +//} +//return segmentLoad +demandLevel=segmentLoad.out('SEGMENTLOAD_SEGMENT').lengthInHours.next() * segmentLoad.baseLoad * growthfactor; + finalResult.add([v.time, v.volume, v.price, v.out('MARKET_POINT').collect{it.name}[0], v.out('SEGMENT_POINT').collect{it.segmentID}[0], v.out('SEGMENT_POINT').collect{it.lengthInHours}[0],v.interconnectorFlow,demandLevel,demandLevel-v.volume]) +} +return finalResult; +", + +"TABLE_ClearingPoints", "DecarbonizationModel", "points = g.idx('__types__')[[className:'emlab.gen.domain.market.ClearingPoint']].propertyFilter('time', FilterPipe.Filter.EQUAL, tick).propertyFilter('forecast', FilterPipe.Filter.EQUAL, false) +finalResult = [] +headers=['tick','volume','price',',market'] +finalResult.add(headers) +for(v in points){ +finalResult.add([v.time, v.volume, v.price, v.out('MARKET_POINT').collect{it.name}[0]]) +} +return finalResult", + +"TABLE_InitialPowerPlants", "DecarbonizationModel", "if(tick<1){ +powerPlants=g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']]; +finalResult = []; +columnNames=['Name', 'Technology', 'Location', 'Age', 'Owner', 'Capacity', 'Efficiency'] +finalResult.add(columnNames) +for(p in powerPlants){ +name = p.name +technology = p.out('TECHNOLOGY').collect{it.name}[0] +location = p.out('LOCATION').collect{it.name}[0] +age = -p.constructionStartTime-p.actualLeadtime-p.actualPermittime +owner = p.out('POWERPLANT_OWNER').collect{it.name}[0] +capacity = p.actualNominalCapacity +efficiency = p.actualEfficiency +finalResult.add([name,technology,location,age,owner,capacity,efficiency]) +} +return finalResult +}", diff --git a/emlab-generation/src/main/java/emlab/gen/domain/agent/DecarbonizationModel.java b/emlab-generation/src/main/java/emlab/gen/domain/agent/DecarbonizationModel.java index 8a6ec4be..856e83aa 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/agent/DecarbonizationModel.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/agent/DecarbonizationModel.java @@ -54,9 +54,6 @@ public class DecarbonizationModel extends AbstractAgent implements Agent { private double stabilityReserveBankingThirdYear; - private boolean noPrivateIntermittentRESInvestment; - - @SimulationParameter(label = "Simulation Length", from = 0, to = 75) private double simulationLength; @@ -75,9 +72,33 @@ public class DecarbonizationModel extends AbstractAgent implements Agent { @SimulationParameter(label = "Exit simulation after simulation length") private boolean exitSimulationAfterSimulationLength; + @SimulationParameter(label = "Simple Capacity Market") + private boolean simpleCapacityMarketEnabled; + + @SimulationParameter(label = "Feed in Premium") + private boolean feedInPremiumImplemented; + @SimulationParameter(label = "Deletion age") private long deletionAge; + private boolean noPrivateIntermittentRESInvestment; + + public boolean isFeedInPremiumImplemented() { + return feedInPremiumImplemented; + } + + public void setFeedInPremiumImplemented(boolean feedInPremiumImplemented) { + this.feedInPremiumImplemented = feedInPremiumImplemented; + } + + public boolean isSimpleCapacityMarketEnabled() { + return simpleCapacityMarketEnabled; + } + + public void setSimpleCapacityMarketEnabled(boolean simpleCapacityMarketEnabled) { + this.simpleCapacityMarketEnabled = simpleCapacityMarketEnabled; + } + public boolean isRealRenewableDataImplemented() { return realRenewableDataImplemented; } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/agent/EnergyProducer.java b/emlab-generation/src/main/java/emlab/gen/domain/agent/EnergyProducer.java index b9a95bbe..d7118e4f 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/agent/EnergyProducer.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/agent/EnergyProducer.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2012 the original author or authors. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -42,7 +42,7 @@ public class EnergyProducer extends DecarbonizationAgent implements Agent { @SimulationParameter(label = "Long-term contract horizon", from = 0, to = 10) private double longTermContractPastTimeHorizon; - //Investment + // Investment @SimulationParameter(label = "Investment horizon", from = 0, to = 15) private int investmentFutureTimeHorizon; @SimulationParameter(label = "Equity Interest Rate", from = 0, to = 1) @@ -52,11 +52,22 @@ public class EnergyProducer extends DecarbonizationAgent implements Agent { private double debtRatioOfInvestments; private boolean willingToInvest; + @SimulationParameter(label = "Simple Capacity Market") + private boolean simpleCapacityMarketEnabled; + + public boolean isSimpleCapacityMarketEnabled() { + return simpleCapacityMarketEnabled; + } + + public void setSimpleCapacityMarketEnabled(boolean isSimpleCapacityMarketEnabled) { + this.simpleCapacityMarketEnabled = isSimpleCapacityMarketEnabled; + } + // Loan @SimulationParameter(label = "Loan Interest Rate", from = 0, to = 1) private double loanInterestRate; - //Forecasting + // Forecasting private int numberOfYearsBacklookingForForecasting; // Dismantling @@ -64,6 +75,12 @@ public class EnergyProducer extends DecarbonizationAgent implements Agent { private double dismantlingRequiredOperatingProfit; private long pastTimeHorizon; + // Historical CVar Parameters + private double historicalCVarAlpha; + private double historicalCVarBeta; + private double historicalCVarPropensityForNewTechnologies; + private double historicalCVarInterestRateIncreaseForNewTechnologies; + public boolean isWillingToInvest() { return willingToInvest; } @@ -183,4 +200,37 @@ public ElectricitySpotMarket getInvestorMarket() { public void setInvestorMarket(ElectricitySpotMarket investorMarket) { this.investorMarket = investorMarket; } + + public double getHistoricalCVarAlpha() { + return historicalCVarAlpha; + } + + public void setHistoricalCVarAlpha(double historicalCVarAlpha) { + this.historicalCVarAlpha = historicalCVarAlpha; + } + + public double getHistoricalCVarBeta() { + return historicalCVarBeta; + } + + public void setHistoricalCVarBeta(double historicalCVarBeta) { + this.historicalCVarBeta = historicalCVarBeta; + } + + public double getHistoricalCVarPropensityForNewTechnologies() { + return historicalCVarPropensityForNewTechnologies; + } + + public void setHistoricalCVarPropensityForNewTechnologies(double historicalCVarPropensityForNewTechnologies) { + this.historicalCVarPropensityForNewTechnologies = historicalCVarPropensityForNewTechnologies; + } + + public double getHistoricalCVarInterestRateIncreaseForNewTechnologies() { + return historicalCVarInterestRateIncreaseForNewTechnologies; + } + + public void setHistoricalCVarInterestRateIncreaseForNewTechnologies( + double historicalCVarInterestRateIncreaseForNewTechnologies) { + this.historicalCVarInterestRateIncreaseForNewTechnologies = historicalCVarInterestRateIncreaseForNewTechnologies; + } } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/agent/Government.java b/emlab-generation/src/main/java/emlab/gen/domain/agent/Government.java index f9d3de7b..1fab770e 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/agent/Government.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/agent/Government.java @@ -61,10 +61,14 @@ public class Government extends DecarbonizationAgent implements Agent { private boolean adaptiveCapAdjustmentBasedOnCapNotActualEmissions; + private boolean adaptiveCapAdjustmentRelativeToNonSubsidisedProduction; + private double co2Penalty; private double stabilityReserve; + private boolean stabilityReserveHasOneYearDelayInsteadOfTwoYearDelay; + @RelatedTo(type = "STABILITY_RESERVE_UPPER_TRIGGER", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) private TimeSeriesImpl stabilityReserveUpperTriggerTrend; @@ -223,4 +227,23 @@ public void setAdaptiveCapAdjustmentBasedOnCapNotActualEmissions( this.adaptiveCapAdjustmentBasedOnCapNotActualEmissions = adaptiveCapAdjustmentBasedOnCapNotActualEmissions; } + + public boolean isAdaptiveCapAdjustmentRelativeToNonSubsidisedProduction() { + return adaptiveCapAdjustmentRelativeToNonSubsidisedProduction; + } + + public void setAdaptiveCapAdjustmentRelativeToNonSubsidisedProduction( + boolean adaptiveCapAdjustmentRelativeToNonSubsidisedProduction) { + this.adaptiveCapAdjustmentRelativeToNonSubsidisedProduction = adaptiveCapAdjustmentRelativeToNonSubsidisedProduction; + } + + public boolean isStabilityReserveHasOneYearDelayInsteadOfTwoYearDelay() { + return stabilityReserveHasOneYearDelayInsteadOfTwoYearDelay; + } + + public void setStabilityReserveHasOneYearDelayInsteadOfTwoYearDelay( + boolean stabilityReserveHasOneYearDelayInsteadOfTwoYearDelay) { + this.stabilityReserveHasOneYearDelayInsteadOfTwoYearDelay = stabilityReserveHasOneYearDelayInsteadOfTwoYearDelay; + } + } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/agent/Regulator.java b/emlab-generation/src/main/java/emlab/gen/domain/agent/Regulator.java new file mode 100644 index 00000000..57c50e9f --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/agent/Regulator.java @@ -0,0 +1,134 @@ +/******************************************************************************* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.agent; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import agentspring.agent.Agent; +import agentspring.simulation.SimulationParameter; +import emlab.gen.domain.gis.Zone; + +/** + * @author Kaveri + * + */ +@NodeEntity +public class Regulator extends DecarbonizationAgent implements Agent { + + @RelatedTo(type = "OF_ZONE", elementClass = Zone.class, direction = Direction.OUTGOING) + private Zone zone; + + private int numberOfYearsLookingBackToForecastDemand; + + // Capacity Market Related Parameters + + @SimulationParameter(label = "Capacity Market Price Cap", from = 1000, to = 150000) + private double capacityMarketPriceCap; + + @SimulationParameter(label = "Reserve Margin", from = 0, to = 1) + private double reserveMargin; + + @SimulationParameter(label = "Reserve Demand Lower Margin", from = 0, to = 1) + private double reserveDemandLowerMargin; + + @SimulationParameter(label = "Reserve Demand Upper Margin", from = 0, to = 1) + private double reserveDemandUpperMargin; + + private double demandTarget; + + @SimulationParameter(label = "Capacity Market Target Period", from = 0, to = 10) + private int targetPeriod; // number of years in the future that the capacity + // is being planned for - set to zero + + // Feed-in-Premium Related Pàrameters + @SimulationParameter(label = "FeedInPremiumFactor", from = 0, to = 1) + private double feedInPremiumFactor; + + public double getDemandTarget() { + return demandTarget; + } + + public void setDemandTarget(double demandTarget) { + this.demandTarget = demandTarget; + } + + public double getCapacityMarketPriceCap() { + return capacityMarketPriceCap; + } + + public void setCapacityMarketPriceCap(double capacityMarketPriceCap) { + this.capacityMarketPriceCap = capacityMarketPriceCap; + } + + public int getNumberOfYearsLookingBackToForecastDemand() { + return numberOfYearsLookingBackToForecastDemand; + } + + public void setNumberOfYearsLookingBackToForecastDemand(int numberOfYearsLookingBackToForecastDemand) { + this.numberOfYearsLookingBackToForecastDemand = numberOfYearsLookingBackToForecastDemand; + } + + public int getTargetPeriod() { + return targetPeriod; + } + + public double getFeedInPremiumFactor() { + return feedInPremiumFactor; + } + + public void setFeedInPremiumFactor(double feedInPremiumFactor) { + this.feedInPremiumFactor = feedInPremiumFactor; + } + + public void setTargetPeriod(int targetPeriod) { + this.targetPeriod = targetPeriod; + } + + public double getReserveDemandLowerMargin() { + return reserveDemandLowerMargin; + } + + public void setReserveDemandLowerMargin(double reserveDemandLowerMargin) { + this.reserveDemandLowerMargin = reserveDemandLowerMargin; + } + + public double getReserveDemandUpperMargin() { + return reserveDemandUpperMargin; + } + + public void setReserveDemandUpperMargin(double reserveDemandUpperMargin) { + this.reserveDemandUpperMargin = reserveDemandUpperMargin; + } + + public double getReserveMargin() { + return reserveMargin; + } + + public void setReserveMargin(double reserveMargin) { + this.reserveMargin = reserveMargin; + } + + public Zone getZone() { + return zone; + } + + public void setZone(Zone zone) { + this.zone = zone; + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/domain/contract/CashFlow.java b/emlab-generation/src/main/java/emlab/gen/domain/contract/CashFlow.java index 34ba51f5..f6d0f559 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/contract/CashFlow.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/contract/CashFlow.java @@ -36,7 +36,9 @@ public class CashFlow { public static final int DOWNPAYMENT = 8; public static final int NATIONALMINCO2 = 9; public static final int STRRESPAYMENT = 10; + public static final int SIMPLE_CAPACITY_MARKET = 11; public static final int CO2HEDGING = 12; + public static final int FEED_IN_PREMIUM = 13; @RelatedTo(type = "FROM_AGENT", elementClass = DecarbonizationAgent.class, direction = Direction.OUTGOING) private DecarbonizationAgent from; diff --git a/emlab-generation/src/main/java/emlab/gen/domain/contract/Loan.java b/emlab-generation/src/main/java/emlab/gen/domain/contract/Loan.java index 3327b949..dcb56b44 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/contract/Loan.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/contract/Loan.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2012 the original author or authors. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,9 +16,9 @@ package emlab.gen.domain.contract; +import org.neo4j.graphdb.Direction; import org.springframework.data.neo4j.annotation.NodeEntity; import org.springframework.data.neo4j.annotation.RelatedTo; -import org.neo4j.graphdb.Direction; import emlab.gen.domain.agent.DecarbonizationAgent; import emlab.gen.domain.technology.PowerPlant; @@ -32,7 +32,7 @@ public class Loan { @RelatedTo(type = "LEND_BY_AGENT", elementClass = DecarbonizationAgent.class, direction = Direction.OUTGOING) private DecarbonizationAgent to; - @RelatedTo(type = "REGARDING_POWERPLANT", elementClass = PowerPlant.class, direction = Direction.OUTGOING) + @RelatedTo(type = "LOAN_POWERPLANT", elementClass = PowerPlant.class, direction = Direction.OUTGOING) private PowerPlant regardingPowerPlant; private double amountPerPayment; @@ -49,30 +49,30 @@ public void setLoanStartTime(long loanStartTime) { } public long getTotalNumberOfPayments() { - return totalNumberOfPayments; - } + return totalNumberOfPayments; + } - public double getAmountPerPayment() { - return amountPerPayment; - } + public double getAmountPerPayment() { + return amountPerPayment; + } - public void setAmountPerPayment(double amountPerPayment) { - this.amountPerPayment = amountPerPayment; - } + public void setAmountPerPayment(double amountPerPayment) { + this.amountPerPayment = amountPerPayment; + } - public void setTotalNumberOfPayments(long totalNumberOfPayments) { - this.totalNumberOfPayments = totalNumberOfPayments; - } + public void setTotalNumberOfPayments(long totalNumberOfPayments) { + this.totalNumberOfPayments = totalNumberOfPayments; + } - public long getNumberOfPaymentsDone() { - return numberOfPaymentsDone; - } + public long getNumberOfPaymentsDone() { + return numberOfPaymentsDone; + } - public void setNumberOfPaymentsDone(long numberOfPaymentsDone) { - this.numberOfPaymentsDone = numberOfPaymentsDone; - } + public void setNumberOfPaymentsDone(long numberOfPaymentsDone) { + this.numberOfPaymentsDone = numberOfPaymentsDone; + } - public DecarbonizationAgent getFrom() { + public DecarbonizationAgent getFrom() { return from; } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/factory/PowerPlantEntryParser.java b/emlab-generation/src/main/java/emlab/gen/domain/factory/PowerPlantEntryParser.java index 7dcc170c..32948c21 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/factory/PowerPlantEntryParser.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/factory/PowerPlantEntryParser.java @@ -174,6 +174,8 @@ private PowerPlant createPowerPlant(String name, PowerGeneratingTechnology techn } plant.calculateAndSetActualFixedOperatingCosts(plant.getConstructionStartTime()); plant.setDismantleTime(1000); + // BigBank bigbank = reps.genericRepository.findFirst(BigBank.class); + Loan loan = new Loan().persist(); loan.setFrom(energyProducer); loan.setTo(null); @@ -189,6 +191,7 @@ private PowerPlant createPowerPlant(String name, PowerGeneratingTechnology techn // already // made plant.setLoan(loan); + loan.setRegardingPowerPlant(plant); return plant; } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityClearingPoint.java b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityClearingPoint.java new file mode 100644 index 00000000..1b5330d8 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityClearingPoint.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.market.capacity; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import emlab.gen.domain.market.ClearingPoint; + +/** + * @author Kaveri + * + */ +@NodeEntity +public class CapacityClearingPoint extends ClearingPoint { + + @RelatedTo(type = "CAPACITY_MARKET", elementClass = CapacityMarket.class, direction = Direction.OUTGOING) + private CapacityMarket capacityMarket; + + public CapacityMarket getCapacityMarket() { + return capacityMarket; + } + + public void setCapacityMarket(CapacityMarket capacityMarket) { + this.capacityMarket = capacityMarket; + } + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityDispatchPlan.java b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityDispatchPlan.java new file mode 100644 index 00000000..22088e96 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityDispatchPlan.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.market.capacity; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.market.Bid; +import emlab.gen.domain.technology.PowerPlant; + +/** + * @author Kaveri + * + */ + +@NodeEntity +public class CapacityDispatchPlan extends Bid { + + @RelatedTo(type = "CAPACITY_DISPATCHPLAN", elementClass = PowerPlant.class, direction = Direction.OUTGOING) + private PowerPlant plant; + + public PowerPlant getPlant() { + return plant; + } + + public void setPlant(PowerPlant plant) { + this.plant = plant; + } + + public void specifyNotPersist(PowerPlant plant, EnergyProducer producer, CapacityMarket market, long time, + double price, double capacityMarketCapacity, int status) { + this.setPlant(plant); + this.setTime(time); + this.setBidder(producer); + this.setBiddingMarket(market); + this.setPrice(price); + this.setAmount(capacityMarketCapacity); + this.setStatus(status); + } + + /** + * @param plant + */ + + // All transactional methods below are signified by starting with update + @Transactional + public void specifyAndPersist(PowerPlant plant, EnergyProducer producer, CapacityMarket market, long time, + double price, double capacityMarketCapacity, int status) { + this.persist(); + this.specifyNotPersist(plant, producer, market, time, price, capacityMarketCapacity, status); + + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityMarket.java b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityMarket.java new file mode 100644 index 00000000..2ee11189 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/CapacityMarket.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.market.capacity; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import emlab.gen.domain.agent.EnergyConsumer; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.market.DecarbonizationMarket; + +/** + * @author Kaveri Agent Capacity Market for implementation of a Simple Capacity + * Market + * + */ +@NodeEntity +public class CapacityMarket extends DecarbonizationMarket { + + @RelatedTo(type = "WITH_REGULATOR", elementClass = Regulator.class, direction = Direction.OUTGOING) + private Regulator regulator; + + @RelatedTo(type = "WITH_CONSUMER", elementClass = EnergyConsumer.class, direction = Direction.OUTGOING) + private EnergyConsumer consumer; + + public EnergyConsumer getConsumer() { + return consumer; + } + + public void setConsumer(EnergyConsumer consumer) { + this.consumer = consumer; + } + + public Regulator getRegulator() { + return regulator; + } + + public void setRegulator(Regulator regulator) { + this.regulator = regulator; + } + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/package-info.java b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/package-info.java new file mode 100644 index 00000000..76418697 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/capacity/package-info.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +/** + * @author Kaveri + *This package contains all the classes necessary for the implementation of a simple capacity market + * */ +package emlab.gen.domain.market.capacity; \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/ElectricitySpotMarket.java b/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/ElectricitySpotMarket.java index 22e5bbb8..50b0baef 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/ElectricitySpotMarket.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/ElectricitySpotMarket.java @@ -21,6 +21,7 @@ import org.springframework.data.neo4j.annotation.NodeEntity; import org.springframework.data.neo4j.annotation.RelatedTo; +import agentspring.simulation.SimulationParameter; import emlab.gen.domain.market.DecarbonizationMarket; import emlab.gen.trend.TimeSeriesImpl; @@ -30,11 +31,33 @@ public class ElectricitySpotMarket extends DecarbonizationMarket { @RelatedTo(type = "SEGMENT_LOAD", elementClass = SegmentLoad.class, direction = Direction.OUTGOING) private Set loadDurationCurve; - @RelatedTo(type = "DEMANDGROWTH_TREND", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) - private TimeSeriesImpl demandGrowthTrend; + @RelatedTo(type = "DEMANDGROWTH_TREND", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) + private TimeSeriesImpl demandGrowthTrend; private double valueOfLostLoad; + @SimulationParameter(label = "Lookback for dismantling", from = 0, to = 10) + private long lookback; + + @SimulationParameter(label = "Look back for demand forecasting", from = 0, to = 10) + private long backlookingForDemandForecastinginDismantling; + + public long getLookback() { + return lookback; + } + + public void setLookback(long lookback) { + this.lookback = lookback; + } + + public long getBacklookingForDemandForecastinginDismantling() { + return backlookingForDemandForecastinginDismantling; + } + + public void setBacklookingForDemandForecastinginDismantling(long backlookingForDemandForecastinginDismantling) { + this.backlookingForDemandForecastinginDismantling = backlookingForDemandForecastinginDismantling; + } + public Set getLoadDurationCurve() { return loadDurationCurve; } @@ -51,11 +74,11 @@ public void setValueOfLostLoad(double valueOfLostLoad) { this.valueOfLostLoad = valueOfLostLoad; } - public TimeSeriesImpl getDemandGrowthTrend() { + public TimeSeriesImpl getDemandGrowthTrend() { return demandGrowthTrend; } - public void setDemandGrowthTrend(TimeSeriesImpl demandGrowthTrend) { + public void setDemandGrowthTrend(TimeSeriesImpl demandGrowthTrend) { this.demandGrowthTrend = demandGrowthTrend; } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/FinancialPowerPlantReport.java b/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/FinancialPowerPlantReport.java new file mode 100644 index 00000000..9436e710 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/market/electricity/FinancialPowerPlantReport.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.market.electricity; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import emlab.gen.domain.technology.PowerPlant; + +/** + * This class reresents a financial report per power plant per year. It is + * mainly used to condense information (from CashFlows and + * PowerPlantDispatchPlans, which are regularly deleted for performance reasons) + * and make it accessible to agents within the information, but also to the + * analyst using EMLab-Generation. + * + * @author JCRichstein + * + */ +@NodeEntity +public class FinancialPowerPlantReport { + + @RelatedTo(type = "FINANCIALREPORT_POWERPLANT", elementClass = PowerPlant.class, direction = Direction.OUTGOING) + private PowerPlant powerPlant; + + long time; + + double spotMarketRevenue; + + double longTermMarketRevenue; + + double capacityMarketRevenue; + + double strategicReserveRevenue; + + double co2HedgingRevenue; + + double overallRevenue; + + double commodityCosts; + + double co2Costs; + + double variableCosts; + + double fixedCosts; + + double fullLoadHours; + + double production; + + int powerPlantStatus; + + public static final int UNDERCONSTRUCTION = 0; + public static final int OPERATIONAL = 1; + public static final int DISMANTLED = 2; + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } + + public PowerPlant getPowerPlant() { + return powerPlant; + } + + public void setPowerPlant(PowerPlant powerPlant) { + this.powerPlant = powerPlant; + } + + public double getSpotMarketRevenue() { + return spotMarketRevenue; + } + + public void setSpotMarketRevenue(double spotMarketRevenue) { + this.spotMarketRevenue = spotMarketRevenue; + } + + public double getLongTermMarketRevenue() { + return longTermMarketRevenue; + } + + public void setLongTermMarketRevenue(double longTermMarketRevenue) { + this.longTermMarketRevenue = longTermMarketRevenue; + } + + public double getCapacityMarketRevenue() { + return capacityMarketRevenue; + } + + public void setCapacityMarketRevenue(double capacityMarketRevenue) { + this.capacityMarketRevenue = capacityMarketRevenue; + } + + public double getStrategicReserveRevenue() { + return strategicReserveRevenue; + } + + public void setStrategicReserveRevenue(double strategicReserveRevenue) { + this.strategicReserveRevenue = strategicReserveRevenue; + } + + public double getCo2HedgingRevenue() { + return co2HedgingRevenue; + } + + public void setCo2HedgingRevenue(double co2HedgingRevenue) { + this.co2HedgingRevenue = co2HedgingRevenue; + } + + public double getOverallRevenue() { + return this.overallRevenue; + } + + public void setOverallRevenue(double overallRevenue) { + this.overallRevenue = overallRevenue; + + } + + public double getVariableCosts() { + return variableCosts; + } + + public void setVariableCosts(double variableCosts) { + this.variableCosts = variableCosts; + } + + public double getFixedCosts() { + return fixedCosts; + } + + public void setFixedCosts(double fixedCosts) { + this.fixedCosts = fixedCosts; + } + + public double getFullLoadHours() { + return fullLoadHours; + } + + public void setFullLoadHours(double fullLoadHours) { + this.fullLoadHours = fullLoadHours; + } + + public double getProduction() { + return production; + } + + public void setProduction(double production) { + this.production = production; + } + + public double getCommodityCosts() { + return commodityCosts; + } + + public void setCommodityCosts(double commodityCosts) { + this.commodityCosts = commodityCosts; + } + + public double getCo2Costs() { + return co2Costs; + } + + public void setCo2Costs(double co2Costs) { + this.co2Costs = co2Costs; + } + + public int getPowerPlantStatus() { + return powerPlantStatus; + } + + public void setPowerPlantStatus(int powerPlantStatus) { + this.powerPlantStatus = powerPlantStatus; + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/RenewableSupportScheme.java b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/RenewableSupportScheme.java new file mode 100644 index 00000000..b6206fb9 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/RenewableSupportScheme.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.policy.renewablesupport; + +import java.util.Set; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import agentspring.simulation.SimulationParameter; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.technology.PowerGeneratingTechnology; + +/** + * @author Kaveri3012 A generic renewable support scheme role, meant to be able + * to model both price based and quantity based schemes. + */ +@NodeEntity +public class RenewableSupportScheme { + + @RelatedTo(type = "WITH_REGULATOR", elementClass = Regulator.class, direction = Direction.OUTGOING) + private Regulator regulator; + + @RelatedTo(type = "TECHNOLOGIES_ELIGIBLE_ARE", elementClass = PowerGeneratingTechnology.class, direction = Direction.OUTGOING) + private Set powerGeneratingTechnologiesEligible; + + private boolean technologySpecificityEnabled; + + private boolean locationSpecificityEnabled; + + @SimulationParameter(label = "Support Scheme Duration", from = 0, to = 50) + private long supportSchemeDuration; + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Set getPowerGeneratingTechnologiesEligible() { + return powerGeneratingTechnologiesEligible; + } + + public void setPowerGeneratingTechnologiesEligible( + Set powerGeneratingTechnologiesEligible) { + this.powerGeneratingTechnologiesEligible = powerGeneratingTechnologiesEligible; + } + + public Regulator getRegulator() { + return regulator; + } + + public void setRegulator(Regulator regulator) { + this.regulator = regulator; + } + + public boolean isTechnologySpecificityEnabled() { + return technologySpecificityEnabled; + } + + public void setTechnologySpecificityEnabled(boolean technologySpecificityEnabled) { + this.technologySpecificityEnabled = technologySpecificityEnabled; + } + + public boolean isLocationSpecificityEnabled() { + return locationSpecificityEnabled; + } + + public void setLocationSpecificityEnabled(boolean locationSpecificityEnabled) { + this.locationSpecificityEnabled = locationSpecificityEnabled; + } + + public long getSupportSchemeDuration() { + return supportSchemeDuration; + } + + public void setSupportSchemeDuration(long supportSchemeDuration) { + this.supportSchemeDuration = supportSchemeDuration; + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/SupportPriceContract.java b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/SupportPriceContract.java new file mode 100644 index 00000000..c41b8fa9 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/SupportPriceContract.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.domain.policy.renewablesupport; + +import org.neo4j.graphdb.Direction; +import org.springframework.data.neo4j.annotation.RelatedTo; + +import emlab.gen.domain.contract.Contract; +import emlab.gen.domain.technology.PowerPlant; + +/** + * @author Kaveri3012 this class is meant to specify a support price for a given + * duration. The price may have been generated either from a quantity + * based scheme or a price based scheme. + */ +public class SupportPriceContract extends Contract { + + @RelatedTo(type = "FOR_SUPPORT_SCHEME", elementClass = RenewableSupportScheme.class, direction = Direction.OUTGOING) + private RenewableSupportScheme renewableSupportScheme; + + @RelatedTo(type = "FOR_POWER_PLANT", elementClass = PowerPlant.class, direction = Direction.OUTGOING) + private PowerPlant plant; + + public RenewableSupportScheme getRenewableSupportScheme() { + return renewableSupportScheme; + } + + public void setRenewableSupportScheme(RenewableSupportScheme renewableSupportScheme) { + this.renewableSupportScheme = renewableSupportScheme; + } + + public PowerPlant getPlant() { + return plant; + } + + public void setPlant(PowerPlant plant) { + this.plant = plant; + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/package-info.java b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/package-info.java new file mode 100644 index 00000000..d9709567 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/domain/policy/renewablesupport/package-info.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +/** + * @author Kaveri3012 + * This package will contain all classes required to define renewable support schemes in EMLAb. They would include price based schemes, quantity based schemes, + * tenders, among others. + */ +package emlab.gen.domain.policy.renewablesupport; \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerGeneratingTechnology.java b/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerGeneratingTechnology.java index 9e2f2516..318a6945 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerGeneratingTechnology.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerGeneratingTechnology.java @@ -33,19 +33,18 @@ public class PowerGeneratingTechnology { @SimulationParameter(label = "Capacity (MW)", from = 0, to = 2000) private double capacity; - @RelatedTo(type = "PGT_INVESTMENTCOSTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) - private TimeSeriesImpl investmentCostTimeSeries; + @RelatedTo(type = "PGT_INVESTMENTCOSTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) + private TimeSeriesImpl investmentCostTimeSeries; - @RelatedTo(type = "PGT_OMCOSTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) - private TimeSeriesImpl fixedOperatingCostTimeSeries; + @RelatedTo(type = "PGT_OMCOSTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) + private TimeSeriesImpl fixedOperatingCostTimeSeries; - @RelatedTo(type = "PGT_EFFICIENCYTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) - private TimeSeriesImpl efficiencyTimeSeries; + @RelatedTo(type = "PGT_EFFICIENCYTS", elementClass = TimeSeriesImpl.class, direction = Direction.OUTGOING) + private TimeSeriesImpl efficiencyTimeSeries; @SimulationParameter(label = "CO2 capture efficiency", from = 0, to = 1) private double co2CaptureEffciency; - @SimulationParameter(label = "Depreciation time (years)", from = 0, to = 40) private int depreciationTime; @@ -54,6 +53,8 @@ public class PowerGeneratingTechnology { private double fixedOperatingCostModifierAfterLifetime; + private double variableOperatingCostinEURPerMWh; + @SimulationParameter(label = "Expected lifetime", from = 0, to = 40) private int expectedLifetime; @@ -77,6 +78,16 @@ public class PowerGeneratingTechnology { private boolean intermittent; + private double maximumLifeExtension; + + public double getMaximumLifeExtension() { + return maximumLifeExtension; + } + + public void setMaximumLifeExtension(double maximumLifeExtension) { + this.maximumLifeExtension = maximumLifeExtension; + } + public double getBaseSegmentDependentAvailability() { return baseSegmentDependentAvailability; } @@ -125,6 +136,14 @@ public void setMinimumRunningHours(double minimumRunningHours) { this.minimumRunningHours = minimumRunningHours; } + public double getVariableOperatingCostinEURPerMWh() { + return variableOperatingCostinEURPerMWh; + } + + public void setVariableOperatingCostinEURPerMWh(double variableOperatingCostinEURPerMWh) { + this.variableOperatingCostinEURPerMWh = variableOperatingCostinEURPerMWh; + } + @RelatedTo(type = "FUEL", elementClass = Substance.class, direction = Direction.OUTGOING) private Set fuels; @@ -161,35 +180,35 @@ public void setCapacity(double capacity) { this.capacity = capacity; } - public double getEfficiency(long time) { - return efficiencyTimeSeries.getValue(time); + public double getEfficiency(long time) { + return efficiencyTimeSeries.getValue(time); } - public TimeSeriesImpl getInvestmentCostTimeSeries() { - return investmentCostTimeSeries; - } + public TimeSeriesImpl getInvestmentCostTimeSeries() { + return investmentCostTimeSeries; + } - public void setInvestmentCostTimeSeries(TimeSeriesImpl investmentCostTrend) { - this.investmentCostTimeSeries = investmentCostTrend; - } + public void setInvestmentCostTimeSeries(TimeSeriesImpl investmentCostTrend) { + this.investmentCostTimeSeries = investmentCostTrend; + } - public TimeSeriesImpl getFixedOperatingCostTimeSeries() { - return fixedOperatingCostTimeSeries; - } + public TimeSeriesImpl getFixedOperatingCostTimeSeries() { + return fixedOperatingCostTimeSeries; + } - public void setFixedOperatingCostTimeSeries(TimeSeriesImpl fixedOperatingCostTrend) { - this.fixedOperatingCostTimeSeries = fixedOperatingCostTrend; - } + public void setFixedOperatingCostTimeSeries(TimeSeriesImpl fixedOperatingCostTrend) { + this.fixedOperatingCostTimeSeries = fixedOperatingCostTrend; + } - public TimeSeriesImpl getEfficiencyTimeSeries() { - return efficiencyTimeSeries; - } + public TimeSeriesImpl getEfficiencyTimeSeries() { + return efficiencyTimeSeries; + } - public void setEfficiencyTimeSeries(TimeSeriesImpl efficiencyTrend) { - this.efficiencyTimeSeries = efficiencyTrend; - } + public void setEfficiencyTimeSeries(TimeSeriesImpl efficiencyTrend) { + this.efficiencyTimeSeries = efficiencyTrend; + } - public double getCo2CaptureEffciency() { + public double getCo2CaptureEffciency() { return co2CaptureEffciency; } @@ -257,15 +276,15 @@ public void setApplicableForLongTermContract(boolean applicableForLongTermContra this.applicableForLongTermContract = applicableForLongTermContract; } - public double getInvestmentCost(long time) { - return investmentCostTimeSeries.getValue(time); + public double getInvestmentCost(long time) { + return investmentCostTimeSeries.getValue(time); } - public double getFixedOperatingCost(long time) { - return fixedOperatingCostTimeSeries.getValue(time); - } + public double getFixedOperatingCost(long time) { + return fixedOperatingCostTimeSeries.getValue(time); + } - public boolean isIntermittent() { + public boolean isIntermittent() { return intermittent; } diff --git a/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerPlant.java b/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerPlant.java index 36f61ea0..23ffcd2a 100644 --- a/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerPlant.java +++ b/emlab-generation/src/main/java/emlab/gen/domain/technology/PowerPlant.java @@ -87,6 +87,26 @@ public class PowerPlant { private double actualEfficiency; private double expectedEndOfLife; private double actualNominalCapacity; + private boolean hasFeedInPremiumContract; + + public double ageFraction; + public double profitability; + + public double getProfitability() { + return profitability; + } + + public void setProfitability(double profitability) { + this.profitability = profitability; + } + + public double getAgeFraction() { + return ageFraction; + } + + public void setAgeFraction(double ageFraction) { + this.ageFraction = ageFraction; + } public boolean isOperational(long currentTick) { @@ -111,6 +131,14 @@ public boolean isOperational(long currentTick) { return false; } + public boolean isHasFeedInPremiumContract() { + return hasFeedInPremiumContract; + } + + public void setHasFeedInPremiumContract(boolean hasFeedInPremiumContract) { + this.hasFeedInPremiumContract = hasFeedInPremiumContract; + } + public boolean isExpectedToBeOperational(long time) { double finishedConstruction = getConstructionStartTime() @@ -218,6 +246,7 @@ public double getExpectedAvailableCapacity(long futureTick, } return getActualNominalCapacity() * factor; } + } else { return 0; } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/BidRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/BidRepository.java index 884c616f..95c2a403 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/BidRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/BidRepository.java @@ -34,113 +34,122 @@ @Repository public interface BidRepository extends GraphRepository { - /** - * Finds all demand bids for a market for a time - * - * @param market - * @param time - * @return the found bids - */ - // @Query(value = - // "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == false}", - // type = QueryType.Gremlin) - // public Iterable findDemandBidsForMarketForTime(@Param("market") - // DecarbonizationMarket market, @Param("time") long time); - - @Query("START bid=node:__types__(\"className:emlab.gen.domain.market.Bid\") WHERE (bid.time={time}) RETURN bid") - Iterable findAllBidsForForTime(@Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) RETURN bid ORDER BY bid.price desc") - Iterable findDemandBidsForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.status>=2) RETURN bid") - Iterable findAllAcceptedDemandBidsForMarketForTime(@Param("market") DecarbonizationMarket market, - @Param("time") long time); - - /** - * Finds all supply bids for a market for a time. Cypher adapted from PGC - * (Alfredas) - * - * @param market - * @param time - * @return - */ - // @Query(value = - // "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == true}", - // type = QueryType.Gremlin) - // public Iterable findOffersForMarketForTime(@Param("market") - // DecarbonizationMarket market, @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN bid ORDER BY bid.price") - Iterable findOffersForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.status>=2) RETURN bid") - Iterable findAllAcceptedOffersForMarketForTime(@Param("market") DecarbonizationMarket market, - @Param("time") long time); - - /** - * Find bids for a market for a time - * - * @param market - * @param time - * @param isSupply - * supply or demand bids - * @return the bids - */ - - @Query(value = "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == isSupply}", type = QueryType.Gremlin) - Iterable getBidsForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time, - @Param("isSupply") boolean isSupply); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price <= {price}) RETURN bid ORDER BY bid.price") - Iterable findOffersForMarketForTimeBelowPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - /** - * Find demand bids above a certain price, and return them in descending - * order. - * - * @param market - * @param time - * @param price - * @return - */ - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN bid ORDER BY bid.price desc") - Iterable findDemandBidsForMarketForTimeAbovePrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN sum(bid.amount)") - double calculateDemandBidsForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price = {price}) RETURN bid ORDER BY bid.price desc") - Iterable findDemandBidsForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price = {price}) RETURN bid ORDER BY bid.price desc") - Iterable findOffersForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price = {price}) RETURN sum(bid.amount)") - double calculateOffersForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) RETURN sum(bid.amount)") - double calculateTotalDemandForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN sum(bid.amount)") - double calculateTotalDemandForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, - @Param("time") long time, @Param("price") double price); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN sum(bid.amount)") - double calculateTotalSupplyForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN max(bid.price)") - double calculateTotalSupplyPriceForMarketForTime(@Param("market") DecarbonizationMarket market, - @Param("time") long time); - - @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN min(bid.price)") - double calculateMinimumSupplyPriceForMarketForTime(@Param("market") DecarbonizationMarket market, - @Param("time") long time); + /** + * Finds all demand bids for a market for a time + * + * @param market + * +Kaveri Search Images Maps Play YouTube News Gmail Drive + * Calendar More + * + * Gmail + * + * Kaveri Iychettira Share Kaveri Iychettira Kaveri Iychettira + * + * + * + * @param time + * @return the found bids + */ + // @Query(value = + // "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == false}", + // type = QueryType.Gremlin) + // public Iterable findDemandBidsForMarketForTime(@Param("market") + // DecarbonizationMarket market, @Param("time") long time); + + @Query("START bid=node:__types__(\"className:emlab.gen.domain.market.Bid\") WHERE (bid.time={time}) RETURN bid") + Iterable findAllBidsForForTime(@Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) RETURN bid ORDER BY bid.price desc") + Iterable findDemandBidsForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.status>=2) RETURN bid") + Iterable findAllAcceptedDemandBidsForMarketForTime(@Param("market") DecarbonizationMarket market, + @Param("time") long time); + + /** + * Finds all supply bids for a market for a time. Cypher adapted from PGC + * (Alfredas) + * + * @param market + * @param time + * @return + */ + // @Query(value = + // "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == true}", + // type = QueryType.Gremlin) + // public Iterable findOffersForMarketForTime(@Param("market") + // DecarbonizationMarket market, @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN bid ORDER BY bid.price") + Iterable findOffersForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.status>=2) RETURN bid") + Iterable findAllAcceptedOffersForMarketForTime(@Param("market") DecarbonizationMarket market, + @Param("time") long time); + + /** + * Find bids for a market for a time + * + * @param market + * @param time + * @param isSupply + * supply or demand bids + * @return the bids + */ + + @Query(value = "g.v(market).in('BIDDINGMARKET').filter{it.time == time}.filter{it.supplyBid == isSupply}", type = QueryType.Gremlin) + Iterable getBidsForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time, + @Param("isSupply") boolean isSupply); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price <= {price}) RETURN bid ORDER BY bid.price") + Iterable findOffersForMarketForTimeBelowPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + /** + * Find demand bids above a certain price, and return them in descending + * order. + * + * @param market + * @param time + * @param price + * @return + */ + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN bid ORDER BY bid.price desc") + Iterable findDemandBidsForMarketForTimeAbovePrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN sum(bid.amount)") + double calculateDemandBidsForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price = {price}) RETURN bid ORDER BY bid.price desc") + Iterable findDemandBidsForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price = {price}) RETURN bid ORDER BY bid.price desc") + Iterable findOffersForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) and (bid.price = {price}) RETURN sum(bid.amount)") + double calculateOffersForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) RETURN sum(bid.amount)") + double calculateTotalDemandForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=false) and (bid.price >= {price}) RETURN sum(bid.amount)") + double calculateTotalDemandForMarketForTimeForPrice(@Param("market") DecarbonizationMarket market, + @Param("time") long time, @Param("price") double price); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN sum(bid.amount)") + double calculateTotalSupplyForMarketForTime(@Param("market") DecarbonizationMarket market, @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN max(bid.price)") + double calculateTotalSupplyPriceForMarketForTime(@Param("market") DecarbonizationMarket market, + @Param("time") long time); + + @Query("START market=node({market}) MATCH (market)<-[:BIDDINGMARKET]-(bid) WHERE (bid.time = {time}) and (bid.supplyBid=true) RETURN min(bid.price)") + double calculateMinimumSupplyPriceForMarketForTime(@Param("market") DecarbonizationMarket market, + @Param("time") long time); } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/CapacityClearingPointRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/CapacityClearingPointRepository.java new file mode 100644 index 00000000..e3707ea2 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/CapacityClearingPointRepository.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.stereotype.Repository; + +import emlab.gen.domain.market.capacity.CapacityClearingPoint; + +/** + * @author Kaveri + * + */ +@Repository +public interface CapacityClearingPointRepository extends GraphRepository { + +} diff --git a/emlab-generation/src/main/java/emlab/gen/repository/CapacityDispatchPlanRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/CapacityDispatchPlanRepository.java new file mode 100644 index 00000000..97e9712d --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/CapacityDispatchPlanRepository.java @@ -0,0 +1,31 @@ +/******************************************************************************* + /******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.stereotype.Repository; + +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; + +/** + * @author Kaveri + * + */ +@Repository +public interface CapacityDispatchPlanRepository extends GraphRepository { + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/repository/CapacityMarketRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/CapacityMarketRepository.java new file mode 100644 index 00000000..d5340b7f --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/CapacityMarketRepository.java @@ -0,0 +1,63 @@ +/******************************************************************************* + /******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.annotation.Query; +import org.springframework.data.neo4j.annotation.QueryType; +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.ClearingPoint; +import emlab.gen.domain.market.capacity.CapacityClearingPoint; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; + +/** + * @author Kaveri + * + */ +@Repository +public interface CapacityMarketRepository extends GraphRepository { + + @Query(value = "g.v(zone).in('ZONE').filter{it.__type__=='emlab.gen.domain.market.capacity.CapacityMarket'}", type = QueryType.Gremlin) + public CapacityMarket findCapacityMarketForZone(@Param("zone") Zone zone); + + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityDispatchPlan']].filter{it.time == tick}.sort{it.price}._()", type = QueryType.Gremlin) + public Iterable findAllSortedCapacityDispatchPlansByTime(@Param("tick") long time); + + @Query(value = "g.v(market).in('BIDDINGMARKET').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('status', FilterPipe.Filter.GREATER_THAN, 2)", type = QueryType.Gremlin) + public Iterable findAllAcceptedCapacityDispatchPlansForTime( + @Param("market") CapacityMarket capacityMarket, @Param("time") long time); + + @Query(value = "g.v(market).in('CAPACITY_MARKET').propertyFilter('time', FilterPipe.Filter.EQUAL, time)", type = QueryType.Gremlin) + public CapacityClearingPoint findOneCapacityClearingPointForTimeAndMarket(@Param("time") long time, + @Param("market") CapacityMarket capacityMarket); + + @Query(value = "g.v(market).in('CAPACITY_MARKET').propertyFilter('time', FilterPipe.Filter.EQUAL, time)", type = QueryType.Gremlin) + public ClearingPoint findOneClearingPointForTimeAndCapacityMarket(@Param("time") long time, + @Param("market") CapacityMarket capacityMarket); + + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.market.capacity.CapacityClearingPoint']].filter{it.time == tick}", type = QueryType.Gremlin) + public CapacityClearingPoint findOneCapacityClearingPointForTime(@Param("time") long time); + + @Query(value = "g.v(zone).in('OF_ZONE')", type = QueryType.Gremlin) + public Regulator findRegulatorForZone(@Param("zone") Zone zone); + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/repository/CashFlowRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/CashFlowRepository.java index e174eb51..ce600654 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/CashFlowRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/CashFlowRepository.java @@ -16,13 +16,18 @@ package emlab.gen.repository; import org.springframework.data.neo4j.annotation.Query; +import org.springframework.data.neo4j.annotation.QueryType; import org.springframework.data.neo4j.repository.GraphRepository; import org.springframework.data.repository.query.Param; import emlab.gen.domain.contract.CashFlow; +import emlab.gen.domain.technology.PowerPlant; public interface CashFlowRepository extends GraphRepository { @Query("START cf=node:__types__(\"className:emlab.gen.domain.contract.CashFlow\") WHERE (cf.time={time}) RETURN cf") Iterable findAllCashFlowsForForTime(@Param("time") long time); + @Query(value = "g.v(plant).in.filter{it.__type__=='emlab.gen.domain.contract.CashFlow' && it.time==tick}", type = QueryType.Gremlin) + Iterable findAllCashFlowsForPowerPlantForTime(@Param("plant") PowerPlant plant, @Param("tick") long tick); + } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/FinancialPowerPlantReportRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/FinancialPowerPlantReportRepository.java new file mode 100644 index 00000000..1ee3fbf2 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/FinancialPowerPlantReportRepository.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.annotation.Query; +import org.springframework.data.neo4j.annotation.QueryType; +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.data.repository.query.Param; + +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.market.electricity.FinancialPowerPlantReport; +import emlab.gen.domain.technology.PowerGeneratingTechnology; + +/** + * @author jrichstein + * + */ +public interface FinancialPowerPlantReportRepository extends +GraphRepository { + + @Query(value = "techName=g.v(tech).name;" + + "fr = g.v(producer).in('POWERPLANT_OWNER').as('x').out('TECHNOLOGY').propertyFilter('name',FilterPipe.Filter.EQUAL, techName).back('x').in('FINANCIALREPORT_POWERPLANT').propertyFilter('time', FilterPipe.Filter.GREATER_THAN_EQUAL, from).propertyFilter('time', FilterPipe.Filter.LESS_THAN_EQUAL, to).propertyFilter('powerPlantStatus', FilterPipe.Filter.EQUAL, 1);", type = QueryType.Gremlin) + public Iterable findAllFinancialPowerPlantReportsOfOperationaPlantsFromToForEnergyProducerAndTechnology( + @Param("from") long from, + @Param("to") long to, @Param("producer") EnergyProducer producer, + @Param("tech") PowerGeneratingTechnology tech); + + @Query(value = "techName=g.v(tech).name; fr = g.v(producer).in('POWERPLANT_OWNER').as('x').out('TECHNOLOGY').propertyFilter('name',FilterPipe.Filter.EQUAL, techName).back('x').in('FINANCIALREPORT_POWERPLANT').propertyFilter('time', FilterPipe.Filter.GREATER_THAN_EQUAL, from).propertyFilter('time', FilterPipe.Filter.LESS_THAN_EQUAL, to).propertyFilter('powerPlantStatus', FilterPipe.Filter.EQUAL, 1);" + + "if(!fr.hasNext()){return null} else{fr=fr.sort{it.overallRevenue-it.variableCosts}._().toList()};" + + + "length=fr.size(); fiveQuantile=(int)length*0.05;cvar=(long) 0;"+ + "for(int i=0; i<=fiveQuantile; i++){cvar=cvar+(fr[i].overallRevenue-fr[i].variableCosts)/fr[i].out('FINANCIALREPORT_POWERPLANT').actualNominalCapacity.next()};" + + + "cvar=cvar/((double)(fiveQuantile+1));"+ + "return cvar;", type = QueryType.Gremlin) + public Double calculateHistoricalCVarRelativePerMWForOperationaPlantsForEnergyProducerAndTechnologyForYearsFromToAndAlphaValue( + @Param("from") long from, @Param("to") long to, @Param("producer") EnergyProducer producer, + @Param("tech") PowerGeneratingTechnology tech, @Param("alpha") double alpha); + + @Query("START fr=node:__types__(\"className:emlab.gen.domain.market.electricity.FinancialPowerPlantReport\") WHERE (fr.time={time}) RETURN fr") + public Iterable findAllFinancialPowerPlantReportsForTime(@Param("time") long time); + +} diff --git a/emlab-generation/src/main/java/emlab/gen/repository/InterconnectorRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/InterconnectorRepository.java index afaac21a..e45f1beb 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/InterconnectorRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/InterconnectorRepository.java @@ -18,17 +18,24 @@ import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.annotation.QueryType; import org.springframework.data.neo4j.repository.GraphRepository; -import org.springframework.data.repository.query.Param; - import emlab.gen.domain.technology.Interconnector; public interface InterconnectorRepository extends GraphRepository { -// @Query(value = "g.v(plant).out('LOCATION').out('REGION').in('GOVERNED_ZONE').next()", type = QueryType.Gremlin) -// NationalGovernment findNationalGovernmentByPowerPlant(@Param("plant") PowerPlant plant); + // @Query(value = + // "g.v(plant).out('LOCATION').out('REGION').in('GOVERNED_ZONE').next()", + // type = QueryType.Gremlin) + // NationalGovernment findNationalGovernmentByPowerPlant(@Param("plant") + // PowerPlant plant); + + // @Query(value = "g.v(market).out('ZONE').in('GOVERNED_ZONE').next()", type + // = QueryType.Gremlin) + // NationalGovernment + // findNationalGovernmentByElectricitySpotMarket(@Param("market") + // ElectricitySpotMarket market); -// @Query(value = "g.v(market).out('ZONE').in('GOVERNED_ZONE').next()", type = QueryType.Gremlin) -// NationalGovernment findNationalGovernmentByElectricitySpotMarket(@Param("market") ElectricitySpotMarket market); + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.technology.Interconnector']].capacity", type = QueryType.Gremlin) + public double findInterconnectorCapacity(); } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/MarketRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/MarketRepository.java index 1297a40c..c231c0ed 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/MarketRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/MarketRepository.java @@ -76,14 +76,22 @@ public interface MarketRepository extends GraphRepository public ElectricitySpotMarket findElectricitySpotMarketForZone(@Param("zone") Zone zone); @Query(value = "START nationalG = node({nationalG}), electricityMarket = node:__types__(\"className:emlab.gen.domain.market.electricity.ElectricitySpotMarket\") MATCH (nationalG)-[:GOVERNED_ZONE]->(zone)<-[:ZONE]-(electricityMarket) RETURN electricityMarket") - public ElectricitySpotMarket findElectricitySpotMarketByNationalGovernment(@Param("nationalG") NationalGovernment nationalG); + public ElectricitySpotMarket findElectricitySpotMarketByNationalGovernment( + @Param("nationalG") NationalGovernment nationalG); @Query(value = "g.v(plant).out('LOCATION').out('REGION').in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.next()", type = QueryType.Gremlin) public ElectricitySpotMarket findElectricitySpotMarketByPowerPlant(@Param("plant") PowerPlant plant); @Query(value = "segID = g.v(segment).segmentID;" + "return g.v(zone).in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.out('SEGMENT_LOAD').as('SL').out('SEGMENTLOAD_SEGMENT').filter{it.segmentID==segID}.back('SL').next();", type = QueryType.Gremlin) - public SegmentLoad findSegmentLoadForElectricitySpotMarketForZone(@Param("zone") Zone zone, @Param("segment") Segment segment); + public SegmentLoad findSegmentLoadForElectricitySpotMarketForZone(@Param("zone") Zone zone, + @Param("segment") Segment segment); + + @Query(value = "g.v(zone).in('REGION').in('LOCATION').filter{f.plantIsOperational(it, tick)}.out('TECHNOLOGY').sum{it.capacity*(it.peakSegmentDependentAvailability)}._()", type = QueryType.Gremlin) + public double findTotalSupplyInElectricitySpotMarketForZone(@Param("zone") Zone zone); + + @Query(value = "topsegments = g.v(zone).out('SEGMENT_LOAD').max{it.baseLoad}.baseLoad; growthfactors = v.out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0]; adjustedTopSegments = topsegments*growthfactors; return adjustedTopSegments", type = QueryType.Gremlin) + public double findPeakDemandInElectricitySpotMarketForZone(@Param("zone") Zone zone); /** * Gives the market for a specific substance diff --git a/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantDispatchPlanRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantDispatchPlanRepository.java index 0294daf0..de2b60be 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantDispatchPlanRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantDispatchPlanRepository.java @@ -39,38 +39,53 @@ @Repository public interface PowerPlantDispatchPlanRepository extends GraphRepository { - // @Query(value = "g.V.filter{it.getProperty('__type__')=='emlab.gen.domain.market.electricity.PowerPlantDispatchPlan' && it.getProperty('time')==time}", type = QueryType.Gremlin) - // public Iterable findAllPowerPlantDispatchPlansForTime(@Param("time") long time); + // @Query(value = + // "g.V.filter{it.getProperty('__type__')=='emlab.gen.domain.market.electricity.PowerPlantDispatchPlan' && it.getProperty('time')==time}", + // type = QueryType.Gremlin) + // public Iterable + // findAllPowerPlantDispatchPlansForTime(@Param("time") long time); @Query("START ppdp=node:__types__(\"className:emlab.gen.domain.market.electricity.PowerPlantDispatchPlan\") WHERE (ppdp.time={time} AND ppdp.forecast = {forecast}) RETURN ppdp") public Iterable findAllPowerPlantDispatchPlansForTime(@Param("time") long time, @Param("forecast") boolean forecast); @Query(value = "result = g.v(plant).in('POWERPLANT_DISPATCHPLAN').as('x').propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).out('SEGMENT_DISPATCHPLAN').idFilter(segment, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) - public Iterable findAllPowerPlantDispatchPlanForPowerPlantForSegmentForTime(@Param("plant") PowerPlant plant, - @Param("segment") Segment segment, @Param("time") long time, + public Iterable findAllPowerPlantDispatchPlanForPowerPlantForSegmentForTime( + @Param("plant") PowerPlant plant, @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); @Query(value = "result = g.v(plant).in('POWERPLANT_DISPATCHPLAN').as('x').propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).out('SEGMENT_DISPATCHPLAN').idFilter(segment, FilterPipe.Filter.EQUAL).back('x').propertyFilter('time', FilterPipe.Filter.EQUAL, time); if(!result.hasNext()){return null;} else{return result.next();}", type = QueryType.Gremlin) - public PowerPlantDispatchPlan findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(@Param("plant") PowerPlant plant, - @Param("segment") Segment segment, @Param("time") long time, + public PowerPlantDispatchPlan findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime( + @Param("plant") PowerPlant plant, @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); - // @Query(value = "g.v(segment).in('SEGMENT_DISPATCHPLAN').propertyFilter('time', FilterPipe.Filter.EQUAL, time)", type = QueryType.Gremlin) - // public Iterable findAllPowerPlantDispatchPlansForSegmentForTime(@Param("segment") Segment segment, + @Query(value = "result = g.v(plant).in('POWERPLANT_DISPATCHPLAN').as('x').out('SEGMENT_DISPATCHPLAN').filter{it.segmentID==1}.back('x').propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).propertyFilter('time', FilterPipe.Filter.EQUAL, time); if(!result.hasNext()){return null;} else{return result.next();}", type = QueryType.Gremlin) + public PowerPlantDispatchPlan findOnePowerPlantDispatchPlanForPeakSegmentGivenPowerPlantAndTime( + @Param("plant") PowerPlant plant, @Param("time") long time, @Param("forecast") boolean forecast); + + // @Query(value = + // "g.v(segment).in('SEGMENT_DISPATCHPLAN').propertyFilter('time', FilterPipe.Filter.EQUAL, time)", + // type = QueryType.Gremlin) + // public Iterable + // findAllPowerPlantDispatchPlansForSegmentForTime(@Param("segment") Segment + // segment, // @Param("time") long time); @Query("START segment = node({segment}) MATCH (segment)<-[:SEGMENT_DISPATCHPLAN]-(ppdp) WHERE (ppdp.time = {time} AND ppdp.forecast={forecast}) RETURN ppdp") - public Iterable findAllPowerPlantDispatchPlansForSegmentForTime(@Param("segment") Segment segment, - @Param("time") long time, @Param("forecast") boolean forecast); + public Iterable findAllPowerPlantDispatchPlansForSegmentForTime( + @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); - // @Query(value = "g.v(segment).in('SEGMENT_DISPATCHPLAN').propertyFilter('time', FilterPipe.Filter.EQUAL, time).sort{it.price}._()", type = QueryType.Gremlin) - // public Iterable findSortedPowerPlantDispatchPlansForSegmentForTime(@Param("segment") Segment segment, + // @Query(value = + // "g.v(segment).in('SEGMENT_DISPATCHPLAN').propertyFilter('time', FilterPipe.Filter.EQUAL, time).sort{it.price}._()", + // type = QueryType.Gremlin) + // public Iterable + // findSortedPowerPlantDispatchPlansForSegmentForTime(@Param("segment") + // Segment segment, // @Param("time") long time); @Query("START segment = node({segment}) MATCH (segment)<-[:SEGMENT_DISPATCHPLAN]-(ppdp) WHERE (ppdp.time = {time} AND ppdp.forecast={forecast}) RETURN ppdp ORDER BY ppdp.price") - public Iterable findSortedPowerPlantDispatchPlansForSegmentForTime(@Param("segment") Segment segment, - @Param("time") long time, @Param("forecast") boolean forecast); + public Iterable findSortedPowerPlantDispatchPlansForSegmentForTime( + @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); // descending order @Query("START segment = node({segment}) MATCH (segment)<-[:SEGMENT_DISPATCHPLAN]-(ppdp) WHERE (ppdp.time = {time} AND ppdp.forecast={forecast}) RETURN ppdp ORDER BY ppdp.price desc") @@ -78,8 +93,8 @@ public Iterable findDescendingSortedPowerPlantDispatchPl @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); @Query(value = "g.v(plant).in('POWERPLANT_DISPATCHPLAN').propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).propertyFilter('time', FilterPipe.Filter.EQUAL, time)", type = QueryType.Gremlin) - public Iterable findAllPowerPlantDispatchPlansForPowerPlantForTime(@Param("plant") PowerPlant plant, - @Param("time") long time, @Param("forecast") boolean forecast); + public Iterable findAllPowerPlantDispatchPlansForPowerPlantForTime( + @Param("plant") PowerPlant plant, @Param("time") long time, @Param("forecast") boolean forecast); @Query(value = "g.v(producer).out('BIDDER').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast)", type = QueryType.Gremlin) public Iterable findAllPowerPlantDispatchPlansForEnergyProducerForTime( @@ -90,19 +105,15 @@ public Iterable findAllPowerPlantDispatchPlansForEnergyP @Param("producer") EnergyProducer producer, @Param("time") long time, @Param("tech") PowerGeneratingTechnology pgt, @Param("forecast") boolean forecast); - @Query(value = "g.v(producer).out('BIDDER').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('status', FilterPipe.Filter.GREATER_THAN_EQUAL , 2).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast)", type = QueryType.Gremlin) public Iterable findAllAcceptedPowerPlantDispatchPlansForEnergyProducerForTime( @Param("producer") EnergyProducer producer, @Param("time") long time, @Param("forecast") boolean forecast); @Query(value = "sum=0;ppdps=g.v(producer).out('BIDDER').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('status', FilterPipe.Filter.GREATER_THAN_EQUAL , 2).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast);" - + - "for(ppdp in ppdps){"+ - "totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract');"+ - "hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours');"+ - "production = totalAmount * hoursInSegment;"+ - "sum = sum + production};" - + " return sum;", type = QueryType.Gremlin) + + "for(ppdp in ppdps){" + + "totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract');" + + "hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours');" + + "production = totalAmount * hoursInSegment;" + "sum = sum + production};" + " return sum;", type = QueryType.Gremlin) public double calculateTotalProductionForEnergyProducerForTime(@Param("producer") EnergyProducer producer, @Param("time") long time, @Param("forecast") boolean forecast); @@ -117,23 +128,30 @@ public double calculateTotalProductionForEnergyProducerForTimeForTechnology( @Query(value = "g.v(producer).out('BIDDER').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).as('x').out('SEGMENT_DISPATCHPLAN').idFilter(segment, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) public Iterable findAllPowerPlantDispatchPlansForEnergyProducerForTimeAndSegment( - @Param("segment") Segment segment, @Param("producer") EnergyProducer producer, @Param("time") long time, @Param("forecast") boolean forecast); + @Param("segment") Segment segment, @Param("producer") EnergyProducer producer, @Param("time") long time, + @Param("forecast") boolean forecast); @Query(value = "g.v(producer).out('BIDDER').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).propertyFilter('status', FilterPipe.Filter.GREATER_THAN_EQUAL, 2).as('x').out('SEGMENT_DISPATCHPLAN').idFilter(segment, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) public Iterable findAllAcceptedPowerPlantDispatchPlansForEnergyProducerForTimeAndSegment( - @Param("segment") Segment segment, @Param("producer") EnergyProducer producer, @Param("time") long time, @Param("forecast") boolean forecast); + @Param("segment") Segment segment, @Param("producer") EnergyProducer producer, @Param("time") long time, + @Param("forecast") boolean forecast); // @Query("START segment = node({segment}), market=node({market}) MATCH (segment)<-[:SEGMENT_DISPATCHPLAN]-(ppdp)-[:BIDDINGMARKET]->(market) WHERE (ppdp.time = {time}) and (ppdp.status >= 2) RETURN ppdp") - // public Iterable findAllAcceptedPowerPlantDispatchPlansForMarketSegmentAndTime( - // @Param("market") ElectricitySpotMarket esm, @Param("segment") Segment segment, @Param("time") long time); + // public Iterable + // findAllAcceptedPowerPlantDispatchPlansForMarketSegmentAndTime( + // @Param("market") ElectricitySpotMarket esm, @Param("segment") Segment + // segment, @Param("time") long time); @Query(value = "g.v(market).in('BIDDINGMARKET').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).propertyFilter('status', FilterPipe.Filter.GREATER_THAN_EQUAL, 2).as('x').out('SEGMENT_DISPATCHPLAN').idFilter(segment, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) public Iterable findAllAcceptedPowerPlantDispatchPlansForMarketSegmentAndTime( - @Param("market") ElectricitySpotMarket esm, @Param("segment") Segment segment, @Param("time") long time, @Param("forecast") boolean forecast); + @Param("market") ElectricitySpotMarket esm, @Param("segment") Segment segment, @Param("time") long time, + @Param("forecast") boolean forecast); // @Query("START segment = node({segment} MATCH (segment)<-[:SEGMENT_DISPATCHPLAN]-(ppdp)<-[:BIDDER]-(node({producer})) WHERE (ppdp.time = {time}) AND (ppdp.status >=1) RETURN ppdp") - // public Iterable findAllAcceptedPowerPlantDispatchPlansForEnergyProducerForTimeAndSegment( - // @Param("segment") Segment segment, @Param("producer") EnergyProducer producer, @Param("time") long time); + // public Iterable + // findAllAcceptedPowerPlantDispatchPlansForEnergyProducerForTimeAndSegment( + // @Param("segment") Segment segment, @Param("producer") EnergyProducer + // producer, @Param("time") long time); } // package emlab.gen.repository; @@ -157,10 +175,14 @@ public Iterable findAllAcceptedPowerPlantDispatchPlansFo // import emlab.gen.domain.technology.PowerPlant; // // @Repository -// public class PowerPlantDispatchPlanRepository extends AbstractRepository { +// public class PowerPlantDispatchPlanRepository extends +// AbstractRepository { // -// public PowerPlantDispatchPlan findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(PowerPlant plant, Segment segment, long time) { -// for (PowerPlantDispatchPlan plan : findAllPowerPlantDispatchPlansForPowerPlantForTime(plant, time)) { +// public PowerPlantDispatchPlan +// findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(PowerPlant plant, +// Segment segment, long time) { +// for (PowerPlantDispatchPlan plan : +// findAllPowerPlantDispatchPlansForPowerPlantForTime(plant, time)) { // if (plan.getSegment().equals(segment)) { // return plan; // } @@ -168,18 +190,23 @@ public Iterable findAllAcceptedPowerPlantDispatchPlansFo // return null; // } // -// public Iterable findAllPowerPlantDispatchPlansForSegmentForTime(Segment segment, long time) { +// public Iterable +// findAllPowerPlantDispatchPlansForSegmentForTime(Segment segment, long time) { // // // get incoming bids -// Pipe bids = new LabeledEdgePipe("SEGMENT_DISPATCHPLAN", LabeledEdgePipe.Step.BOTH_BOTH); +// Pipe bids = new LabeledEdgePipe("SEGMENT_DISPATCHPLAN", +// LabeledEdgePipe.Step.BOTH_BOTH); // // filter by time -// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); +// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); // // create pipeline -// Pipe pipeline = new Pipeline(bids, timeFilter); +// Pipe pipeline = new Pipeline(bids, +// timeFilter); // return this.findAllByPipe(segment, pipeline); // } // -// public Iterable findAllPowerPlantDispatchPlansForTime(long time) { +// public Iterable +// findAllPowerPlantDispatchPlansForTime(long time) { // List list = new ArrayList(); // for (PowerPlantDispatchPlan plan : findAll()) { // if (plan.getTime() == time) { @@ -189,32 +216,47 @@ public Iterable findAllAcceptedPowerPlantDispatchPlansFo // return list; // } // -// public Iterable findAllPowerPlantDispatchPlansForPowerPlantForTime(PowerPlant powerPlant, long time) { -// Pipe bids = new LabeledEdgePipe("POWERPLANT_DISPATCHPLAN", LabeledEdgePipe.Step.BOTH_BOTH); +// public Iterable +// findAllPowerPlantDispatchPlansForPowerPlantForTime(PowerPlant powerPlant, +// long time) { +// Pipe bids = new LabeledEdgePipe("POWERPLANT_DISPATCHPLAN", +// LabeledEdgePipe.Step.BOTH_BOTH); // // filter by time -// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); +// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); // // create pipeline -// Pipe pipeline = new Pipeline(bids, timeFilter); +// Pipe pipeline = new Pipeline(bids, +// timeFilter); // // return this.findAllByPipe(powerPlant, pipeline); // } // -// public Iterable findAllPowerPlantDispatchPlansForEnergyProducerForTime(EnergyProducer energyProducer, long time) { -// Pipe bids = new LabeledEdgePipe("BIDDER", LabeledEdgePipe.Step.BOTH_BOTH); +// public Iterable +// findAllPowerPlantDispatchPlansForEnergyProducerForTime(EnergyProducer +// energyProducer, long time) { +// Pipe bids = new LabeledEdgePipe("BIDDER", +// LabeledEdgePipe.Step.BOTH_BOTH); // // filter by time -// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); +// Pipe timeFilter = new PropertyFilterPipe("time", time, FilterPipe.Filter.EQUAL); // // create pipeline -// Pipe pipeline = new Pipeline(bids, timeFilter); +// Pipe pipeline = new Pipeline(bids, +// timeFilter); // // return this.findAllByPipe(energyProducer, pipeline); // } // // @Transactional -// public PowerPlantDispatchPlan submitOrUpdatePowerPlantDispatchPlanForSpotMarket(PowerPlant plant, EnergyProducer producer, -// ElectricitySpotMarket market, Segment segment, long time, double price, double capacity) { +// public PowerPlantDispatchPlan +// submitOrUpdatePowerPlantDispatchPlanForSpotMarket(PowerPlant plant, +// EnergyProducer producer, +// ElectricitySpotMarket market, Segment segment, long time, double price, +// double capacity) { // // // make a new one if it -// PowerPlantDispatchPlan plan = findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(plant, segment, time); +// PowerPlantDispatchPlan plan = +// findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(plant, segment, +// time); // if (plan == null) { // plan = new PowerPlantDispatchPlan().persist(); // plan.setPowerPlant(plant); @@ -231,7 +273,8 @@ public Iterable findAllAcceptedPowerPlantDispatchPlansFo // } // // @Transactional -// public void updateCapacityLongTermContract(PowerPlantDispatchPlan plan, double capacity) { +// public void updateCapacityLongTermContract(PowerPlantDispatchPlan plan, +// double capacity) { // plan.setCapacityLongTermContract(capacity); // // if(plan.getCapacitySpotMarket() + capacity > // // plan.getPowerPlant().getTechnology().getCapacity()){ @@ -241,7 +284,8 @@ public Iterable findAllAcceptedPowerPlantDispatchPlansFo // } // // @Transactional -// public void updateCapacitySpotMarket(PowerPlantDispatchPlan plan, double capacity) { +// public void updateCapacitySpotMarket(PowerPlantDispatchPlan plan, double +// capacity) { // plan.setCapacitySpotMarket(capacity); // // if(plan.getCapacityLongTermContract() + capacity > // // plan.getPowerPlant().getTechnology().getCapacity()){ diff --git a/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantRepository.java index 421ba7e2..6f78cbd3 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/PowerPlantRepository.java @@ -42,7 +42,7 @@ public interface PowerPlantRepository extends GraphRepository { /** * Finds plants by owner. - * + * * @param owner * of the plants * @return the list of plants @@ -79,9 +79,15 @@ public interface PowerPlantRepository extends GraphRepository { // Iterable findOperationalPowerPlants(@Param("tick") long // tick); + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']] .propertyFilter('dismantleTime', FilterPipe.Filter.GREATER_THAN, tick)", type = QueryType.Gremlin) + Iterable findAllPowerPlantsWhichAreNotDismantledBeforeTick(@Param("tick") long tick); + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']] .propertyFilter('dismantleTime', FilterPipe.Filter.LESS_THAN, tick)", type = QueryType.Gremlin) Iterable findAllPowerPlantsDismantledBeforeTick(@Param("tick") long tick); + @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{it.constructionStartTime==tick}", type = QueryType.Gremlin) + Iterable findAllPowerPlantsWithConstructionStartTimeInTick(@Param("tick") long tick); + /** * Finds operational plants and gives them back as a list (only use for * current tick, since only officially dismantled powerplants and plants in @@ -99,9 +105,9 @@ public interface PowerPlantRepository extends GraphRepository { @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.sum{it.actualNominalCapacity};", type = QueryType.Gremlin) double calculateCapacityOfOperationalPowerPlants(@Param("tick") long tick); - @Query(value = "t = new Table();" + - "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.as('pp').out('TECHNOLOGY').as('ty').table(t){it.actualNominalCapacity}{it.peakSegmentDependentAvailability}.cap().next(); " + - "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;" , type = QueryType.Gremlin) + @Query(value = "t = new Table();" + + "g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.as('pp').out('TECHNOLOGY').as('ty').table(t){it.actualNominalCapacity}{it.peakSegmentDependentAvailability}.cap().next(); " + + "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;", type = QueryType.Gremlin) double calculatePeakCapacityOfOperationalPowerPlants(@Param("tick") long tick); /** @@ -163,9 +169,9 @@ public Iterable findOperationalPowerPlantsInMarket(@Param("market") public double calculateCapacityOfOperationalPowerPlantsInMarket(@Param("market") ElectricitySpotMarket market, @Param("tick") long tick); - @Query(value = "t = new Table();" + - "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.as('pp').out('TECHNOLOGY').as('ty').table(t){it.actualNominalCapacity}{it.peakSegmentDependentAvailability}.cap().next(); " + - "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;" , type = QueryType.Gremlin) + @Query(value = "t = new Table();" + + "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.as('pp').out('TECHNOLOGY').as('ty').table(t){it.actualNominalCapacity}{it.peakSegmentDependentAvailability}.cap().next(); " + + "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;", type = QueryType.Gremlin) public double calculatePeakCapacityOfOperationalPowerPlantsInMarket(@Param("market") ElectricitySpotMarket market, @Param("tick") long tick); @@ -193,42 +199,37 @@ public double calculateCapacityOfExpectedOperationalPowerPlantsByNodeAndTechnolo @Param("node") PowerGridNode node, @Param("tech") PowerGeneratingTechnology technology, @Param("tick") long tick); - @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('owner').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('owner').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.out('TECHNOLOGY').filter{it==g.v(tech)};", type = QueryType.Gremlin) + @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.out('POWERPLANT_OWNER').filter{it==g.v(owner)}.in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.out('TECHNOLOGY').filter{it==g.v(tech)};", type = QueryType.Gremlin) public Iterable findExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology( @Param("market") ElectricitySpotMarket market, @Param("tech") PowerGeneratingTechnology technology, @Param("tick") long tick, @Param("owner") EnergyProducer owner); - @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('owner').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('owner').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.as('x').out('TECHNOLOGY').filter{it==g.v(tech)}.back('x').sum{it.actualNominalCapacity};" + @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.out('POWERPLANT_OWNER').filter{it==g.v(owner)}.in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.as('x').out('TECHNOLOGY').filter{it==g.v(tech)}.back('x').sum{it.actualNominalCapacity};" + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology( @Param("market") ElectricitySpotMarket market, @Param("tech") PowerGeneratingTechnology technology, @Param("tick") long tick, @Param("owner") EnergyProducer owner); - @Query(value = "result = g.v(owner).in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.sum{it.actualNominalCapacity};" + @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.out('POWERPLANT_OWNER').filter{it==g.v(owner)}.in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.sum{it.actualNominalCapacity};" + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) - public double calculateCapacityOfExpectedOperationalPowerPlantsByOwner(@Param("tick") long tick, + public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick, @Param("owner") EnergyProducer owner); - @Query(value = "result = g.v(owner).in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.as('x').out('TECHNOLOGY').filter{it.name==g.v(tech).name}.back('x').sum{it.actualNominalCapacity};" - + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) - public double calculateCapacityOfExpectedOperationalPowerPlantsByOwnerByTechnology(@Param("tick") long tick, - @Param("owner") EnergyProducer owner, @Param("tech") PowerGeneratingTechnology pgt); - @Query(value = "result = g.v(owner).in('POWERPLANT_OWNER').filter{it.expectedEndOfLife == tick}.as('x').out('TECHNOLOGY').filter{it.name==g.v(tech).name}.back('x').sum{it.actualNominalCapacity};" + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) public double calculateCapacityOfExpectedDismantledPowerPlantsByOwnerByTechnology(@Param("tick") long tick, @Param("owner") EnergyProducer owner, @Param("tech") PowerGeneratingTechnology pgt); - @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('x').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('x').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.out('TECHNOLOGY');", type = QueryType.Gremlin) - public Iterable findExpectedOperationalPowerPlantsInMarketByOwner( - @Param("market") ElectricitySpotMarket market, @Param("tick") long tick, + @Query(value = "result = g.v(owner).in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.sum{it.actualNominalCapacity};" + + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) + public double calculateCapacityOfExpectedOperationalPowerPlantsByOwner(@Param("tick") long tick, @Param("owner") EnergyProducer owner); - @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.out('POWERPLANT_OWNER').filter{it==g.v(owner)}.in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.sum{it.actualNominalCapacity};" + @Query(value = "result = g.v(owner).in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.as('x').out('TECHNOLOGY').filter{it.name==g.v(tech).name}.back('x').sum{it.actualNominalCapacity};" + "if(result == null){return 0} else{return result}", type = QueryType.Gremlin) - public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner( - @Param("market") ElectricitySpotMarket market, @Param("tick") long tick, - @Param("owner") EnergyProducer owner); + public double calculateCapacityOfExpectedOperationalPowerPlantsByOwnerByTechnology(@Param("tick") long tick, + @Param("owner") EnergyProducer owner, @Param("tech") PowerGeneratingTechnology pgt); @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}", type = QueryType.Gremlin) public Iterable findPowerPlantsInMarket(@Param("market") ElectricitySpotMarket market); @@ -259,10 +260,44 @@ public double calculateCapacityOfPowerPlantsByTechnologyInPipeline( public double calculateCapacityOfPowerPlantsByMarketInPipeline(@Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('plant').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.sort{-it.ageFraction}_()", type = QueryType.Gremlin) + public Iterable findOperationalPowerPlantsByDescendingAgeFactorAndMarket( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('plant').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.sort{it.profitability}_()", type = QueryType.Gremlin) + public Iterable findOperationalPowerPlantsByAscendingProfitabilityAndMarket( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('plant').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.sort{-it.profitability}_()", type = QueryType.Gremlin) + public Iterable findOperationalPowerPlantsByDescendingProfitabilityAndMarket( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin) + public Iterable findExpectedOperationalPowerPlantsInMarketWithoutDismantling( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + + @Query(value = "double counter=0;" + + "powerplants = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)};" + + "for (pp in powerplants) {" + "capacity = pp.actualNominalCapacity.next();" + + "peak=pp.out('TECHNOLOGY').peakSegmentDependentAvailability.next();" + "result = capacity*peak;" + + "counter = counter+result };" + "return counter", type = QueryType.Gremlin) + public double calculatePeakCapacityOfPowerPlantsByMarketTime(@Param("market") ElectricitySpotMarket market, + @Param("tick") long tick); + @Query(value = "substanceShares = g.v(substance).in('SUBSTANCE').filter{it.__type__=='emlab.gen.domain.technology.SubstanceShareInFuelMix'};" + "sum=substanceShares.sum{it.share}; if(sum!=null) return sum else return 0;;", type = QueryType.Gremlin) public double calculateSubstanceUsage(@Param("substance") Substance substance); + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick) && it.profitability>=0}", type = QueryType.Gremlin) + public Iterable findExpectedOperationalProfitablePowerPlantsInMarket( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick); + + @Query(value = "t = new Table();" + + "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.as('pp').out('TECHNOLOGY').as('ty').table(t){it.actualNominalCapacity}{it.baseSegmentDependentAvailability}.cap().next(); " + + "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;", type = QueryType.Gremlin) + public double calculateBaseCapacityOfOperationalPowerPlantsInMarket(@Param("market") ElectricitySpotMarket market, + @Param("tick") long tick); + @Query(value = "g.v(gridnode).in('LOCATION').filter{(it.__type__=='emlab.gen.domain.technology.PowerPlant')}.as('p').out('TECHNOLOGY').filter{it.intermittent == true}.back('p').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin) Iterable findOperationalIntermittentPowerPlantsByPowerGridNode(@Param("gridnode") PowerGridNode node, @Param("tick") long tick); @@ -283,4 +318,45 @@ Iterable findOperationalIntermittentPowerPlantsByPowerGridNodeAndTec @Param("gridnode") PowerGridNode node, @Param("technology") PowerGeneratingTechnology powerGeneratingTechnology, @Param("tick") long tick); + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').propertyFilter('type', FilterPipe.Filter.EQUAL, 1).propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateSpotMarketRevenueOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').propertyFilter('type', FilterPipe.Filter.EQUAL, 2).propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateLongTermContractRevenueOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').propertyFilter('type', FilterPipe.Filter.EQUAL, 10).propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateStrategicReserveRevenueOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').propertyFilter('type', FilterPipe.Filter.EQUAL, 11).propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateCapacityMarketRevenueOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').propertyFilter('type', FilterPipe.Filter.EQUAL, 12).propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateCO2HedgingRevenueOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').filter{it.type==5 || it.type==6 || it.type==9}.propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateCO2CostsOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "result=g.v(plant).in('REGARDING_POWERPLANT').filter{it.type==3 || it.type==7 || it.type==8}.propertyFilter('time', FilterPipe.Filter.EQUAL, tick).money.sum(); if(result==null){result=0}; return result", type = QueryType.Gremlin) + double calculateFixedCostsOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "ppdps=g.v(plant).in('POWERPLANT_DISPATCHPLAN').filter{it.time==tick}.propertyFilter('forecast', FilterPipe.Filter.EQUAL, false); sum=0;" + + "fullLoadHours=0;" + + "for(ppdp in ppdps){" + + "totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract');" + + "if(totalAmount==null) totalAmount=0;" + + "hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours');" + + "production = totalAmount * hoursInSegment;" + + "fullLoadHours = fullLoadHours + hoursInSegment * totalAmount / (ppdp.out('POWERPLANT_DISPATCHPLAN').next().actualNominalCapacity *1.0d);" + + "}; return fullLoadHours;", type = QueryType.Gremlin) + double calculateFullLoadHoursOfPowerPlant(@Param("plant") PowerPlant plant, @Param("tick") long tick); + + @Query(value = "g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{(it.__type__=='emlab.gen.domain.technology.PowerPlant')}.as('p').out('TECHNOLOGY').filter{it==g.v(technology)}.back('p').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin) + Iterable findOperationalPowerPlantsByMarketAndTechnology(@Param("market") ElectricitySpotMarket market, + @Param("technology") PowerGeneratingTechnology powerGeneratingTechnology, @Param("tick") long tick); + + @Query(value = "result = g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('x').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('x').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.out('TECHNOLOGY');", type = QueryType.Gremlin) + public Iterable findExpectedOperationalPowerPlantsInMarketByOwner( + @Param("market") ElectricitySpotMarket market, @Param("tick") long tick, + @Param("owner") EnergyProducer owner); + } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/RegulatorRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/RegulatorRepository.java new file mode 100644 index 00000000..fd0b6eb9 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/RegulatorRepository.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.annotation.Query; +import org.springframework.data.neo4j.annotation.QueryType; +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; + +/** + * @author Kaveri + * + */ +@Repository +public interface RegulatorRepository extends GraphRepository { + + @Query(value = "g.v(zone).in('OF_ZONE')", type = QueryType.Gremlin) + public Regulator findRegulatorForZone(@Param("zone") Zone zone); + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/repository/Reps.java b/emlab-generation/src/main/java/emlab/gen/repository/Reps.java index 33f872c3..d770b56c 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/Reps.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/Reps.java @@ -89,6 +89,9 @@ public class Reps { @Autowired public PowerGeneratingTechnologyNodeLimitRepository powerGeneratingTechnologyNodeLimitRepository; + @Autowired + public InterconnectorRepository interconnectorRepository; + @Autowired public StrategicReserveOperatorRepository strategicReserveOperatorRepository; @@ -98,4 +101,21 @@ public class Reps { @Autowired public IntermittentTechnologyNodeLoadFactorRepository intermittentTechnologyNodeLoadFactorRepository; + @Autowired + public CapacityMarketRepository capacityMarketRepository; + + @Autowired + public CapacityClearingPointRepository capacityClearingPointRepository; + + @Autowired + public RegulatorRepository regulatorRepository; + + @Autowired + public CapacityDispatchPlanRepository capacityDispatchPlanRepository; + + @Autowired + public RenewableSupportSchemeRepository renewableSupportSchemeRepository; + + @Autowired + public FinancialPowerPlantReportRepository financialPowerPlantReportRepository; } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/SegmentClearingPointRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/SegmentClearingPointRepository.java index 1d48e432..95b15827 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/SegmentClearingPointRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/SegmentClearingPointRepository.java @@ -35,11 +35,17 @@ Iterable findAllSegmentClearingPointsForSegmentAndTime(@Pa @Param("segment") Segment segment, @Param("forecast") boolean forecast); // @Query("START segment = node({segment}), market=node({market}) MATCH (segment)<-[:SEGMENT_POINT]-(scp)-[:MARKET_POINT]->(market) WHERE (scp.time = {time}) RETURN scp") - // SegmentClearingPoint findOneSegmentClearingPointForMarketSegmentAndTime(@Param("time") long time, @Param("segment") Segment segment, + // SegmentClearingPoint + // findOneSegmentClearingPointForMarketSegmentAndTime(@Param("time") long + // time, @Param("segment") Segment segment, // @Param("market") ElectricitySpotMarket electricitySpotMarket); @Query(value = "g.v(segment).in('SEGMENT_POINT').propertyFilter('time', FilterPipe.Filter.EQUAL, time).propertyFilter('forecast', FilterPipe.Filter.EQUAL, forecast).as('x').out('MARKET_POINT').idFilter(market, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) - SegmentClearingPoint findOneSegmentClearingPointForMarketSegmentAndTime(@Param("time") long time, @Param("segment") Segment segment, - @Param("market") ElectricitySpotMarket electricitySpotMarket, + SegmentClearingPoint findOneSegmentClearingPointForMarketSegmentAndTime(@Param("time") long time, + @Param("segment") Segment segment, @Param("market") ElectricitySpotMarket electricitySpotMarket, @Param("forecast") boolean forecast); + + @Query(value = "g.v(segment).in('SEGMENT_POINT').propertyFilter('time', FilterPipe.Filter.EQUAL, time).as('x').out('MARKET_POINT').idFilter(market, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) + SegmentClearingPoint findOneSegmentClearingPointForMarketSegmentAndTime(@Param("time") long time, + @Param("segment") Segment segment, @Param("market") ElectricitySpotMarket electricitySpotMarket); } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/SegmentLoadRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/SegmentLoadRepository.java index 980873b2..6923c8fc 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/SegmentLoadRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/SegmentLoadRepository.java @@ -45,6 +45,9 @@ public interface SegmentLoadRepository extends GraphRepository { @Query("start segment=node({segment}) match (segment)<-[:SEGMENTLOAD_SEGMENT]-(segmentload) return segmentload") public Iterable findAllSegmentLoadsBySegment(@Param("segment") Segment segment); + @Query("start segment=node({segment}) match (segment)<-[:SEGMENTLOAD_SEGMENT]-(segmentload) return segmentload") + public SegmentLoad getSegmentLoadBySegment(@Param("segment") Segment segment); + /** * Finds the segment load for a certain segment and market * @@ -64,4 +67,9 @@ public interface SegmentLoadRepository extends GraphRepository { @Query(value = "g.v(zone).in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.outE('SEGMENT_LOAD').inV.max{it.baseLoad}.baseLoad", type = QueryType.Gremlin) double peakLoadbyZoneMarketandTime(@Param("zone") Zone zone, @Param("market") ElectricitySpotMarket market); + @Query(value = "topsegments = g.v(market).out('SEGMENT_LOAD').max{it.baseLoad}.baseLoad;" + + "try{growthfactors = g.v(market).out('DEMANDGROWTH_TREND').collect{f.getTrendValue(it, tick)}[0];} catch(Exception e){" + + "growthfactors=g.v(market).out('DEMANDGROWTH_TREND').timeSeries.next()[tick.toInteger()]};" + + "adjustedTopSegments = topsegments*growthfactors;" + "return[adjustedTopSegments]", type = QueryType.Gremlin) + double peakLoadbyMarketandTime(@Param("market") ElectricitySpotMarket market, @Param("tick") long tick); } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/SegmentRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/SegmentRepository.java index 6bedadce..3afdc088 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/SegmentRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/SegmentRepository.java @@ -15,12 +15,27 @@ ******************************************************************************/ package emlab.gen.repository; +import org.springframework.data.neo4j.annotation.Query; +import org.springframework.data.neo4j.annotation.QueryType; import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; import emlab.gen.domain.market.electricity.Segment; @Repository public interface SegmentRepository extends GraphRepository { + @Query(value = "g.v(market).out('SEGMENT_LOAD').out('SEGMENTLOAD_SEGMENT').filter{it.segmentID==1}", type = QueryType.Gremlin) + public Segment findPeakSegmentforMarket(@Param("market") ElectricitySpotMarket market); + + @Query(value = "g.v(market).out('SEGMENT_LOAD').out.sort{-it.segmentID}.next()", type = QueryType.Gremlin) + public Segment findBaseSegmentforMarket(@Param("market") ElectricitySpotMarket market); + + @Query(value = "g.v(market).out('SEGMENT_LOAD').out.sort{it.segmentID}_()", type = QueryType.Gremlin) + public Iterable findSegmentforMarketSortedbySegmentID(@Param("market") ElectricitySpotMarket market); + + @Query(value = "g.v(market).out('SEGMENT_LOAD').out", type = QueryType.Gremlin) + public Iterable findSegmentforMarket(@Param("market") ElectricitySpotMarket market); } diff --git a/emlab-generation/src/main/java/emlab/gen/repository/SupportPriceContractRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/SupportPriceContractRepository.java new file mode 100644 index 00000000..6e6f1e78 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/repository/SupportPriceContractRepository.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.repository; + +import org.springframework.data.neo4j.repository.GraphRepository; +import org.springframework.stereotype.Repository; + +import emlab.gen.domain.policy.renewablesupport.SupportPriceContract; + +/** + * @author Kaveri3012 + * + */ + +@Repository +public interface SupportPriceContractRepository extends GraphRepository { + +} diff --git a/emlab-generation/src/main/java/emlab/gen/repository/TargetInvestorRepository.java b/emlab-generation/src/main/java/emlab/gen/repository/TargetInvestorRepository.java index 449e85d4..5a05e14b 100644 --- a/emlab-generation/src/main/java/emlab/gen/repository/TargetInvestorRepository.java +++ b/emlab-generation/src/main/java/emlab/gen/repository/TargetInvestorRepository.java @@ -27,8 +27,16 @@ * @author JCRichstein * */ -public interface TargetInvestorRepository extends -GraphRepository { +public interface TargetInvestorRepository extends GraphRepository { + + @Query(value = "result = g.v(market).in('INVESTOR_MARKET').next(); ; if(!result.hasNext()){return null;} else{return result.next();}", type = QueryType.Gremlin) + TargetInvestor findOneByMarket(@Param("market") ElectricitySpotMarket electricitySpotMarket); + + @Query(value = "result = g.v(market).in('INVESTOR_MARKET').next();", type = QueryType.Gremlin) + TargetInvestor findInvestorByMarket(@Param("market") ElectricitySpotMarket electricitySpotMarket); + + @Query(value = "result = g.v(market).in('INVESTOR_MARKET').filter{it.__type__=='emlab.gen.domain.agent.TargetInvestor'};", type = QueryType.Gremlin) + TargetInvestor findTargetInvestorByMarket(@Param("market") ElectricitySpotMarket electricitySpotMarket); @Query(value = "g.idx('__types__')[[className:'emlab.gen.domain.agent.TargetInvestor']].as('x').out('INVESTOR_MARKET').idFilter(market, FilterPipe.Filter.EQUAL).back('x')", type = QueryType.Gremlin) Iterable findAllByMarket(@Param("market") ElectricitySpotMarket electricitySpotMarket); diff --git a/emlab-generation/src/main/java/emlab/gen/role/DecarbonizationModelRole.java b/emlab-generation/src/main/java/emlab/gen/role/DecarbonizationModelRole.java index 5dbe6f1a..f4a0619f 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/DecarbonizationModelRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/DecarbonizationModelRole.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2012 the original author or authors. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,16 +31,22 @@ import emlab.gen.domain.agent.StrategicReserveOperator; import emlab.gen.domain.agent.TargetInvestor; import emlab.gen.domain.market.CommodityMarket; +import emlab.gen.domain.market.capacity.CapacityMarket; import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.policy.renewablesupport.RenewableSupportScheme; import emlab.gen.repository.Reps; +import emlab.gen.role.capacitymarket.ExportLimiterRole; +import emlab.gen.role.capacitymarket.SimpleCapacityMarketMainRole; import emlab.gen.role.capacitymechanisms.ProcessAcceptedPowerPlantDispatchRoleinSR; import emlab.gen.role.capacitymechanisms.StrategicReserveOperatorRole; import emlab.gen.role.co2policy.MarketStabilityReserveRole; import emlab.gen.role.co2policy.RenewableAdaptiveCO2CapRole; +import emlab.gen.role.investment.DismantlePowerPlantOperationalLossRole; import emlab.gen.role.investment.DismantlePowerPlantPastTechnicalLifetimeRole; import emlab.gen.role.investment.GenericInvestmentRole; import emlab.gen.role.market.ClearCommodityMarketRole; import emlab.gen.role.market.ClearIterativeCO2AndElectricitySpotMarketTwoCountryRole; +import emlab.gen.role.market.CreatingFinancialReports; import emlab.gen.role.market.DetermineResidualLoadCurvesForTwoCountriesRole; import emlab.gen.role.market.ProcessAcceptedBidsRole; import emlab.gen.role.market.ProcessAcceptedPowerPlantDispatchRole; @@ -56,6 +62,7 @@ import emlab.gen.role.operating.PayCO2TaxRole; import emlab.gen.role.operating.PayForLoansRole; import emlab.gen.role.operating.PayOperatingAndMaintainanceCostsRole; +import emlab.gen.role.renewablesupport.FeedInPremiumRole; /** * Main model role. @@ -107,11 +114,20 @@ public class DecarbonizationModelRole extends AbstractRole @Autowired private ProcessAcceptedPowerPlantDispatchRoleinSR acceptedPowerPlantDispatchRoleinSR; @Autowired + private DismantlePowerPlantOperationalLossRole dismantlePowerPlantOperationalLossRole; + @Autowired private RenewableAdaptiveCO2CapRole renewableAdaptiveCO2CapRole; @Autowired MarketStabilityReserveRole marketStabilityReserveRole; @Autowired private DetermineResidualLoadCurvesForTwoCountriesRole determineResidualLoadCurve; + @Autowired + private SimpleCapacityMarketMainRole simpleCapacityMarketMainRole; + @Autowired + private CreatingFinancialReports creatingFinancialReports; + + @Autowired + private FeedInPremiumRole feedInPremiumRole; @Autowired Reps reps; @@ -143,20 +159,42 @@ public void act(DecarbonizationModel model) { if (model.isRealRenewableDataImplemented()) determineResidualLoadCurve.act(model); - logger.warn(" 0. Dismantling & paying loans"); - for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { - dismantlePowerPlantRole.act(producer); - payForLoansRole.act(producer); - // producer.act(dismantlePowerPlantRole); - // producer.act(payForLoansRole); - } + // logger.warn(" 0. Dismantling & paying loans"); + // for (EnergyProducer producer : + // reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { + // dismantlePowerPlantRole.act(producer); + // payForLoansRole.act(producer); + // producer.act(dismantlePowerPlantRole); + // producer.act(payForLoansRole); + // } /* * Determine fuel mix of power plants */ Timer timerMarket = new Timer(); timerMarket.start(); + + logger.warn(" 0b. Dismantling"); + timerMarket.reset(); + timerMarket.start(); + for (ElectricitySpotMarket market : reps.marketRepository.findAllElectricitySpotMarketsAsList()) { + dismantlePowerPlantOperationalLossRole.act(market); + } + timerMarket.stop(); + logger.warn(" took: {} seconds.", timerMarket.seconds()); + + logger.warn(" 0c. Paying loans"); + timerMarket.reset(); + timerMarket.start(); + for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { + payForLoansRole.act(producer); + } + timerMarket.stop(); + logger.warn(" took: {} seconds.", timerMarket.seconds()); + logger.warn(" 1. Determining fuel mix"); + timerMarket.reset(); + timerMarket.start(); for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { determineFuelMixRole.act(producer); // producer.act(determineFuelMixRole); @@ -164,6 +202,26 @@ public void act(DecarbonizationModel model) { timerMarket.stop(); logger.warn(" took: {} seconds.", timerMarket.seconds()); + /* + * Run Simple Capacity Market (start from tick 1, due to initialization + * requirements- it needs values (revenues from electricity spot market) + * from previous tick + */ + + if ((getCurrentTick() > 0) && (model.isSimpleCapacityMarketEnabled())) { + timerMarket.reset(); + timerMarket.start(); + logger.warn(" 2a. Run Simple Capacity Market"); + for (CapacityMarket market : reps.capacityMarketRepository.findAll()) { + simpleCapacityMarketMainRole.act(market); + } + + // exportLimiterRole.act(model); + + timerMarket.stop(); + logger.warn(" took: {} seconds.", timerMarket.seconds()); + } + /* * Submit and select long-term electricity contracts */ @@ -171,7 +229,7 @@ public void act(DecarbonizationModel model) { if (model.isLongTermContractsImplemented()) { timerMarket.reset(); timerMarket.start(); - logger.warn(" 2. Submit and select long-term electricity contracts"); + logger.warn(" 2b. Submit and select long-term electricity contracts"); for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { submitLongTermElectricityContractsRole.act(producer); // producer.act(submitLongTermElectricityContractsRole); @@ -185,8 +243,21 @@ public void act(DecarbonizationModel model) { logger.warn(" took: {} seconds.", timerMarket.seconds()); } + // timerMarket.reset(); + // timerMarket.start(); + // logger.warn(" 2b. Creating market forecast"); + // + // clearIterativeCO2AndElectricitySpotMarketTwoCountryRole + // .makeCentralElectricityMarketForecastForTimeStep(getCurrentTick() + + // model.getCentralForecastingYear()); + // + // logger.warn(" took: {} seconds.", timerMarket.seconds()); + // + // timerMarket.reset(); + /* - * Clear electricity spot and CO2 markets and determine also the commitment of powerplants. + * Clear electricity spot and CO2 markets and determine also the + * commitment of powerplants. */ timerMarket.reset(); timerMarket.start(); @@ -301,6 +372,25 @@ public void act(DecarbonizationModel model) { timerMarket.stop(); logger.warn(" took: {} seconds.", timerMarket.seconds()); +logger.warn(" 6.b) Creating power plant financial reports."); + Timer financialReports = new Timer(); + financialReports.start(); + + creatingFinancialReports.act(model); + + financialReports.stop(); + logger.warn(" took: {} seconds.", financialReports.seconds()); + + + if (model.isFeedInPremiumImplemented()) { + logger.warn(" 6a. Run Feed In Premium Scheme"); + for (RenewableSupportScheme scheme : reps.renewableSupportSchemeRepository.findAll()) { + feedInPremiumRole.act(scheme); + } + timerMarket.stop(); + logger.warn(" took: {} seconds.", timerMarket.seconds()); + } + logger.warn(" 7. Investing"); Timer timerInvest = new Timer(); timerInvest.start(); @@ -335,7 +425,7 @@ public void act(DecarbonizationModel model) { // agentspring.simulation.Schedule.getSchedule().stop(); // } - logger.warn(" 7. Reassign LTCs"); + logger.warn(" 7.5. Reassign LTCs"); timerMarket.reset(); timerMarket.start(); for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { @@ -363,6 +453,8 @@ public void act(DecarbonizationModel model) { reps.powerPlantDispatchPlanRepository.delete(reps.powerPlantDispatchPlanRepository .findAllPowerPlantDispatchPlansForTime(getCurrentTick() + model.getCentralForecastingYear() - 1, true)); + reps.financialPowerPlantReportRepository.delete(reps.financialPowerPlantReportRepository + .findAllFinancialPowerPlantReportsForTime(getCurrentTick() - 5 - model.getDeletionAge())); timerMarket.stop(); logger.warn(" took: {} seconds.", timerMarket.seconds()); } diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRole.java new file mode 100644 index 00000000..2c661a8f --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRole.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.neo4j.support.Neo4jTemplate; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.market.Bid; +import emlab.gen.domain.market.capacity.CapacityClearingPoint; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri + * + */ + +@RoleComponent +public class ClearCapacityMarketRole extends AbstractRole implements Role { + + // CapacityMarketRepository capacityMarketRepository; + + @Autowired + Reps reps; + + @Autowired + Neo4jTemplate template; + + @Override + @Transactional + public void act(Regulator regulator) { + + CapacityMarket market = new CapacityMarket(); + market = reps.capacityMarketRepository.findCapacityMarketForZone(regulator.getZone()); + + Iterable sortedListofCDP = null; + sortedListofCDP = reps.capacityMarketRepository.findAllSortedCapacityDispatchPlansByTime(getCurrentTick()); + double demand = 0d; + double sumofSupplyBidsAccepted = 0d; + double acceptedPrice = 0d; + boolean isTheMarketCleared = false; + + // This epsilon is to account for rounding errors for java (only + // relevant for exact clearing) + double clearingEpsilon = 0.001d; + + if (regulator.getDemandTarget() == 0) { + isTheMarketCleared = true; + acceptedPrice = 0; + } + + for (CapacityDispatchPlan currentCDP : sortedListofCDP) { + + if (currentCDP.getPrice() <= regulator.getCapacityMarketPriceCap()) { + + demand = regulator.getDemandTarget() + * (1 - regulator.getReserveDemandLowerMargin()) + + ((regulator.getCapacityMarketPriceCap() - currentCDP.getPrice()) + * (regulator.getReserveDemandUpperMargin() + regulator.getReserveDemandLowerMargin()) * regulator + .getDemandTarget()) / regulator.getCapacityMarketPriceCap(); + + // logger.warn("Price of this cdp is " + currentCDP.getPrice()); + // logger.warn("Demand at this cdp is " + demand); + + if (isTheMarketCleared == false) { + if (demand - (sumofSupplyBidsAccepted + currentCDP.getAmount()) >= -clearingEpsilon) { + acceptedPrice = currentCDP.getPrice(); + currentCDP.setStatus(Bid.ACCEPTED); + currentCDP.setAcceptedAmount(currentCDP.getAmount()); + sumofSupplyBidsAccepted = sumofSupplyBidsAccepted + currentCDP.getAmount(); + // logger.warn("Price of this cdp is " + + // currentCDP.getPrice()); + // logger.warn("accepted price" + acceptedPrice); + } + + else if (demand - (sumofSupplyBidsAccepted + currentCDP.getAmount()) < clearingEpsilon) { + + currentCDP.setStatus(Bid.PARTLY_ACCEPTED); + currentCDP.setAcceptedAmount((sumofSupplyBidsAccepted - demand)); + acceptedPrice = currentCDP.getPrice(); + sumofSupplyBidsAccepted = sumofSupplyBidsAccepted + currentCDP.getAcceptedAmount(); + isTheMarketCleared = true; + + // logger.warn("accepted price" + acceptedPrice); + + } + + // else if (demand - sumofSupplyBidsAccepted < + // clearingEpsilon) { + // isTheMarketCleared = true; + // } + } else { + currentCDP.setStatus(Bid.FAILED); + currentCDP.setAcceptedAmount(0); + } + + // logger.warn("Cumulatively Accepted Supply " + + // sumofSupplyBidsAccepted); + currentCDP.persist(); + + } + + // logger.warn("Current CDP Price " + currentCDP.getPrice()); + // logger.warn("Cumulatively accepted volume " + + // sumofSupplyBidsAccepted); + } + // logger.warn("Demand for the capacity market at tick {} is " + demand, + // getCurrentTick()); + + CapacityClearingPoint clearingPoint = new CapacityClearingPoint(); + if (isTheMarketCleared == true) { + // sumofSupplyBidsAccepted = demand; + logger.warn("MARKET CLEARED at price" + acceptedPrice); + clearingPoint.setPrice(acceptedPrice); + clearingPoint.setVolume(sumofSupplyBidsAccepted); + clearingPoint.setTime(getCurrentTick()); + clearingPoint.setCapacityMarket(market); + clearingPoint.persist(); + + logger.warn("Clearing point Price {} and volume " + clearingPoint.getVolume(), clearingPoint.getPrice()); + + } else { + acceptedPrice = regulator.getCapacityMarketPriceCap() + * (1 + ((regulator.getDemandTarget() * (1 - regulator.getReserveDemandLowerMargin()) - sumofSupplyBidsAccepted) / ((regulator + .getReserveDemandUpperMargin() + regulator.getReserveDemandLowerMargin()) * regulator + .getDemandTarget()))); + clearingPoint.setPrice(max(regulator.getCapacityMarketPriceCap(), acceptedPrice)); + clearingPoint.setVolume(sumofSupplyBidsAccepted); + clearingPoint.setTime(getCurrentTick()); + clearingPoint.setCapacityMarket(market); + clearingPoint.persist(); + logger.warn("MARKET UNCLEARED at price" + clearingPoint.getPrice()); + logger.warn("Clearing point Price {} and volume " + clearingPoint.getVolume(), clearingPoint.getPrice()); + + } + // clearingPoint.persist(); + // logger.warn("is the market cleared? " + isTheMarketCleared); + // logger.warn("Clearing point Price" + clearingPoint.getPrice()); + // logger.warn("Clearing Point Volume" + clearingPoint.getVolume()); + + // VERIFICATION + double q2 = clearingPoint.getVolume(); + double q1 = regulator.getDemandTarget() + * (1 - regulator.getReserveDemandLowerMargin()) + + ((regulator.getCapacityMarketPriceCap() - clearingPoint.getPrice()) + * (regulator.getReserveDemandUpperMargin() + regulator.getReserveDemandLowerMargin()) * regulator + .getDemandTarget()) / regulator.getCapacityMarketPriceCap(); + if (q1 == q2) { + logger.warn("matches"); + } else { + logger.warn("does not match"); + } + + } + + /** + * @param capacityMarketPriceCap + * @param acceptedPrice + * @return + */ + private double max(double capacityMarketPriceCap, double acceptedPrice) { + if (acceptedPrice >= capacityMarketPriceCap) + return capacityMarketPriceCap; + else + return acceptedPrice; + } + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ExportLimiterRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ExportLimiterRole.java new file mode 100644 index 00000000..f1918169 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ExportLimiterRole.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.neo4j.support.Neo4jTemplate; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.DecarbonizationModel; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.technology.Interconnector; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri + * + */ + +@RoleComponent +public class ExportLimiterRole extends AbstractRole implements Role { + + @Autowired + Reps reps; + + @Autowired + Neo4jTemplate template; + + @Override + @Transactional + public void act(DecarbonizationModel model) { + + double initialInterconnectorCapacity = 0d; + + // find all interconnectors + Interconnector interconnector = template.findAll(Interconnector.class).iterator().next(); + + // get initial interconnector capacity at tick 1 as capacity market is + // functional only from tick 1 + if (getCurrentTick() == 1) { + + initialInterconnectorCapacity = interconnector.getCapacity(getCurrentTick()); + logger.warn("at tick 1 the interconnector capacity is" + initialInterconnectorCapacity); + + } + + // initialize interconnector capacity, irrespective of current tick, to + // initialInterconnectorCapacity + logger.warn("print capacity temp variable initialICcapacity" + initialInterconnectorCapacity); + logger.warn("interconnector capacity before setting " + interconnector.getCapacity(getCurrentTick())); + interconnector.setCapacity(initialInterconnectorCapacity); + logger.warn("interconnector capacity after setting " + interconnector.getCapacity(getCurrentTick())); + // loop through capacity markets and if supply < demand in any of the + // capacity market regions, set interconnector capacity = 0 + for (CapacityMarket market : reps.capacityMarketRepository.findAll()) { + Zone zone = market.getZone(); + logger.warn("zone" + zone); + ElectricitySpotMarket emarket = reps.marketRepository.findElectricitySpotMarketForZone(zone); + + // double supply = + // reps.marketRepository.findTotalSupplyInElectricitySpotMarketForZone(zone); + double supply = reps.powerPlantRepository.calculatePeakCapacityOfOperationalPowerPlantsInMarket(emarket, + getCurrentTick()); + logger.warn("Supply" + supply); + // double peakDemand = + // reps.marketRepository.findPeakDemandInElectricitySpotMarketForZone(zone); + double peakLoadforMarketNOtrend = reps.segmentLoadRepository.peakLoadbyZoneMarketandTime(zone, emarket); + double demandfactor = emarket.getDemandGrowthTrend().getValue(getCurrentTick()); + + double peakDemand = peakLoadforMarketNOtrend * demandfactor; + logger.warn("demand" + peakDemand); + + if ((supply - peakDemand) < 0) { + + interconnector.setCapacity(0); + logger.warn("interconnector capacity set to zero" + interconnector.getCapacity(getCurrentTick())); + } + + } + + } +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ForecastDemandRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ForecastDemandRole.java new file mode 100644 index 00000000..9e3d1b0c --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/ForecastDemandRole.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.repository.Reps; +import emlab.gen.util.GeometricTrendRegression; + +/** + * @author Kaveri + * + */ +@RoleComponent +public class ForecastDemandRole extends AbstractRole implements Role { + + @Autowired + Reps reps; + + @Override + @Transactional + public void act(Regulator regulator) { + long capabilityYear = 0; + capabilityYear = getCurrentTick() + regulator.getTargetPeriod(); + + Zone zone = regulator.getZone(); + ElectricitySpotMarket market = reps.marketRepository.findElectricitySpotMarketForZone(zone); + + // double trend = + // market.getDemandGrowthTrend().getValue(getCurrentTick()); + // double peakLoadforMarket = trend * peakLoadforMarketNOtrend; + // double reserveMargin = regulator.getReserveMargin(); + // double demandTarget = peakLoadforMarket * (1 + reserveMargin); + + // regulator.setDemandTarget(demandTarget); + + /* + * // Computing Demand (the current year's demand is not considered for + * // regression, as it is forecasted. double expectedDemandFactor = 0d; + */ + + double expectedDemandFactor = 0d; + if (getCurrentTick() < 2) { + + expectedDemandFactor = market.getDemandGrowthTrend().getValue(getCurrentTick()); + } else { + + GeometricTrendRegression gtr = new GeometricTrendRegression(); + for (long time = getCurrentTick() - 1; time > getCurrentTick() - 1 + - regulator.getNumberOfYearsLookingBackToForecastDemand() + && time >= 0; time = time - 1) { + gtr.addData(time, market.getDemandGrowthTrend().getValue(time)); + } + expectedDemandFactor = gtr.predict(capabilityYear); + } + logger.warn("ExpectedDemandFactor for this tick: " + expectedDemandFactor); + logger.warn("demand factor " + market.getDemandGrowthTrend().getValue(getCurrentTick())); + // Calculate peak demand across all markets + + double peakLoadforMarketNOtrend = reps.segmentLoadRepository.peakLoadbyZoneMarketandTime(zone, market); + double peakExpectedDemand = peakLoadforMarketNOtrend * expectedDemandFactor; + + // Compute demand target by multiplying reserve margin double double + double demandTarget = peakExpectedDemand * (1 + regulator.getReserveMargin()); + + regulator.setDemandTarget(demandTarget); + + } + +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerForCapacityRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerForCapacityRole.java new file mode 100644 index 00000000..11ddac1b --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerForCapacityRole.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.contract.CashFlow; +import emlab.gen.domain.market.ClearingPoint; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.repository.Reps; +import emlab.gen.role.market.AbstractMarketRole; + +//import org.springframework.data.neo4j.annotation.NodeEntity; + +/** + * @author Kaveri + * + */ +@RoleComponent +public class PaymentFromConsumerToProducerForCapacityRole extends AbstractMarketRole implements + Role { + + @Autowired + Reps reps; + + // CashFlow cash = new CashFlow(); + + @Override + @Transactional + public void act(CapacityMarket capacityMarket) { + + for (CapacityDispatchPlan plan : reps.capacityMarketRepository.findAllAcceptedCapacityDispatchPlansForTime( + capacityMarket, getCurrentTick())) { + + // logger.warn("Hi"); + // logger.warn("cdp for plant" + plan.getPlant()); + + ClearingPoint capacityClearingPoint = reps.capacityMarketRepository + .findOneClearingPointForTimeAndCapacityMarket(getCurrentTick(), capacityMarket); + + // logger.warn("capacity clearing point " + + // capacityClearingPoint.getPrice()); + // double price = capacityClearingPoint.getPrice(); + ElectricitySpotMarket esm = reps.marketRepository + .findElectricitySpotMarketForZone(capacityMarket.getZone()); + // logger.warn("esmt " + esm.getName()); + + reps.nonTransactionalCreateRepository.createCashFlow(esm, plan.getBidder(), plan.getAcceptedAmount() + * capacityClearingPoint.getPrice(), CashFlow.SIMPLE_CAPACITY_MARKET, getCurrentTick(), + plan.getPlant()); + // logger.warn("Cash flow from consumer {} to Producer {} of value {} " + // + plan.getAcceptedAmount() + // * capacityClearingPoint.getPrice(), plan.getBidder(), + // capacityMarket.getConsumer()); + } + + } + + /* + * (non-Javadoc) + * + * @see emlab.gen.role.market.AbstractMarketRole#getReps() + */ + @Override + public Reps getReps() { + + return reps; + + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SimpleCapacityMarketMainRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SimpleCapacityMarketMainRole.java new file mode 100644 index 00000000..047fcca5 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SimpleCapacityMarketMainRole.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri + * + */ + +@RoleComponent +public class SimpleCapacityMarketMainRole extends AbstractRole implements Role { + + @Autowired + Reps reps; + + @Autowired + ForecastDemandRole forecastDemandRole; + + @Autowired + SubmitCapacityBidToMarketRole submitCapacityBidToMarketRole; + + @Autowired + ClearCapacityMarketRole clearCapacityMarketRole; + + @Autowired + PaymentFromConsumerToProducerForCapacityRole paymentFromConsumerToProducerforCapacityRole; + + @Override + @Transactional + public void act(CapacityMarket market) { + + Regulator regulator = market.getRegulator(); + + // Forecast Demand + forecastDemandRole.act(regulator); + logger.warn("Forecast demand role run"); + + // Energy producers submit Bids to Capacity market + for (EnergyProducer producer : reps.genericRepository.findAllAtRandom(EnergyProducer.class)) { + submitCapacityBidToMarketRole.act(producer); + } + logger.warn("******************capacity bids submitted****************************"); + + // Clear capacity market + clearCapacityMarketRole.act(regulator); + + logger.warn("************************Capacity Market cleared******************************"); + + // ensure cash flows + paymentFromConsumerToProducerforCapacityRole.act(market); + + logger.warn("capacity payments made"); + logger.warn("Capacity Market Main Role Completed once"); + + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRole.java new file mode 100644 index 00000000..da47bda7 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRole.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.market.Bid; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.PowerPlantDispatchPlan; +import emlab.gen.domain.market.electricity.Segment; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.repository.Reps; +import emlab.gen.role.AbstractEnergyProducerRole; + +//import org.springframework.data.neo4j.annotation.NodeEntity; + +/** + * @author Kaveri + * + */ + +@RoleComponent +public class SubmitCapacityBidToMarketRole extends AbstractEnergyProducerRole implements + Role { + + Logger logger = Logger.getLogger(SubmitCapacityBidToMarketRole.class); + + @Autowired + Reps reps; + + @Override + @Transactional + public void act(EnergyProducer producer) { + // logger.warn("***********Submitting Bid Role for Energy Producer ********" + // + producer.getName()); + + for (PowerPlant plant : reps.powerPlantRepository.findOperationalPowerPlantsByOwner(producer, getCurrentTick())) { + + // logger.warn("Bid calculation for PowerPlant " + plant.getName()); + // get market for the plant by zone + CapacityMarket market = reps.capacityMarketRepository.findCapacityMarketForZone(plant.getLocation() + .getZone()); + if (market != null) { + // logger.warn("CapacityMarket is " + market.getName()); + + ElectricitySpotMarket eMarket = reps.marketRepository.findElectricitySpotMarketForZone(plant + .getLocation().getZone()); + + // compute bid price as (fixedOMCost - elecricityMarketRevenue), + // if + // the difference is positive. Else if negative, bid at zero. + double bidPrice = 0d; + + // get FixedOMCost + double fixedOnMCost = plant.getTechnology().getFixedOperatingCost(getCurrentTick()); + // logger.warn("FIxed OM cost is " + fixedOnMCost); + + // logger.warn("fixed operation and maintenance cost is " + + // fixedOnMCost); + + double expectedElectricityPrice = 0; + double electricityMarketRevenue = 0d; + long numberOfSegments = reps.segmentRepository.count(); + double mc = 0d; + if (getCurrentTick() == 0) { + mc = 0; + electricityMarketRevenue = 0d; + + } else { + + // ********** to check if plant was in the merit order or + // not in the previous tick, hence tickTemp****** + long tickTemp = (getCurrentTick() - 1); + // logger.warn("current tick - 1 is " + tickTemp); + + PowerPlantDispatchPlan ppdpTest = reps.powerPlantDispatchPlanRepository + .findOnePowerPlantDispatchPlanForPeakSegmentGivenPowerPlantAndTime(plant, tickTemp, false); + + if (ppdpTest == null) { + + } else { + // compute revenue from the energy market, using + // previous + // tick's + // electricity spot market prices + double capacityAccepted = 0d; + mc = calculateMarginalCostExclCO2MarketCost(plant, getCurrentTick()); + + double sumEMR = 0d; + + for (SegmentLoad segmentLoad : eMarket.getLoadDurationCurve()) { + + PowerPlantDispatchPlan ppdp = reps.powerPlantDispatchPlanRepository + .findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(plant, + segmentLoad.getSegment(), tickTemp, false); + + if (ppdp.getStatus() < 0) { + electricityMarketRevenue = 0d; + } else if (ppdp.getStatus() >= 2) { + capacityAccepted = ppdp.getAcceptedAmount(); + + expectedElectricityPrice = reps.segmentClearingPointRepository + .findOneSegmentClearingPointForMarketSegmentAndTime(getCurrentTick() - 1, + segmentLoad.getSegment(), eMarket).getPrice(); + + double hours = segmentLoad.getSegment().getLengthInHours(); + // logger.warn("Number of hours per segment is"logger.warn("EL Market revenue is " + // + electricityMarketRevenue); + // + + // hours); + // because you're only trying to compute + // marginal cost of capacity, you subtract the + // marg. cost of energy from the revenue + if (mc <= expectedElectricityPrice) { + sumEMR = sumEMR + (expectedElectricityPrice - mc) * hours + * ppdp.getAcceptedAmount(); + // logger.warn("EL Market revenue for this segment is " + // + sumEMR); + } + + } + + } + + electricityMarketRevenue = sumEMR; + } + } + + double electricityMarketRevenuePerMW = electricityMarketRevenue + / plant.getAvailableCapacity(getCurrentTick()); + // logger.warn("FINAL EL Market revenue is " + + // electricityMarketRevenue); + // logger.warn("EL Market revenue per MW is " + + // electricityMarketRevenuePerMW); + + double mcCapacity = fixedOnMCost - electricityMarketRevenuePerMW; + // logger.warn("Fixed Cost - ESM Rev = " + mcCapacity); + + if (mcCapacity < 0) { + bidPrice = 0d; + // } else if (mcCapacity <= fixedOnMCost) { + } else { + bidPrice = mcCapacity; + } + + Segment peakSegment = reps.segmentRepository.findPeakSegmentforMarket(eMarket); + double capacity = plant.getAvailableCapacity(getCurrentTick(), peakSegment, numberOfSegments); + + CapacityDispatchPlan plan = new CapacityDispatchPlan().persist(); + plan.specifyAndPersist(plant, producer, market, getCurrentTick(), bidPrice, capacity, Bid.SUBMITTED); + + // logger.warn("CDP for powerplant " + + // plan.getPlant().getName()); + // logger.warn("CDP price is " + plan.getPrice()); + // logger.warn("CDP amount is " + plan.getAmount()); + + } + } + + } +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/package-info.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/package-info.java new file mode 100644 index 00000000..d2fa577d --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymarket/package-info.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +/** + * @author Kaveri + * + */ +package emlab.gen.role.capacitymarket; \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/capacitymechanisms/StrategicReserveOperatorRole.java b/emlab-generation/src/main/java/emlab/gen/role/capacitymechanisms/StrategicReserveOperatorRole.java index ffa2b9b3..bee04201 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/capacitymechanisms/StrategicReserveOperatorRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/capacitymechanisms/StrategicReserveOperatorRole.java @@ -22,10 +22,11 @@ /** * * @author pbhagwat - * + * */ @RoleComponent -public class StrategicReserveOperatorRole extends AbstractRole implements Role{ +public class StrategicReserveOperatorRole extends AbstractRole implements + Role { @Autowired Reps reps; @@ -45,198 +46,243 @@ public class StrategicReserveOperatorRole extends AbstractRole sortedListofBidPairs = bidRepository.findOffersDescendingForMarketForTime(currentMarket, getCurrentTick()); + // Iterable sortedListofBidPairs = + // bidRepository.findOffersDescendingForMarketForTime(currentMarket, + // getCurrentTick()); - //finds List of all segments - //List segments = Utils.asList(reps.segmentRepository.findAll()); - //for(Segment currentSegment: reps.segmentRepository.findAll()){ - //segmentCounter += 1; - //} + // finds List of all segments + // List segments = + // Utils.asList(reps.segmentRepository.findAll()); + // for(Segment currentSegment: reps.segmentRepository.findAll()){ + // segmentCounter += 1; + // } // Count all segments in the given market segmentCounter = reps.segmentRepository.count(); // find all segments for the given market - for(Segment currentSegment: reps.segmentRepository.findAll()){ - //logger.warn("Current segment is" + currentSegment); - //find query for specific market - + for (Segment currentSegment : reps.segmentRepository.findAll()) { + // logger.warn("Current segment is" + currentSegment); + // find query for specific market boolean isORMarketCleared = false; - double sumofContractedBids=0; + double sumofContractedBids = 0; double volumetobeContracted = strategicReserveOperator.getReserveVolume(); - //logger.warn("volumetobeContracted " + volumetobeContracted); + // logger.warn("volumetobeContracted " + volumetobeContracted); double clearingEpsilon = 0.001; double dispatchPrice = strategicReserveOperator.getReservePriceSR(); - //logger.warn("dispatchPrice " + dispatchPrice); - //double reserveMargin = peakCapacityforMarket-peakLoadforMarket; + // logger.warn("dispatchPrice " + dispatchPrice); + // double reserveMargin = peakCapacityforMarket-peakLoadforMarket; Iterable sortedListofPPDP = plantDispatchPlanRepository .findDescendingSortedPowerPlantDispatchPlansForSegmentForTime(currentSegment, getCurrentTick(), false); - for (PowerPlantDispatchPlan currentPPDP: sortedListofPPDP){ + for (PowerPlantDispatchPlan currentPPDP : sortedListofPPDP) { - //logger.warn("Bidding Market " + currentPPDP.getBiddingMarket().getNodeId().intValue()); - //logger.warn("Bidding Volume" + (currentPPDP.getAmount())); - //logger.warn("current Market" + market.getNodeId().intValue()); + // logger.warn("Bidding Market " + + // currentPPDP.getBiddingMarket().getNodeId().intValue()); + // logger.warn("Bidding Volume" + (currentPPDP.getAmount())); + // logger.warn("current Market" + + // market.getNodeId().intValue()); // **use querying for market** - if (currentPPDP.getBiddingMarket().getNodeId().intValue() == market.getNodeId().intValue()){ - //logger.warn("isOR market cleared" + isORMarketCleared); - - // Check the size of margin - - /* if (strategicReserveOperator.getReserveVolume()>reserveMargin){ - if (reserveMargin-currentPPDP.getAmount()>strategicReserveOperator.getReserveVolume()){ - currentPPDP.setSRstatus(PowerPlantDispatchPlan.NOT_CONTRACTED); - reserveMargin -= currentPPDP.getAmount(); - } - - }*/ - - if (volumetobeContracted==0){ - isORMarketCleared=true; - } - else if (isORMarketCleared == false){ - //logger.warn("volume of current PPDP " + currentPPDP.getAmount()); - if (volumetobeContracted-(sumofContractedBids + currentPPDP.getAmount()) >= clearingEpsilon){ - - // check if already not contracted - //if(currentPPDP.getSRstatus()!=PowerPlantDispatchPlan.NOT_CONTRACTED){ - //logger.warn("RemainingVolume" + (volumetobeContracted-(sumofContractedBids + currentPPDP.getAmount()))); - currentPPDP.setSRstatus(PowerPlantDispatchPlan.CONTRACTED); - //logger.warn("SRSTATUS " +currentPPDP.getSRstatus()); - sumofContractedBids += currentPPDP.getAmount(); - currentPPDP.setOldPrice(currentPPDP.getPrice()); - //logger.warn("Old Price" + currentPPDP.getOldPrice()); - currentPPDP.setPrice(dispatchPrice); - - //logger.warn("New Price" + currentPPDP.getPrice()); - // Pays O&M costs to the generated for the contracted capacity - - double Loan = 0; - if ((currentPPDP.getPowerPlant().getLoan().getTotalNumberOfPayments() - currentPPDP - .getPowerPlant().getLoan().getNumberOfPaymentsDone()) > 0d) { - Loan = (currentPPDP.getPowerPlant().getLoan().getAmountPerPayment()); + if (currentPPDP.getBiddingMarket().getNodeId().intValue() == market.getNodeId().intValue()) { + + if (currentPPDP.getPowerPlant().getAgeFraction() < 1.2) { + // logger.warn("isOR market cleared" + + // isORMarketCleared); + + // Check the size of margin + + /* + * if (strategicReserveOperator.getReserveVolume()> + * reserveMargin ){ if + * (reserveMargin-currentPPDP.getAmount()> + * strategicReserveOperator.getReserveVolume()){ + * currentPPDP. + * setSRstatus(PowerPlantDispatchPlan.NOT_CONTRACTED); + * reserveMargin -= currentPPDP.getAmount(); } + * + * } + */ + + if (volumetobeContracted == 0) { + isORMarketCleared = true; + } else if (isORMarketCleared == false) { + // logger.warn("volume of current PPDP " + + // currentPPDP.getAmount()); + if (volumetobeContracted - (sumofContractedBids + currentPPDP.getAmount()) >= clearingEpsilon) { + + // check if already not contracted + // if(currentPPDP.getSRstatus()!=PowerPlantDispatchPlan.NOT_CONTRACTED){ + // logger.warn("RemainingVolume" + + // (volumetobeContracted-(sumofContractedBids + + // currentPPDP.getAmount()))); + currentPPDP.setSRstatus(PowerPlantDispatchPlan.CONTRACTED); + // logger.warn("SRSTATUS " + // +currentPPDP.getSRstatus()); + sumofContractedBids += currentPPDP.getAmount(); + currentPPDP.setOldPrice(currentPPDP.getPrice()); + // logger.warn("Old Price" + + // currentPPDP.getOldPrice()); + currentPPDP.setPrice(dispatchPrice); + + // logger.warn("New Price" + + // currentPPDP.getPrice()); + // Pays O&M costs to the generated for the + // contracted capacity + + double Loan = 0; + if ((currentPPDP.getPowerPlant().getLoan().getTotalNumberOfPayments() - currentPPDP + .getPowerPlant().getLoan().getNumberOfPaymentsDone()) > 0d) { + Loan = (currentPPDP.getPowerPlant().getLoan().getAmountPerPayment()); + } + + double money = ((currentPPDP.getPowerPlant().getActualFixedOperatingCost()) + Loan) + / segmentCounter; + // logger.warn("Annual FOC "+ + // currentPPDP.getPowerPlant().getTechnology().getFixedOperatingCost()); + // logger.warn("No of Segments " + // +segmentCounter); + // logger.warn("Money Paid " +money); + + // logger.warn("SRO "+ + // strategicReserveOperator.getName() + // +" CASH Before" + // +strategicReserveOperator.getCash()); + // logger.warn("Owner " + + // currentPPDP.getBidder().getName() + + // "money Before" + // +currentPPDP.getBidder().getCash()); + + reps.nonTransactionalCreateRepository.createCashFlow(strategicReserveOperator, + currentPPDP.getBidder(), money, CashFlow.STRRESPAYMENT, getCurrentTick(), + currentPPDP.getPowerPlant()); + + // logger.warn("SRO's CASH After" + // +strategicReserveOperator.getCash()); + // logger.warn("Owner " + + // currentPPDP.getBidder().getName() + + // " money After" + // +currentPPDP.getBidder().getCash()); + // } } - double money = ((currentPPDP.getPowerPlant().getActualFixedOperatingCost()) + Loan) - / segmentCounter; - //logger.warn("Annual FOC "+ currentPPDP.getPowerPlant().getTechnology().getFixedOperatingCost()); - //logger.warn("No of Segments " +segmentCounter); - //logger.warn("Money Paid " +money); - - //logger.warn("SRO "+ strategicReserveOperator.getName() +" CASH Before" +strategicReserveOperator.getCash()); - //logger.warn("Owner " + currentPPDP.getBidder().getName() + "money Before" +currentPPDP.getBidder().getCash()); - + else if (volumetobeContracted - (sumofContractedBids + currentPPDP.getAmount()) < clearingEpsilon) { + + // if(currentPPDP.getSRstatus()!=PowerPlantDispatchPlan.NOT_CONTRACTED){ + + currentPPDP.setSRstatus(PowerPlantDispatchPlan.PARTLY_CONTRACTED); + // logger.warn("SRSTATUS " + // +currentPPDP.getSRstatus()); + sumofContractedBids += currentPPDP.getAmount(); + currentPPDP.setOldPrice(currentPPDP.getPrice()); + // logger.warn("Old Price" + + // currentPPDP.getOldPrice()); + currentPPDP.setPrice(dispatchPrice); + + // logger.warn("New Price" + + // currentPPDP.getPrice()); + isORMarketCleared = true; + // Pays O&M costs and outstanding loans to the + // generated for the contracted capacity + double Loan = 0; + if ((currentPPDP.getPowerPlant().getLoan().getTotalNumberOfPayments() - currentPPDP + .getPowerPlant().getLoan().getNumberOfPaymentsDone()) > 0d) { + Loan = (currentPPDP.getPowerPlant().getLoan().getAmountPerPayment()); + } + + double money = ((currentPPDP.getPowerPlant().getActualFixedOperatingCost()) + Loan) + / segmentCounter; + // logger.warn("Annual FOC "+ + // currentPPDP.getPowerPlant().getTechnology().getFixedOperatingCost()); + // logger.warn("No of Segments " + // +segmentCounter); + // logger.warn("Money Paid " +money); + + // logger.warn("SRO "+ + // strategicReserveOperator.getName() + // +" CASH Before" + // +strategicReserveOperator.getCash()); + // logger.warn("Owner " + + // currentPPDP.getBidder().getName() + + // "money Before" + // +currentPPDP.getBidder().getCash()); + + reps.nonTransactionalCreateRepository.createCashFlow(strategicReserveOperator, + currentPPDP.getBidder(), money, CashFlow.STRRESPAYMENT, getCurrentTick(), + currentPPDP.getPowerPlant()); + + // logger.warn("SRO's CASH After" + // +strategicReserveOperator.getCash()); + // logger.warn("Owner " + + // currentPPDP.getBidder().getName() + + // " money After" + // +currentPPDP.getBidder().getCash()); + // } + } - reps.nonTransactionalCreateRepository.createCashFlow(strategicReserveOperator, currentPPDP.getBidder(), money, CashFlow.STRRESPAYMENT, getCurrentTick(), currentPPDP.getPowerPlant()); + } else { + currentPPDP.setSRstatus(PowerPlantDispatchPlan.NOT_CONTRACTED); - //logger.warn("SRO's CASH After" +strategicReserveOperator.getCash()); - //logger.warn("Owner " + currentPPDP.getBidder().getName() + " money After" +currentPPDP.getBidder().getCash()); - // } } - - else if (volumetobeContracted-(sumofContractedBids + currentPPDP.getAmount()) < clearingEpsilon){ - - // if(currentPPDP.getSRstatus()!=PowerPlantDispatchPlan.NOT_CONTRACTED){ - - currentPPDP.setSRstatus(PowerPlantDispatchPlan.PARTLY_CONTRACTED); - //logger.warn("SRSTATUS " +currentPPDP.getSRstatus()); - sumofContractedBids += currentPPDP.getAmount(); - currentPPDP.setOldPrice(currentPPDP.getPrice()); - //logger.warn("Old Price" + currentPPDP.getOldPrice()); - currentPPDP.setPrice(dispatchPrice); - - //logger.warn("New Price" + currentPPDP.getPrice()); + // logger.warn(volumetobeContracted-sumofContractedBids); + if (volumetobeContracted - sumofContractedBids < clearingEpsilon) { + // logger.warn("is market clear" + + // isORMarketCleared); isORMarketCleared = true; - // Pays O&M costs and outstanding loans to the - // generated for the contracted capacity - double Loan = 0; - if ((currentPPDP.getPowerPlant().getLoan().getTotalNumberOfPayments() - currentPPDP - .getPowerPlant().getLoan().getNumberOfPaymentsDone()) > 0d) { - Loan = (currentPPDP.getPowerPlant().getLoan().getAmountPerPayment()); - } - - - double money = ((currentPPDP.getPowerPlant().getActualFixedOperatingCost()) + Loan) - / segmentCounter; - //logger.warn("Annual FOC "+ currentPPDP.getPowerPlant().getTechnology().getFixedOperatingCost()); - //logger.warn("No of Segments " +segmentCounter); - //logger.warn("Money Paid " +money); - - //logger.warn("SRO "+ strategicReserveOperator.getName() +" CASH Before" +strategicReserveOperator.getCash()); - //logger.warn("Owner " + currentPPDP.getBidder().getName() + "money Before" +currentPPDP.getBidder().getCash()); - - reps.nonTransactionalCreateRepository.createCashFlow(strategicReserveOperator, currentPPDP.getBidder(), money, CashFlow.STRRESPAYMENT, getCurrentTick(), currentPPDP.getPowerPlant()); - - //logger.warn("SRO's CASH After" +strategicReserveOperator.getCash()); - //logger.warn("Owner " + currentPPDP.getBidder().getName() + " money After" +currentPPDP.getBidder().getCash()); - //} } - - } - else { - currentPPDP.setSRstatus(PowerPlantDispatchPlan.NOT_CONTRACTED); - - } - //logger.warn(volumetobeContracted-sumofContractedBids); - if (volumetobeContracted-sumofContractedBids < clearingEpsilon){ - //logger.warn("is market clear" + isORMarketCleared); - isORMarketCleared = true; + // logger.warn(" iS OR CLEARED "+isORMarketCleared); + // logger.warn("Price is "+currentPPDP.getPrice()); + currentPPDP.persist(); } - //logger.warn(" iS OR CLEARED "+isORMarketCleared); - //logger.warn("Price is "+currentPPDP.getPrice()); - currentPPDP.persist(); } } } - //logger.warn("cash of SR " +strategicReserveOperator.getCash()); + // logger.warn("cash of SR " +strategicReserveOperator.getCash()); } } \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/co2policy/MarketStabilityReserveRole.java b/emlab-generation/src/main/java/emlab/gen/role/co2policy/MarketStabilityReserveRole.java index 6d3bca33..91127e4a 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/co2policy/MarketStabilityReserveRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/co2policy/MarketStabilityReserveRole.java @@ -46,7 +46,9 @@ public class MarketStabilityReserveRole extends AbstractRole { @Transactional public void act(Government government) { - double allowancesInCirculation = reps.decarbonizationAgentRepository.determinePreviouslyBankedCO2Certificates(); + double allowancesInCirculation = government.isStabilityReserveHasOneYearDelayInsteadOfTwoYearDelay() ? reps.decarbonizationAgentRepository + .determineTotallyBankedCO2Certificates() : reps.decarbonizationAgentRepository + .determinePreviouslyBankedCO2Certificates(); double inflowToMarketReserve = calculateInflowToMarketReserveForTimeStep(getCurrentTick(), allowancesInCirculation, government); government.setStabilityReserve(government.getStabilityReserve() + inflowToMarketReserve); @@ -66,7 +68,7 @@ public double calculateInflowToMarketReserveForTimeStep(long clearingTick, doubl return allowancesToBeAddedToReserve; } else if (allowancesInCirculation < government.getStabilityReserveLowerTriggerTrend().getValue(clearingTick)) { double allowancesToBeReleased = Math.min(government.getStabilityReserve(), - government + government .getStabilityReserveReleaseQuantityTrend().getValue(clearingTick)); return -allowancesToBeReleased; } diff --git a/emlab-generation/src/main/java/emlab/gen/role/co2policy/RenewableAdaptiveCO2CapRole.java b/emlab-generation/src/main/java/emlab/gen/role/co2policy/RenewableAdaptiveCO2CapRole.java index 7d974950..1a6b59c4 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/co2policy/RenewableAdaptiveCO2CapRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/co2policy/RenewableAdaptiveCO2CapRole.java @@ -27,7 +27,9 @@ import emlab.gen.domain.market.CO2Auction; import emlab.gen.domain.market.ClearingPoint; import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.Segment; import emlab.gen.domain.policy.PowerGeneratingTechnologyTarget; +import emlab.gen.domain.technology.PowerPlant; import emlab.gen.repository.Reps; import emlab.gen.repository.StrategicReserveOperatorRepository; import emlab.gen.trend.TimeSeriesImpl; @@ -75,57 +77,61 @@ public void act(Government government) { } } - double averageEmissionsPerMWh = government.isAdaptiveCapAdjustmentBasedOnCapNotActualEmissions() ? (government - .getCo2CapTrend().getValue(getCurrentTick()) / totalProduction) : (co2Emissions / totalProduction); + double absoluteBase = government.isAdaptiveCapAdjustmentBasedOnCapNotActualEmissions() ? government + .getCo2CapTrend().getValue(getCurrentTick()) : co2Emissions; - double plannedProductionByRenewables = 0; - double totalPlannedCapacity = 0; - - double totalProducedRenewableElectricity = 0; - - double totalActualInstalledCapacity = 0; - for (TargetInvestor targetInvestor : template.findAll(TargetInvestor.class)) { - for (PowerGeneratingTechnologyTarget target : targetInvestor.getPowerGenerationTechnologyTargets()) { - double producedRenewableElectricityByTechnologyByTargetInvestor = reps.powerPlantDispatchPlanRepository - .calculateTotalProductionForEnergyProducerForTimeForTechnology(targetInvestor, - getCurrentTick() - 1, target.getPowerGeneratingTechnology(), false); - totalProducedRenewableElectricity += producedRenewableElectricityByTechnologyByTargetInvestor; - double installedCapacityByTechnology = reps.powerPlantRepository - .calculateCapacityOfExpectedOperationalPowerPlantsByOwnerByTechnology(getCurrentTick() - 1, - targetInvestor, target.getPowerGeneratingTechnology()); - totalActualInstalledCapacity += installedCapacityByTechnology; - double plannedCapacityByTechnologyAndTargetInvestor = target.getTrend().getValue(getCurrentTick() - 1); - totalPlannedCapacity += plannedCapacityByTechnologyAndTargetInvestor; - double plannedProducedRenewableElectricityByTechnologyAndTargetInvestor = plannedCapacityByTechnologyAndTargetInvestor - / installedCapacityByTechnology * producedRenewableElectricityByTechnologyByTargetInvestor; - logger.warn("plannedProducedRenewable " + target.getPowerGeneratingTechnology().getName() + ": " - + plannedProducedRenewableElectricityByTechnologyAndTargetInvestor + " = " - + plannedCapacityByTechnologyAndTargetInvestor - +"/" + installedCapacityByTechnology +"*" + producedRenewableElectricityByTechnologyByTargetInvestor); - plannedProductionByRenewables += Double - .isNaN(plannedProducedRenewableElectricityByTechnologyAndTargetInvestor) ? 0 - : plannedProducedRenewableElectricityByTechnologyAndTargetInvestor; - } - } + double plannedProductionByRenewables = 0; + double totalPlannedCapacity = 0; - double plannedSavedEmissionsApproximation = plannedProductionByRenewables * averageEmissionsPerMWh; - double actualSavedEmissionsApproximation = totalProducedRenewableElectricity * averageEmissionsPerMWh; + double totalProducedRenewableElectricity = 0; - double capReduction = calculateCapReductionForTimeStep(government, plannedSavedEmissionsApproximation, - actualSavedEmissionsApproximation); - government.getCo2CapTrend().setValue(getCurrentTick(), - government.getCo2CapTrend().getValue(getCurrentTick()) - capReduction); - TimeSeriesImpl co2CapAdjustmentTimeSeries = government.getCo2CapAdjustmentTimeSeries(); - if (co2CapAdjustmentTimeSeries == null) { - co2CapAdjustmentTimeSeries = new TimeSeriesImpl(); - co2CapAdjustmentTimeSeries.setTimeSeries(new double[government.getCo2CapTrend().getTimeSeries().length]); - co2CapAdjustmentTimeSeries.persist(); - government.setCo2CapAdjustmentTimeSeries(co2CapAdjustmentTimeSeries); - } - co2CapAdjustmentTimeSeries.setValue(getCurrentTick(), capReduction); - - // logger.warn("TimeSeries after: {}", - // government.getCo2CapTrend().getTimeSeries()); + double totalActualInstalledCapacity = 0; + for (TargetInvestor targetInvestor : template.findAll(TargetInvestor.class)) { + for (PowerGeneratingTechnologyTarget target : targetInvestor.getPowerGenerationTechnologyTargets()) { + double producedRenewableElectricityByTechnologyByTargetInvestor = reps.powerPlantDispatchPlanRepository + .calculateTotalProductionForEnergyProducerForTimeForTechnology(targetInvestor, + getCurrentTick() - 1, target.getPowerGeneratingTechnology(), false); + totalProducedRenewableElectricity += producedRenewableElectricityByTechnologyByTargetInvestor; + double installedCapacityByTechnology = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsByOwnerByTechnology(getCurrentTick() - 1, + targetInvestor, target.getPowerGeneratingTechnology()); + totalActualInstalledCapacity += installedCapacityByTechnology; + double plannedCapacityByTechnologyAndTargetInvestor = target.getTrend().getValue(getCurrentTick() - 1); + totalPlannedCapacity += plannedCapacityByTechnologyAndTargetInvestor; + double plannedProducedRenewableElectricityByTechnologyAndTargetInvestor = plannedCapacityByTechnologyAndTargetInvestor + / installedCapacityByTechnology * producedRenewableElectricityByTechnologyByTargetInvestor; + // logger.warn("plannedProducedRenewable " + + // target.getPowerGeneratingTechnology().getName() + ": " + // + + // plannedProducedRenewableElectricityByTechnologyAndTargetInvestor + // + " = " + // + plannedCapacityByTechnologyAndTargetInvestor + // +"/" + installedCapacityByTechnology +"*" + + // producedRenewableElectricityByTechnologyByTargetInvestor); + plannedProductionByRenewables += Double + .isNaN(plannedProducedRenewableElectricityByTechnologyAndTargetInvestor) ? 0 + : plannedProducedRenewableElectricityByTechnologyAndTargetInvestor; + } + } + + double capReduction = government.isAdaptiveCapAdjustmentRelativeToNonSubsidisedProduction() ? calculateCapReductionForTimeStepRelativeToNonSubsidizedGeneration( + government, plannedProductionByRenewables, totalProducedRenewableElectricity, totalProduction, + absoluteBase) + : calculateCapReductionForTimeStepRelativeToTotalGeneration(government, + plannedProductionByRenewables, totalProducedRenewableElectricity, totalProduction, absoluteBase); + government.getCo2CapTrend().setValue(getCurrentTick(), + government.getCo2CapTrend().getValue(getCurrentTick()) - capReduction); + TimeSeriesImpl co2CapAdjustmentTimeSeries = government.getCo2CapAdjustmentTimeSeries(); + if (co2CapAdjustmentTimeSeries == null) { + co2CapAdjustmentTimeSeries = new TimeSeriesImpl(); + co2CapAdjustmentTimeSeries.setTimeSeries(new double[government.getCo2CapTrend().getTimeSeries().length]); + co2CapAdjustmentTimeSeries.persist(); + government.setCo2CapAdjustmentTimeSeries(co2CapAdjustmentTimeSeries); + } + co2CapAdjustmentTimeSeries.setValue(getCurrentTick(), capReduction); + + // logger.warn("TimeSeries after: {}", + // government.getCo2CapTrend().getTimeSeries()); } public double calculatedExpectedCapReductionForTimeStep(Government government, long currentTimeStep, @@ -150,8 +156,7 @@ public double calculatedExpectedCapReductionForTimeStep(Government government, l } } - double averageEmissionsPerMWh = government.isAdaptiveCapAdjustmentBasedOnCapNotActualEmissions() ? (government - .getCo2CapTrend().getValue(futureTimeStep - 1) / totalProduction) : (co2Emissions / totalProduction); + double absoluteBase = government.isAdaptiveCapAdjustmentBasedOnCapNotActualEmissions() ? government.getCo2CapTrend().getValue(futureTimeStep - 1) : co2Emissions; double plannedProductionByRenewables = 0; double totalPlannedCapacity = 0; @@ -179,26 +184,34 @@ public double calculatedExpectedCapReductionForTimeStep(Government government, l totalPlannedCapacity += plannedCapacityByTechnologyAndTargetInvestor; double plannedProducedRenewableElectricityByTechnologyAndTargetInvestor = plannedCapacityByTechnologyAndTargetInvestor / installedCapacityByTechnology * producedRenewableElectricityByTechnologyByTargetInvestor; - logger.warn("plannedProducedRenewable " + target.getPowerGeneratingTechnology().getName() + ": " - + plannedProducedRenewableElectricityByTechnologyAndTargetInvestor + " = " - + plannedCapacityByTechnologyAndTargetInvestor + "/" + installedCapacityByTechnology + "*" - + producedRenewableElectricityByTechnologyByTargetInvestor); + // logger.warn("plannedProducedRenewable " + + // target.getPowerGeneratingTechnology().getName() + ": " + // + + // plannedProducedRenewableElectricityByTechnologyAndTargetInvestor + // + " = " + // + plannedCapacityByTechnologyAndTargetInvestor + "/" + + // installedCapacityByTechnology + "*" + // + producedRenewableElectricityByTechnologyByTargetInvestor); plannedProductionByRenewables += Double .isNaN(plannedProducedRenewableElectricityByTechnologyAndTargetInvestor) ? 0 : plannedProducedRenewableElectricityByTechnologyAndTargetInvestor; } } - double plannedSavedEmissionsApproximation = plannedProductionByRenewables * averageEmissionsPerMWh; - double actualSavedEmissionsApproximation = totalProducedRenewableElectricity * averageEmissionsPerMWh; - double capReduction = calculateCapReductionForTimeStep(government, plannedSavedEmissionsApproximation, - actualSavedEmissionsApproximation); - return capReduction; + double capReduction = government.isAdaptiveCapAdjustmentRelativeToNonSubsidisedProduction() ? calculateCapReductionForTimeStepRelativeToNonSubsidizedGeneration( + government, plannedProductionByRenewables, totalProducedRenewableElectricity, totalProduction,absoluteBase) + : calculateCapReductionForTimeStepRelativeToTotalGeneration(government, + plannedProductionByRenewables, totalProducedRenewableElectricity, totalProduction, absoluteBase); + return capReduction; } - double calculateCapReductionForTimeStep(Government government, - double plannedSavedEmissionsApproximation, double actualSavedEmissionsApproximation) { + double calculateCapReductionForTimeStepRelativeToTotalGeneration(Government government, + double plannedProductionByRenewables, double totalProducedRenewableElectricity, double totalProduction, + double absoluteBase) { + double averageEmissionsPerMWh = (absoluteBase / totalProduction); + double plannedSavedEmissionsApproximation = plannedProductionByRenewables * averageEmissionsPerMWh; + double actualSavedEmissionsApproximation = totalProducedRenewableElectricity * averageEmissionsPerMWh; double capReduction = 0; @@ -208,12 +221,28 @@ public double calculatedExpectedCapReductionForTimeStep(Government government, l capReduction = Math.max(0, actualSavedEmissionsApproximation - plannedSavedEmissionsApproximation) * government.getAdaptiveCapCO2SavingsWeighingFactor(); } - logger.warn("plannedSavedEmissionsApproximation: " + plannedSavedEmissionsApproximation - + ", actualSavedEmissionsApproximation: " + actualSavedEmissionsApproximation + ", Cap reduction: " - + capReduction); + // logger.warn("plannedSavedEmissionsApproximation: " + + // plannedSavedEmissionsApproximation + // + ", actualSavedEmissionsApproximation: " + + // actualSavedEmissionsApproximation + ", Cap reduction: " + // + capReduction); // logger.warn("TimeSeries after: {}", // government.getCo2CapTrend().getTimeSeries()); + return capReduction; + + } + double calculateCapReductionForTimeStepRelativeToNonSubsidizedGeneration(Government government, + double plannedProductionByRenewables, double totalProducedRenewableElectricity, double totalProduction, + double absoluteBase) { + double capReduction = Math.max(0, (totalProducedRenewableElectricity - plannedProductionByRenewables) + / (totalProduction - plannedProductionByRenewables)) + * absoluteBase; + // double alternativeCapReduction = + // calculateCapReductionForTimeStepRelativeToTotalGeneration(government, + // plannedProductionByRenewables, totalProducedRenewableElectricity, + // totalProduction,absoluteBase); + // logger.warn("CapReductionToNonSub: {}, instead of to toal: {}",capReduction,alternativeCapReduction); return capReduction; } diff --git a/emlab-generation/src/main/java/emlab/gen/role/investment/DismantlePowerPlantOperationalLossRole.java b/emlab-generation/src/main/java/emlab/gen/role/investment/DismantlePowerPlantOperationalLossRole.java index 051deff3..846ec776 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/investment/DismantlePowerPlantOperationalLossRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/investment/DismantlePowerPlantOperationalLossRole.java @@ -15,25 +15,39 @@ ******************************************************************************/ package emlab.gen.role.investment; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + +import org.apache.commons.math.stat.regression.SimpleRegression; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; -import agentspring.role.Role; +import agentspring.role.AbstractRole; import agentspring.role.RoleComponent; -import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.agent.CommoditySupplier; +import emlab.gen.domain.agent.Government; +import emlab.gen.domain.contract.CashFlow; +import emlab.gen.domain.contract.Loan; +import emlab.gen.domain.market.ClearingPoint; +import emlab.gen.domain.market.DecarbonizationMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.PowerPlantDispatchPlan; +import emlab.gen.domain.market.electricity.Segment; import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.domain.technology.Substance; +import emlab.gen.domain.technology.SubstanceShareInFuelMix; import emlab.gen.repository.Reps; -import emlab.gen.role.AbstractEnergyProducerRole; +import emlab.gen.util.MapValueComparator; /** - * {@link EnergyProducer}s dismantle {@link PowerPlant}s that are out of merit - * - * @author Emile Chappin @author - * Alfredas - * Chmieliauskas + * @author pradyumnabhagwat * */ + @RoleComponent -public class DismantlePowerPlantOperationalLossRole extends AbstractEnergyProducerRole implements Role { +public class DismantlePowerPlantOperationalLossRole extends AbstractRole { @Autowired Reps reps; @@ -42,23 +56,424 @@ public Reps getReps() { return reps; } - public void act(EnergyProducer producer) { + @Transactional + public void act(ElectricitySpotMarket market) { + if (getCurrentTick() > 0) { + + for (PowerPlant plant : reps.powerPlantRepository.findOperationalPowerPlantsInMarket(market, + getCurrentTick())) { + + double age = 0; + long currentLiftime = 0; + currentLiftime = getCurrentTick() - plant.getConstructionStartTime() + - plant.getTechnology().getExpectedLeadtime() - plant.getTechnology().getExpectedPermittime(); + + plant.setActualLifetime(currentLiftime); + + age = (double) plant.getActualLifetime() / (((double) plant.getTechnology().getExpectedLifetime())); + + plant.setAgeFraction((double) age); + + if (plant.getAgeFraction() > 1.00D) { + + double ModifiedOM = plant.getActualFixedOperatingCost() + * Math.pow((1 + (plant.getTechnology().getFixedOperatingCostModifierAfterLifetime())), + ((double) plant.getActualLifetime() - (((double) plant.getTechnology() + .getExpectedLifetime())))); + + plant.setActualFixedOperatingCost(ModifiedOM); + } + + long yearIterator = 1; + + double profitability = 0; + double totalInvestment = 0; + for (yearIterator = 1; yearIterator <= market.getLookback() && yearIterator > 0; yearIterator++) { + double profit = 0; + double plantMarginalCost = 0; + double cost = 0; + double revenue = 0; + double energyGenerated = 0; + double calculatedOM = 0; + if ((getCurrentTick() - yearIterator) >= 0) { + + for (Segment currentSegment : reps.segmentRepository.findAll()) { + + PowerPlantDispatchPlan ppdp = new PowerPlantDispatchPlan(); + ppdp = reps.powerPlantDispatchPlanRepository + .findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(plant, currentSegment, + getCurrentTick() - yearIterator, false); + + if (ppdp != null) { + + double segmentMC = 0; + double mc = 0; + double acceptedAmount = 0; + double energyInSegment = 0; + + acceptedAmount = ppdp.getAcceptedAmount(); + mc = calculateMarginalCostExclCO2MarketCost(plant, getCurrentTick()); + segmentMC = mc * acceptedAmount * currentSegment.getLengthInHours(); + energyInSegment = acceptedAmount * currentSegment.getLengthInHours(); + plantMarginalCost += segmentMC; + energyGenerated += energyInSegment; + } + + } + + for (CashFlow cf : reps.cashFlowRepository.findAllCashFlowsForPowerPlantForTime(plant, + (getCurrentTick() - yearIterator))) { + + if (cf.getType() == CashFlow.FIXEDOMCOST) { + calculatedOM = cf.getMoney(); + } + + if (cf.getType() == CashFlow.COMMODITY || cf.getType() == CashFlow.CO2TAX + || cf.getType() == CashFlow.CO2AUCTION) { + + cost = cost + cf.getMoney(); + } + + if (cf.getType() == CashFlow.ELECTRICITY_SPOT || cf.getType() == CashFlow.STRRESPAYMENT + || cf.getType() == CashFlow.SIMPLE_CAPACITY_MARKET) { + revenue = revenue + cf.getMoney(); + + } + + } + + double actualOM = (calculatedOM - (plant.getTechnology().getVariableOperatingCostinEURPerMWh() * 8760 * plant + .getTechnology().getCapacity())) + + (plant.getTechnology().getVariableOperatingCostinEURPerMWh() * energyGenerated); + + cost = cost + plantMarginalCost + actualOM; + profit = (revenue - cost); + + } + profitability += profit; + totalInvestment = plant.getTechnology().getInvestmentCost(plant.getConstructionStartTime()) + * plant.getActualNominalCapacity(); + } + + plant.setProfitability((profitability / totalInvestment)); + + // logger.warn("1 ROI " + plant.getProfitability()); + // logger.warn("prof " + plant.getProfitability() + " plant " + + // plant.getName()); + } + + for (PowerPlant plant : reps.powerPlantRepository.findOperationalPowerPlantsInMarket(market, + getCurrentTick())) { + + if (plant.getOwner().equals(reps.targetInvestorRepository.findInvestorByMarket(market))) { + + double prolongYearsOfDismantlng = plant.getTechnology().getMaximumLifeExtension() + + plant.getTechnology().getExpectedLifetime(); + + if (plant.getActualLifetime() > (prolongYearsOfDismantlng)) { + + plant.dismantlePowerPlant(getCurrentTick()); + } + } + } + + for (PowerPlant plant : reps.powerPlantRepository + .findOperationalPowerPlantsByAscendingProfitabilityAndMarket(market, getCurrentTick())) { + // logger.warn("profitability " + plant.getProfitability()); + if (plant.getProfitability() < 0) { + + Map marginalCostMap = new HashMap(); + Map meritOrder; + + for (PowerPlant plant1 : reps.powerPlantRepository.findExpectedOperationalPowerPlantsInMarket( + market, getCurrentTick())) { + marginalCostMap.put(plant1, calculateMarginalCostExclCO2MarketCost(plant1, getCurrentTick())); + + } + + MapValueComparator comp = new MapValueComparator(marginalCostMap); + meritOrder = new TreeMap(comp); + meritOrder.putAll(marginalCostMap); + + double mc = 0; + double OM = 0; + double sumProfit = 0; + double energy = 0; + + double totalProfit = 0; + double demandGrowthFactor = 0; + double assignment = 0; + + mc = calculateMarginalCostExclCO2MarketCost(plant, getCurrentTick()); + + OM = plant.getActualFixedOperatingCost(); + + if (getCurrentTick() == 1) { + demandGrowthFactor = (market.getDemandGrowthTrend().getValue(getCurrentTick())); + } + if (getCurrentTick() > 1) { + SimpleRegression sr = new SimpleRegression(); + for (long time = getCurrentTick() - 1; time >= getCurrentTick() + - market.getBacklookingForDemandForecastinginDismantling() + && time >= 0; time = time - 1) { + sr.addData(time, market.getDemandGrowthTrend().getValue(time)); + + } + + demandGrowthFactor = (market.getDemandGrowthTrend().getValue(getCurrentTick())); + } + + double range = 0; + + if (getCurrentTick() == 1) { + double max = reps.powerPlantRepository.calculateBaseCapacityOfOperationalPowerPlantsInMarket( + market, getCurrentTick()); + double min = reps.powerPlantRepository.calculatePeakCapacityOfOperationalPowerPlantsInMarket( + market, getCurrentTick()); + + range = ((max + min) / 2); + + } + + if (getCurrentTick() > 1) { + SimpleRegression sr = new SimpleRegression(); + for (long time = getCurrentTick() - 1; time >= getCurrentTick() + - market.getBacklookingForDemandForecastinginDismantling() + && time >= 0; time = time - 1) { + + double max = reps.powerPlantRepository + .calculateBaseCapacityOfOperationalPowerPlantsInMarket(market, time); + double min = reps.powerPlantRepository + .calculatePeakCapacityOfOperationalPowerPlantsInMarket(market, time); + + sr.addData(time, ((max + min) / 2)); + + } + + range = (sr.predict(getCurrentTick())); + } + + // * ((100 + r.nextGaussian() * 20) / 100); + + for (Segment currentSegment : reps.segmentRepository.findAll()) { + double segmentCapacity = 0; + double segmentLoad = demandGrowthFactor + * reps.segmentLoadRepository.returnSegmentBaseLoadBySegmentAndMarket(currentSegment, + market); + + if ((int) currentSegment.getSegmentID() != 1) { + + double segmentPortion = (int) currentSegment.getSegmentID(); + + segmentCapacity = reps.powerPlantRepository + .calculateBaseCapacityOfOperationalPowerPlantsInMarket(market, getCurrentTick()); + + // reps.powerPlantRepository + // .calculateBaseCapacityOfOperationalPowerPlantsInMarket(market, + // getCurrentTick()) + // - (range); + } + + else { + segmentCapacity = reps.powerPlantRepository + .calculateBaseCapacityOfOperationalPowerPlantsInMarket(market, getCurrentTick()); + + // reps.powerPlantRepository + // .calculateBaseCapacityOfOperationalPowerPlantsInMarket(market, + // getCurrentTick()) + // - (range); + } + // logger.warn("Capacity " + market.getName() + " DGF " + // + demandGrowthFactor); + + if (segmentLoad > (segmentCapacity)) { + double price = 0; + double profit1 = 0; + price = market.getValueOfLostLoad(); + + profit1 = currentSegment.getLengthInHours() + * plant.getAvailableCapacity(getCurrentTick(), currentSegment, + reps.segmentRepository.count()) * (price - mc); + + sumProfit += profit1; + energy += currentSegment.getLengthInHours() + * plant.getAvailableCapacity(getCurrentTick(), currentSegment, + reps.segmentRepository.count()); + } + + if (segmentLoad <= (segmentCapacity)) { + double price = 0; + double capacityCounter = 0; + + for (Entry plantCost : meritOrder.entrySet()) { + PowerPlant plant1 = plantCost.getKey(); + + if (capacityCounter < segmentLoad) { + capacityCounter += plant1.getAvailableCapacity(getCurrentTick(), currentSegment, + reps.segmentRepository.count()); + price = plantCost.getValue(); + } + + } + + if (price > mc) { + double profit1 = 0; + profit1 = currentSegment.getLengthInHours() + * plant.getAvailableCapacity(getCurrentTick(), currentSegment, + reps.segmentRepository.count()) * (price - mc); + + energy += currentSegment.getLengthInHours() + * plant.getAvailableCapacity(getCurrentTick(), currentSegment, + reps.segmentRepository.count()); + sumProfit += profit1; + } + } + } + + totalProfit = (sumProfit - ((OM - (plant.getTechnology().getVariableOperatingCostinEURPerMWh() * 8760 * plant + .getTechnology().getCapacity())) + (plant.getTechnology() + .getVariableOperatingCostinEURPerMWh() * energy))); + + // logger.warn("2 Range " + (range1*mc)); + + if ((totalProfit + plant.getProfitability()) < 0) { + + // REMAINING LOAN-----// + Loan loan = plant.getLoan(); + + if (loan != null) { + + logger.info("Found a loan: {}", loan); + if (loan.getNumberOfPaymentsDone() < loan.getTotalNumberOfPayments()) { + + double payment = loan.getAmountPerPayment() + * (loan.getTotalNumberOfPayments() - loan.getNumberOfPaymentsDone()); + + reps.nonTransactionalCreateRepository.createCashFlow(plant.getOwner(), loan.getTo(), + payment, CashFlow.LOAN, getCurrentTick(), loan.getRegardingPowerPlant()); + + loan.setNumberOfPaymentsDone(loan.getNumberOfPaymentsDone() + + (loan.getTotalNumberOfPayments() - loan.getNumberOfPaymentsDone())); + + logger.info("DISMANTLING: Paying {} (euro) for remaining loan {}", payment, loan); + } + } + Loan downpayment = plant.getDownpayment(); + if (downpayment != null) { + logger.info("Found downpayment"); + if (downpayment.getNumberOfPaymentsDone() < downpayment.getTotalNumberOfPayments()) { + + double payment = downpayment.getAmountPerPayment() + * (downpayment.getTotalNumberOfPayments() - downpayment + .getNumberOfPaymentsDone()); + reps.nonTransactionalCreateRepository.createCashFlow(plant.getOwner(), + downpayment.getTo(), payment, CashFlow.DOWNPAYMENT, getCurrentTick(), + downpayment.getRegardingPowerPlant()); + + downpayment.setNumberOfPaymentsDone(downpayment.getNumberOfPaymentsDone() + + (downpayment.getTotalNumberOfPayments() - downpayment + .getNumberOfPaymentsDone())); + + logger.info("DISMANTLING: Paying {} (euro) for remaining downpayment {}", payment, + downpayment); + } + } + // logger.warn("dismantled " + plant.getName()); + plant.dismantlePowerPlant(getCurrentTick()); + + } + } + } + } + } + + public double calculateMarginalCostExclCO2MarketCost(PowerPlant powerPlant, long clearingTick) { + double mc = 0d; + // fuel cost + mc += calculateMarginalFuelCost(powerPlant, clearingTick); + mc += calculateCO2TaxMarginalCost(powerPlant, clearingTick); + logger.info("Margincal cost excluding CO2 auction/market cost for plant {} is {}", powerPlant.getName(), mc); + return mc; + } - logger.info("Dismantling plants if out of merit"); + public double calculateMarginalFuelCost(PowerPlant powerPlant, long clearingTick) { + double fc = 0d; + // fuel cost for each fuel + for (SubstanceShareInFuelMix mix : powerPlant.getFuelMix()) { - // dis-mantle plants when passed technical lifetime. - for (PowerPlant plant : reps.powerPlantRepository.findOperationalPowerPlantsByOwner(producer, getCurrentTick())) { - long horizon = producer.getPastTimeHorizon(); + double amount = mix.getShare(); + logger.info("Calculating need for fuel: {} units of {}", mix.getShare(), mix.getSubstance().getName()); + double fuelPrice = findLastKnownPriceForSubstance(mix.getSubstance(), clearingTick); + fc += amount * fuelPrice; + logger.info("Calculating marginal cost and found a fuel price which is {} per unit of fuel", fuelPrice); + } + + return fc; + } - double requiredProfit = producer.getDismantlingRequiredOperatingProfit(); - if (calculateAveragePastOperatingProfit(plant, horizon) < requiredProfit) { - logger.info("Dismantling power plant because it has had an operating loss (incl O&M cost) on average in the last " - + horizon + " years: " + plant); + public double calculateCO2TaxMarginalCost(PowerPlant powerPlant, long tick) { + double co2Intensity = powerPlant.calculateEmissionIntensity(); + Government government = reps.genericRepository.findFirst(Government.class); + double co2Tax = government.getCO2Tax(tick); + return co2Intensity * co2Tax; + } - plant.dismantlePowerPlant(getCurrentTick()); + public double findLastKnownPriceForSubstance(Substance substance, long clearingTick) { + + DecarbonizationMarket market = reps.marketRepository.findFirstMarketBySubstance(substance); + if (market == null) { + logger.warn("No market found for {} so no price can be found", substance.getName()); + return 0d; + } else { + return findLastKnownPriceOnMarket(market, clearingTick); + } + } + public double findLastKnownPriceOnMarket(DecarbonizationMarket market, long clearingTick) { + Double average = calculateAverageMarketPriceBasedOnClearingPoints(reps.clearingPointRepositoryOld + .findClearingPointsForMarketAndTime(market, clearingTick, false)); + Substance substance = market.getSubstance(); + + if (average != null) { + logger.info("Average price found on market for this tick for {}", substance.getName()); + return average; + } + + average = calculateAverageMarketPriceBasedOnClearingPoints(reps.clearingPointRepositoryOld + .findClearingPointsForMarketAndTime(market, clearingTick - 1, false)); + if (average != null) { + logger.info("Average price found on market for previous tick for {}", substance.getName()); + return average; + } + + if (market.getReferencePrice() > 0) { + logger.info("Found a reference price found for market for {}", substance.getName()); + return market.getReferencePrice(); + } + + for (CommoditySupplier supplier : reps.genericRepository.findAll(CommoditySupplier.class)) { + if (supplier.getSubstance().equals(substance)) { + + return supplier.getPriceOfCommodity().getValue(clearingTick); } } + + logger.info("No price has been found for {}", substance.getName()); + return 0d; + } + + private Double calculateAverageMarketPriceBasedOnClearingPoints(Iterable clearingPoints) { + double priceTimesVolume = 0d; + double volume = 0d; + + for (ClearingPoint point : clearingPoints) { + priceTimesVolume += point.getPrice() * point.getVolume(); + volume += point.getVolume(); + } + if (volume > 0) { + return priceTimesVolume / volume; + } + return null; } -} +} \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/investment/InvestInPowerGenerationTechnologiesRole.java b/emlab-generation/src/main/java/emlab/gen/role/investment/InvestInPowerGenerationTechnologiesRole.java index d89d5aaf..9eafaec5 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/investment/InvestInPowerGenerationTechnologiesRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/investment/InvestInPowerGenerationTechnologiesRole.java @@ -33,15 +33,18 @@ import emlab.gen.domain.agent.BigBank; import emlab.gen.domain.agent.EnergyProducer; import emlab.gen.domain.agent.PowerPlantManufacturer; +import emlab.gen.domain.agent.Regulator; import emlab.gen.domain.agent.StrategicReserveOperator; import emlab.gen.domain.contract.CashFlow; import emlab.gen.domain.contract.Loan; import emlab.gen.domain.gis.Zone; import emlab.gen.domain.market.ClearingPoint; +import emlab.gen.domain.market.capacity.CapacityMarket; import emlab.gen.domain.market.electricity.ElectricitySpotMarket; import emlab.gen.domain.market.electricity.Segment; import emlab.gen.domain.market.electricity.SegmentLoad; import emlab.gen.domain.policy.PowerGeneratingTechnologyTarget; +import emlab.gen.domain.policy.renewablesupport.RenewableSupportScheme; import emlab.gen.domain.technology.PowerGeneratingTechnology; import emlab.gen.domain.technology.PowerGeneratingTechnologyNodeLimit; import emlab.gen.domain.technology.PowerGridNode; @@ -56,15 +59,15 @@ /** * {@link EnergyProducer}s decide to invest in new {@link PowerPlant} * - * @author Emile Chappin @author Alfredas Chmieliauskas + * @author Emile Chappin @author + * Alfredas + * Chmieliauskas * @author JCRichstein */ @Configurable @NodeEntity public class InvestInPowerGenerationTechnologiesRole extends GenericInvestmentRole -implements -Role, -NodeBacked { + implements Role, NodeBacked { @Transient @Autowired @@ -98,28 +101,32 @@ public void act(T agent) { // logger.warn(expectedCO2Price.toString()); - //Demand + // Demand Map expectedDemand = new HashMap(); - for(ElectricitySpotMarket elm : reps.template.findAll(ElectricitySpotMarket.class)){ + for (ElectricitySpotMarket elm : reps.template.findAll(ElectricitySpotMarket.class)) { GeometricTrendRegression gtr = new GeometricTrendRegression(); - for(long time = getCurrentTick(); time>getCurrentTick()-agent.getNumberOfYearsBacklookingForForecasting() && time>=0; time=time-1){ + for (long time = getCurrentTick(); time > getCurrentTick() + - agent.getNumberOfYearsBacklookingForForecasting() + && time >= 0; time = time - 1) { gtr.addData(time, elm.getDemandGrowthTrend().getValue(time)); } expectedDemand.put(elm, gtr.predict(futureTimePoint)); } - - // Investment decision // for (ElectricitySpotMarket market : // reps.genericRepository.findAllAtRandom(ElectricitySpotMarket.class)) // { ElectricitySpotMarket market = agent.getInvestorMarket(); - MarketInformation marketInformation = new MarketInformation(market, expectedDemand, expectedFuelPrices, expectedCO2Price.get(market) - .doubleValue(), futureTimePoint); + MarketInformation marketInformation = new MarketInformation(market, expectedDemand, expectedFuelPrices, + expectedCO2Price.get(market).doubleValue(), futureTimePoint); /* - * if (marketInfoMap.containsKey(market) && marketInfoMap.get(market).time == futureTimePoint) { marketInformation = marketInfoMap.get(market); } else { marketInformation = new - * MarketInformation(market, expectedFuelPrices, expectedCO2Price, futureTimePoint); marketInfoMap.put(market, marketInformation); } + * if (marketInfoMap.containsKey(market) && + * marketInfoMap.get(market).time == futureTimePoint) { + * marketInformation = marketInfoMap.get(market); } else { + * marketInformation = new MarketInformation(market, expectedFuelPrices, + * expectedCO2Price, futureTimePoint); marketInfoMap.put(market, + * marketInformation); } */ // logger.warn(agent + " is expecting a CO2 price of " + @@ -144,11 +151,14 @@ public void act(T agent) { // if too much capacity of this technology in the pipeline (not // limited to the 5 years) double expectedInstalledCapacityOfTechnology = reps.powerPlantRepository - .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, technology, futureTimePoint); - PowerGeneratingTechnologyTarget technologyTarget = reps.powerGenerationTechnologyTargetRepository.findOneByTechnologyAndMarket(technology, market); - if(technologyTarget!=null){ + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, technology, + futureTimePoint); + PowerGeneratingTechnologyTarget technologyTarget = reps.powerGenerationTechnologyTargetRepository + .findOneByTechnologyAndMarket(technology, market); + if (technologyTarget != null) { double technologyTargetCapacity = technologyTarget.getTrend().getValue(futureTimePoint); - expectedInstalledCapacityOfTechnology = (technologyTargetCapacity > expectedInstalledCapacityOfTechnology) ? technologyTargetCapacity : expectedInstalledCapacityOfTechnology; + expectedInstalledCapacityOfTechnology = (technologyTargetCapacity > expectedInstalledCapacityOfTechnology) ? technologyTargetCapacity + : expectedInstalledCapacityOfTechnology; } double pgtNodeLimit = Double.MAX_VALUE; PowerGeneratingTechnologyNodeLimit pgtLimit = reps.powerGeneratingTechnologyNodeLimitRepository @@ -162,18 +172,18 @@ public void act(T agent) { double expectedOwnedTotalCapacityInMarket = reps.powerPlantRepository .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner(market, futureTimePoint, agent); double expectedOwnedCapacityInMarketOfThisTechnology = reps.powerPlantRepository - .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(market, technology, futureTimePoint, - agent); - double capacityOfTechnologyInPipeline = reps.powerPlantRepository.calculateCapacityOfPowerPlantsByTechnologyInPipeline( - technology, getCurrentTick()); - double operationalCapacityOfTechnology = reps.powerPlantRepository.calculateCapacityOfOperationalPowerPlantsByTechnology( - technology, getCurrentTick()); + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(market, technology, + futureTimePoint, agent); + double capacityOfTechnologyInPipeline = reps.powerPlantRepository + .calculateCapacityOfPowerPlantsByTechnologyInPipeline(technology, getCurrentTick()); + double operationalCapacityOfTechnology = reps.powerPlantRepository + .calculateCapacityOfOperationalPowerPlantsByTechnology(technology, getCurrentTick()); double capacityInPipelineInMarket = reps.powerPlantRepository .calculateCapacityOfPowerPlantsByMarketInPipeline(market, getCurrentTick()); if ((expectedInstalledCapacityOfTechnology + plant.getActualNominalCapacity()) / (marketInformation.maxExpectedLoad + plant.getActualNominalCapacity()) > technology - .getMaximumInstalledCapacityFractionInCountry()) { + .getMaximumInstalledCapacityFractionInCountry()) { // logger.warn(agent + // " will not invest in {} technology because there's too much of this type in the market", // technology); @@ -204,10 +214,12 @@ public void act(T agent) { for (Substance fuel : technology.getFuels()) { myFuelPrices.put(fuel, expectedFuelPrices.get(fuel)); } - Set fuelMix = calculateFuelMix(plant, myFuelPrices, expectedCO2Price.get(market)); + Set fuelMix = calculateFuelMix(plant, myFuelPrices, + expectedCO2Price.get(market)); plant.setFuelMix(fuelMix); - double expectedMarginalCost = determineExpectedMarginalCost(plant, expectedFuelPrices, expectedCO2Price.get(market)); + double expectedMarginalCost = determineExpectedMarginalCost(plant, expectedFuelPrices, + expectedCO2Price.get(market)); double runningHours = 0d; double expectedGrossProfit = 0d; @@ -217,13 +229,15 @@ public void act(T agent) { // be used here to determine the expected profit. Maybe not // though... for (SegmentLoad segmentLoad : market.getLoadDurationCurve()) { - double expectedElectricityPrice = marketInformation.expectedElectricityPricesPerSegment.get(segmentLoad - .getSegment()); + double expectedElectricityPrice = marketInformation.expectedElectricityPricesPerSegment + .get(segmentLoad.getSegment()); double hours = segmentLoad.getSegment().getLengthInHours(); if (expectedMarginalCost <= expectedElectricityPrice) { runningHours += hours; - expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) * hours - * plant.getAvailableCapacity(futureTimePoint, segmentLoad.getSegment(), numberOfSegments); + expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) + * hours + * plant.getAvailableCapacity(futureTimePoint, segmentLoad.getSegment(), + numberOfSegments); } } @@ -241,6 +255,80 @@ public void act(T agent) { // plant.getActualNominalCapacity(); double operatingProfit = expectedGrossProfit - fixedOMCost; + // logger.warn("Operating Profit without Capacity Revenue" + + // operatingProfit); + Segment peakSegment = reps.segmentRepository.findPeakSegmentforMarket(market); + + Zone zoneTemp = market.getZone(); + Regulator regulator = reps.regulatorRepository.findRegulatorForZone(zoneTemp); + CapacityMarket cMarket = reps.capacityMarketRepository.findCapacityMarketForZone(zoneTemp); + + double capacityRevenue = 0d; + double sumCapacityRevenue = 0d; + // the following is a piece of bad coding - as it requires + // each agent to have the property of + // 'issimplecapacitymarketenabled. While the concept of + // 'enablingCapacityMarket' should not be related + // to an agent but to the zone in question., and therefore + // be accessed by the zone as well. + + if ((agent.isSimpleCapacityMarketEnabled()) && (regulator != null)) { + + long time = 0l; + for (time = getCurrentTick(); time > getCurrentTick() + - agent.getNumberOfYearsBacklookingForForecasting() + && time > 0; time = time - 1) { + double capacityRevenueTemp = reps.capacityMarketRepository + .findOneClearingPointForTimeAndCapacityMarket(time, cMarket).getPrice(); + sumCapacityRevenue += capacityRevenueTemp; + } + // logger.warn(" And capacity (peak segment) is" + // + plant.getExpectedAvailableCapacity(futureTimePoint, + // peakSegment, numberOfSegments)); + // logger.warn(" And capacity (null) is" + // + plant.getExpectedAvailableCapacity(futureTimePoint, + // null, numberOfSegments)); + + // -------expected capacity revenue, N years in the + // future, is the AVERAGE of the past few years of + // capacity revenue----- + capacityRevenue = plant.getExpectedAvailableCapacity(futureTimePoint, peakSegment, + numberOfSegments) * sumCapacityRevenue / (getCurrentTick() - time); + + } else { + capacityRevenue = 0; + } + // logger.warn("Capacity Revenue" + capacityRevenue); + + operatingProfit = operatingProfit + capacityRevenue; + + // Feed In Premium revenues : + // if feed in premiumImplemented, then get regulator's + // feedInPremiumFactor and then + // if technology is eligible, + // + + if (reps.renewableSupportSchemeRepository.findAll() != null) // change + // this + // later + // to + // make + // it + // specific + // to + // feed + // in + // tariff + + { + for (RenewableSupportScheme scheme : reps.renewableSupportSchemeRepository.findAll()) { + + if (scheme.getPowerGeneratingTechnologiesEligible().contains(technology)) + operatingProfit = operatingProfit * (1 + regulator.getFeedInPremiumFactor()); + + } + + } // TODO Alter discount rate on the basis of the amount // in long-term contracts? @@ -278,6 +366,7 @@ public void act(T agent) { // agent, technology); double projectValue = discountedOpProfit + discountedCapitalCosts; + // logger.warn("Project value" + projectValue); // logger.warn( // "Agent {} found the project value for technology {} to be " @@ -307,23 +396,25 @@ public void act(T agent) { } if (bestTechnology != null) { - // logger.warn("Agent {} invested in technology {} at tick " + getCurrentTick(), agent, bestTechnology); + // logger.warn("Agent {} invested in technology {} at tick " + + // getCurrentTick(), agent, bestTechnology); PowerPlant plant = new PowerPlant(); plant.specifyAndPersist(getCurrentTick(), agent, getNodeForZone(market.getZone()), bestTechnology); PowerPlantManufacturer manufacturer = reps.genericRepository.findFirst(PowerPlantManufacturer.class); BigBank bigbank = reps.genericRepository.findFirst(BigBank.class); - double investmentCostPayedByEquity = plant.getActualInvestedCapital() * (1 - agent.getDebtRatioOfInvestments()); + double investmentCostPayedByEquity = plant.getActualInvestedCapital() + * (1 - agent.getDebtRatioOfInvestments()); double investmentCostPayedByDebt = plant.getActualInvestedCapital() * agent.getDebtRatioOfInvestments(); double downPayment = investmentCostPayedByEquity; createSpreadOutDownPayments(agent, manufacturer, downPayment, plant); - double amount = determineLoanAnnuities(investmentCostPayedByDebt, plant.getTechnology().getDepreciationTime(), - agent.getLoanInterestRate()); + double amount = determineLoanAnnuities(investmentCostPayedByDebt, plant.getTechnology() + .getDepreciationTime(), agent.getLoanInterestRate()); // logger.warn("Loan amount is: " + amount); - Loan loan = reps.loanRepository.createLoan(agent, bigbank, amount, plant.getTechnology().getDepreciationTime(), - getCurrentTick(), plant); + Loan loan = reps.loanRepository.createLoan(agent, bigbank, amount, plant.getTechnology() + .getDepreciationTime(), getCurrentTick(), plant); // Create the loan plant.createOrUpdateLoan(loan); @@ -341,8 +432,8 @@ public void act(T agent) { // Creates n downpayments of equal size in each of the n building years of a // power plant @Transactional - private void createSpreadOutDownPayments(EnergyProducer agent, PowerPlantManufacturer manufacturer, double totalDownPayment, - PowerPlant plant) { + private void createSpreadOutDownPayments(EnergyProducer agent, PowerPlantManufacturer manufacturer, + double totalDownPayment, PowerPlant plant) { int buildingTime = (int) plant.getActualLeadtime(); reps.nonTransactionalCreateRepository.createCashFlow(agent, manufacturer, totalDownPayment / buildingTime, CashFlow.DOWNPAYMENT, getCurrentTick(), plant); @@ -357,29 +448,36 @@ private void setNotWillingToInvest(EnergyProducer agent) { } /** - * Predicts fuel prices for {@link futureTimePoint} using a geometric trend regression forecast. Only predicts fuels that are - * traded on a commodity market. + * Predicts fuel prices for {@link futureTimePoint} using a geometric trend + * regression forecast. Only predicts fuels that are traded on a commodity + * market. + * * @param agent * @param futureTimePoint * @return Map of predicted prices. */ - public Map predictFuelPrices(EnergyProducer agent, long futureTimePoint){ + public Map predictFuelPrices(EnergyProducer agent, long futureTimePoint) { // Fuel Prices Map expectedFuelPrices = new HashMap(); for (Substance substance : reps.substanceRepository.findAllSubstancesTradedOnCommodityMarkets()) { - //Find Clearing Points for the last 5 years (counting current year as one of the last 5 years). + // Find Clearing Points for the last 5 years (counting current year + // as one of the last 5 years). Iterable cps = reps.clearingPointRepository .findAllClearingPointsForSubstanceTradedOnCommodityMarkesAndTimeRange(substance, getCurrentTick() - (agent.getNumberOfYearsBacklookingForForecasting() - 1), getCurrentTick(), false); - //logger.warn("{}, {}", getCurrentTick()-(agent.getNumberOfYearsBacklookingForForecasting()-1), getCurrentTick()); - //Create regression object + // logger.warn("{}, {}", + // getCurrentTick()-(agent.getNumberOfYearsBacklookingForForecasting()-1), + // getCurrentTick()); + // Create regression object GeometricTrendRegression gtr = new GeometricTrendRegression(); for (ClearingPoint clearingPoint : cps) { - //logger.warn("CP {}: {} , in" + clearingPoint.getTime(), substance.getName(), clearingPoint.getPrice()); + // logger.warn("CP {}: {} , in" + clearingPoint.getTime(), + // substance.getName(), clearingPoint.getPrice()); gtr.addData(clearingPoint.getTime(), clearingPoint.getPrice()); } expectedFuelPrices.put(substance, gtr.predict(futureTimePoint)); - //logger.warn("Forecast {}: {}, in Step " + futureTimePoint, substance, expectedFuelPrices.get(substance)); + // logger.warn("Forecast {}: {}, in Step " + futureTimePoint, + // substance, expectedFuelPrices.get(substance)); } return expectedFuelPrices; } @@ -387,8 +485,8 @@ public Map predictFuelPrices(EnergyProducer agent, long futur // Create a powerplant investment and operation cash-flow in the form of a // map. If only investment, or operation costs should be considered set // totalInvestment or operatingProfit to 0 - private TreeMap calculateSimplePowerPlantInvestmentCashFlow(int depriacationTime, int buildingTime, - double totalInvestment, double operatingProfit) { + private TreeMap calculateSimplePowerPlantInvestmentCashFlow(int depriacationTime, + int buildingTime, double totalInvestment, double operatingProfit) { TreeMap investmentCashFlow = new TreeMap(); double equalTotalDownPaymentInstallement = totalInvestment / buildingTime; for (int i = 0; i < buildingTime; i++) { @@ -409,7 +507,8 @@ private double npv(TreeMap netCashFlow, double wacc) { return npv; } - public double determineExpectedMarginalCost(PowerPlant plant, Map expectedFuelPrices, double expectedCO2Price) { + public double determineExpectedMarginalCost(PowerPlant plant, Map expectedFuelPrices, + double expectedCO2Price) { double mc = determineExpectedMarginalFuelCost(plant, expectedFuelPrices); double co2Intensity = plant.calculateEmissionIntensity(); mc += co2Intensity * expectedCO2Price; @@ -442,7 +541,8 @@ private class MarketInformation { Map meritOrder; double capacitySum; - MarketInformation(ElectricitySpotMarket market, Map expectedDemand, Map fuelPrices, double co2price, long time) { + MarketInformation(ElectricitySpotMarket market, Map expectedDemand, + Map fuelPrices, double co2price, long time) { // determine expected power prices expectedElectricityPricesPerSegment = new HashMap(); Map marginalCostMap = new HashMap(); @@ -456,13 +556,19 @@ private class MarketInformation { capacitySum += plant.getActualNominalCapacity(); } - //get difference between technology target and expected operational capacity - for(PowerGeneratingTechnologyTarget pggt : reps.powerGenerationTechnologyTargetRepository.findAllByMarket(market)){ - double expectedTechnologyCapacity = reps.powerPlantRepository.calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, pggt.getPowerGeneratingTechnology(), time); + // get difference between technology target and expected operational + // capacity + for (PowerGeneratingTechnologyTarget pggt : reps.powerGenerationTechnologyTargetRepository + .findAllByMarket(market)) { + double expectedTechnologyCapacity = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, + pggt.getPowerGeneratingTechnology(), time); double targetDifference = pggt.getTrend().getValue(time) - expectedTechnologyCapacity; - if(targetDifference > 0){ + if (targetDifference > 0) { PowerPlant plant = new PowerPlant(); - plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), pggt.getPowerGeneratingTechnology()); + plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), + reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), + pggt.getPowerGeneratingTechnology()); plant.setActualNominalCapacity(targetDifference); double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); marginalCostMap.put(plant, plantMarginalCost); @@ -496,7 +602,8 @@ private class MarketInformation { double plantCapacity = 0d; // Determine available capacity in the future in this // segment - plantCapacity = plant.getExpectedAvailableCapacity(time, segmentLoad.getSegment(), numberOfSegments); + plantCapacity = plant + .getExpectedAvailableCapacity(time, segmentLoad.getSegment(), numberOfSegments); totalCapacityAvailable += plantCapacity; // logger.warn("Capacity of plant " + plant.toString() + // " is " + diff --git a/emlab-generation/src/main/java/emlab/gen/role/investment/InvestWithHistoricalCVar.java b/emlab-generation/src/main/java/emlab/gen/role/investment/InvestWithHistoricalCVar.java new file mode 100644 index 00000000..3b2b8e4f --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/investment/InvestWithHistoricalCVar.java @@ -0,0 +1,793 @@ +/******************************************************************************* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.investment; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.TreeMap; + +import org.apache.commons.math.stat.regression.SimpleRegression; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.data.annotation.Transient; +import org.springframework.data.neo4j.annotation.NodeEntity; +import org.springframework.data.neo4j.aspects.core.NodeBacked; +import org.springframework.data.neo4j.support.Neo4jTemplate; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.Role; +import emlab.gen.domain.agent.BigBank; +import emlab.gen.domain.agent.DecarbonizationModel; +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.agent.Government; +import emlab.gen.domain.agent.PowerPlantManufacturer; +import emlab.gen.domain.agent.StochasticTargetInvestor; +import emlab.gen.domain.agent.StrategicReserveOperator; +import emlab.gen.domain.agent.TargetInvestor; +import emlab.gen.domain.contract.CashFlow; +import emlab.gen.domain.contract.Loan; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.CO2Auction; +import emlab.gen.domain.market.ClearingPoint; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.Segment; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.domain.policy.PowerGeneratingTechnologyTarget; +import emlab.gen.domain.technology.PowerGeneratingTechnology; +import emlab.gen.domain.technology.PowerGeneratingTechnologyNodeLimit; +import emlab.gen.domain.technology.PowerGridNode; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.domain.technology.Substance; +import emlab.gen.domain.technology.SubstanceShareInFuelMix; +import emlab.gen.repository.Reps; +import emlab.gen.repository.StrategicReserveOperatorRepository; +import emlab.gen.util.GeometricTrendRegression; +import emlab.gen.util.MapValueComparator; + +/** + * {@link EnergyProducer}s decide to invest in new {@link PowerPlant} + * + * @author Emile Chappin @author Alfredas Chmieliauskas + * @author JCRichstein + */ +@Configurable +@NodeEntity +public class InvestWithHistoricalCVar extends GenericInvestmentRole +implements +Role, +NodeBacked { + + @Transient + @Autowired + Reps reps; + + @Transient + @Autowired + Neo4jTemplate template; + + @Transient + @Autowired + StrategicReserveOperatorRepository strategicReserveOperatorRepository; + + // market expectations + @Transient + Map marketInfoMap = new HashMap(); + + @Override + public void act(T agent) { + + long futureTimePoint = getCurrentTick() + agent.getInvestmentFutureTimeHorizon(); + // logger.warn(agent + " is looking at timepoint " + futureTimePoint); + + // ==== Expectations === + + Map expectedFuelPrices = predictFuelPrices(agent, futureTimePoint); + + // CO2 + Map expectedCO2Price = determineExpectedCO2PriceInclTaxAndFundamentalForecast( + futureTimePoint, + agent.getNumberOfYearsBacklookingForForecasting(), 0, getCurrentTick()); + + // logger.warn("{} expects CO2 prices {}", agent.getName(), + // expectedCO2Price); + + Map expectedCO2PriceOld = determineExpectedCO2PriceInclTax(futureTimePoint, + agent.getNumberOfYearsBacklookingForForecasting(), getCurrentTick()); + // logger.warn("{} used to expect CO2 prices {}", agent.getName(), + // expectedCO2PriceOld); + + // logger.warn(expectedCO2Price.toString()); + + //Demand + Map expectedDemand = new HashMap(); + for(ElectricitySpotMarket elm : reps.template.findAll(ElectricitySpotMarket.class)){ + GeometricTrendRegression gtr = new GeometricTrendRegression(); + for(long time = getCurrentTick(); time>getCurrentTick()-agent.getNumberOfYearsBacklookingForForecasting() && time>=0; time=time-1){ + gtr.addData(time, elm.getDemandGrowthTrend().getValue(time)); + } + expectedDemand.put(elm, gtr.predict(futureTimePoint)); + } + + + + // Investment decision + // for (ElectricitySpotMarket market : + // reps.genericRepository.findAllAtRandom(ElectricitySpotMarket.class)) + // { + ElectricitySpotMarket market = agent.getInvestorMarket(); + MarketInformation marketInformation = new MarketInformation(market, expectedDemand, expectedFuelPrices, expectedCO2Price.get(market) + .doubleValue(), futureTimePoint); + /* + * if (marketInfoMap.containsKey(market) && marketInfoMap.get(market).time == futureTimePoint) { marketInformation = marketInfoMap.get(market); } else { marketInformation = new + * MarketInformation(market, expectedFuelPrices, expectedCO2Price, futureTimePoint); marketInfoMap.put(market, marketInformation); } + */ + + // logger.warn(agent + " is expecting a CO2 price of " + + // expectedCO2Price.get(market) + " Euro/MWh at timepoint " + // + futureTimePoint + " in Market " + market); + + // logger.warn("Agent {} found the expected prices to be {}", agent, + // marketInformation.expectedElectricityPricesPerSegment); + + // logger.warn("Agent {} found that the installed capacity in the market {} in future to be " + // + marketInformation.capacitySum + + // "and expectde maximum demand to be " + // + marketInformation.maxExpectedLoad, agent, market); + + double highestValue = Double.MIN_VALUE; + double highestValueWithoutCvar = Double.MIN_VALUE; + PowerGeneratingTechnology bestTechnology = null; + PowerGeneratingTechnology bestTechnologyWithoutCVar = null; + PowerGridNode bestNode = null; + PowerGridNode bestNodeWithoutCvar = null; + + for (PowerGeneratingTechnology technology : reps.genericRepository.findAll(PowerGeneratingTechnology.class)) { + + DecarbonizationModel model = reps.genericRepository.findAll(DecarbonizationModel.class).iterator().next(); + + if (technology.isIntermittent() && model.isNoPrivateIntermittentRESInvestment()) + continue; + + Iterable possibleInstallationNodes; + + /* + * For dispatchable technologies just choose a random node. For + * intermittent evaluate all possibilities. + */ + if(technology.isIntermittent()) + possibleInstallationNodes = reps.powerGridNodeRepository.findAllPowerGridNodesByZone(market.getZone()); + else{ + possibleInstallationNodes = new LinkedList(); + ((LinkedList) possibleInstallationNodes).add(reps.powerGridNodeRepository + .findAllPowerGridNodesByZone(market.getZone()).iterator().next()); + } + + // logger.warn("Calculating for " + technology.getName() + + // ", for Nodes: " + // + possibleInstallationNodes.toString()); + + for (PowerGridNode node : possibleInstallationNodes) { + + PowerPlant plant = new PowerPlant(); + plant.specifyNotPersist(getCurrentTick(), agent, node, technology); + // if too much capacity of this technology in the pipeline (not + // limited to the 5 years) + double expectedInstalledCapacityOfTechnology = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, technology, futureTimePoint); + PowerGeneratingTechnologyTarget technologyTarget = reps.powerGenerationTechnologyTargetRepository + .findOneByTechnologyAndMarket(technology, market); + if (technologyTarget != null) { + double technologyTargetCapacity = technologyTarget.getTrend().getValue(futureTimePoint); + expectedInstalledCapacityOfTechnology = (technologyTargetCapacity > expectedInstalledCapacityOfTechnology) ? technologyTargetCapacity + : expectedInstalledCapacityOfTechnology; + } + double pgtNodeLimit = Double.MAX_VALUE; + PowerGeneratingTechnologyNodeLimit pgtLimit = reps.powerGeneratingTechnologyNodeLimitRepository + .findOneByTechnologyAndNode(technology, plant.getLocation()); + if (pgtLimit != null) { + pgtNodeLimit = pgtLimit.getUpperCapacityLimit(futureTimePoint); + } + double expectedInstalledCapacityOfTechnologyInNode = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsByNodeAndTechnology(plant.getLocation(), + technology, futureTimePoint); + double expectedOwnedTotalCapacityInMarket = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner(market, futureTimePoint, agent); + double expectedOwnedCapacityInMarketOfThisTechnology = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(market, technology, futureTimePoint, + agent); + double capacityOfTechnologyInPipeline = reps.powerPlantRepository.calculateCapacityOfPowerPlantsByTechnologyInPipeline( + technology, getCurrentTick()); + double operationalCapacityOfTechnology = reps.powerPlantRepository.calculateCapacityOfOperationalPowerPlantsByTechnology( + technology, getCurrentTick()); + double capacityInPipelineInMarket = reps.powerPlantRepository + .calculateCapacityOfPowerPlantsByMarketInPipeline(market, getCurrentTick()); + + if ((expectedInstalledCapacityOfTechnology + plant.getActualNominalCapacity()) + / (marketInformation.maxExpectedLoad + plant.getActualNominalCapacity()) > technology + .getMaximumInstalledCapacityFractionInCountry()) { + // logger.warn(agent + + // " will not invest in {} technology because there's too much of this type in the market", + // technology); + } else if ((expectedInstalledCapacityOfTechnologyInNode + plant.getActualNominalCapacity()) > pgtNodeLimit) { + + } else if (expectedOwnedCapacityInMarketOfThisTechnology > expectedOwnedTotalCapacityInMarket + * technology.getMaximumInstalledCapacityFractionPerAgent()) { + // logger.warn(agent + + // " will not invest in {} technology because there's too much capacity planned by him", + // technology); + } else if (capacityInPipelineInMarket > 0.2 * marketInformation.maxExpectedLoad) { + // logger.warn("Not investing because more than 20% of demand in pipeline."); + + } else if ((capacityOfTechnologyInPipeline > 2.0 * operationalCapacityOfTechnology) + && capacityOfTechnologyInPipeline > 9000) { // TODO: + // reflects that you cannot expand a technology out of zero. + // logger.warn(agent + + // " will not invest in {} technology because there's too much capacity in the pipeline", + // technology); + } else if (plant.getActualInvestedCapital() * (1 - agent.getDebtRatioOfInvestments()) > agent + .getDownpaymentFractionOfCash() * agent.getCash()) { + // logger.warn(agent + + // " will not invest in {} technology as he does not have enough money for downpayment", + // technology); + } else { + + Map myFuelPrices = new HashMap(); + for (Substance fuel : technology.getFuels()) { + myFuelPrices.put(fuel, expectedFuelPrices.get(fuel)); + } + Set fuelMix = calculateFuelMix(plant, myFuelPrices, expectedCO2Price.get(market)); + plant.setFuelMix(fuelMix); + + double expectedMarginalCost = determineExpectedMarginalCost(plant, expectedFuelPrices, expectedCO2Price.get(market)); + double runningHours = 0d; + double expectedGrossProfit = 0d; + + long numberOfSegments = reps.segmentRepository.count(); + + // TODO somehow the prices of long-term contracts could also + // be used here to determine the expected profit. Maybe not + // though... + for (SegmentLoad segmentLoad : market.getLoadDurationCurve()) { + double expectedElectricityPrice = marketInformation.expectedElectricityPricesPerSegment.get(segmentLoad + .getSegment()); + double hours = segmentLoad.getSegment().getLengthInHours(); + if (expectedMarginalCost <= expectedElectricityPrice) { + runningHours += hours; + if (technology.isIntermittent()) + expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) + * hours + * plant.getActualNominalCapacity() + * reps.intermittentTechnologyNodeLoadFactorRepository + .findIntermittentTechnologyNodeLoadFactorForNodeAndTechnology(node, + technology).getLoadFactorForSegment(segmentLoad.getSegment()); + else + expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) + * hours + * plant.getAvailableCapacity(futureTimePoint, segmentLoad.getSegment(), numberOfSegments); + } + } + + // logger.warn(agent + + // "expects technology {} to have {} running", technology, + // runningHours); + // expect to meet minimum running hours? + if (runningHours < plant.getTechnology().getMinimumRunningHours()) { + // logger.warn(agent+ + // " will not invest in {} technology as he expect to have {} running, which is lower then required", + // technology, runningHours); + } else { + + double fixedOMCost = calculateFixedOperatingCost(plant, getCurrentTick());// / + // plant.getActualNominalCapacity(); + + + Double cVarOfHistoricalGrossProfitsResult = reps.financialPowerPlantReportRepository + .calculateHistoricalCVarRelativePerMWForOperationaPlantsForEnergyProducerAndTechnologyForYearsFromToAndAlphaValue( + getCurrentTick() - 5, getCurrentTick(), agent, technology, + agent.getHistoricalCVarAlpha()); + + double cVarOfHistoricalGrossProfits = 0; + if (cVarOfHistoricalGrossProfitsResult != null) { + cVarOfHistoricalGrossProfits = cVarOfHistoricalGrossProfitsResult.doubleValue() + * plant.getActualNominalCapacity(); + } else { + cVarOfHistoricalGrossProfits = agent.getHistoricalCVarPropensityForNewTechnologies() + * expectedGrossProfit; + } + + + + double operatingProfit = expectedGrossProfit - fixedOMCost; + + double historicalCvarOperatingProfit = cVarOfHistoricalGrossProfits - fixedOMCost; + + + // TODO Alter discount rate on the basis of the amount + // in long-term contracts? + // TODO Alter discount rate on the basis of other stuff, + // such as amount of money, market share, portfolio + // size. + + // Calculation of weighted average cost of capital, + // based on the companies debt-ratio + double wacc = (1 - agent.getDebtRatioOfInvestments()) * agent.getEquityInterestRate() + + agent.getDebtRatioOfInvestments() * agent.getLoanInterestRate(); + if (cVarOfHistoricalGrossProfitsResult == null) + wacc += agent.getHistoricalCVarInterestRateIncreaseForNewTechnologies(); + + // Creation of out cash-flow during power plant building + // phase (note that the cash-flow is negative!) + TreeMap projectCapitalOutflow = calculateSimplePowerPlantInvestmentCashFlow( + technology.getDepreciationTime(), (int) plant.getActualLeadtime(), + plant.getActualInvestedCapital(), 0); + // Creation of in cashflow during operation + TreeMap projectCashInflow = calculateSimplePowerPlantInvestmentCashFlow( + technology.getDepreciationTime(), (int) plant.getActualLeadtime(), 0, operatingProfit); + + TreeMap projectCashInflowHistoricalCVar = calculateSimplePowerPlantInvestmentCashFlow( + technology.getDepreciationTime(), (int) plant.getActualLeadtime(), 0, + historicalCvarOperatingProfit); + + double discountedCapitalCosts = npv(projectCapitalOutflow, wacc);// are + // defined + // negative!! + // plant.getActualNominalCapacity(); + + // logger.warn("Agent {} found that the discounted capital for technology {} to be " + // + discountedCapitalCosts, agent, + // technology); + + double discountedOpProfit = npv(projectCashInflow, wacc); + + double discountedHistoricalCvarOpProfit = npv(projectCashInflowHistoricalCVar, wacc); + + // logger.warn("Agent {} found that the projected discounted inflows for technology {} to be " + // + discountedOpProfit, + // agent, technology); + + double projectValue = discountedOpProfit + discountedCapitalCosts; + double oldProjectValue = projectValue; + + double historicalCvarProjectValue = discountedHistoricalCvarOpProfit + discountedCapitalCosts; + + if (cVarOfHistoricalGrossProfitsResult != null + || (agent.getHistoricalCVarInterestRateIncreaseForNewTechnologies() == 0 & cVarOfHistoricalGrossProfitsResult == null)) { + projectValue += (agent.getHistoricalCVarBeta() * historicalCvarProjectValue < 0) ? agent + .getHistoricalCVarBeta() * historicalCvarProjectValue : 0; + } + // if (historicalCvarProjectValue < 0) { + // logger.warn("Adjusting NPV!"); + // projectValue += beta * historicalCvarProjectValue; + // } + + // if (technology.isIntermittent()) { + // logger.warn(technology + "in " + node.getName() + + // ", NPV: " + projectValue + // + ", GrossProfit: " + expectedGrossProfit); + // } + + // logger.warn(technology + "in " + node.getName() + + // ", NPV: " + projectValue + ", GrossProfit: " + // + expectedGrossProfit); + // + // logger.warn("CVar: " + historicalCvarProjectValue); + // + // logger.warn("NPV-CVAR: " + projectValue); + + // logger.warn( + // "Agent {} found the project value for technology {} to be " + // + Math.round(projectValue / + // plant.getActualNominalCapacity()) + // + " EUR/kW (running hours: " + runningHours + "", + // agent, technology); + + // double projectTotalValue = projectValuePerMW * + // plant.getActualNominalCapacity(); + + // double projectReturnOnInvestment = discountedOpProfit + // / (-discountedCapitalCosts); + + /* + * Divide by capacity, in order not to favour large power plants (which have the single largest NPV + */ + if (projectValue < 0 && oldProjectValue > 0) { + logger.warn( + "Not profitable w CVAR. NPV-CVAR: {}, NPV: {}, CVAR-GP: " + + cVarOfHistoricalGrossProfits / plant.getActualNominalCapacity() + " Tech:" + + technology + " in " + + node.getName(), projectValue / plant.getActualNominalCapacity(), + oldProjectValue / plant.getActualNominalCapacity()); + } + if (projectValue > 0) { + logger.warn( + "Is profitable w CVAR. NPV-CVAR: {}, NPV: {}, CVAR-GP: " + + cVarOfHistoricalGrossProfits / plant.getActualNominalCapacity() + " Tech:" + + technology + " in " + + node.getName(), projectValue / plant.getActualNominalCapacity(), + oldProjectValue / plant.getActualNominalCapacity()); + } + + if (projectValue > 0 && projectValue / plant.getActualNominalCapacity() > highestValue) { + highestValue = projectValue / plant.getActualNominalCapacity(); + bestTechnology = plant.getTechnology(); + bestNode = node; + } + + if (oldProjectValue > 0 + && oldProjectValue / plant.getActualNominalCapacity() > highestValueWithoutCvar) { + highestValueWithoutCvar = oldProjectValue / plant.getActualNominalCapacity(); + bestTechnologyWithoutCVar = plant.getTechnology(); + bestNodeWithoutCvar = node; + } + } + + } + + } + } + + if (bestTechnology != null && bestTechnologyWithoutCVar != null + && !bestTechnologyWithoutCVar.equals(bestTechnology)) { + logger.warn("Because of CVar investing in {}, instead of in {}", bestTechnology.getName(), + bestTechnologyWithoutCVar.getName()); + } + if (bestTechnology == null && bestTechnologyWithoutCVar != null) { + logger.warn("Not investing. W/o CVar would have invested in {}", + bestTechnologyWithoutCVar.getName()); + } + + if (bestTechnology != null) { + // logger.warn("Agent {} invested in technology {} at tick " + + // getCurrentTick(), agent, bestTechnology); + + PowerPlant plant = new PowerPlant(); + plant.specifyAndPersist(getCurrentTick(), agent, bestNode, bestTechnology); + PowerPlantManufacturer manufacturer = reps.genericRepository.findFirst(PowerPlantManufacturer.class); + BigBank bigbank = reps.genericRepository.findFirst(BigBank.class); + + double investmentCostPayedByEquity = plant.getActualInvestedCapital() * (1 - agent.getDebtRatioOfInvestments()); + double investmentCostPayedByDebt = plant.getActualInvestedCapital() * agent.getDebtRatioOfInvestments(); + double downPayment = investmentCostPayedByEquity; + createSpreadOutDownPayments(agent, manufacturer, downPayment, plant); + + double amount = determineLoanAnnuities(investmentCostPayedByDebt, plant.getTechnology().getDepreciationTime(), + agent.getLoanInterestRate()); + // logger.warn("Loan amount is: " + amount); + Loan loan = reps.loanRepository.createLoan(agent, bigbank, amount, plant.getTechnology().getDepreciationTime(), + getCurrentTick(), plant); + // Create the loan + plant.createOrUpdateLoan(loan); + + } else { + // logger.warn("{} found no suitable technology anymore to invest in at tick " + // + getCurrentTick(), agent); + // agent will not participate in the next round of investment if + // he does not invest now + setNotWillingToInvest(agent); + } + } + + // } + + // Creates n downpayments of equal size in each of the n building years of a + // power plant + @Transactional + private void createSpreadOutDownPayments(EnergyProducer agent, PowerPlantManufacturer manufacturer, double totalDownPayment, + PowerPlant plant) { + int buildingTime = (int) plant.getActualLeadtime(); + reps.nonTransactionalCreateRepository.createCashFlow(agent, manufacturer, totalDownPayment / buildingTime, + CashFlow.DOWNPAYMENT, getCurrentTick(), plant); + Loan downpayment = reps.loanRepository.createLoan(agent, manufacturer, totalDownPayment / buildingTime, + buildingTime - 1, getCurrentTick(), plant); + plant.createOrUpdateDownPayment(downpayment); + } + + @Transactional + private void setNotWillingToInvest(EnergyProducer agent) { + agent.setWillingToInvest(false); + } + + /** + * Predicts fuel prices for {@link futureTimePoint} using a geometric trend regression forecast. Only predicts fuels that are + * traded on a commodity market. + * @param agent + * @param futureTimePoint + * @return Map of predicted prices. + */ + public Map predictFuelPrices(EnergyProducer agent, long futureTimePoint){ + // Fuel Prices + Map expectedFuelPrices = new HashMap(); + for (Substance substance : reps.substanceRepository.findAllSubstancesTradedOnCommodityMarkets()) { + //Find Clearing Points for the last 5 years (counting current year as one of the last 5 years). + Iterable cps = reps.clearingPointRepository + .findAllClearingPointsForSubstanceTradedOnCommodityMarkesAndTimeRange(substance, getCurrentTick() + - (agent.getNumberOfYearsBacklookingForForecasting() - 1), getCurrentTick(), false); + //logger.warn("{}, {}", getCurrentTick()-(agent.getNumberOfYearsBacklookingForForecasting()-1), getCurrentTick()); + //Create regression object + SimpleRegression gtr = new SimpleRegression(); + for (ClearingPoint clearingPoint : cps) { + //logger.warn("CP {}: {} , in" + clearingPoint.getTime(), substance.getName(), clearingPoint.getPrice()); + gtr.addData(clearingPoint.getTime(), clearingPoint.getPrice()); + } + gtr.addData(getCurrentTick(), findLastKnownPriceForSubstance(substance, getCurrentTick())); + expectedFuelPrices.put(substance, gtr.predict(futureTimePoint)); + //logger.warn("Forecast {}: {}, in Step " + futureTimePoint, substance, expectedFuelPrices.get(substance)); + } + return expectedFuelPrices; + } + + // Create a powerplant investment and operation cash-flow in the form of a + // map. If only investment, or operation costs should be considered set + // totalInvestment or operatingProfit to 0 + private TreeMap calculateSimplePowerPlantInvestmentCashFlow(int depriacationTime, int buildingTime, + double totalInvestment, double operatingProfit) { + TreeMap investmentCashFlow = new TreeMap(); + double equalTotalDownPaymentInstallement = totalInvestment / buildingTime; + for (int i = 0; i < buildingTime; i++) { + investmentCashFlow.put(new Integer(i), -equalTotalDownPaymentInstallement); + } + for (int i = buildingTime; i < depriacationTime + buildingTime; i++) { + investmentCashFlow.put(new Integer(i), operatingProfit); + } + + return investmentCashFlow; + } + + private double npv(TreeMap netCashFlow, double wacc) { + double npv = 0; + for (Integer iterator : netCashFlow.keySet()) { + npv += netCashFlow.get(iterator).doubleValue() / Math.pow(1 + wacc, iterator.intValue()); + } + return npv; + } + + public double determineExpectedMarginalCost(PowerPlant plant, Map expectedFuelPrices, double expectedCO2Price) { + double mc = determineExpectedMarginalFuelCost(plant, expectedFuelPrices); + double co2Intensity = plant.calculateEmissionIntensity(); + mc += co2Intensity * expectedCO2Price; + return mc; + } + + public double determineExpectedMarginalFuelCost(PowerPlant powerPlant, Map expectedFuelPrices) { + double fc = 0d; + for (SubstanceShareInFuelMix mix : powerPlant.getFuelMix()) { + double amount = mix.getShare(); + double fuelPrice = expectedFuelPrices.get(mix.getSubstance()); + fc += amount * fuelPrice; + } + return fc; + } + + private PowerGridNode getNodeForZone(Zone zone) { + for (PowerGridNode node : reps.genericRepository.findAll(PowerGridNode.class)) { + if (node.getZone().equals(zone)) { + return node; + } + } + return null; + } + + private class MarketInformation { + + Map expectedElectricityPricesPerSegment; + double maxExpectedLoad = 0d; + Map meritOrder; + double capacitySum; + + MarketInformation(ElectricitySpotMarket market, Map expectedDemand, Map fuelPrices, double co2price, long time) { + // determine expected power prices + expectedElectricityPricesPerSegment = new HashMap(); + Map marginalCostMap = new HashMap(); + capacitySum = 0d; + + // get merit order for this market + for (PowerPlant plant : reps.powerPlantRepository.findExpectedOperationalPowerPlantsInMarket(market, time)) { + + double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); + marginalCostMap.put(plant, plantMarginalCost); + capacitySum += plant.getActualNominalCapacity(); + } + + //get difference between technology target and expected operational capacity + for (TargetInvestor targetInvestor : reps.targetInvestorRepository.findAllByMarket(market)) { + if (!(targetInvestor instanceof StochasticTargetInvestor)) { + for (PowerGeneratingTechnologyTarget pggt : targetInvestor.getPowerGenerationTechnologyTargets()) { + double expectedTechnologyCapacity = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, + pggt.getPowerGeneratingTechnology(), time); + double targetDifference = pggt.getTrend().getValue(time) - expectedTechnologyCapacity; + if (targetDifference > 0) { + PowerPlant plant = new PowerPlant(); + plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), + reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), + pggt.getPowerGeneratingTechnology()); + plant.setActualNominalCapacity(targetDifference); + double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); + marginalCostMap.put(plant, plantMarginalCost); + capacitySum += targetDifference; + } + } + } else { + for (PowerGeneratingTechnologyTarget pggt : targetInvestor.getPowerGenerationTechnologyTargets()) { + double expectedTechnologyCapacity = reps.powerPlantRepository + .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, + pggt.getPowerGeneratingTechnology(), time); + double expectedTechnologyAddition = 0; + long contructionTime = getCurrentTick() + + pggt.getPowerGeneratingTechnology().getExpectedLeadtime() + + pggt.getPowerGeneratingTechnology().getExpectedPermittime(); + for (long investmentTimeStep = contructionTime + 1; investmentTimeStep <= time; investmentTimeStep = investmentTimeStep + 1) { + expectedTechnologyAddition += (pggt.getTrend().getValue(investmentTimeStep) - pggt + .getTrend().getValue(investmentTimeStep - 1)); + } + if (expectedTechnologyAddition > 0) { + PowerPlant plant = new PowerPlant(); + plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), + reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), + pggt.getPowerGeneratingTechnology()); + plant.setActualNominalCapacity(expectedTechnologyAddition); + double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); + marginalCostMap.put(plant, plantMarginalCost); + capacitySum += expectedTechnologyAddition; + } + } + } + + } + + MapValueComparator comp = new MapValueComparator(marginalCostMap); + meritOrder = new TreeMap(comp); + meritOrder.putAll(marginalCostMap); + + long numberOfSegments = reps.segmentRepository.count(); + + double demandFactor = expectedDemand.get(market).doubleValue(); + + // find expected prices per segment given merit order + for (SegmentLoad segmentLoad : market.getLoadDurationCurve()) { + + double expectedSegmentLoad = segmentLoad.getBaseLoad() * demandFactor; + + if (expectedSegmentLoad > maxExpectedLoad) { + maxExpectedLoad = expectedSegmentLoad; + } + + double segmentSupply = 0d; + double segmentPrice = 0d; + double totalCapacityAvailable = 0d; + + for (Entry plantCost : meritOrder.entrySet()) { + PowerPlant plant = plantCost.getKey(); + double plantCapacity = 0d; + // Determine available capacity in the future in this + // segment + plantCapacity = plant.getExpectedAvailableCapacity(time, segmentLoad.getSegment(), numberOfSegments); + totalCapacityAvailable += plantCapacity; + // logger.warn("Capacity of plant " + plant.toString() + + // " is " + + // plantCapacity/plant.getActualNominalCapacity()); + if (segmentSupply < expectedSegmentLoad) { + segmentSupply += plantCapacity; + segmentPrice = plantCost.getValue(); + } + + } + + // logger.warn("Segment " + + // segmentLoad.getSegment().getSegmentID() + " supply equals " + + // segmentSupply + " and segment demand equals " + + // expectedSegmentLoad); + + // Find strategic reserve operator for the market. + double reservePrice = 0; + double reserveVolume = 0; + for (StrategicReserveOperator operator : strategicReserveOperatorRepository.findAll()) { + ElectricitySpotMarket market1 = reps.marketRepository.findElectricitySpotMarketForZone(operator + .getZone()); + if (market.getNodeId().intValue() == market1.getNodeId().intValue()) { + reservePrice = operator.getReservePriceSR(); + reserveVolume = operator.getReserveVolume(); + } + } + + if (segmentSupply >= expectedSegmentLoad + && ((totalCapacityAvailable - expectedSegmentLoad) <= (reserveVolume))) { + expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), reservePrice); + // logger.warn("Price: "+ + // expectedElectricityPricesPerSegment); + } else if (segmentSupply >= expectedSegmentLoad + && ((totalCapacityAvailable - expectedSegmentLoad) > (reserveVolume))) { + expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), segmentPrice); + // logger.warn("Price: "+ + // expectedElectricityPricesPerSegment); + } else { + expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), market.getValueOfLostLoad()); + } + + } + } + } + + /** + * Calculates expected CO2 price based on a geometric trend estimation, of + * the past years. The adjustmentForDetermineFuelMix needs to be set to 1, + * if this is used in the determine fuel mix role. + * + * @param futureTimePoint + * Year the prediction is made for + * @param yearsLookingBackForRegression + * How many years are used as input for the regression, incl. the + * current tick. + * @return + */ + protected HashMap determineExpectedCO2PriceInclTaxAndFundamentalForecast( + long futureTimePoint, long yearsLookingBackForRegression, int adjustmentForDetermineFuelMix, + long clearingTick) { + HashMap co2Prices = new HashMap(); + CO2Auction co2Auction = reps.genericRepository.findFirst(CO2Auction.class); + Iterable cps = reps.clearingPointRepository.findAllClearingPointsForMarketAndTimeRange( + co2Auction, clearingTick - yearsLookingBackForRegression + 1 - adjustmentForDetermineFuelMix, + clearingTick - adjustmentForDetermineFuelMix, false); + // Create regression object and calculate average + SimpleRegression sr = new SimpleRegression(); + Government government = reps.template.findAll(Government.class).iterator().next(); + double lastPrice = 0; + double averagePrice = 0; + int i = 0; + for (ClearingPoint clearingPoint : cps) { + sr.addData(clearingPoint.getTime(), clearingPoint.getPrice()); + lastPrice = clearingPoint.getPrice(); + averagePrice += lastPrice; + i++; + } + averagePrice = averagePrice / i; + double expectedCO2Price; + double expectedRegressionCO2Price; + if (i > 1) { + expectedRegressionCO2Price = sr.predict(futureTimePoint); + expectedRegressionCO2Price = Math.max(0, expectedRegressionCO2Price); + expectedRegressionCO2Price = Math + .min(expectedRegressionCO2Price, government.getCo2Penalty(futureTimePoint)); + } else { + expectedRegressionCO2Price = lastPrice; + } + ClearingPoint expectedCO2ClearingPoint = reps.clearingPointRepository.findClearingPointForMarketAndTime( + co2Auction, + getCurrentTick() + + reps.genericRepository.findFirst(DecarbonizationModel.class).getCentralForecastingYear(), + true); + expectedCO2Price = (expectedCO2ClearingPoint == null) ? 0 : expectedCO2ClearingPoint.getPrice(); + expectedCO2Price = (expectedCO2Price + expectedRegressionCO2Price) / 2; + for (ElectricitySpotMarket esm : reps.marketRepository.findAllElectricitySpotMarkets()) { + double nationalCo2MinPriceinFutureTick = reps.nationalGovernmentRepository + .findNationalGovernmentByElectricitySpotMarket(esm).getMinNationalCo2PriceTrend() + .getValue(futureTimePoint); + double co2PriceInCountry = 0d; + if (expectedCO2Price > nationalCo2MinPriceinFutureTick) { + co2PriceInCountry = expectedCO2Price; + } else { + co2PriceInCountry = nationalCo2MinPriceinFutureTick; + } + co2PriceInCountry += reps.genericRepository.findFirst(Government.class).getCO2Tax(futureTimePoint); + co2Prices.put(esm, Double.valueOf(co2PriceInCountry)); + } + return co2Prices; + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/investment/StochasticTargetInvestmentRole.java b/emlab-generation/src/main/java/emlab/gen/role/investment/StochasticTargetInvestmentRole.java index 863df1c9..4997b055 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/investment/StochasticTargetInvestmentRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/investment/StochasticTargetInvestmentRole.java @@ -50,11 +50,11 @@ public class StochasticTargetInvestmentRole extends GenericInvestmentRole expectedInstalledCapacity + targetInstallationDelta) { installedCapacityDeviation = targetInstallationDelta; diff --git a/emlab-generation/src/main/java/emlab/gen/role/market/AbstractClearElectricitySpotMarketRole.java b/emlab-generation/src/main/java/emlab/gen/role/market/AbstractClearElectricitySpotMarketRole.java index 0d50c3b7..f1e6c32b 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/market/AbstractClearElectricitySpotMarketRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/market/AbstractClearElectricitySpotMarketRole.java @@ -619,6 +619,15 @@ CO2PriceStability determineStabilityOfCO2andElectricityPricesAndAdjustIfNecessar .findClearingPointsForMarketAndTime(market, getCurrentTick(), false)); Substance substance = market.getSubstance(); + for (CommoditySupplier supplier : reps.genericRepository.findAll(CommoditySupplier.class)) { + if (supplier.getSubstance().equals(substance)) { + + logger.info("Price found for {} by asking the supplier {} directly", substance.getName(), + supplier.getName()); + return supplier.getPriceOfCommodity().getValue(getCurrentTick()); + } + } + if (average != null) { logger.info("Average price found on market for this tick for {}", substance.getName()); return average; @@ -636,13 +645,7 @@ CO2PriceStability determineStabilityOfCO2andElectricityPricesAndAdjustIfNecessar return market.getReferencePrice(); } - for (CommoditySupplier supplier : reps.genericRepository.findAll(CommoditySupplier.class)) { - if (supplier.getSubstance().equals(substance)) { - logger.info("Price found for {} by asking the supplier {} directly", substance.getName(), supplier.getName()); - return supplier.getPriceOfCommodity().getValue(getCurrentTick()); - } - } logger.info("No price has been found for {}", substance.getName()); return 0d; diff --git a/emlab-generation/src/main/java/emlab/gen/role/market/ClearIterativeCO2AndElectricitySpotMarketTwoCountryRole.java b/emlab-generation/src/main/java/emlab/gen/role/market/ClearIterativeCO2AndElectricitySpotMarketTwoCountryRole.java index 6804904d..20112262 100644 --- a/emlab-generation/src/main/java/emlab/gen/role/market/ClearIterativeCO2AndElectricitySpotMarketTwoCountryRole.java +++ b/emlab-generation/src/main/java/emlab/gen/role/market/ClearIterativeCO2AndElectricitySpotMarketTwoCountryRole.java @@ -105,7 +105,7 @@ public void makeCentralElectricityMarketForecastForTimeStep(long clearingTick) { Map fuelPriceMap = predictFuelPrices(model.getCentralForecastBacklookingYears(), clearingTick); - logger.warn("Fuel prices: {}", fuelPriceMap); + // logger.warn("Fuel prices: {}", fuelPriceMap); Map demandGrowthMap = predictDemand(model.getCentralForecastBacklookingYears(), clearingTick); @@ -628,7 +628,6 @@ public void clearIterativeCO2ElectricitySpotMarketAndFutureMarketTwoCountryForTi double targetEnergyProducerBanking = calculateTargetCO2EmissionBankingOfEnergyProducers(clearingTick, clearingTick + model.getCentralForecastingYear(), government, model); - logger.warn("Hedging Target: {}, Relative Hedging: {}", targetEnergyProducerBanking, targetEnergyProducerBanking/government.getCo2Cap(getCurrentTick())); double deltaBankedEmissionCertificateToReachBankingTarget = (targetEnergyProducerBanking - previouslyBankedCertificates) / model.getCentralCO2TargetReversionSpeedFactor(); @@ -684,6 +683,7 @@ public void clearIterativeCO2ElectricitySpotMarketAndFutureMarketTwoCountryForTi futureCO2Price = co2SecantSearch.co2Price * Math.pow(1 + model.getCentralPrivateDiscountingRate(), model.getCentralForecastingYear()); + logger.warn("Iteration " + breakOffIterator + ", CO2Price for clearing: " + co2SecantSearch.co2Price); clearOneOrTwoConnectedElectricityMarketsAtAGivenCO2PriceForSegments(government, clearingTick + model.getCentralForecastingYear(), true, futureDemandGrowthMap, futureFuelPriceMap, futureCO2Price, futureNationalMinCo2Prices, segments, interconnector, model); @@ -706,13 +706,16 @@ public void clearIterativeCO2ElectricitySpotMarketAndFutureMarketTwoCountryForTi clearingTick, -deltaBankedEmissionCertificateToReachBankingTarget, currentEmissions, futureEmissions, previouslyBankedCertificates, averageCO2PriceOfLastTwoYears); - logger.warn("Iteration: " + breakOffIterator + ": " + co2SecantSearch.toString() + ", Future: " - + futureCO2Price); + // logger.warn("Iteration: " + breakOffIterator + ": " + + // co2SecantSearch.toString() + ", Future: " + // + futureCO2Price); if (!co2SecantSearch.stable) { targetEnergyProducerBanking = calculateTargetCO2EmissionBankingOfEnergyProducers(currentEmissions, futureEmissions, model); - logger.warn("Hedging Target: {}, Relative Hedging: {}", targetEnergyProducerBanking, targetEnergyProducerBanking/government.getCo2Cap(getCurrentTick())); + // logger.warn("Hedging Target: {}, Relative Hedging: {}", + // targetEnergyProducerBanking, + // targetEnergyProducerBanking/government.getCo2Cap(getCurrentTick())); deltaBankedEmissionCertificateToReachBankingTarget = (targetEnergyProducerBanking - previouslyBankedCertificates) / model.getCentralCO2TargetReversionSpeedFactor(); @@ -791,6 +794,7 @@ public void clearIterativeCO2ElectricitySpotMarketAndFutureMarketTwoCountryForTi } } + logger.warn("CO2Price that is saved: " + co2SecantSearch.co2Price); reps.clearingPointRepositoryOld.createOrUpdateCO2MarketClearingPoint(co2Auction, co2SecantSearch.co2Price, currentEmissions, emergencyPriceTriggerActive, emergencyAllowancesToBeReleased, clearingTick, false); reps.clearingPointRepositoryOld.createOrUpdateCO2MarketClearingPoint(co2Auction, @@ -815,10 +819,11 @@ public void clearIterativeCO2ElectricitySpotMarketAndFutureMarketTwoCountryForTi producer.setCo2Allowances(bankedEmissionsOfProducer); } } else { - clearIterativeCO2AndElectricitySpotMarketTwoCountryForTimestepAndFuelPrices(model, false, clearingTick, - fuelPriceMap, null, previouslyBankedCertificates); + logger.warn("Banking exhausted."); clearIterativeCO2AndElectricitySpotMarketTwoCountryForTimestepAndFuelPrices(model, true, clearingTick + model.getCentralForecastingYear(), futureFuelPriceMap, futureDemandGrowthMap, 0); + clearIterativeCO2AndElectricitySpotMarketTwoCountryForTimestepAndFuelPrices(model, false, clearingTick, + fuelPriceMap, null, previouslyBankedCertificates); for (EnergyProducer producer : reps.energyProducerRepository.findAll()) { producer.setLastYearsCo2Allowances(producer.getCo2Allowances()); producer.setCo2Allowances(0); @@ -948,18 +953,19 @@ CO2SecantSearch co2PriceSecantSearchUpdateWithCO2Banking(CO2SecantSearch co2Seca DecarbonizationModel model, Government government, long clearingTick, double co2CapAdjustment, double currentEmissions, double futureEmissions, double previouslyBankedCertificates, double averageCO2PriceOfLastTwoYears) { + co2SecantSearch.stable = false; double capDeviationCriterion = model.getCapDeviationCriterion(); double currentCap = government.getCo2Cap(clearingTick); - logger.warn("Current cap: {}", currentCap); + // logger.warn("Current cap: {}", currentCap); double futureCap = government.getCo2Cap(clearingTick + model.getCentralForecastingYear()); - logger.warn("Future cap: {}", futureCap); + // logger.warn("Future cap: {}", futureCap); // logger.warn("Is MSR active in future ? {}.", // (model.isStabilityReserveIsActive() && (model.getStabilityReserveFirstYearOfOperation() <= clearingTick // + model.getCentralForecastingYear()))); // logger.warn("First year MSR is active: {}", model.getStabilityReserveFirstYearOfOperation()); double expectedBankedPermits = calculateExpectedBankedCertificates(currentEmissions, futureEmissions, - currentCap, futureCap, previouslyBankedCertificates, model.getCentralForecastingYear()); + currentCap, futureCap, previouslyBankedCertificates, model.getCentralForecastingYear(), government); double effectiveCapInFuture = (model.isStabilityReserveIsActive() && (model .getStabilityReserveFirstYearOfOperation() <= clearingTick + model.getCentralForecastingYear())) ? futureCap - marketStabilityReserveRole.calculateInflowToMarketReserveForTimeStep( @@ -967,7 +973,7 @@ CO2SecantSearch co2PriceSecantSearchUpdateWithCO2Banking(CO2SecantSearch co2Seca expectedBankedPermits, government) : futureCap; - logger.warn("effective future cap: {}", effectiveCapInFuture); + // logger.warn("effective future cap: {}", effectiveCapInFuture); effectiveCapInFuture -= (government.isActivelyAdjustingTheCO2Cap() & getCurrentTick() > 0) ? renewableAdaptiveCO2CapRole .calculatedExpectedCapReductionForTimeStep(government, clearingTick, clearingTick + model.getCentralForecastingYear(), currentEmissions, futureEmissions, @@ -991,7 +997,7 @@ CO2SecantSearch co2PriceSecantSearchUpdateWithCO2Banking(CO2SecantSearch co2Seca return co2SecantSearch; } - // Check and update the twoPricesExistWithBelowAboveEmissions + // Check and update the twoPricesExistWithBelowAboveEmissions if (co2SecantSearch.tooHighEmissionsPair != null && co2SecantSearch.tooLowEmissionsPair != null) { co2SecantSearch.twoPricesExistWithBelowAboveEmissions = true; @@ -1113,10 +1119,11 @@ CO2SecantSearch co2PriceSecantSearchUpdateWithCO2Banking(CO2SecantSearch co2Seca } double calculateExpectedBankedCertificates(double currentEmissions, double futureEmissions, double currentCap, - double futureCap, double currentlyBankedEmissions, long centralForecastingYear) { + double futureCap, double currentlyBankedEmissions, long centralForecastingYear, Government government) { double expectedBankedCertificates = currentlyBankedEmissions + currentCap - currentEmissions + futureCap - futureEmissions; - expectedBankedCertificates = 1 / 3.0 + expectedBankedCertificates = government.isStabilityReserveHasOneYearDelayInsteadOfTwoYearDelay() ? 2.0 / 3.0 + * expectedBankedCertificates + 1.0 / 3.0 * currentlyBankedEmissions : 1 / 3.0 * expectedBankedCertificates + 2 / 3.0 * currentlyBankedEmissions; return expectedBankedCertificates; diff --git a/emlab-generation/src/main/java/emlab/gen/role/market/CreatingFinancialReports.java b/emlab-generation/src/main/java/emlab/gen/role/market/CreatingFinancialReports.java new file mode 100644 index 00000000..c3a47f55 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/market/CreatingFinancialReports.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.market; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.DecarbonizationModel; +import org.springframework.data.neo4j.support.Neo4jTemplate; +import emlab.gen.domain.market.electricity.FinancialPowerPlantReport; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.domain.technology.Substance; +import emlab.gen.domain.technology.SubstanceShareInFuelMix; +import emlab.gen.repository.Reps; + +/** + * Creating finanical reports for each power plant. Currently implemented for + * use with spot markets only. Long-term contracts are ignored since costs can + * not easily be assigned to individual power plants. + * + * @author Joern + * + */ +@RoleComponent +public class CreatingFinancialReports extends AbstractClearElectricitySpotMarketRole { + + @Autowired + private Reps reps; + + @Autowired + Neo4jTemplate template; + + @Transactional + public void act(DecarbonizationModel model) { + + Map fuelPriceMap = new HashMap(); + for (Substance substance : template.findAll(Substance.class)) { + fuelPriceMap.put(substance, findLastKnownPriceForSubstance(substance)); + } + logger.warn(fuelPriceMap.toString()); + + createFinancialReportsForPowerPlantsAndTick( + reps.powerPlantRepository.findAllPowerPlantsWhichAreNotDismantledBeforeTick(getCurrentTick() - 2), + getCurrentTick()); + + } + + public void createFinancialReportsForNewInvestments(DecarbonizationModel model) { + createFinancialReportsForPowerPlantsAndTick( + reps.powerPlantRepository.findAllPowerPlantsWithConstructionStartTimeInTick(getCurrentTick()), + getCurrentTick()); + } + + void createFinancialReportsForPowerPlantsAndTick(Iterable plants, long tick) { + + for (PowerPlant plant : plants) { + + FinancialPowerPlantReport financialPowerPlantReport = new FinancialPowerPlantReport(); + financialPowerPlantReport.setTime(tick); + financialPowerPlantReport.setFullLoadHours(0); + financialPowerPlantReport.setPowerPlant(plant); + financialPowerPlantReport.setCommodityCosts(0); + financialPowerPlantReport.persist(); + + + // Determining variable and CO2 costs in current time step. + double totalSupply = plant.calculateElectricityOutputAtTime(tick, false); + financialPowerPlantReport.setProduction(totalSupply); + + for (SubstanceShareInFuelMix share : plant.getFuelMix()) { + + double amount = share.getShare() * totalSupply; + Substance substance = share.getSubstance(); + double substanceCost = findLastKnownPriceForSubstance(substance) * amount; + financialPowerPlantReport.setCommodityCosts(financialPowerPlantReport.getCommodityCosts() + + substanceCost); + + + } + financialPowerPlantReport.setCo2Costs(reps.powerPlantRepository.calculateCO2CostsOfPowerPlant(plant, + tick)); + financialPowerPlantReport.setVariableCosts(financialPowerPlantReport.getCommodityCosts()+financialPowerPlantReport.getCo2Costs()); + + //Determine fixed costs + financialPowerPlantReport.setFixedCosts(reps.powerPlantRepository + .calculateFixedCostsOfPowerPlant(plant, + tick)); + + //Calculate overall revenue + financialPowerPlantReport.setSpotMarketRevenue(reps.powerPlantRepository + .calculateSpotMarketRevenueOfPowerPlant(plant, tick)); + + financialPowerPlantReport.setStrategicReserveRevenue(reps.powerPlantRepository + .calculateStrategicReserveRevenueOfPowerPlant(plant, tick)); + + financialPowerPlantReport.setCapacityMarketRevenue(reps.powerPlantRepository + .calculateCapacityMarketRevenueOfPowerPlant(plant, tick)); + + financialPowerPlantReport.setCo2HedgingRevenue(reps.powerPlantRepository + .calculateCO2HedgingRevenueOfPowerPlant(plant, tick)); + + + financialPowerPlantReport.setOverallRevenue(financialPowerPlantReport.getCapacityMarketRevenue() + financialPowerPlantReport.getCo2HedgingRevenue() + financialPowerPlantReport.getSpotMarketRevenue() + financialPowerPlantReport + .getStrategicReserveRevenue()); + + // Calculate Full load hours + financialPowerPlantReport.setFullLoadHours(reps.powerPlantRepository.calculateFullLoadHoursOfPowerPlant( + plant, tick)); + + int operationalStatus; + if (plant.isOperational(tick)) + operationalStatus = 1; + else if (plant.isInPipeline(tick)) + operationalStatus = 0; + else + operationalStatus = 2; + + financialPowerPlantReport.setPowerPlantStatus(operationalStatus); + + + + } + + } + +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/FeedInPremiumRole.java b/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/FeedInPremiumRole.java new file mode 100644 index 00000000..d8f6d486 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/FeedInPremiumRole.java @@ -0,0 +1,148 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.renewablesupport; + +import java.util.HashSet; +import java.util.Set; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.annotation.Transient; +import org.springframework.data.neo4j.support.Neo4jTemplate; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.contract.CashFlow; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.PowerPlantDispatchPlan; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.domain.policy.renewablesupport.RenewableSupportScheme; +import emlab.gen.domain.policy.renewablesupport.SupportPriceContract; +import emlab.gen.domain.technology.PowerGeneratingTechnology; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri3012 for loop through eligible, operational power plants, + * create support price contract for each technology SupportPrice = + * electricityMarketPrice*(1+premiumFactor) for 15 years? + * + * Assumption: when the policy is implemented for a certain country, all + * operational, eligible plants in that zone receive the premium by + * default. there is no need for an energy producer agent to voluntarily + * apply for the scheme. + * + * + */ +@RoleComponent +public class FeedInPremiumRole extends AbstractRole { + + @Transient + @Autowired + Reps reps; + + @Transient + @Autowired + Neo4jTemplate template; + + @Transactional + public void act(RenewableSupportScheme renewableSupportScheme) { + + Regulator regulator = new Regulator(); + regulator = renewableSupportScheme.getRegulator(); + + Set technologySet = new HashSet(); + technologySet = renewableSupportScheme.getPowerGeneratingTechnologiesEligible(); + + ElectricitySpotMarket eMarket = reps.marketRepository.findElectricitySpotMarketForZone(regulator.getZone()); + + for (PowerGeneratingTechnology technology : technologySet) { + + for (PowerPlant plant : reps.powerPlantRepository.findOperationalPowerPlantsByMarketAndTechnology(eMarket, + technology, getCurrentTick())) { + + SupportPriceContract contract = null; + + double finishedConstruction = plant.getConstructionStartTime() + plant.calculateActualPermittime() + + plant.calculateActualLeadtime(); + + // existing eligible plants at the start of the simulation (tick + // 0) do not get contracts. + + // if statement below is for newly constructed plants at any + // tick + if (finishedConstruction == getCurrentTick()) { + contract = new SupportPriceContract(); + contract.setStart(getCurrentTick()); + } + + // for all eligible plants, the support price is calculated, and + // payment is made. + if (contract != null) { + + if (getCurrentTick() <= (contract.getStart() + renewableSupportScheme.getSupportSchemeDuration())) { + + double sumEMR = 0d; + double electricityPrice = 0d; + + // the for loop below calculates the electricity market + // price the plant earned + // throughout the year, for its total production + for (SegmentLoad segmentLoad : eMarket.getLoadDurationCurve()) { + + PowerPlantDispatchPlan ppdp = reps.powerPlantDispatchPlanRepository + .findOnePowerPlantDispatchPlanForPowerPlantForSegmentForTime(plant, + segmentLoad.getSegment(), getCurrentTick(), false); + if (ppdp.getStatus() < 0) { + sumEMR = 0d; + } else if (ppdp.getStatus() >= 2) { + electricityPrice = reps.segmentClearingPointRepository + .findOneSegmentClearingPointForMarketSegmentAndTime(getCurrentTick(), + segmentLoad.getSegment(), eMarket).getPrice(); + + double hours = segmentLoad.getSegment().getLengthInHours(); + sumEMR = sumEMR + electricityPrice * hours * ppdp.getAcceptedAmount(); + + } + + } + + // support price calculation for this year (NOT per UNIT + // as + // the contract property states + double supportPrice = sumEMR * regulator.getFeedInPremiumFactor(); + contract.setPricePerUnit(supportPrice); + + // payment + reps.nonTransactionalCreateRepository.createCashFlow(eMarket, plant.getOwner(), + contract.getPricePerUnit(), CashFlow.FEED_IN_PREMIUM, getCurrentTick(), plant); + + } + + // delete contract. not sure if necessary. contract has been + // mainly used to control period of payment + if (getCurrentTick() > (contract.getStart() + renewableSupportScheme.getSupportSchemeDuration())) { + contract = null; + } + + } + + } + + } + } +} diff --git a/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/package-info.java b/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/package-info.java new file mode 100644 index 00000000..41860bc2 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/renewablesupport/package-info.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +/** + * @author Kaveri3012 + * + */ +package emlab.gen.role.renewablesupport; \ No newline at end of file diff --git a/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateBidForRenewableRole.java b/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateBidForRenewableRole.java new file mode 100644 index 00000000..8b28e064 --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateBidForRenewableRole.java @@ -0,0 +1,646 @@ +///******************************************************************************* +// * Copyright 2013 the original author or authors. +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// ******************************************************************************/ +//package emlab.gen.role.tender; +// +///** +// * @author rjjdejeu +// * adapted from emlab.gen.role.investment of InvestmentInPowerGenerationTechnologiesStandard.java +// * Where CO2 decisions are omitted +// * +// * Investors make a bid based on NPV that includes +// * - price per MWh, +// * - expected generation in MWh, +// * - node, +// * - and technology +// * this information needs to be stored and retrieved later +// * +// */ +// +//import java.util.HashMap; +//import java.util.LinkedList; +//import java.util.Map; +//import java.util.Map.Entry; +//import java.util.Set; +//import java.util.TreeMap; +// +//import org.apache.commons.math.stat.regression.SimpleRegression; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Configurable; +//import org.springframework.data.annotation.Transient; +//import org.springframework.data.neo4j.annotation.NodeEntity; +//import org.springframework.data.neo4j.aspects.core.NodeBacked; +//import org.springframework.data.neo4j.support.Neo4jTemplate; +//import org.springframework.transaction.annotation.Transactional; +// +//import agentspring.role.Role; +//import emlab.gen.domain.agent.BigBank; +//import emlab.gen.domain.agent.DecarbonizationModel; +//import emlab.gen.domain.agent.EnergyProducer; +//import emlab.gen.domain.agent.Government; +//import emlab.gen.domain.agent.PowerPlantManufacturer; +//import emlab.gen.domain.agent.StochasticTargetInvestor; +//import emlab.gen.domain.agent.StrategicReserveOperator; +//import emlab.gen.domain.agent.TargetInvestor; +//import emlab.gen.domain.contract.CashFlow; +//import emlab.gen.domain.contract.Loan; +//import emlab.gen.domain.gis.Zone; +//import emlab.gen.domain.market.CO2Auction; +//import emlab.gen.domain.market.ClearingPoint; +//import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +//import emlab.gen.domain.market.electricity.Segment; +//import emlab.gen.domain.market.electricity.SegmentLoad; +//import emlab.gen.domain.policy.PowerGeneratingTechnologyTarget; +//import emlab.gen.domain.technology.PowerGeneratingTechnology; +//import emlab.gen.domain.technology.PowerGeneratingTechnologyNodeLimit; +//import emlab.gen.domain.technology.PowerGridNode; +//import emlab.gen.domain.technology.PowerPlant; +//import emlab.gen.domain.technology.Substance; +//import emlab.gen.domain.technology.SubstanceShareInFuelMix; +//import emlab.gen.repository.Reps; +//import emlab.gen.repository.StrategicReserveOperatorRepository; +//import emlab.gen.util.GeometricTrendRegression; +//import emlab.gen.util.MapValueComparator; +// +//@Configurable +//@NodeEntity +//public class CalculateBidForRenewableRole extends GenericInvestmentRole implements +// Role, NodeBacked { +// +// @Transient +// @Autowired +// Reps reps; +// +// @Transient +// @Autowired +// Neo4jTemplate template; +// +// // do I need strategic reserver operator? +// @Transient +// @Autowired +// StrategicReserveOperatorRepository strategicReserveOperatorRepository; +// +// // market expectations +// @Transient +// Map marketInfoMap = new HashMap(); +// +// @Override +// public void act(T agent) { +// +// long futureTimePoint = getCurrentTick() + agent.getInvestmentFutureTimeHorizon(); +// // logger.warn(agent + " is looking at timepoint " + futureTimePoint); +// +// // ==== Expectations === +// +// Map expectedFuelPrices = predictFuelPrices(agent, futureTimePoint); +// +// +// //Demand +// Map expectedDemand = new HashMap(); +// for(ElectricitySpotMarket elm : reps.template.findAll(ElectricitySpotMarket.class)){ +// GeometricTrendRegression gtr = new GeometricTrendRegression(); +// for(long time = getCurrentTick(); time>getCurrentTick()-agent.getNumberOfYearsBacklookingForForecasting() && time>=0; time=time-1){ +// gtr.addData(time, elm.getDemandGrowthTrend().getValue(time)); +// } +// expectedDemand.put(elm, gtr.predict(futureTimePoint)); +// } +// +// +// +// // Investment decision +// // for (ElectricitySpotMarket market : +// // reps.genericRepository.findAllAtRandom(ElectricitySpotMarket.class)) +// // { +// ElectricitySpotMarket market = agent.getInvestorMarket(); +// MarketInformation marketInformation = new MarketInformation(market, expectedDemand, expectedFuelPrices, +// .doubleValue(), futureTimePoint); +// /* +// * if (marketInfoMap.containsKey(market) && marketInfoMap.get(market).time == futureTimePoint) { marketInformation = marketInfoMap.get(market); } else { marketInformation = new +// * MarketInformation(market, expectedFuelPrices, expectedCO2Price, futureTimePoint); marketInfoMap.put(market, marketInformation); } +// */ +// +// // logger.warn(agent + " is expecting a CO2 price of " + +// // expectedCO2Price.get(market) + " Euro/MWh at timepoint " +// // + futureTimePoint + " in Market " + market); +// +// // logger.warn("Agent {} found the expected prices to be {}", agent, +// // marketInformation.expectedElectricityPricesPerSegment); +// +// // logger.warn("Agent {} found that the installed capacity in the market {} in future to be " +// // + marketInformation.capacitySum + +// // "and expectde maximum demand to be " +// // + marketInformation.maxExpectedLoad, agent, market); +// +// double highestValue = Double.MIN_VALUE; +// PowerGeneratingTechnology bestTechnology = null; +// PowerGridNode bestNode = null; +// +// for (PowerGeneratingTechnology technology : reps.genericRepository.findAll(PowerGeneratingTechnology.class)) { +// +// DecarbonizationModel model = reps.genericRepository.findAll(DecarbonizationModel.class).iterator().next(); +// +// if (technology.isIntermittent() && model.isNoPrivateIntermittentRESInvestment()) +// continue; +// +// Iterable possibleInstallationNodes; +// +// /* +// * For dispatchable technologies just choose a random node. For +// * intermittent evaluate all possibilities. +// */ +// if(technology.isIntermittent()) +// possibleInstallationNodes = reps.powerGridNodeRepository.findAllPowerGridNodesByZone(market.getZone()); +// else{ +// possibleInstallationNodes = new LinkedList(); +// ((LinkedList) possibleInstallationNodes).add(reps.powerGridNodeRepository +// .findAllPowerGridNodesByZone(market.getZone()).iterator().next()); +// } +// +// // logger.warn("Calculating for " + technology.getName() + +// // ", for Nodes: " +// // + possibleInstallationNodes.toString()); +// +// for (PowerGridNode node : possibleInstallationNodes) { +// +// PowerPlant plant = new PowerPlant(); +// plant.specifyNotPersist(getCurrentTick(), agent, node, technology); +// // if too much capacity of this technology in the pipeline (not +// // limited to the 5 years) +// double expectedInstalledCapacityOfTechnology = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, technology, futureTimePoint); +// PowerGeneratingTechnologyTarget technologyTarget = reps.powerGenerationTechnologyTargetRepository +// .findOneByTechnologyAndMarket(technology, market); +// if (technologyTarget != null) { +// double technologyTargetCapacity = technologyTarget.getTrend().getValue(futureTimePoint); +// expectedInstalledCapacityOfTechnology = (technologyTargetCapacity > expectedInstalledCapacityOfTechnology) ? technologyTargetCapacity +// : expectedInstalledCapacityOfTechnology; +// } +// double pgtNodeLimit = Double.MAX_VALUE; +// PowerGeneratingTechnologyNodeLimit pgtLimit = reps.powerGeneratingTechnologyNodeLimitRepository +// .findOneByTechnologyAndNode(technology, plant.getLocation()); +// if (pgtLimit != null) { +// pgtNodeLimit = pgtLimit.getUpperCapacityLimit(futureTimePoint); +// } +// double expectedInstalledCapacityOfTechnologyInNode = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsByNodeAndTechnology(plant.getLocation(), +// technology, futureTimePoint); +// double expectedOwnedTotalCapacityInMarket = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner(market, futureTimePoint, agent); +// double expectedOwnedCapacityInMarketOfThisTechnology = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(market, technology, futureTimePoint, +// agent); +// double capacityOfTechnologyInPipeline = reps.powerPlantRepository.calculateCapacityOfPowerPlantsByTechnologyInPipeline( +// technology, getCurrentTick()); +// double operationalCapacityOfTechnology = reps.powerPlantRepository.calculateCapacityOfOperationalPowerPlantsByTechnology( +// technology, getCurrentTick()); +// double capacityInPipelineInMarket = reps.powerPlantRepository +// .calculateCapacityOfPowerPlantsByMarketInPipeline(market, getCurrentTick()); +// +// if ((expectedInstalledCapacityOfTechnology + plant.getActualNominalCapacity()) +// / (marketInformation.maxExpectedLoad + plant.getActualNominalCapacity()) > technology +// .getMaximumInstalledCapacityFractionInCountry()) { +// // logger.warn(agent + +// // " will not invest in {} technology because there's too much of this type in the market", +// // technology); +// } else if ((expectedInstalledCapacityOfTechnologyInNode + plant.getActualNominalCapacity()) > pgtNodeLimit) { +// +// } else if (expectedOwnedCapacityInMarketOfThisTechnology > expectedOwnedTotalCapacityInMarket +// * technology.getMaximumInstalledCapacityFractionPerAgent()) { +// // logger.warn(agent + +// // " will not invest in {} technology because there's too much capacity planned by him", +// // technology); +// } else if (capacityInPipelineInMarket > 0.2 * marketInformation.maxExpectedLoad) { +// // logger.warn("Not investing because more than 20% of demand in pipeline."); +// +// } else if ((capacityOfTechnologyInPipeline > 2.0 * operationalCapacityOfTechnology) +// && capacityOfTechnologyInPipeline > 9000) { // TODO: +// // reflects that you cannot expand a technology out of zero. +// // logger.warn(agent + +// // " will not invest in {} technology because there's too much capacity in the pipeline", +// // technology); +// } else if (plant.getActualInvestedCapital() * (1 - agent.getDebtRatioOfInvestments()) > agent +// .getDownpaymentFractionOfCash() * agent.getCash()) { +// // logger.warn(agent + +// // " will not invest in {} technology as he does not have enough money for downpayment", +// // technology); +// } else { +// +// Map myFuelPrices = new HashMap(); +// for (Substance fuel : technology.getFuels()) { +// myFuelPrices.put(fuel, expectedFuelPrices.get(fuel)); +// } +// Set fuelMix = calculateFuelMix(plant, myFuelPrices, expectedCO2Price.get(market)); +// plant.setFuelMix(fuelMix); +// +// double expectedMarginalCost = determineExpectedMarginalCost(plant, expectedFuelPrices, expectedCO2Price.get(market)); +// double runningHours = 0d; +// double expectedGrossProfit = 0d; +// +// long numberOfSegments = reps.segmentRepository.count(); +// +// // TODO somehow the prices of long-term contracts could also +// // be used here to determine the expected profit. Maybe not +// // though... +// for (SegmentLoad segmentLoad : market.getLoadDurationCurve()) { +// double expectedElectricityPrice = marketInformation.expectedElectricityPricesPerSegment.get(segmentLoad +// .getSegment()); +// double hours = segmentLoad.getSegment().getLengthInHours(); +// if (expectedMarginalCost <= expectedElectricityPrice) { +// runningHours += hours; +// if (technology.isIntermittent()) +// expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) +// * hours +// * plant.getActualNominalCapacity() +// * reps.intermittentTechnologyNodeLoadFactorRepository +// .findIntermittentTechnologyNodeLoadFactorForNodeAndTechnology(node, +// technology).getLoadFactorForSegment(segmentLoad.getSegment()); +// else +// expectedGrossProfit += (expectedElectricityPrice - expectedMarginalCost) +// * hours +// * plant.getAvailableCapacity(futureTimePoint, segmentLoad.getSegment(), numberOfSegments); +// } +// } +// +// // logger.warn(agent + +// // "expects technology {} to have {} running", technology, +// // runningHours); +// // expect to meet minimum running hours? +// if (runningHours < plant.getTechnology().getMinimumRunningHours()) { +// // logger.warn(agent+ +// // " will not invest in {} technology as he expect to have {} running, which is lower then required", +// // technology, runningHours); +// } else { +// +// double fixedOMCost = calculateFixedOperatingCost(plant, getCurrentTick());// / +// // plant.getActualNominalCapacity(); +// +// double operatingProfit = expectedGrossProfit - fixedOMCost; +// +// // TODO Alter discount rate on the basis of the amount +// // in long-term contracts? +// // TODO Alter discount rate on the basis of other stuff, +// // such as amount of money, market share, portfolio +// // size. +// +// // Calculation of weighted average cost of capital, +// // based on the companies debt-ratio +// double wacc = (1 - agent.getDebtRatioOfInvestments()) * agent.getEquityInterestRate() +// + agent.getDebtRatioOfInvestments() * agent.getLoanInterestRate(); +// +// // Creation of out cash-flow during power plant building +// // phase (note that the cash-flow is negative!) +// TreeMap discountedProjectCapitalOutflow = calculateSimplePowerPlantInvestmentCashFlow( +// technology.getDepreciationTime(), (int) plant.getActualLeadtime(), +// plant.getActualInvestedCapital(), 0); +// // Creation of in cashflow during operation +// TreeMap discountedProjectCashInflow = calculateSimplePowerPlantInvestmentCashFlow( +// technology.getDepreciationTime(), (int) plant.getActualLeadtime(), 0, operatingProfit); +// +// double discountedCapitalCosts = npv(discountedProjectCapitalOutflow, wacc);// are +// // defined +// // negative!! +// // plant.getActualNominalCapacity(); +// +// // logger.warn("Agent {} found that the discounted capital for technology {} to be " +// // + discountedCapitalCosts, agent, +// // technology); +// +// double discountedOpProfit = npv(discountedProjectCashInflow, wacc); +// +// // logger.warn("Agent {} found that the projected discounted inflows for technology {} to be " +// // + discountedOpProfit, +// // agent, technology); +// +// double projectValue = discountedOpProfit + discountedCapitalCosts; +// +// // if (technology.isIntermittent()) { +// // logger.warn(technology + "in " + node.getName() + +// // ", NPV: " + projectValue +// // + ", GrossProfit: " + expectedGrossProfit); +// // } +// +// // logger.warn( +// // "Agent {} found the project value for technology {} to be " +// // + Math.round(projectValue / +// // plant.getActualNominalCapacity()) +// // + " EUR/kW (running hours: " + runningHours + "", +// // agent, technology); +// +// // double projectTotalValue = projectValuePerMW * +// // plant.getActualNominalCapacity(); +// +// // double projectReturnOnInvestment = discountedOpProfit +// // / (-discountedCapitalCosts); +// +// /* +// * Divide by capacity, in order not to favour large power plants (which have the single largest NPV +// */ +// +// if (projectValue > 0 && projectValue / plant.getActualNominalCapacity() > highestValue) { +// highestValue = projectValue / plant.getActualNominalCapacity(); +// bestTechnology = plant.getTechnology(); +// bestNode = node; +// } +// } +// +// } +// +// } +// } +// +// if (bestTechnology != null) { +// // logger.warn("Agent {} invested in technology {} at tick " + +// // getCurrentTick(), agent, bestTechnology); +// +// PowerPlant plant = new PowerPlant(); +// plant.specifyAndPersist(getCurrentTick(), agent, bestNode, bestTechnology); +// PowerPlantManufacturer manufacturer = reps.genericRepository.findFirst(PowerPlantManufacturer.class); +// BigBank bigbank = reps.genericRepository.findFirst(BigBank.class); +// +// double investmentCostPayedByEquity = plant.getActualInvestedCapital() * (1 - agent.getDebtRatioOfInvestments()); +// double investmentCostPayedByDebt = plant.getActualInvestedCapital() * agent.getDebtRatioOfInvestments(); +// double downPayment = investmentCostPayedByEquity; +// createSpreadOutDownPayments(agent, manufacturer, downPayment, plant); +// +// double amount = determineLoanAnnuities(investmentCostPayedByDebt, plant.getTechnology().getDepreciationTime(), +// agent.getLoanInterestRate()); +// // logger.warn("Loan amount is: " + amount); +// Loan loan = reps.loanRepository.createLoan(agent, bigbank, amount, plant.getTechnology().getDepreciationTime(), +// getCurrentTick(), plant); +// // Create the loan +// plant.createOrUpdateLoan(loan); +// +// } else { +// // logger.warn("{} found no suitable technology anymore to invest in at tick " +// // + getCurrentTick(), agent); +// // agent will not participate in the next round of investment if +// // he does not invest now +// setNotWillingToInvest(agent); +// } +// } +// +// // } +// +// // Creates n downpayments of equal size in each of the n building years of a +// // power plant +// @Transactional +// private void createSpreadOutDownPayments(EnergyProducer agent, PowerPlantManufacturer manufacturer, +// double totalDownPayment, PowerPlant plant) { +// int buildingTime = (int) plant.getActualLeadtime(); +// reps.nonTransactionalCreateRepository.createCashFlow(agent, manufacturer, totalDownPayment / buildingTime, +// CashFlow.DOWNPAYMENT, getCurrentTick(), plant); +// Loan downpayment = reps.loanRepository.createLoan(agent, manufacturer, totalDownPayment / buildingTime, +// buildingTime - 1, getCurrentTick(), plant); +// plant.createOrUpdateDownPayment(downpayment); +// } +// +// @Transactional +// private void setNotWillingToInvest(EnergyProducer agent) { +// agent.setWillingToInvest(false); +// } +// +// /** +// * Predicts fuel prices for {@link futureTimePoint} using a geometric trend +// * regression forecast. Only predicts fuels that are traded on a commodity +// * market. +// * +// * @param agent +// * @param futureTimePoint +// * @return Map of predicted prices. +// */ +// public Map predictFuelPrices(EnergyProducer agent, long futureTimePoint) { +// // Fuel Prices +// Map expectedFuelPrices = new HashMap(); +// for (Substance substance : reps.substanceRepository.findAllSubstancesTradedOnCommodityMarkets()) { +// // Find Clearing Points for the last 5 years (counting current year +// // as one of the last 5 years). +// Iterable cps = reps.clearingPointRepository +// .findAllClearingPointsForSubstanceTradedOnCommodityMarkesAndTimeRange(substance, getCurrentTick() +// - (agent.getNumberOfYearsBacklookingForForecasting() - 1), getCurrentTick(), false); +// // logger.warn("{}, {}", +// // getCurrentTick()-(agent.getNumberOfYearsBacklookingForForecasting()-1), +// // getCurrentTick()); +// // Create regression object +// SimpleRegression gtr = new SimpleRegression(); +// for (ClearingPoint clearingPoint : cps) { +// // logger.warn("CP {}: {} , in" + clearingPoint.getTime(), +// // substance.getName(), clearingPoint.getPrice()); +// gtr.addData(clearingPoint.getTime(), clearingPoint.getPrice()); +// } +// gtr.addData(getCurrentTick(), findLastKnownPriceForSubstance(substance, getCurrentTick())); +// expectedFuelPrices.put(substance, gtr.predict(futureTimePoint)); +// // logger.warn("Forecast {}: {}, in Step " + futureTimePoint, +// // substance, expectedFuelPrices.get(substance)); +// } +// return expectedFuelPrices; +// } +// +// // Create a powerplant investment and operation cash-flow in the form of a +// // map. If only investment, or operation costs should be considered set +// // totalInvestment or operatingProfit to 0 +// private TreeMap calculateSimplePowerPlantInvestmentCashFlow(int depriacationTime, +// int buildingTime, double totalInvestment, double operatingProfit) { +// TreeMap investmentCashFlow = new TreeMap(); +// double equalTotalDownPaymentInstallement = totalInvestment / buildingTime; +// for (int i = 0; i < buildingTime; i++) { +// investmentCashFlow.put(new Integer(i), -equalTotalDownPaymentInstallement); +// } +// for (int i = buildingTime; i < depriacationTime + buildingTime; i++) { +// investmentCashFlow.put(new Integer(i), operatingProfit); +// } +// +// return investmentCashFlow; +// } +// +// private double npv(TreeMap netCashFlow, double wacc) { +// double npv = 0; +// for (Integer iterator : netCashFlow.keySet()) { +// npv += netCashFlow.get(iterator).doubleValue() / Math.pow(1 + wacc, iterator.intValue()); +// } +// return npv; +// } +// +// public double determineExpectedMarginalCost(PowerPlant plant, Map expectedFuelPrices, +// double expectedCO2Price) { +// double mc = determineExpectedMarginalFuelCost(plant, expectedFuelPrices); +// double co2Intensity = plant.calculateEmissionIntensity(); +// mc += co2Intensity * expectedCO2Price; +// return mc; +// } +// +// public double determineExpectedMarginalFuelCost(PowerPlant powerPlant, Map expectedFuelPrices) { +// double fc = 0d; +// for (SubstanceShareInFuelMix mix : powerPlant.getFuelMix()) { +// double amount = mix.getShare(); +// double fuelPrice = expectedFuelPrices.get(mix.getSubstance()); +// fc += amount * fuelPrice; +// } +// return fc; +// } +// +// private PowerGridNode getNodeForZone(Zone zone) { +// for (PowerGridNode node : reps.genericRepository.findAll(PowerGridNode.class)) { +// if (node.getZone().equals(zone)) { +// return node; +// } +// } +// return null; +// } +// +// private class MarketInformation { +// +// Map expectedElectricityPricesPerSegment; +// double maxExpectedLoad = 0d; +// Map meritOrder; +// double capacitySum; +// +// MarketInformation(ElectricitySpotMarket market, Map expectedDemand, +// Map fuelPrices, double co2price, long time) { +// // determine expected power prices +// expectedElectricityPricesPerSegment = new HashMap(); +// Map marginalCostMap = new HashMap(); +// capacitySum = 0d; +// +// // get merit order for this market +// for (PowerPlant plant : reps.powerPlantRepository.findExpectedOperationalPowerPlantsInMarket(market, time)) { +// +// double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); +// marginalCostMap.put(plant, plantMarginalCost); +// capacitySum += plant.getActualNominalCapacity(); +// } +// +// // get difference between technology target and expected operational +// // capacity +// for (TargetInvestor targetInvestor : reps.targetInvestorRepository.findAll()) { +// if (!(targetInvestor instanceof StochasticTargetInvestor)) { +// for (PowerGeneratingTechnologyTarget pggt : targetInvestor.getPowerGenerationTechnologyTargets()) { +// double expectedTechnologyCapacity = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, +// pggt.getPowerGeneratingTechnology(), time); +// double targetDifference = pggt.getTrend().getValue(time) - expectedTechnologyCapacity; +// if (targetDifference > 0) { +// PowerPlant plant = new PowerPlant(); +// plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), +// reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), +// pggt.getPowerGeneratingTechnology()); +// plant.setActualNominalCapacity(targetDifference); +// double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); +// marginalCostMap.put(plant, plantMarginalCost); +// capacitySum += targetDifference; +// } +// } +// } else { +// for (PowerGeneratingTechnologyTarget pggt : targetInvestor.getPowerGenerationTechnologyTargets()) { +// double expectedTechnologyCapacity = reps.powerPlantRepository +// .calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(market, +// pggt.getPowerGeneratingTechnology(), time); +// double expectedTechnologyAddition = 0; +// long contructionTime = getCurrentTick() +// + pggt.getPowerGeneratingTechnology().getExpectedLeadtime() +// + pggt.getPowerGeneratingTechnology().getExpectedPermittime(); +// for (long investmentTimeStep = contructionTime + 1; investmentTimeStep <= time; investmentTimeStep = investmentTimeStep + 1) { +// expectedTechnologyAddition += (pggt.getTrend().getValue(investmentTimeStep) - pggt +// .getTrend().getValue(investmentTimeStep - 1)); +// } +// if (expectedTechnologyAddition > 0) { +// PowerPlant plant = new PowerPlant(); +// plant.specifyNotPersist(getCurrentTick(), new EnergyProducer(), +// reps.powerGridNodeRepository.findFirstPowerGridNodeByElectricitySpotMarket(market), +// pggt.getPowerGeneratingTechnology()); +// plant.setActualNominalCapacity(expectedTechnologyAddition); +// double plantMarginalCost = determineExpectedMarginalCost(plant, fuelPrices, co2price); +// marginalCostMap.put(plant, plantMarginalCost); +// capacitySum += expectedTechnologyAddition; +// } +// } +// } +// +// } +// +// MapValueComparator comp = new MapValueComparator(marginalCostMap); +// meritOrder = new TreeMap(comp); +// meritOrder.putAll(marginalCostMap); +// +// long numberOfSegments = reps.segmentRepository.count(); +// +// double demandFactor = expectedDemand.get(market).doubleValue(); +// +// // find expected prices per segment given merit order +// for (SegmentLoad segmentLoad : market.getLoadDurationCurve()) { +// +// double expectedSegmentLoad = segmentLoad.getBaseLoad() * demandFactor; +// +// if (expectedSegmentLoad > maxExpectedLoad) { +// maxExpectedLoad = expectedSegmentLoad; +// } +// +// double segmentSupply = 0d; +// double segmentPrice = 0d; +// double totalCapacityAvailable = 0d; +// +// for (Entry plantCost : meritOrder.entrySet()) { +// PowerPlant plant = plantCost.getKey(); +// double plantCapacity = 0d; +// // Determine available capacity in the future in this +// // segment +// plantCapacity = plant +// .getExpectedAvailableCapacity(time, segmentLoad.getSegment(), numberOfSegments); +// totalCapacityAvailable += plantCapacity; +// // logger.warn("Capacity of plant " + plant.toString() + +// // " is " + +// // plantCapacity/plant.getActualNominalCapacity()); +// if (segmentSupply < expectedSegmentLoad) { +// segmentSupply += plantCapacity; +// segmentPrice = plantCost.getValue(); +// } +// +// } +// +// // logger.warn("Segment " + +// // segmentLoad.getSegment().getSegmentID() + " supply equals " + +// // segmentSupply + " and segment demand equals " + +// // expectedSegmentLoad); +// +// // Find strategic reserve operator for the market. +// double reservePrice = 0; +// double reserveVolume = 0; +// for (StrategicReserveOperator operator : strategicReserveOperatorRepository.findAll()) { +// ElectricitySpotMarket market1 = reps.marketRepository.findElectricitySpotMarketForZone(operator +// .getZone()); +// if (market.getNodeId().intValue() == market1.getNodeId().intValue()) { +// reservePrice = operator.getReservePriceSR(); +// reserveVolume = operator.getReserveVolume(); +// } +// } +// +// if (segmentSupply >= expectedSegmentLoad +// && ((totalCapacityAvailable - expectedSegmentLoad) <= (reserveVolume))) { +// expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), reservePrice); +// // logger.warn("Price: "+ +// // expectedElectricityPricesPerSegment); +// } else if (segmentSupply >= expectedSegmentLoad +// && ((totalCapacityAvailable - expectedSegmentLoad) > (reserveVolume))) { +// expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), segmentPrice); +// // logger.warn("Price: "+ +// // expectedElectricityPricesPerSegment); +// } else { +// expectedElectricityPricesPerSegment.put(segmentLoad.getSegment(), market.getValueOfLostLoad()); +// } +// +// } +// } +// } +// +// } diff --git a/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateRenewableTargetRoleTender.java b/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateRenewableTargetRoleTender.java new file mode 100644 index 00000000..1a1f9a9b --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/role/tender/CalculateRenewableTargetRoleTender.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.tender; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import agentspring.role.AbstractRole; +import agentspring.role.Role; +import agentspring.role.RoleComponent; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.repository.Reps; +import emlab.gen.util.GeometricTrendRegression; + +/** + * @author rjjdejeu + * + */ + +@RoleComponent +public class CalculateRenewableTargetRoleTender extends AbstractRole implements Role { + + @Autowired + Reps reps; + + @Override + @Transactional + public void act(Regulator regulator) { + + // Zone is the country + Zone zone = regulator.getZone(); + ElectricitySpotMarket market = reps.marketRepository.findElectricitySpotMarketForZone(zone); + + } + + // predicts demand for a full year for a certain period of the spot market, + // based on looking back for a certain time + + public double predictDemandForElectricitySpotMarket(ElectricitySpotMarket market, + long numberOfYearsBacklookingForForecasting, long futureTimePoint) { + + // in predicting a geometric trend (linear regression) method is used + + GeometricTrendRegression gtr = new GeometricTrendRegression(); + + // starts at current year, + // stops when time is greater then the current year minus years looking + // in the past AND when time non-negative + // it decrements with 1 + /* Where is the numberOfYearsBacklookingForForecasting defined for the + * regulator? + */ + + for (long time = getCurrentTick(); time > getCurrentTick() - numberOfYearsBacklookingForForecasting + && time >= 0; time = time - 1) { + + // this results into a regression by looping over previous demand + // data till a certain point in the past. + // DOT operator is defining where to find the method, and what to + // act on (if applicable) + + // getValue is used as follows; it is + /* + * @Override public double getValue(long time) { return + * timeSeries[(int) time - (int) startingYear]; } + */ + + gtr.addData(time, market.getDemandGrowthTrend().getValue(time)); + } + + /* new variable forecast is made to use the regression to a certain + * point of the agent in the future + * this futureTimePoint could be in my case (the regulator) the lead + + */ permit time = 4 (biomass is the max) + double forecast = gtr.predict(futureTimePoint); + + /* Double.isNan() method returns true if this Double value is a + * Not-a-Number (NaN), false otherwise. + */ What happens here exactly and why? + + if (Double.isNaN(forecast)) + forecast = market.getDemandGrowthTrend().getValue(getCurrentTick()); + + // This should be then the demand in MWh predicted in the future + return forecast; + } + + // Is this method now applied to the regulator via 'act', yes right? + + /* + * Gets the established renewable energy targets for NL and DE from a stored + * file in data/policyNREAP_DE_2050.csv and data/policyNREAP_NL_2050.csv + * which are stored as a scenario in the file Tender.xml, but this should be + * included in a complete scenario + */ + + // + // + // + // + // + // + // + // + + /* + * does tenderTargets relate to the scenario file? Or do I need to define + * something is else to relate tothis part of the scenario file? + */ + public double targetFactor = tenderTargets.getTrend().getValue(futureTimePoint); + + /* + * Calculates the target for the current tick. But How do I retrieve + * forecast from line 99? I thought 'return' would do the job + */ + + double renewableTarget = targetFactor * forecast; + +} diff --git a/emlab-generation/src/main/java/emlab/gen/util/PredictionAnalysis.java b/emlab-generation/src/main/java/emlab/gen/util/PredictionAnalysis.java new file mode 100644 index 00000000..5329730b --- /dev/null +++ b/emlab-generation/src/main/java/emlab/gen/util/PredictionAnalysis.java @@ -0,0 +1,219 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.util; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; + +import org.apache.commons.math.stat.regression.SimpleRegression; + +/** + * @author manebel, jrichstein + * + */ +public class PredictionAnalysis { + + /** + * @param args + */ + public static void main(String[] args) { + // read in data + String inputFolder = "/home/jrichstein/emlab-generation/emlab-generation" + + "/src/main/resources/data/stochasticFuelPrices/"; + + String outputFile = "/home/jrichstein/Desktop/emlabGen/PredictionAnalyse/"; + // First year, where Prediction shall be calculated for + int startYear = 2022; + // Last year, where Prediction shall be calculated for + int endYear = 2050; + double[] confidenceLevels = { 0.95 }; + + // Create data for different confidence levels + for (int i = 0; i < confidenceLevels.length; i++) { + createData(startYear, endYear, confidenceLevels[i], outputFile, inputFolder); + } + } + + public static void createData(int startingYear, int endYear, double predictionInterval, String outputFile, + String inputFolder) { + BufferedReader br = null; + String line = ""; + String cvsSplitBy = ","; + String[] years = new String[200]; + String[] coalMedium = new String[200]; + String[] gasMedium = new String[200]; + StringBuffer bufCoal = new StringBuffer(); + StringBuffer bufGas = new StringBuffer(); + bufCoal.append("stochId,year,real,prediction-6-8,prediction-4-6,prediction-4-8,prediction-6-6,prediction-5-7\n"); + bufGas.append("stochId,year,real,prediction-6-8,prediction-4-6,prediction-4-8,prediction-6-6,prediction-5-7\n"); + + for (int j = 1; j <= 120; j++) { + String filename = "fuelPrices-" + j + ".csv"; + String fuelFile = inputFolder + filename; + try { + + br = new BufferedReader(new FileReader(fuelFile)); + int i = 0; + while ((line = br.readLine()) != null) { + if (i == 0) { + years = line.split(cvsSplitBy); + } + if (i == 1) { + coalMedium = line.split(cvsSplitBy); + } + if (i == 2) { + gasMedium = line.split(cvsSplitBy); + } + i++; + + } + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (br != null) { + try { + br.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + // FORECASTS FOR COAL PRICES + // according to different values for numberOfYearsBackLooking and + // futureTimePoint + double[][] coal1 = new double[endYear - startingYear + 1][3]; + coal1 = getData(6, 8, predictionInterval, coalMedium, years, startingYear, endYear); + double[][] coal2 = new double[endYear - startingYear + 1][3]; + coal2 = getData(4, 6, predictionInterval, coalMedium, years, startingYear, endYear); + double[][] coal3 = new double[endYear - startingYear + 1][3]; + coal3 = getData(4, 8, predictionInterval, coalMedium, years, startingYear, endYear); + double[][] coal4 = new double[endYear - startingYear + 1][3]; + coal4 = getData(6, 6, predictionInterval, coalMedium, years, startingYear, endYear); + double[][] coal5 = new double[endYear - startingYear + 1][3]; + coal5 = getData(5, 7, predictionInterval, coalMedium, years, startingYear, endYear); + // Calculating the average. There are 4 agents, that have + // numberOfYearsBackLooking: 6 and futureTimePoint: 8 + for (int i = 0; i < endYear - startingYear + 1; i++) { + bufCoal.append(j); + bufCoal.append(","); + bufCoal.append(coal1[i][0]); + bufCoal.append(","); + bufCoal.append(coal1[i][2]); + bufCoal.append(","); + bufCoal.append(coal1[i][1]); + bufCoal.append(","); + bufCoal.append(coal2[i][1]); + bufCoal.append(","); + bufCoal.append(coal3[i][1]); + bufCoal.append(","); + bufCoal.append(coal4[i][1]); + bufCoal.append(","); + bufCoal.append(coal5[i][1]); + bufCoal.append("\n"); + + } + + // FORECASTS FOR GAS PRICES + // according to different values for numberOfYearsBackLooking and + // futureTimePoint + double[][] gas1 = new double[endYear - startingYear + 1][3]; + gas1 = getData(6, 8, predictionInterval, gasMedium, years, startingYear, endYear); + double[][] gas2 = new double[endYear - startingYear + 1][3]; + gas2 = getData(4, 6, predictionInterval, gasMedium, years, startingYear, endYear); + double[][] gas3 = new double[endYear - startingYear + 1][3]; + gas3 = getData(4, 8, predictionInterval, gasMedium, years, startingYear, endYear); + double[][] gas4 = new double[endYear - startingYear + 1][3]; + gas4 = getData(6, 6, predictionInterval, gasMedium, years, startingYear, endYear); + double[][] gas5 = new double[endYear - startingYear + 1][3]; + gas5 = getData(5, 7, predictionInterval, gasMedium, years, startingYear, endYear); + // Calculating the average. There are 4 agents, that have + // numberOfYearsBackLooking: 6 and futureTimePoint: 8 + for (int i = 0; i < endYear - startingYear + 1; i++) { + bufGas.append(j); + bufGas.append(","); + bufGas.append(gas1[i][0]); + bufGas.append(","); + bufGas.append(gas1[i][2]); + bufGas.append(","); + bufGas.append(gas1[i][1]); + bufGas.append(","); + bufGas.append(gas2[i][1]); + bufGas.append(","); + bufGas.append(gas3[i][1]); + bufGas.append(","); + bufGas.append(gas4[i][1]); + bufGas.append(","); + bufGas.append(gas5[i][1]); + bufGas.append("\n"); + + } + } + + try { + FileWriter writer = new FileWriter(outputFile + "Coal" + "_" + predictionInterval + ".csv"); + writer.append(bufCoal); + writer.flush(); + writer.close(); + + } catch (IOException e) { + e.printStackTrace(); + } + + try { + FileWriter writer = new FileWriter(outputFile + "Gas" + "_" + predictionInterval + ".csv"); + writer.append(bufGas); + writer.flush(); + writer.close(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static double[][] getData(int yearsBack, int yearsAhead, double alpha, String[] data, String[] years, + int startYear, int endYear) { + double[][] result = new double[endYear - startYear + 1][3]; + int currentYear = startYear - yearsAhead; + int i = 0; + while (currentYear + yearsAhead <= endYear) { + int startToCollect = Math.max(1, currentYear - 2011 - yearsBack); + SimpleRegression sr = new SimpleRegression(); + while (startToCollect <= currentYear - 2011) { + sr.addData(Integer.parseInt(years[startToCollect]), Double.parseDouble(data[startToCollect])); + startToCollect++; + } + + result[i][0] = Integer.parseInt(years[currentYear - 2011 + yearsAhead]); + result[i][1] = sr.predict(currentYear + yearsAhead); + // result[i][2] = Math.max(0, sr.getPredictionInterval(currentYear + + // yearsAhead, alpha)[0]); + // result[i][3] = sr.getPredictionInterval(currentYear + yearsAhead, + // alpha)[1]; + result[i][2] = Double.parseDouble(data[currentYear - 2011 + yearsAhead]); + + i++; + currentYear++; + } + return result; + } +} diff --git a/emlab-generation/src/main/resources/data/learningCurves.csv b/emlab-generation/src/main/resources/data/learningCurves.csv index 4e2065ad..b0f5498b 100644 --- a/emlab-generation/src/main/resources/data/learningCurves.csv +++ b/emlab-generation/src/main/resources/data/learningCurves.csv @@ -1,26 +1 @@ -realtime,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076 -timestep,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65 -PV_Inv,13864745.333,13344475.511,12843728.637,12361772.118,11897900.852,11451436.196,11021724.974,10608138.518,10210071.753,9826942.306,9458189.661,9103274.332,8761677.080,8432898.148,8116456.532,7811889.280,7518750.809,7236612.260,6965060.862,6703699.338,6452145.316,6210030.772,5977001.494,5752716.560,5536847.840,5329079.521,5129107.637,4936639.629,4751393.917,4573099.487,4401495.495,4236330.883,4077364.018,3924362.329,3777101.976,3635367.518,3498951.597,3367654.636,3241284.549,3119656.456,3002592.416,2889921.163,2781477.861,2677103.857,2576646.451,2479958.675,2386899.075,2297331.505,2211124.927,2128153.221,2048295.000,1971433.431,1897456.067,1826254.678,1757725.096,1691767.064,1628284.084,1567183.281,1508375.265,1451774.000,1426977.842,1402605.201,1378648.841,1355101.654,1331956.650,1309206.961,1286845.835,1264866.634,1243262.836,1222028.028,1201155.909,1180640.284,1160475.063,1140654.263,1121172.000,1102022.492,1083200.056,1064699.105,1046514.149,1028639.789,1011070.723,993801.734,976827.697,960143.576,943744.418,927625.356,911781.605,896208.465,880901.312,865855.604,851066.875,836530.736,822242.873,808199.045,794395.085,780826.895,767490.448,754381.786,741497.019,728832.323,716383.938,704148.170,692121.389,680300.023,668680.565,657259.567,646033.638,634999.447,624153.718,613493.234,603014.830,592715.395,582591.874,572641.262,562860.606,553247.002 -PV_OM,31173.146,30912.411,30653.856,30397.464,30143.216,29891.095,29641.083,29393.161,29147.314,28903.523,28661.770,28422.040,28184.315,27948.578,27714.814,27483.004,27253.133,27025.185,26799.143,26574.992,26352.716,26132.299,25913.726,25696.981,25482.048,25268.914,25057.562,24847.978,24640.146,24434.054,24229.684,24027.025,23826.060,23626.776,23429.159,23233.195,23038.870,22846.171,22655.083,22465.593,22277.689,22091.356,21906.581,21723.352,21541.656,21361.479,21182.809,21005.634,20829.941,20655.717,20482.950,20311.628,20141.740,19973.272,19806.213,19640.552,19476.276,19313.375,19151.836,18991.648,18935.396,18879.311,18823.391,18767.638,18712.050,18656.626,18601.367,18546.271,18491.338,18436.568,18381.961,18327.515,18273.230,18219.106,18165.143,18111.339,18057.694,18004.209,17950.882,17897.713,17844.701,17791.846,17739.148,17686.606,17634.220,17581.989,17529.912,17477.990,17426.222,17374.606,17323.144,17271.834,17220.677,17169.670,17118.815,17068.110,17017.556,16967.151,16916.896,16866.789,16816.831,16767.021,16717.359,16667.843,16618.474,16569.252,16520.175,16471.243,16422.457,16373.815,16325.317,16276.962,16228.751,16180.683,16132.757,16084.973 -PV_Eff,0.316,0.323,0.330,0.338,0.346,0.354,0.362,0.371,0.379,0.388,0.397,0.407,0.416,0.426,0.436,0.446,0.456,0.467,0.478,0.489,0.501,0.512,0.524,0.536,0.549,0.562,0.575,0.588,0.602,0.616,0.630,0.645,0.660,0.676,0.691,0.707,0.724,0.741,0.758,0.776,0.794,0.813,0.831,0.851,0.871,0.891,0.912,0.933,0.955,0.977,1.000,1.023,1.047,1.072,1.097,1.122,1.148,1.175,1.203,1.231,1.236,1.241,1.246,1.251,1.256,1.261,1.266,1.271,1.276,1.282,1.287,1.292,1.297,1.302,1.308,1.313,1.318,1.324,1.329,1.334,1.340,1.345,1.351,1.356,1.362,1.367,1.373,1.378,1.384,1.389,1.395,1.401,1.406,1.412,1.418,1.424,1.429,1.435,1.441,1.447,1.453,1.458,1.464,1.470,1.476,1.482,1.488,1.494,1.500,1.506,1.512,1.519,1.525,1.531,1.537,1.543 -Wind_Inv,1484743.979,1478792.463,1472864.803,1466960.903,1461080.670,1455224.006,1449390.819,1443581.014,1437794.497,1432031.175,1426290.955,1420573.745,1414879.451,1409207.983,1403559.249,1397933.157,1392329.617,1386748.539,1381189.832,1375653.407,1370139.174,1364647.045,1359176.930,1353728.743,1348302.394,1342897.796,1337514.863,1332153.506,1326813.641,1321495.180,1316198.037,1310922.128,1305667.367,1300433.670,1295220.952,1290029.128,1284858.116,1279707.831,1274578.191,1269469.113,1264380.514,1259312.313,1254264.427,1249236.776,1244229.277,1239241.851,1234274.417,1229326.894,1224399.203,1219491.265,1214603.000,1209734.329,1204885.174,1200055.457,1195245.099,1190454.023,1185682.152,1180929.409,1176195.717,1171481.000,1171000.489,1170520.176,1170040.060,1169560.140,1169080.417,1168600.892,1168121.562,1167642.430,1167163.494,1166684.754,1166206.211,1165727.864,1165249.713,1164771.759,1164294.000,1163816.437,1163339.071,1162861.900,1162384.925,1161908.145,1161431.561,1160955.172,1160478.979,1160002.982,1159527.179,1159051.572,1158576.159,1158100.942,1157625.920,1157151.092,1156676.459,1156202.021,1155727.778,1155253.729,1154779.874,1154306.214,1153832.748,1153359.476,1152886.399,1152413.515,1151940.826,1151468.330,1150996.028,1150523.920,1150052.006,1149580.285,1149108.757,1148637.423,1148166.282,1147695.335,1147224.581,1146754.020,1146283.651,1145813.476,1145343.494,1144873.704 -Wind_OM,21166.116,21102.741,21039.555,20976.559,20913.751,20851.131,20788.699,20726.454,20664.395,20602.521,20540.834,20479.330,20418.011,20356.876,20295.924,20235.154,20174.566,20114.159,20053.934,19993.888,19934.023,19874.336,19814.829,19755.500,19696.348,19637.373,19578.575,19519.953,19461.507,19403.235,19345.138,19287.215,19229.466,19171.889,19114.485,19057.252,19000.191,18943.301,18886.581,18830.031,18773.650,18717.438,18661.395,18605.519,18549.810,18494.269,18438.893,18383.684,18328.640,18273.760,18219.045,18164.494,18140.625,18116.787,18092.981,18069.206,18045.462,18021.749,17998.068,17733.923,17999.224,17975.572,17951.951,17928.362,17904.803,17881.275,17857.778,17834.312,17810.877,17787.473,17764.100,17740.757,17717.444,17694.163,17653.069,17647.692,17624.502,17601.342,17578.213,17555.115,17532.047,17509.009,17486.001,17463.024,17440.076,17417.159,17394.272,17371.416,17348.589,17325.792,17303.025,17280.288,17257.581,17234.904,17212.256,17189.638,17167.051,17144.492,17121.964,17099.465,17076.995,17054.555,17032.145,17009.764,16987.412,16965.090,16942.797,16920.533,16898.299,16876.094,16853.918,16831.771,16809.653,16787.565,16765.505,16743.474 -Wind_Eff,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000,1.000 -WindOffshore_Inv,12316633.424,11925269.871,11546341.976,11179454.593,10824225.131,10480283.158,10147270.012,9824838.427,9512652.171,9210385.698,8917723.804,8634361.302,8360002.701,8094361.901,7837161.892,7588134.466,7347019.938,7113566.873,6887531.827,6668679.091,6456780.446,6251614.923,6052968.577,5860634.260,5674411.404,5494105.819,5319529.480,5150500.340,4986842.136,4828384.204,4674961.306,4526413.452,4382585.737,4243328.176,4108495.554,3977947.265,3851547.175,3729163.474,3610668.540,3495938.807,3384854.634,3277300.184,3173163.299,3072335.385,2974711.298,2880189.236,2788670.633,2700060.052,2614265.090,2531196.281,2450767.000,2372893.376,2297494.203,2224490.853,2153807.200,2085369.535,2019106.490,1954948.968,1892830.063,1832685.000,1807381.515,1782427.390,1757817.802,1733547.992,1709613.271,1686009.011,1662730.649,1639773.688,1617133.688,1594806.273,1572787.129,1551071.997,1529656.682,1508537.044,1487709.000,1467168.524,1446911.646,1426934.451,1407233.076,1387803.714,1368642.609,1349746.057,1331110.405,1312732.052,1294607.445,1276733.081,1259105.504,1241721.307,1224577.130,1207669.659,1190995.626,1174551.807,1158335.025,1142342.144,1126570.074,1111015.765,1095676.211,1080548.447,1065629.548,1050916.632,1036406.854,1022097.409,1007985.532,994068.494,980343.605,966808.214,953459.702,940295.491,927313.035,914509.824,901883.385,889431.277,877151.092,865040.457,853097.031,841318.505 -WindOffshore_OM,235671.987,230245.033,224943.048,219763.156,214702.543,209758.465,204928.236,200209.236,195598.903,191094.735,186694.286,182395.170,178195.051,174091.652,170082.743,166166.150,162339.747,158601.456,154949.250,151381.144,147895.204,144489.536,141162.292,137911.667,134735.896,131633.255,128602.061,125640.667,122747.467,119920.891,117159.404,114461.507,111825.736,109250.661,106734.883,104277.037,101875.790,99529.838,97237.907,94998.754,92811.163,90673.947,88585.946,86546.027,84553.082,82606.029,80703.813,78845.400,77029.782,75255.972,73523.010,71829.953,70175.884,68559.903,66981.135,65438.722,63931.827,62459.632,61021.338,59616.165,59064.341,58517.625,57975.970,57439.328,56907.654,56380.901,55859.024,55341.977,54829.717,54322.198,53819.376,53321.209,52827.654,52338.666,51854.205,51374.228,50898.694,50427.562,49960.790,49498.339,49040.169,48586.240,48136.512,47690.947,47249.507,46812.152,46378.846,45949.550,45524.229,45102.844,44685.359,44271.739,43861.948,43455.950,43053.709,42655.192,42260.364,41869.190,41481.638,41097.672,40717.261,40340.370,39966.969,39597.023,39230.502,38867.374,38507.607,38151.170,37798.032,37448.163,37101.532,36758.110,36417.867,36080.773,35746.800,35415.917 -WindOffshore_Eff,0.734,0.739,0.744,0.748,0.753,0.757,0.762,0.767,0.772,0.776,0.781,0.786,0.791,0.796,0.801,0.806,0.811,0.816,0.821,0.826,0.831,0.836,0.841,0.846,0.852,0.857,0.862,0.868,0.873,0.878,0.884,0.889,0.895,0.900,0.906,0.912,0.917,0.923,0.929,0.934,0.940,0.946,0.952,0.958,0.964,0.970,0.976,0.982,0.988,0.994,1.000,1.006,1.012,1.019,1.025,1.031,1.038,1.044,1.051,1.057,1.063,1.068,1.074,1.079,1.085,1.091,1.096,1.102,1.108,1.114,1.119,1.125,1.131,1.137,1.143,1.149,1.155,1.161,1.167,1.173,1.179,1.185,1.191,1.198,1.204,1.210,1.216,1.223,1.229,1.236,1.242,1.248,1.255,1.261,1.268,1.275,1.281,1.288,1.295,1.301,1.308,1.315,1.322,1.329,1.336,1.343,1.350,1.357,1.364,1.371,1.378,1.385,1.392,1.400,1.407,1.414 -Biomass_Inv,2164261.917,2153919.862,2143627.227,2133383.776,2123189.274,2113043.487,2102946.182,2092897.127,2082896.093,2072942.849,2063037.168,2053178.821,2043367.583,2033603.228,2023885.534,2014214.275,2004589.232,1995010.182,1985476.906,1975989.186,1966546.803,1957149.541,1947797.185,1938489.519,1929226.331,1920007.408,1910832.537,1901701.509,1892614.115,1883570.145,1874569.392,1865611.650,1856696.713,1847824.376,1838994.437,1830206.692,1821460.939,1812756.979,1804094.611,1795473.637,1786893.859,1778355.079,1769857.103,1761399.735,1752982.781,1744606.047,1736269.343,1727972.476,1719715.256,1711497.493,1703319.000,1695179.588,1687079.071,1679017.262,1670993.978,1663009.033,1655062.245,1647153.431,1639282.409,1631449.000,1624540.035,1617660.328,1610809.756,1603988.195,1597195.523,1590431.616,1583696.354,1576989.615,1570311.278,1563661.223,1557039.330,1550445.479,1543879.553,1537341.432,1530831.000,1524348.138,1517892.731,1511464.661,1505063.813,1498690.072,1492343.323,1486023.451,1479730.344,1473463.886,1467223.967,1461010.472,1454823.291,1448662.312,1442527.423,1436418.515,1430335.478,1424278.201,1418246.576,1412240.494,1406259.847,1400304.528,1394374.428,1388469.441,1382589.462,1376734.383,1370904.099,1365098.507,1359317.500,1353560.974,1347828.827,1342120.955,1336437.255,1330777.624,1325141.962,1319530.165,1313942.134,1308377.767,1302836.965,1297319.627,1291825.654,1286354.948 -Biomass_OM,75749.167,75387.195,75026.953,74668.432,74311.625,73956.522,73603.116,73251.399,72901.363,72553.000,72206.301,71861.259,71517.865,71176.113,70835.994,70497.500,70160.623,69825.356,69491.692,69159.622,68829.138,68500.234,68172.901,67847.133,67522.922,67200.259,66879.139,66559.553,66241.494,65924.955,65609.929,65296.408,64984.385,64673.853,64364.805,64057.234,63751.133,63446.494,63143.311,62841.577,62541.285,62242.428,61944.999,61648.991,61354.397,61061.212,60769.427,60479.037,60190.034,59902.412,59616.165,59331.286,59047.767,58765.604,58484.789,58205.316,57927.179,57650.370,57374.884,57100.715,56827.856,56556.300,56286.043,56017.077,55749.396,55482.994,55217.865,54954.003,54691.402,54430.056,54169.959,53911.104,53653.487,53397.100,53141.939,52887.997,52635.269,52383.748,52133.429,51884.306,51636.374,51389.627,51144.058,50899.663,50656.436,50414.371,50173.463,49933.706,49695.095,49457.624,49221.288,48986.081,48751.998,48519.034,48287.183,48056.440,47826.799,47598.256,47370.805,47144.440,46919.158,46694.952,46471.817,46249.749,46028.742,45808.791,45589.891,45372.036,45155.223,44939.447,44724.701,44510.981,44298.283,44086.601,43875.930,43666.266 -Biomass_Eff,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350,0.350 -Biogas_Inv,2521166.319,2510004.766,2498892.626,2487829.681,2476815.713,2465850.505,2454933.842,2444065.509,2433245.291,2422472.976,2411748.351,2401071.206,2390441.330,2379858.514,2369322.549,2358833.229,2348390.347,2337993.696,2327643.073,2317338.273,2307079.095,2296865.335,2286696.793,2276573.268,2266494.562,2256460.475,2246470.811,2236525.373,2226623.964,2216766.390,2206952.457,2197181.972,2187454.742,2177770.575,2168129.282,2158530.673,2148974.557,2139460.748,2129989.058,2120559.300,2111171.290,2101824.841,2092519.770,2083255.894,2074033.031,2064850.998,2055709.616,2046608.703,2037548.082,2028527.574,2019547.000,2010606.185,2001704.952,1992843.126,1984020.532,1975236.997,1966492.348,1957786.413,1949119.021,1940490.000,1935613.822,1930749.896,1925898.193,1921058.682,1916231.332,1911416.112,1906612.992,1901821.942,1897042.931,1892275.929,1887520.906,1882777.831,1878046.675,1873327.408,1868620.000,1863924.421,1859240.641,1854568.631,1849908.361,1845259.801,1840622.923,1835997.696,1831384.092,1826782.082,1822191.635,1817612.724,1813045.319,1808489.391,1803944.912,1799411.852,1794890.183,1790379.876,1785880.904,1781393.236,1776916.846,1772451.703,1767997.782,1763555.052,1759123.486,1754703.056,1750293.734,1745895.492,1741508.303,1737132.137,1732766.968,1728412.769,1724069.511,1719737.166,1715415.709,1711105.110,1706805.344,1702516.382,1698238.198,1693970.764,1689714.054,1685468.040 -Biogas_OM,95804.320,95380.181,94957.920,94537.528,94118.997,93702.319,93287.486,92874.489,92463.321,92053.973,91646.437,91240.706,90836.771,90434.624,90034.257,89635.663,89238.833,88843.760,88450.437,88058.854,87669.006,87280.883,86894.478,86509.784,86126.793,85745.498,85365.891,84987.964,84611.711,84237.123,83864.193,83492.915,83123.280,82755.282,82388.913,82024.166,81661.033,81299.508,80939.584,80581.253,80224.509,79869.344,79515.751,79163.724,78813.255,78464.338,78116.965,77771.131,77426.827,77084.048,76742.786,76403.035,76064.788,75728.039,75392.780,75059.006,74726.709,74395.884,74066.523,73738.620,73412.169,73087.163,72763.596,72441.461,72120.753,71801.464,71483.589,71167.122,70852.055,70538.383,70226.100,69915.199,69605.675,69297.521,68990.731,68685.299,68381.220,68078.487,67777.094,67477.035,67178.305,66880.897,66584.806,66290.026,65996.551,65704.375,65413.493,65123.898,64835.586,64548.549,64262.784,63978.284,63695.043,63413.056,63132.318,62852.822,62574.564,62297.538,62021.738,61747.159,61473.796,61201.643,60930.694,60660.946,60392.391,60125.026,59858.844,59593.841,59330.010,59067.348,58805.849,58545.507,58286.318,58028.276,57771.377,57515.615 -Biogas_Eff,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300,0.300 -Igcc_Inv,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1724880.000,1714903.352,1704984.408,1695122.835,1685318.302,1675570.477,1665879.033,1656243.645,1646663.987,1637139.737,1627670.576,1618256.184,1608896.244,1599590.442,1590338.464,1581140.000,1575417.997,1569716.701,1564036.037,1558375.932,1552736.310,1547117.097,1541518.219,1535939.604,1530381.177,1524842.865,1519324.596,1513826.297,1508347.896,1502889.321,1497450.500,1492031.361,1486631.834,1481251.847,1475891.330,1470550.213,1465228.424,1459925.894,1454642.554,1449378.333,1444133.164,1438906.976,1433699.701,1428511.271,1423341.617,1418190.672,1413058.368,1407944.637,1402849.412,1397772.626,1392714.213,1387674.106,1382652.238,1377648.544,1372662.958,1367695.415,1362745.848 -Igcc_OM,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60370.800,60021.617,59674.454,59329.299,58986.141,58644.967,58305.766,57968.528,57633.240,57299.891,56968.470,56638.966,56311.369,55985.665,55661.846,55339.900,55139.630,54940.085,54741.261,54543.158,54345.771,54149.098,53953.138,53757.886,53563.341,53369.500,53176.361,52983.920,52792.176,52601.126,52410.767,52221.098,52032.114,51843.815,51656.197,51469.257,51282.995,51097.406,50912.489,50728.242,50544.661,50361.744,50179.490,49997.894,49816.957,49636.674,49457.043,49278.062,49099.729,48922.042,48744.997,48568.594,48392.828,48217.699,48043.204,47869.340,47696.105 -Igcc_Eff,0.383,0.384,0.386,0.388,0.390,0.391,0.393,0.395,0.397,0.399,0.400,0.402,0.404,0.406,0.408,0.410,0.411,0.413,0.415,0.417,0.419,0.421,0.423,0.425,0.427,0.429,0.430,0.432,0.434,0.436,0.438,0.440,0.442,0.444,0.446,0.448,0.450,0.453,0.455,0.457,0.459,0.461,0.463,0.465,0.467,0.469,0.471,0.474,0.476,0.478,0.480,0.482,0.484,0.487,0.489,0.491,0.493,0.495,0.498,0.500,0.501,0.503,0.504,0.505,0.507,0.508,0.509,0.511,0.512,0.513,0.515,0.516,0.517,0.519,0.520,0.522,0.523,0.525,0.527,0.529,0.531,0.532,0.534,0.536,0.538,0.539,0.541,0.543,0.545,0.547,0.549,0.550,0.552,0.554,0.556,0.558,0.560,0.561,0.563,0.565,0.567,0.569,0.571,0.573,0.575,0.577,0.579,0.580,0.582,0.584,0.586,0.588,0.590,0.592,0.594,0.596 -IgccCCS_Inv,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2501076.000,2470860.002,2441009.049,2411518.731,2382384.692,2353602.627,2325168.284,2297077.462,2269326.010,2241909.830,2214824.870,2188067.128,2161632.653,2135517.537,2109717.923,2084230.000,2068456.653,2052802.678,2037267.171,2021849.237,2006547.984,1991362.531,1976292.000,1961335.522,1946492.235,1931761.280,1917141.809,1902632.977,1888233.947,1873943.888,1859761.976,1845687.391,1831719.323,1817856.964,1804099.514,1790446.181,1776896.175,1763448.715,1750103.024,1736858.333,1723713.878,1710668.898,1697722.643,1684874.364,1672123.320,1659468.776,1646910.000,1634446.269,1622076.862,1609801.067,1597618.174,1585527.481,1573528.289,1561619.907,1549801.646,1538072.826,1526432.769 -IgccCCS_OM,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,87681.400,86641.008,85612.962,84597.113,83593.319,82601.434,81621.320,80652.834,79695.841,78750.203,77815.785,76892.455,75980.080,75078.532,74187.681,73307.400,72762.537,72221.723,71684.929,71152.125,70623.281,70098.367,69577.355,69060.216,68546.920,68037.439,67531.745,67029.810,66531.605,66037.103,65546.277,65059.099,64575.542,64095.579,63619.183,63146.328,62676.988,62211.136,61748.746,61289.793,60834.252,60382.096,59933.301,59487.842,59045.694,58606.832,58171.231,57738.869,57309.720,56883.761,56460.967,56041.316,55624.785,55211.349,54800.986,54393.673,53989.387 -IgccCCS_Eff,0.295,0.297,0.299,0.300,0.302,0.304,0.305,0.307,0.309,0.311,0.312,0.314,0.316,0.318,0.319,0.321,0.323,0.325,0.326,0.328,0.330,0.332,0.334,0.336,0.338,0.339,0.341,0.343,0.345,0.347,0.349,0.351,0.353,0.355,0.357,0.359,0.361,0.363,0.365,0.367,0.369,0.371,0.373,0.375,0.377,0.379,0.381,0.384,0.386,0.388,0.390,0.392,0.394,0.397,0.399,0.401,0.403,0.405,0.408,0.410,0.413,0.415,0.418,0.420,0.423,0.426,0.428,0.431,0.434,0.436,0.439,0.442,0.444,0.447,0.450,0.453,0.455,0.458,0.461,0.464,0.466,0.469,0.472,0.475,0.478,0.481,0.483,0.486,0.489,0.492,0.495,0.498,0.501,0.504,0.507,0.510,0.513,0.516,0.519,0.522,0.525,0.529,0.532,0.535,0.538,0.541,0.545,0.548,0.551,0.554,0.558,0.561,0.564,0.568,0.571,0.575 -CcgtCCS_Inv,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1164294.000,1150227.932,1136331.799,1122603.547,1109041.150,1095642.602,1082405.925,1069329.163,1056410.384,1043647.679,1031039.163,1018582.974,1006277.269,994120.233,982110.068,970245.000,962902.235,955615.040,948382.994,941205.679,934082.682,927013.592,919998.000,913035.502,906125.695,899268.182,892462.566,885708.455,879005.458,872353.189,865751.265,859199.303,852696.926,846243.759,839839.429,833483.567,827175.806,820915.781,814703.132,808537.500,802418.529,796345.866,790319.161,784338.066,778402.235,772511.327,766665.000,760862.918,755104.746,749390.152,743718.805,738090.379,732504.548,726960.991,721459.387,715999.419,710580.772 -CcgtCCS_OM,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29466.700,29101.218,28740.270,28383.798,28031.748,27684.065,27340.693,27001.581,26666.675,26335.923,26009.273,25686.674,25368.077,25053.432,24742.689,24435.800,24245.931,24057.536,23870.606,23685.128,23501.091,23318.485,23137.297,22957.517,22779.134,22602.137,22426.515,22252.258,22079.355,21907.796,21737.569,21568.665,21401.074,21234.784,21069.787,20906.072,20743.629,20582.448,20422.520,20263.834,20106.381,19950.152,19795.137,19641.326,19488.710,19337.280,19187.027,19037.941,18890.014,18743.236,18597.598,18453.092,18309.709,18167.440,18026.277,17886.210,17747.232 -CcgtCCS_Eff,0.412,0.414,0.415,0.417,0.419,0.421,0.423,0.424,0.426,0.428,0.430,0.432,0.434,0.435,0.437,0.439,0.441,0.443,0.445,0.447,0.449,0.451,0.452,0.454,0.456,0.458,0.460,0.462,0.464,0.466,0.468,0.470,0.472,0.474,0.476,0.478,0.480,0.482,0.485,0.487,0.489,0.491,0.493,0.495,0.497,0.499,0.501,0.504,0.506,0.508,0.510,0.512,0.514,0.517,0.519,0.521,0.523,0.525,0.528,0.530,0.531,0.533,0.534,0.535,0.537,0.538,0.539,0.541,0.542,0.543,0.545,0.546,0.547,0.549,0.550,0.552,0.553,0.555,0.557,0.559,0.560,0.562,0.564,0.566,0.568,0.569,0.571,0.573,0.575,0.577,0.578,0.580,0.582,0.584,0.586,0.588,0.589,0.591,0.593,0.595,0.597,0.599,0.601,0.603,0.604,0.606,0.608,0.610,0.612,0.614,0.616,0.618,0.620,0.622,0.624,0.626 +realtime,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121 timestep,-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110 PV_Inv,13864745.33,13344475.51,12843728.64,12361772.12,11897900.85,11451436.2,11021724.97,10608138.52,10210071.75,9826942.306,9458189.661,9103274.332,8761677.08,8432898.148,8116456.532,7811889.28,7518750.809,7236612.26,6965060.862,6703699.338,6452145.316,6210030.772,5977001.494,5752716.56,5536847.84,5329079.521,5129107.637,4936639.629,4751393.917,4573099.487,4401495.495,4236330.883,4077364.018,3924362.329,3777101.976,3635367.518,3498951.597,3367654.636,3241284.549,3119656.456,3002592.416,2889921.163,2781477.861,2677103.857,2576646.451,2479958.675,2386899.075,2297331.505,2211124.927,2128153.221,2048295,1971433.431,1897456.067,1826254.678,1757725.096,1691767.064,1628284.084,1567183.281,1508375.265,1451774,1426977.842,1402605.201,1378648.841,1355101.654,1331956.65,1309206.961,1286845.835,1264866.634,1243262.836,1222028.028,1201155.909,1180640.284,1160475.063,1140654.263,1121172,1102022.492,1083200.056,1064699.105,1046514.149,1028639.789,1011070.723,993801.734,976827.697,960143.576,943744.418,927625.356,911781.605,896208.465,880901.312,865855.604,851066.875,836530.736,822242.873,808199.045,794395.085,780826.895,767490.448,754381.786,741497.019,728832.323,716383.938,704148.17,692121.389,680300.023,668680.565,657259.567,646033.638,634999.447,624153.718,613493.234,603014.83,592715.395,582591.874,572641.262,562860.606,553247.002,543797.597,534509.587,525380.216,516406.773,507586.596,498917.067,490395.612,482019.703,473786.854,465694.621,457740.602,449922.438,442237.807,434684.428,427260.061,419962.501,412789.582,405739.177,398809.191,391997.569,385302.289,378721.364,372252.84,365894.798,359645.351,353502.643,347464.853,341530.187,335696.885,329963.215,324327.476,318787.994,313343.127,307991.257,302730.796,297560.184,292477.885,287482.391,282572.22,277745.914,273002.041,268339.193,263755.986,259251.06,254823.077 PV_OM,31173.146,30912.411,30653.856,30397.464,30143.216,29891.095,29641.083,29393.161,29147.314,28903.523,28661.77,28422.04,28184.315,27948.578,27714.814,27483.004,27253.133,27025.185,26799.143,26574.992,26352.716,26132.299,25913.726,25696.981,25482.048,25268.914,25057.562,24847.978,24640.146,24434.054,24229.684,24027.025,23826.06,23626.776,23429.159,23233.195,23038.87,22846.171,22655.083,22465.593,22277.689,22091.356,21906.581,21723.352,21541.656,21361.479,21182.809,21005.634,20829.941,20655.717,20482.95,20311.628,20141.74,19973.272,19806.213,19640.552,19476.276,19313.375,19151.836,18991.648,18935.396,18879.311,18823.391,18767.638,18712.05,18656.626,18601.367,18546.271,18491.338,18436.568,18381.961,18327.515,18273.23,18219.106,18165.143,18111.339,18057.694,18004.209,17950.882,17897.713,17844.701,17791.846,17739.148,17686.606,17634.22,17581.989,17529.912,17477.99,17426.222,17374.606,17323.144,17271.834,17220.677,17169.67,17118.815,17068.11,17017.556,16967.151,16916.896,16866.789,16816.831,16767.021,16717.359,16667.843,16618.474,16569.252,16520.175,16471.243,16422.457,16373.815,16325.317,16276.962,16228.751,16180.683,16132.757,16084.973,16037.331,15989.829,15942.469,15895.248,15848.168,15801.227,15754.425,15707.761,15661.236,15614.849,15568.599,15522.486,15476.509,15430.669,15384.965,15339.396,15293.962,15248.662,15203.497,15158.465,15113.567,15068.802,15024.169,14979.669,14935.3,14891.063,14846.957,14802.981,14759.136,14715.42,14671.834,14628.378,14585.049,14541.85,14498.778,14455.834,14413.017,14370.326,14327.762,14285.325,14243.013,14200.826,14158.764,14116.827,14075.014 PV_Eff,0.316,0.323,0.33,0.338,0.346,0.354,0.362,0.371,0.379,0.388,0.397,0.407,0.416,0.426,0.436,0.446,0.456,0.467,0.478,0.489,0.501,0.512,0.524,0.536,0.549,0.562,0.575,0.588,0.602,0.616,0.63,0.645,0.66,0.676,0.691,0.707,0.724,0.741,0.758,0.776,0.794,0.813,0.831,0.851,0.871,0.891,0.912,0.933,0.955,0.977,1,1.023,1.047,1.072,1.097,1.122,1.148,1.175,1.203,1.231,1.236,1.241,1.246,1.251,1.256,1.261,1.266,1.271,1.276,1.282,1.287,1.292,1.297,1.302,1.308,1.313,1.318,1.324,1.329,1.334,1.34,1.345,1.351,1.356,1.362,1.367,1.373,1.378,1.384,1.389,1.395,1.401,1.406,1.412,1.418,1.424,1.429,1.435,1.441,1.447,1.453,1.458,1.464,1.47,1.476,1.482,1.488,1.494,1.5,1.506,1.512,1.519,1.525,1.531,1.537,1.543,1.55,1.556,1.562,1.569,1.575,1.581,1.588,1.594,1.601,1.607,1.614,1.62,1.627,1.633,1.64,1.646,1.653,1.66,1.667,1.673,1.68,1.687,1.694,1.701,1.707,1.714,1.721,1.728,1.735,1.742,1.749,1.756,1.764,1.771,1.778,1.785,1.792,1.8,1.807,1.814,1.822,1.829,1.836,1.844,1.851 Wind_Inv,1484743.979,1478792.463,1472864.803,1466960.903,1461080.67,1455224.006,1449390.819,1443581.014,1437794.497,1432031.175,1426290.955,1420573.745,1414879.451,1409207.983,1403559.249,1397933.157,1392329.617,1386748.539,1381189.832,1375653.407,1370139.174,1364647.045,1359176.93,1353728.743,1348302.394,1342897.796,1337514.863,1332153.506,1326813.641,1321495.18,1316198.037,1310922.128,1305667.367,1300433.67,1295220.952,1290029.128,1284858.116,1279707.831,1274578.191,1269469.113,1264380.514,1259312.313,1254264.427,1249236.776,1244229.277,1239241.851,1234274.417,1229326.894,1224399.203,1219491.265,1214603,1209734.329,1204885.174,1200055.457,1195245.099,1190454.023,1185682.152,1180929.409,1176195.717,1171481,1171000.489,1170520.176,1170040.06,1169560.14,1169080.417,1168600.892,1168121.562,1167642.43,1167163.494,1166684.754,1166206.211,1165727.864,1165249.713,1164771.759,1164294,1163816.437,1163339.071,1162861.9,1162384.925,1161908.145,1161431.561,1160955.172,1160478.979,1160002.982,1159527.179,1159051.572,1158576.159,1158100.942,1157625.92,1157151.092,1156676.459,1156202.021,1155727.778,1155253.729,1154779.874,1154306.214,1153832.748,1153359.476,1152886.399,1152413.515,1151940.826,1151468.33,1150996.028,1150523.92,1150052.006,1149580.285,1149108.757,1148637.423,1148166.282,1147695.335,1147224.581,1146754.02,1146283.651,1145813.476,1145343.494,1144873.704,1144404.107,1143934.703,1143465.491,1142996.472,1142527.645,1142059.01,1141590.568,1141122.318,1140654.259,1140186.393,1139718.719,1139251.236,1138783.946,1138316.847,1137849.939,1137383.223,1136916.699,1136450.365,1135984.224,1135518.273,1135052.513,1134586.945,1134121.567,1133656.38,1133191.385,1132726.579,1132261.965,1131797.541,1131333.308,1130869.265,1130405.412,1129941.749,1129478.277,1129014.995,1128551.903,1128089.001,1127626.289,1127163.766,1126701.433,1126239.29,1125777.337,1125315.573,1124853.998,1124392.612,1123931.416 Wind_OM,21166.116,21102.741,21039.555,20976.559,20913.751,20851.131,20788.699,20726.454,20664.395,20602.521,20540.834,20479.33,20418.011,20356.876,20295.924,20235.154,20174.566,20114.159,20053.934,19993.888,19934.023,19874.336,19814.829,19755.5,19696.348,19637.373,19578.575,19519.953,19461.507,19403.235,19345.138,19287.215,19229.466,19171.889,19114.485,19057.252,19000.191,18943.301,18886.581,18830.031,18773.65,18717.438,18661.395,18605.519,18549.81,18494.269,18438.893,18383.684,18328.64,18273.76,18219.045,18164.494,18140.625,18116.787,18092.981,18069.206,18045.462,18021.749,17998.068,17733.923,17999.224,17975.572,17951.951,17928.362,17904.803,17881.275,17857.778,17834.312,17810.877,17787.473,17764.1,17740.757,17717.444,17694.163,17653.069,17647.692,17624.502,17601.342,17578.213,17555.115,17532.047,17509.009,17486.001,17463.024,17440.076,17417.159,17394.272,17371.416,17348.589,17325.792,17303.025,17280.288,17257.581,17234.904,17212.256,17189.638,17167.051,17144.492,17121.964,17099.465,17076.995,17054.555,17032.145,17009.764,16987.412,16965.09,16942.797,16920.533,16898.299,16876.094,16853.918,16831.771,16809.653,16787.565,16765.505,16743.474,16721.473,16699.5,16677.556,16655.641,16633.755,16611.897,16590.068,16568.268,16546.497,16524.754,16503.04,16481.354,16459.697,16438.068,16416.467,16394.895,16373.352,16351.836,16330.349,16308.89,16287.46,16266.057,16244.683,16223.337,16202.019,16180.728,16159.466,16138.232,16117.025,16095.847,16074.696,16053.573,16032.478,16011.411,15990.371,15969.359,15948.375,15927.418,15906.488,15885.586,15864.712,15843.865,15823.046,15802.253,15781.488 Wind_Eff,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 WindOffshore_Inv,12316633.42,11925269.87,11546341.98,11179454.59,10824225.13,10480283.16,10147270.01,9824838.427,9512652.171,9210385.698,8917723.804,8634361.302,8360002.701,8094361.901,7837161.892,7588134.466,7347019.938,7113566.873,6887531.827,6668679.091,6456780.446,6251614.923,6052968.577,5860634.26,5674411.404,5494105.819,5319529.48,5150500.34,4986842.136,4828384.204,4674961.306,4526413.452,4382585.737,4243328.176,4108495.554,3977947.265,3851547.175,3729163.474,3610668.54,3495938.807,3384854.634,3277300.184,3173163.299,3072335.385,2974711.298,2880189.236,2788670.633,2700060.052,2614265.09,2531196.281,2450767,2372893.376,2297494.203,2224490.853,2153807.2,2085369.535,2019106.49,1954948.968,1892830.063,1832685,1807381.515,1782427.39,1757817.802,1733547.992,1709613.271,1686009.011,1662730.649,1639773.688,1617133.688,1594806.273,1572787.129,1551071.997,1529656.682,1508537.044,1487709,1467168.524,1446911.646,1426934.451,1407233.076,1387803.714,1368642.609,1349746.057,1331110.405,1312732.052,1294607.445,1276733.081,1259105.504,1241721.307,1224577.13,1207669.659,1190995.626,1174551.807,1158335.025,1142342.144,1126570.074,1111015.765,1095676.211,1080548.447,1065629.548,1050916.632,1036406.854,1022097.409,1007985.532,994068.494,980343.605,966808.214,953459.702,940295.491,927313.035,914509.824,901883.385,889431.277,877151.092,865040.457,853097.031,841318.505,829702.603,818247.079,806949.718,795808.338,784820.785,773984.935,763298.692,752759.993,742366.799,732117.101,722008.919,712040.298,702209.312,692514.06,682952.669,673523.289,664224.099,655053.301,646009.122,637089.814,628293.653,619618.939,611063.994,602627.166,594306.823,586101.358,578009.183,570028.736,562158.472,554396.872,546742.435,539193.68,531749.15,524407.405,517167.025,510026.612,502984.785,496040.183,489191.464,482437.304,475776.396,469207.455,462729.209,456340.407,450039.814 WindOffshore_OM,235671.987,230245.033,224943.048,219763.156,214702.543,209758.465,204928.236,200209.236,195598.903,191094.735,186694.286,182395.17,178195.051,174091.652,170082.743,166166.15,162339.747,158601.456,154949.25,151381.144,147895.204,144489.536,141162.292,137911.667,134735.896,131633.255,128602.061,125640.667,122747.467,119920.891,117159.404,114461.507,111825.736,109250.661,106734.883,104277.037,101875.79,99529.838,97237.907,94998.754,92811.163,90673.947,88585.946,86546.027,84553.082,82606.029,80703.813,78845.4,77029.782,75255.972,73523.01,71829.953,70175.884,68559.903,66981.135,65438.722,63931.827,62459.632,61021.338,59616.165,59064.341,58517.625,57975.97,57439.328,56907.654,56380.901,55859.024,55341.977,54829.717,54322.198,53819.376,53321.209,52827.654,52338.666,51854.205,51374.228,50898.694,50427.562,49960.79,49498.339,49040.169,48586.24,48136.512,47690.947,47249.507,46812.152,46378.846,45949.55,45524.229,45102.844,44685.359,44271.739,43861.948,43455.95,43053.709,42655.192,42260.364,41869.19,41481.638,41097.672,40717.261,40340.37,39966.969,39597.023,39230.502,38867.374,38507.607,38151.17,37798.032,37448.163,37101.532,36758.11,36417.867,36080.773,35746.8,35415.917,35088.098,34763.313,34441.534,34122.734,33806.884,33493.958,33183.929,32876.769,32572.453,32270.953,31972.244,31676.3,31383.096,31092.605,30804.803,30519.666,30237.167,29957.284,29679.991,29405.265,29133.081,28863.417,28596.25,28331.555,28069.31,27809.493,27552.08,27297.051,27044.382,26794.051,26546.038,26300.321,26056.878,25815.688,25576.731,25339.986,25105.432,24873.049,24642.817,24414.716,24188.727,23964.829,23743.004,23523.233,23305.495 WindOffshore_Eff,0.734,0.739,0.744,0.748,0.753,0.757,0.762,0.767,0.772,0.776,0.781,0.786,0.791,0.796,0.801,0.806,0.811,0.816,0.821,0.826,0.831,0.836,0.841,0.846,0.852,0.857,0.862,0.868,0.873,0.878,0.884,0.889,0.895,0.9,0.906,0.912,0.917,0.923,0.929,0.934,0.94,0.946,0.952,0.958,0.964,0.97,0.976,0.982,0.988,0.994,1,1.006,1.012,1.019,1.025,1.031,1.038,1.044,1.051,1.057,1.063,1.068,1.074,1.079,1.085,1.091,1.096,1.102,1.108,1.114,1.119,1.125,1.131,1.137,1.143,1.149,1.155,1.161,1.167,1.173,1.179,1.185,1.191,1.198,1.204,1.21,1.216,1.223,1.229,1.236,1.242,1.248,1.255,1.261,1.268,1.275,1.281,1.288,1.295,1.301,1.308,1.315,1.322,1.329,1.336,1.343,1.35,1.357,1.364,1.371,1.378,1.385,1.392,1.4,1.407,1.414,1.422,1.429,1.437,1.444,1.452,1.459,1.467,1.474,1.482,1.49,1.498,1.505,1.513,1.521,1.529,1.537,1.545,1.553,1.561,1.569,1.577,1.586,1.594,1.602,1.611,1.619,1.627,1.636,1.644,1.653,1.662,1.67,1.679,1.688,1.696,1.705,1.714,1.723,1.732,1.741,1.75,1.759,1.768,1.778,1.787 Biomass_Inv,2164261.917,2153919.862,2143627.227,2133383.776,2123189.274,2113043.487,2102946.182,2092897.127,2082896.093,2072942.849,2063037.168,2053178.821,2043367.583,2033603.228,2023885.534,2014214.275,2004589.232,1995010.182,1985476.906,1975989.186,1966546.803,1957149.541,1947797.185,1938489.519,1929226.331,1920007.408,1910832.537,1901701.509,1892614.115,1883570.145,1874569.392,1865611.65,1856696.713,1847824.376,1838994.437,1830206.692,1821460.939,1812756.979,1804094.611,1795473.637,1786893.859,1778355.079,1769857.103,1761399.735,1752982.781,1744606.047,1736269.343,1727972.476,1719715.256,1711497.493,1703319,1695179.588,1687079.071,1679017.262,1670993.978,1663009.033,1655062.245,1647153.431,1639282.409,1631449,1624540.035,1617660.328,1610809.756,1603988.195,1597195.523,1590431.616,1583696.354,1576989.615,1570311.278,1563661.223,1557039.33,1550445.479,1543879.553,1537341.432,1530831,1524348.138,1517892.731,1511464.661,1505063.813,1498690.072,1492343.323,1486023.451,1479730.344,1473463.886,1467223.967,1461010.472,1454823.291,1448662.312,1442527.423,1436418.515,1430335.478,1424278.201,1418246.576,1412240.494,1406259.847,1400304.528,1394374.428,1388469.441,1382589.462,1376734.383,1370904.099,1365098.507,1359317.5,1353560.974,1347828.827,1342120.955,1336437.255,1330777.624,1325141.962,1319530.165,1313942.134,1308377.767,1302836.965,1297319.627,1291825.654,1286354.948,1280907.409,1275482.94,1270081.443,1264702.82,1259346.975,1254013.812,1248703.233,1243415.145,1238149.45,1232906.055,1227684.865,1222485.786,1217308.725,1212153.588,1207020.282,1201908.714,1196818.794,1191750.429,1186703.527,1181677.999,1176673.753,1171690.699,1166728.748,1161787.81,1156867.796,1151968.618,1147090.187,1142232.416,1137395.217,1132578.502,1127782.186,1123006.181,1118250.402,1113514.764,1108799.18,1104103.565,1099427.837,1094771.909,1090135.698,1085519.122,1080922.095,1076344.537,1071786.364,1067247.494,1062727.846 Biomass_OM,75749.167,75387.195,75026.953,74668.432,74311.625,73956.522,73603.116,73251.399,72901.363,72553,72206.301,71861.259,71517.865,71176.113,70835.994,70497.5,70160.623,69825.356,69491.692,69159.622,68829.138,68500.234,68172.901,67847.133,67522.922,67200.259,66879.139,66559.553,66241.494,65924.955,65609.929,65296.408,64984.385,64673.853,64364.805,64057.234,63751.133,63446.494,63143.311,62841.577,62541.285,62242.428,61944.999,61648.991,61354.397,61061.212,60769.427,60479.037,60190.034,59902.412,59616.165,59331.286,59047.767,58765.604,58484.789,58205.316,57927.179,57650.37,57374.884,57100.715,56827.856,56556.3,56286.043,56017.077,55749.396,55482.994,55217.865,54954.003,54691.402,54430.056,54169.959,53911.104,53653.487,53397.1,53141.939,52887.997,52635.269,52383.748,52133.429,51884.306,51636.374,51389.627,51144.058,50899.663,50656.436,50414.371,50173.463,49933.706,49695.095,49457.624,49221.288,48986.081,48751.998,48519.034,48287.183,48056.44,47826.799,47598.256,47370.805,47144.44,46919.158,46694.952,46471.817,46249.749,46028.742,45808.791,45589.891,45372.036,45155.223,44939.447,44724.701,44510.981,44298.283,44086.601,43875.93,43666.266,43457.605,43249.94,43043.267,42837.583,42632.881,42429.157,42226.407,42024.625,41823.808,41623.95,41425.048,41227.096,41030.09,40834.025,40638.897,40444.702,40251.434,40059.09,39867.666,39677.156,39487.556,39298.862,39111.07,38924.176,38738.174,38553.061,38368.833,38185.486,38003.014,37821.414,37640.682,37460.814,37281.805,37103.652,36926.35,36749.895,36574.284,36399.511,36225.574,36052.468,35880.189,35708.733,35538.097,35368.276,35199.267 Biomass_Eff,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35 Biogas_Inv,2521166.319,2510004.766,2498892.626,2487829.681,2476815.713,2465850.505,2454933.842,2444065.509,2433245.291,2422472.976,2411748.351,2401071.206,2390441.33,2379858.514,2369322.549,2358833.229,2348390.347,2337993.696,2327643.073,2317338.273,2307079.095,2296865.335,2286696.793,2276573.268,2266494.562,2256460.475,2246470.811,2236525.373,2226623.964,2216766.39,2206952.457,2197181.972,2187454.742,2177770.575,2168129.282,2158530.673,2148974.557,2139460.748,2129989.058,2120559.3,2111171.29,2101824.841,2092519.77,2083255.894,2074033.031,2064850.998,2055709.616,2046608.703,2037548.082,2028527.574,2019547,2010606.185,2001704.952,1992843.126,1984020.532,1975236.997,1966492.348,1957786.413,1949119.021,1940490,1935613.822,1930749.896,1925898.193,1921058.682,1916231.332,1911416.112,1906612.992,1901821.942,1897042.931,1892275.929,1887520.906,1882777.831,1878046.675,1873327.408,1868620,1863924.421,1859240.641,1854568.631,1849908.361,1845259.801,1840622.923,1835997.696,1831384.092,1826782.082,1822191.635,1817612.724,1813045.319,1808489.391,1803944.912,1799411.852,1794890.183,1790379.876,1785880.904,1781393.236,1776916.846,1772451.703,1767997.782,1763555.052,1759123.486,1754703.056,1750293.734,1745895.492,1741508.303,1737132.137,1732766.968,1728412.769,1724069.511,1719737.166,1715415.709,1711105.11,1706805.344,1702516.382,1698238.198,1693970.764,1689714.054,1685468.04,1681232.696,1677007.995,1672793.91,1668590.414,1664397.481,1660215.084,1656043.197,1651881.794,1647730.847,1643590.331,1639460.22,1635340.487,1631231.106,1627132.052,1623043.298,1618964.819,1614896.588,1610838.58,1606790.769,1602753.13,1598725.637,1594708.264,1590700.987,1586703.779,1582716.615,1578739.471,1574772.321,1570815.14,1566867.902,1562930.583,1559003.159,1555085.603,1551177.892,1547280,1543391.903,1539513.576,1535644.995,1531786.135,1527936.972,1524097.481,1520267.639,1516447.42,1512636.801,1508835.758,1505044.266 Biogas_OM,95804.32,95380.181,94957.92,94537.528,94118.997,93702.319,93287.486,92874.489,92463.321,92053.973,91646.437,91240.706,90836.771,90434.624,90034.257,89635.663,89238.833,88843.76,88450.437,88058.854,87669.006,87280.883,86894.478,86509.784,86126.793,85745.498,85365.891,84987.964,84611.711,84237.123,83864.193,83492.915,83123.28,82755.282,82388.913,82024.166,81661.033,81299.508,80939.584,80581.253,80224.509,79869.344,79515.751,79163.724,78813.255,78464.338,78116.965,77771.131,77426.827,77084.048,76742.786,76403.035,76064.788,75728.039,75392.78,75059.006,74726.709,74395.884,74066.523,73738.62,73412.169,73087.163,72763.596,72441.461,72120.753,71801.464,71483.589,71167.122,70852.055,70538.383,70226.1,69915.199,69605.675,69297.521,68990.731,68685.299,68381.22,68078.487,67777.094,67477.035,67178.305,66880.897,66584.806,66290.026,65996.551,65704.375,65413.493,65123.898,64835.586,64548.549,64262.784,63978.284,63695.043,63413.056,63132.318,62852.822,62574.564,62297.538,62021.738,61747.159,61473.796,61201.643,60930.694,60660.946,60392.391,60125.026,59858.844,59593.841,59330.01,59067.348,58805.849,58545.507,58286.318,58028.276,57771.377,57515.615,57260.986,57007.483,56755.103,56503.841,56253.69,56004.647,55756.707,55509.864,55264.114,55019.452,54775.874,54533.373,54291.946,54051.588,53812.294,53574.06,53336.88,53100.75,52865.666,52631.622,52398.615,52166.639,51935.69,51705.763,51476.855,51248.96,51022.073,50796.192,50571.31,50347.424,50124.528,49902.62,49681.694,49461.747,49242.773,49024.768,48807.729,48591.65,48376.528,48162.358,47949.137,47736.859,47525.522,47315.12,47105.649 Biogas_Eff,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3 Igcc_Inv,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1724880,1714903.352,1704984.408,1695122.835,1685318.302,1675570.477,1665879.033,1656243.645,1646663.987,1637139.737,1627670.576,1618256.184,1608896.244,1599590.442,1590338.464,1581140,1575417.997,1569716.701,1564036.037,1558375.932,1552736.31,1547117.097,1541518.219,1535939.604,1530381.177,1524842.865,1519324.596,1513826.297,1508347.896,1502889.321,1497450.5,1492031.361,1486631.834,1481251.847,1475891.33,1470550.213,1465228.424,1459925.894,1454642.554,1449378.333,1444133.164,1438906.976,1433699.701,1428511.271,1423341.617,1418190.672,1413058.368,1407944.637,1402849.412,1397772.626,1392714.213,1387674.106,1382652.238,1377648.544,1372662.958,1367695.415,1362745.848,1357814.193,1352900.386,1348004.362,1343126.055,1338265.403,1333422.341,1328596.806,1323788.733,1318998.061,1314224.726,1309468.665,1304729.816,1300008.116,1295303.504,1290615.917,1285945.294,1281291.574,1276654.695,1272034.597,1267431.218,1262844.499,1258274.378,1253720.797,1249183.694,1244663.011,1240158.687,1235670.665,1231198.884,1226743.286,1222303.813,1217880.405,1213473.006,1209081.556,1204705.999,1200346.276,1196002.331,1191674.106,1187361.545,1183064.591,1178783.186,1174517.276,1170266.804,1166031.714,1161811.95,1157607.457 Igcc_OM,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60370.8,60021.617,59674.454,59329.299,58986.141,58644.967,58305.766,57968.528,57633.24,57299.891,56968.47,56638.966,56311.369,55985.665,55661.846,55339.9,55139.63,54940.085,54741.261,54543.158,54345.771,54149.098,53953.138,53757.886,53563.341,53369.5,53176.361,52983.92,52792.176,52601.126,52410.767,52221.098,52032.114,51843.815,51656.197,51469.257,51282.995,51097.406,50912.489,50728.242,50544.661,50361.744,50179.49,49997.894,49816.957,49636.674,49457.043,49278.062,49099.729,48922.042,48744.997,48568.594,48392.828,48217.699,48043.204,47869.34,47696.105,47523.497,47351.514,47180.153,47009.412,46839.289,46669.782,46500.888,46332.606,46164.932,45997.865,45831.403,45665.544,45500.284,45335.623,45171.557,45008.085,44845.205,44682.914,44521.211,44360.093,44199.557,44039.603,43880.228,43721.429,43563.205,43405.554,43248.473,43091.961,42936.015,42780.633,42625.814,42471.555,42317.854,42164.71,42012.12,41860.082,41708.594,41557.654,41407.261,41257.412,41108.105,40959.338,40811.11,40663.418,40516.261 Igcc_Eff,0.383,0.384,0.386,0.388,0.39,0.391,0.393,0.395,0.397,0.399,0.4,0.402,0.404,0.406,0.408,0.41,0.411,0.413,0.415,0.417,0.419,0.421,0.423,0.425,0.427,0.429,0.43,0.432,0.434,0.436,0.438,0.44,0.442,0.444,0.446,0.448,0.45,0.453,0.455,0.457,0.459,0.461,0.463,0.465,0.467,0.469,0.471,0.474,0.476,0.478,0.48,0.482,0.484,0.487,0.489,0.491,0.493,0.495,0.498,0.5,0.501,0.503,0.504,0.505,0.507,0.508,0.509,0.511,0.512,0.513,0.515,0.516,0.517,0.519,0.52,0.522,0.523,0.525,0.527,0.529,0.531,0.532,0.534,0.536,0.538,0.539,0.541,0.543,0.545,0.547,0.549,0.55,0.552,0.554,0.556,0.558,0.56,0.561,0.563,0.565,0.567,0.569,0.571,0.573,0.575,0.577,0.579,0.58,0.582,0.584,0.586,0.588,0.59,0.592,0.594,0.596,0.598,0.6,0.602,0.604,0.606,0.608,0.61,0.612,0.614,0.616,0.618,0.621,0.623,0.625,0.627,0.629,0.631,0.633,0.635,0.637,0.639,0.642,0.644,0.646,0.648,0.65,0.652,0.655,0.657,0.659,0.661,0.663,0.666,0.668,0.67,0.672,0.674,0.677,0.679,0.681,0.684,0.686,0.688,0.69,0.693 IgccCCS_Inv,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2501076,2470860.002,2441009.049,2411518.731,2382384.692,2353602.627,2325168.284,2297077.462,2269326.01,2241909.83,2214824.87,2188067.128,2161632.653,2135517.537,2109717.923,2084230,2068456.653,2052802.678,2037267.171,2021849.237,2006547.984,1991362.531,1976292,1961335.522,1946492.235,1931761.28,1917141.809,1902632.977,1888233.947,1873943.888,1859761.976,1845687.391,1831719.323,1817856.964,1804099.514,1790446.181,1776896.175,1763448.715,1750103.024,1736858.333,1723713.878,1710668.898,1697722.643,1684874.364,1672123.32,1659468.776,1646910,1634446.269,1622076.862,1609801.067,1597618.174,1585527.481,1573528.289,1561619.907,1549801.646,1538072.826,1526432.769,1514880.803,1503416.262,1492038.484,1480746.812,1469540.596,1458419.187,1447381.944,1436428.231,1425557.415,1414768.869,1404061.97,1393436.1,1382890.646,1372425,1362038.557,1351730.719,1341500.889,1331348.478,1321272.9,1311273.574,1301349.922,1291501.372,1281727.355,1272027.307,1262400.669,1252846.885,1243365.403,1233955.677,1224617.163,1215349.322,1206151.62,1197023.526,1187964.513,1178974.058,1170051.642,1161196.75,1152408.872,1143687.5,1135032.131,1126442.265,1117917.407,1109457.065,1101060.75,1092727.978,1084458.269 IgccCCS_OM,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,87681.4,86641.008,85612.962,84597.113,83593.319,82601.434,81621.32,80652.834,79695.841,78750.203,77815.785,76892.455,75980.08,75078.532,74187.681,73307.4,72762.537,72221.723,71684.929,71152.125,70623.281,70098.367,69577.355,69060.216,68546.92,68037.439,67531.745,67029.81,66531.605,66037.103,65546.277,65059.099,64575.542,64095.579,63619.183,63146.328,62676.988,62211.136,61748.746,61289.793,60834.252,60382.096,59933.301,59487.842,59045.694,58606.832,58171.231,57738.869,57309.72,56883.761,56460.967,56041.316,55624.785,55211.349,54800.986,54393.673,53989.387,53588.107,53189.809,52794.471,52402.072,52012.589,51626.001,51242.286,50861.424,50483.392,50108.17,49735.737,49366.072,48999.154,48634.964,48273.481,47914.684,47558.554,47205.071,46854.215,46505.967,46160.308,45817.218,45476.677,45138.668,44803.171,44470.168,44139.64,43811.568,43485.935,43162.722,42841.912,42523.485,42207.426,41893.716,41582.337,41273.273,40966.506,40662.019,40359.795,40059.818,39762.07,39466.535,39173.196,38882.038,38593.044 IgccCCS_Eff,0.295,0.297,0.299,0.3,0.302,0.304,0.305,0.307,0.309,0.311,0.312,0.314,0.316,0.318,0.319,0.321,0.323,0.325,0.326,0.328,0.33,0.332,0.334,0.336,0.338,0.339,0.341,0.343,0.345,0.347,0.349,0.351,0.353,0.355,0.357,0.359,0.361,0.363,0.365,0.367,0.369,0.371,0.373,0.375,0.377,0.379,0.381,0.384,0.386,0.388,0.39,0.392,0.394,0.397,0.399,0.401,0.403,0.405,0.408,0.41,0.413,0.415,0.418,0.42,0.423,0.426,0.428,0.431,0.434,0.436,0.439,0.442,0.444,0.447,0.45,0.453,0.455,0.458,0.461,0.464,0.466,0.469,0.472,0.475,0.478,0.481,0.483,0.486,0.489,0.492,0.495,0.498,0.501,0.504,0.507,0.51,0.513,0.516,0.519,0.522,0.525,0.529,0.532,0.535,0.538,0.541,0.545,0.548,0.551,0.554,0.558,0.561,0.564,0.568,0.571,0.575,0.578,0.582,0.585,0.588,0.592,0.596,0.599,0.603,0.606,0.61,0.614,0.617,0.621,0.625,0.628,0.632,0.636,0.64,0.644,0.647,0.651,0.655,0.659,0.663,0.667,0.671,0.675,0.679,0.683,0.687,0.691,0.695,0.7,0.704,0.708,0.712,0.716,0.721,0.725,0.729,0.734,0.738,0.743,0.747,0.751 CcgtCCS_Inv,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1164294,1150227.932,1136331.799,1122603.547,1109041.15,1095642.602,1082405.925,1069329.163,1056410.384,1043647.679,1031039.163,1018582.974,1006277.269,994120.233,982110.068,970245,962902.235,955615.04,948382.994,941205.679,934082.682,927013.592,919998,913035.502,906125.695,899268.182,892462.566,885708.455,879005.458,872353.189,865751.265,859199.303,852696.926,846243.759,839839.429,833483.567,827175.806,820915.781,814703.132,808537.5,802418.529,796345.866,790319.161,784338.066,778402.235,772511.327,766665,760862.918,755104.746,749390.152,743718.805,738090.379,732504.548,726960.991,721459.387,715999.419,710580.772,705203.133,699866.191,694569.639,689313.171,684096.484,678919.277,673781.25,668682.108,663621.555,658599.301,653615.055,648668.529,643759.439,638887.5,634052.432,629253.955,624491.793,619765.671,615075.316,610420.457,605800.826,601216.156,596666.183,592150.643,587669.277,583221.826,578808.033,574427.643,570080.403,565766.064,561484.375,557235.09,553017.963,548832.751,544679.212,540557.108,536466.199,532406.25,528377.027,524378.296,520409.828,516471.392,512562.763,508683.714,504834.022 CcgtCCS_OM,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29466.7,29101.218,28740.27,28383.798,28031.748,27684.065,27340.693,27001.581,26666.675,26335.923,26009.273,25686.674,25368.077,25053.432,24742.689,24435.8,24245.931,24057.536,23870.606,23685.128,23501.091,23318.485,23137.297,22957.517,22779.134,22602.137,22426.515,22252.258,22079.355,21907.796,21737.569,21568.665,21401.074,21234.784,21069.787,20906.072,20743.629,20582.448,20422.52,20263.834,20106.381,19950.152,19795.137,19641.326,19488.71,19337.28,19187.027,19037.941,18890.014,18743.236,18597.598,18453.092,18309.709,18167.44,18026.277,17886.21,17747.232,17609.333,17472.507,17336.743,17202.034,17068.372,16935.748,16804.155,16673.585,16544.029,16415.479,16287.929,16161.369,16035.793,15911.193,15787.561,15664.889,15543.171,15422.398,15302.564,15183.661,15065.682,14948.62,14832.467,14717.217,14602.862,14489.396,14376.811,14265.101,14154.26,14044.279,13935.153,13826.875,13719.438,13612.836,13507.063,13402.111,13297.975,13194.648,13092.124,12990.396,12889.459,12789.306,12689.931,12591.329,12493.493 CcgtCCS_Eff,0.412,0.414,0.415,0.417,0.419,0.421,0.423,0.424,0.426,0.428,0.43,0.432,0.434,0.435,0.437,0.439,0.441,0.443,0.445,0.447,0.449,0.451,0.452,0.454,0.456,0.458,0.46,0.462,0.464,0.466,0.468,0.47,0.472,0.474,0.476,0.478,0.48,0.482,0.485,0.487,0.489,0.491,0.493,0.495,0.497,0.499,0.501,0.504,0.506,0.508,0.51,0.512,0.514,0.517,0.519,0.521,0.523,0.525,0.528,0.53,0.531,0.533,0.534,0.535,0.537,0.538,0.539,0.541,0.542,0.543,0.545,0.546,0.547,0.549,0.55,0.552,0.553,0.555,0.557,0.559,0.56,0.562,0.564,0.566,0.568,0.569,0.571,0.573,0.575,0.577,0.578,0.58,0.582,0.584,0.586,0.588,0.589,0.591,0.593,0.595,0.597,0.599,0.601,0.603,0.604,0.606,0.608,0.61,0.612,0.614,0.616,0.618,0.62,0.622,0.624,0.626,0.628,0.63,0.632,0.634,0.636,0.638,0.64,0.642,0.644,0.646,0.648,0.65,0.652,0.654,0.656,0.658,0.66,0.662,0.664,0.666,0.668,0.671,0.673,0.675,0.677,0.679,0.681,0.683,0.686,0.688,0.69,0.692,0.694,0.696,0.699,0.701,0.703,0.705,0.707,0.71,0.712,0.714,0.716,0.719,0.721 \ No newline at end of file diff --git a/emlab-generation/src/main/resources/scenarios/BL.xml b/emlab-generation/src/main/resources/scenarios/BL.xml new file mode 100644 index 00000000..d658912b --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/BL.xml @@ -0,0 +1,1146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1371 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1271 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountry-1.xml b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-1.xml new file mode 100644 index 00000000..65a3d3c7 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-1.xml @@ -0,0 +1,1253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1371 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1271 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountry-2.xml b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-2.xml new file mode 100644 index 00000000..803b3436 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-2.xml @@ -0,0 +1,1252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1371 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1271 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountry-3.xml b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-3.xml new file mode 100644 index 00000000..6a4a6688 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountry-3.xml @@ -0,0 +1,1253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1371 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.422 + + + + + + 0.1271 + + + + + + 0.10514 + + + + + + 0.04846 + + + + + + 0.0731 + + + + + + 0.1551 + + + + + + 0.0591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountryDE.properties b/emlab-generation/src/main/resources/scenarios/CmTwoCountryDE.properties new file mode 100644 index 00000000..79040ede --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountryDE.properties @@ -0,0 +1,158 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=3.6917419368 +coalPriceMin=0.9707458246 +coalPriceTop=1.0107458246 +coalPriceMax=1.0507458246 + +gasPriceStart=7.5 +gasPriceMin=0.9446627902 +gasPriceTop=1.0146627902 +gasPriceMax=1.0846627902 + +biomassPriceStart=4.5 +biomassPriceMin=0.97 +biomassPriceTop=1.01 +biomassPriceMax=1.05 + +uraniumPriceStart=1.286 +uraniumPriceMin=1 +uraniumPriceMax=1.02 +uraniumPriceTop=1.01 + +#coalPriceStart=3.6917419368 +#coalPriceMin=1 +#coalPriceTop=1 +#coalPriceMax=1 + +#gasPriceStart=7.5 +#gasPriceMin=1 +#gasPriceTop=1 +#gasPriceMax=1 + +#biomassPriceStart=4.5 +#biomassPriceMin=1 +#biomassPriceTop=1 +#biomassPriceMax=1 + +#uraniumPriceStart=1.286 +#uraniumPriceMin=1 +#uraniumPriceMax=1 +#uraniumPriceTop=1 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +#co2CapStart=351.75e6 +co2CapStart=72e10 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +demandGrowthNLStart=1 +demandGrowthNLMin=1 +demandGrowthNLTop=1 +demandGrowthNLMax=1 + +#demandGrowthDEStart=1 +#demandGrowthDEMin=0.99 +#demandGrowthDETop=1.02 +#demandGrowthDEMax=1.05 + +#demandGrowthNLStart=1 +#demandGrowthNLMin=0.99 +#demandGrowthNLTop=1.02 +#demandGrowthNLMax=1.05 + + +startCash=3e9 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=5000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 +simpleCapacityMarketEnabled=true + +capacityMarketPriceCap=58940 +reserveMargin=0.15 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountryNl.properties b/emlab-generation/src/main/resources/scenarios/CmTwoCountryNl.properties new file mode 100644 index 00000000..79040ede --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountryNl.properties @@ -0,0 +1,158 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=3.6917419368 +coalPriceMin=0.9707458246 +coalPriceTop=1.0107458246 +coalPriceMax=1.0507458246 + +gasPriceStart=7.5 +gasPriceMin=0.9446627902 +gasPriceTop=1.0146627902 +gasPriceMax=1.0846627902 + +biomassPriceStart=4.5 +biomassPriceMin=0.97 +biomassPriceTop=1.01 +biomassPriceMax=1.05 + +uraniumPriceStart=1.286 +uraniumPriceMin=1 +uraniumPriceMax=1.02 +uraniumPriceTop=1.01 + +#coalPriceStart=3.6917419368 +#coalPriceMin=1 +#coalPriceTop=1 +#coalPriceMax=1 + +#gasPriceStart=7.5 +#gasPriceMin=1 +#gasPriceTop=1 +#gasPriceMax=1 + +#biomassPriceStart=4.5 +#biomassPriceMin=1 +#biomassPriceTop=1 +#biomassPriceMax=1 + +#uraniumPriceStart=1.286 +#uraniumPriceMin=1 +#uraniumPriceMax=1 +#uraniumPriceTop=1 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +#co2CapStart=351.75e6 +co2CapStart=72e10 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +demandGrowthNLStart=1 +demandGrowthNLMin=1 +demandGrowthNLTop=1 +demandGrowthNLMax=1 + +#demandGrowthDEStart=1 +#demandGrowthDEMin=0.99 +#demandGrowthDETop=1.02 +#demandGrowthDEMax=1.05 + +#demandGrowthNLStart=1 +#demandGrowthNLMin=0.99 +#demandGrowthNLTop=1.02 +#demandGrowthNLMax=1.05 + + +startCash=3e9 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=5000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 +simpleCapacityMarketEnabled=true + +capacityMarketPriceCap=58940 +reserveMargin=0.15 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/CmTwoCountryNone.properties b/emlab-generation/src/main/resources/scenarios/CmTwoCountryNone.properties new file mode 100644 index 00000000..407b7d28 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/CmTwoCountryNone.properties @@ -0,0 +1,158 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=3.6917419368 +coalPriceMin=0.9707458246 +coalPriceTop=1.0107458246 +coalPriceMax=1.0507458246 + +gasPriceStart=7.5 +gasPriceMin=0.9446627902 +gasPriceTop=1.0146627902 +gasPriceMax=1.0846627902 + +biomassPriceStart=4.5 +biomassPriceMin=0.97 +biomassPriceTop=1.01 +biomassPriceMax=1.05 + +uraniumPriceStart=1.286 +uraniumPriceMin=1 +uraniumPriceMax=1.02 +uraniumPriceTop=1.01 + +#coalPriceStart=3.6917419368 +#coalPriceMin=1 +#coalPriceTop=1 +#coalPriceMax=1 + +#gasPriceStart=7.5 +#gasPriceMin=1 +#gasPriceTop=1 +#gasPriceMax=1 + +#biomassPriceStart=4.5 +#biomassPriceMin=1 +#biomassPriceTop=1 +#biomassPriceMax=1 + +#uraniumPriceStart=1.286 +#uraniumPriceMin=1 +#uraniumPriceMax=1 +#uraniumPriceTop=1 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +#co2CapStart=351.75e6 +co2CapStart=72e10 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +demandGrowthNLStart=1 +demandGrowthNLMin=1 +demandGrowthNLTop=1 +demandGrowthNLMax=1 + +#demandGrowthDEStart=1 +#demandGrowthDEMin=0.99 +#demandGrowthDETop=1.02 +#demandGrowthDEMax=1.05 + +#demandGrowthNLStart=1 +#demandGrowthNLMin=0.99 +#demandGrowthNLTop=1.02 +#demandGrowthNLMax=1.05 + + +startCash=3e9 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=5000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 +simpleCapacityMarketEnabled=false + +capacityMarketPriceCap=58940 +reserveMargin=0.15 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/DET-BL-110.xml b/emlab-generation/src/main/resources/scenarios/DET-BL-110.xml new file mode 100644 index 00000000..6c2f866a --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/DET-BL-110.xml @@ -0,0 +1,838 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/DET-BL-TT-81.xml b/emlab-generation/src/main/resources/scenarios/DET-BL-TT-81.xml new file mode 100644 index 00000000..11110ae7 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/DET-BL-TT-81.xml @@ -0,0 +1,838 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/RES-BL-119.xml b/emlab-generation/src/main/resources/scenarios/RES-BL-119.xml new file mode 100644 index 00000000..28df5328 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/RES-BL-119.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/RES-SR-66.xml b/emlab-generation/src/main/resources/scenarios/RES-SR-66.xml new file mode 100644 index 00000000..ed60f2e8 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/RES-SR-66.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-1-8.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-1-8.xml new file mode 100644 index 00000000..ecb2302b --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-1-8.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-2-11.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-2-11.xml new file mode 100644 index 00000000..c1315c7a --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-2-11.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-3-26.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-3-26.xml new file mode 100644 index 00000000..caf514a6 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-3-26.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-4-19.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-4-19.xml new file mode 100644 index 00000000..9f2f6f02 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-4-19.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-5-44.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-5-44.xml new file mode 100644 index 00000000..c7d10da9 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-5-44.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-6-12.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-6-12.xml new file mode 100644 index 00000000..6a495945 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-6-12.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-7-45.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-7-45.xml new file mode 100644 index 00000000..b526c797 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-7-45.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-8-100.xml b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-8-100.xml new file mode 100644 index 00000000..a05b6fd1 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/SENS-RES-SR-8-100.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/StaticDemand-1.xml b/emlab-generation/src/main/resources/scenarios/StaticDemand-1.xml new file mode 100644 index 00000000..6569a1bc --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/StaticDemand-1.xml @@ -0,0 +1,840 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TM-BL-108.xml b/emlab-generation/src/main/resources/scenarios/TM-BL-108.xml new file mode 100644 index 00000000..56434f7b --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TM-BL-108.xml @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TM-BL-111.xml b/emlab-generation/src/main/resources/scenarios/TM-BL-111.xml new file mode 100644 index 00000000..77cabfa0 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TM-BL-111.xml @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TM-BL-119.xml b/emlab-generation/src/main/resources/scenarios/TM-BL-119.xml new file mode 100644 index 00000000..8a095cb1 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TM-BL-119.xml @@ -0,0 +1,859 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TM-SR-82.xml b/emlab-generation/src/main/resources/scenarios/TM-SR-82.xml new file mode 100644 index 00000000..593296d8 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TM-SR-82.xml @@ -0,0 +1,831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.properties new file mode 100644 index 00000000..82a60fbf --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.properties @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=0 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=false +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.xml new file mode 100644 index 00000000..fd852151 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBC-1.xml @@ -0,0 +1,1487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.properties new file mode 100644 index 00000000..82a60fbf --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.properties @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=0 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=false +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.xml new file mode 100644 index 00000000..0f0788bf --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-1.xml @@ -0,0 +1,1576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.properties new file mode 100644 index 00000000..23f12db0 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.properties @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=470.635e6 +co2CapIncrement=-8.189049e6 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=true +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=false +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.xml new file mode 100644 index 00000000..6847ba16 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryBCres-2.xml @@ -0,0 +1,1576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.properties new file mode 100644 index 00000000..43a8d103 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.properties @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=0 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=true +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.xml new file mode 100644 index 00000000..6249d10b --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCM-1.xml @@ -0,0 +1,1487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.properties new file mode 100644 index 00000000..43a8d103 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.properties @@ -0,0 +1,142 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=0 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=true +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.xml new file mode 100644 index 00000000..c6db6042 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-1.xml @@ -0,0 +1,1576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.properties b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.properties new file mode 100644 index 00000000..3cea680e --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.properties @@ -0,0 +1,141 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=470.635e6 +co2CapIncrement=-8.189049e6 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.942294159 +demandGrowthDETop=1.0082073112 +demandGrowthDEMax=1.0548917102 +#demandGrowthDEMax=1.0548917102 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.9516263553 +demandGrowthNLTop=1.0194189818 +demandGrowthNLMax=1.0435267857 + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=true +simulationLength=50 + +interconnectorCapacity=4441 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=true +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 + diff --git a/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.xml b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.xml new file mode 100644 index 00000000..37d4525d --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/TwoCountryCMres-2.xml @@ -0,0 +1,1576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-108.xml b/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-108.xml new file mode 100644 index 00000000..06fe66ea --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-108.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-119.xml b/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-119.xml new file mode 100644 index 00000000..00679a57 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/ZERO_START_RES-BL-119.xml @@ -0,0 +1,873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + + + + + + 0.19 + + + + + + 0.13 + + + + + + 0.18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/parametersA-Old-CM.properties b/emlab-generation/src/main/resources/scenarios/parametersA-Old-CM.properties new file mode 100644 index 00000000..9de8a871 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersA-Old-CM.properties @@ -0,0 +1,99 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=1 +#coalPriceTop=1.00 +coalPriceTop=1 +#coalPriceMax=1.04 +coalPriceMax=1 + +gasPriceStart=0.25 +#gasPriceMin=0.95 +gasPriceMin=1 +#gasPriceTop=1.01 +gasPriceTop=1 +#gasPriceMax=1.07 +gasPriceMax=1 + +biomassPriceStart=100 +#biomassPriceMin=0.95 +biomassPriceMin=1 +#biomassPriceTop=1.01 +biomassPriceTop=1 +#biomassPriceMax=1.05 +biomassPriceMax=1 + +uraniumPriceStart=5000000 +uraniumPriceMin=1 +#uraniumPriceMax=1.02 +uraniumPriceMax=1 +#uraniumPriceTop=1.01 +uraniumPriceTop=1 +uraniumSeries=5000000,5050000,5100500,5151505,5203020.05,5255050.2505,5307600.753005,5360676.76053505,5414283.5281404,5468426.3634218,5523110.62705602,5578341.73332658,5634125.15065985,5690466.40216645,5747371.06618811,5804844.77684999,5862893.22461849,5921522.15686468,5980737.37843332,6040544.75221766,6100950.19973983,6161959.70173723,6223579.2987546,6285815.09174215,6348673.24265957,6412159.97508617,6476281.57483703,6541044.3905854,6606454.83449125,6672519.38283617,6739244.57666453,6806637.02243117,6874703.39265549,6943450.42658204,7012884.93084786,7083013.78015634,7153843.9179579,7225382.35713748,7297636.18070886,7370612.54251594,7444318.6679411,7518761.85462052,7593949.47316672,7669888.96789839,7746587.85757737,7824053.73615315,7902294.27351468,7981317.21624983,8061130.38841232,8141741.69229645,8223159.10921941,8305390.70031161,8388444.60731472,8472329.05338787,8557052.34392175,8642622.86736096,8729049.09603457,8816339.58699492,8904502.98286487,8993548.01269352,9083483.49282045 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=10e7 +#co2CapIncrement=-.5e6 +co2CapIncrement=0 +co2CapDuration=1 + +minCo2PriceStart=0 +minCo2PriceIncrement=0 +minCo2PriceDuration=20 + +segment1nl=9074 +segment2nl=10455 +segment3nl=11980 +segment4nl=13642 +segment5nl=15342 + +segment1de=13500 +segment2de=15200 +segment3de=18000 +segment4de=20000 +segment5de=22500 + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +demandGrowthNLStart=1 +demandGrowthNLMin=1 +demandGrowthNLTop=1 +demandGrowthNLMax=1 + +startCash=1e9 +priceMarkUp=1.1 + +co2TradingImplemented=false +simpleCapacityMarketEnabled=true +simulationLength=50 + +interconnectorCapacity=0 + +numberOfYearsBacklookingForForecasting=5 + +capacityMarketPriceCap=109500 +reserveMargin=0.15 +reserveDemandLowerMargin=0.05 +reserveDemandUpperMargin=0.05 + + diff --git a/emlab-generation/src/main/resources/scenarios/parametersB-DYN.properties b/emlab-generation/src/main/resources/scenarios/parametersB-DYN.properties new file mode 100644 index 00000000..e3d5f7d1 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersB-DYN.properties @@ -0,0 +1,64 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +co2CapStart=72e10 +co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2PriceStart=0 +minCo2PriceIncrement=0 +minCo2PriceDuration=1 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +startCash=5e10 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=40 + +interconnectorCapacity=0 + diff --git a/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry-CapacityMarket.properties b/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry-CapacityMarket.properties new file mode 100644 index 00000000..d44f3081 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry-CapacityMarket.properties @@ -0,0 +1,146 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +#coalPriceMin=0.97 +#coalPriceTop=1.00 +#coalPriceTop=1.01 +#coalPriceMax=1.04 +#coalPriceMax=1.05 + +coalPriceStart=100.8629923136 +coalPriceMin=1 +coalPriceTop=1 +coalPriceMax=1 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +gasPriceMin=1 +#gasPriceMin=0.9446627902 +gasPriceTop=1 +#gasPriceTop=1.0146627902 +gasPriceMax=1 +#gasPriceMax=1.0846627902 + +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +#gasPriceMin=0.96 +#gasPriceTop=1.01 +#gasPriceTop=1.03 +#gasPriceMax=1.07 +#gasPriceMax=1.10 + +biomassPriceStart=112.5 +biomassPriceMin=1 +#biomassPriceMin=0.97 +biomassPriceTop=1 +#biomassPriceTop=1.01 +biomassPriceMax=1 +#biomassPriceMax=1.05 + +#biomassPriceStart=112.5 +#biomassPriceMin=0.95 +#biomassPriceMin=0.97 +#biomassPriceTop=1.01 +#biomassPriceTop=1.01 +#biomassPriceMax=1.05 +#biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1 +uraniumPriceMax=1 +#uraniumPriceMax=1.02 +uraniumPriceTop=1 +#uraniumPriceTop=1.01 + +#uraniumPriceStart=5000000 +#uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +#uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +#uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +co2CapStart=72e10 +#co2CapIncrement=-1.104e6 +co2CapIncrement=0 +co2CapDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +minCo2PriceStart=0 +minCo2PriceIncrement=0 +minCo2PriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + + +demandGrowthNLStart=1 +demandGrowthNLMin=0.95 +demandGrowthNLTop=1.022 +demandGrowthNLMax=1.07 + +#demandGrowthNLStart=1 +#demandGrowthNLMin=1 +#demandGrowthNLTop=1 +#demandGrowthNLMax=1 + +startCash=3e9 +priceMarkUp=1 + +co2TradingImplemented=false +simpleCapacityMarketEnabled=true +simulationLength=50 + +interconnectorCapacity=0 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry.properties b/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry.properties index 7bcfe8f8..10abfc90 100644 --- a/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry.properties +++ b/emlab-generation/src/main/resources/scenarios/parametersB-OneCountry.properties @@ -116,21 +116,20 @@ segment18nl=17535.46 segment19nl=18179.78 segment20nl=18390.00 +demandGrowthNLStart=1 +demandGrowthNLMin=0.95 +demandGrowthNLTop=1.022 +demandGrowthNLMax=1.07 #demandGrowthNLStart=1 -#demandGrowthNLMin=0.99 -#demandGrowthNLTop=1.02 -#demandGrowthNLMax=1.05 - -demandGrowthNLStart=1 -demandGrowthNLMin=1 -demandGrowthNLTop=1 -demandGrowthNLMax=1 +#demandGrowthNLMin=1 +#demandGrowthNLTop=1 +#demandGrowthNLMax=1 startCash=3e9 priceMarkUp=1 -co2TradingImplemented=true +co2TradingImplemented=false simulationLength=50 interconnectorCapacity=0 diff --git a/emlab-generation/src/main/resources/scenarios/parametersB-TM-DE.properties b/emlab-generation/src/main/resources/scenarios/parametersB-TM-DE.properties new file mode 100644 index 00000000..488100f3 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersB-TM-DE.properties @@ -0,0 +1,98 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- + + +coalPriceStart=3.6917419368 +coalPriceMin=1 +coalPriceTop=1 +coalPriceMax=1 + +gasPriceStart=7.5 +gasPriceMin=1 +gasPriceTop=1 +gasPriceMax=1 + + +biomassPriceStart=4.5 +biomassPriceMin=1 +biomassPriceTop=1 +biomassPriceMax=1 + +uraniumPriceStart=1.286 +uraniumPriceMin=1 +uraniumPriceMax=1 +uraniumPriceTop=1 + +lignitePriceStart=1.428 +lignitePriceMin=1 +lignitePriceMax=1 +lignitePriceTop=1 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +co2CapStart=72e10 +co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2PriceStart=0 +minCo2PriceIncrement=0 +minCo2PriceDuration=1 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +startCash=5e10 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=40 + +interconnectorCapacity=0 + + diff --git a/emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE.properties b/emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE-CapacityMarket.properties similarity index 93% rename from emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE.properties rename to emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE-CapacityMarket.properties index 8f79ca96..2ad15151 100644 --- a/emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE.properties +++ b/emlab-generation/src/main/resources/scenarios/parametersB-ThermalMixDE-CapacityMarket.properties @@ -122,11 +122,17 @@ demandGrowthDEMax=1 startCash=8e10 priceMarkUp=1 -co2TradingImplemented=true -simulationLength=110 +co2TradingImplemented=false +simpleCapacityMarketEnabled=true +simulationLength=100 interconnectorCapacity=0 investmentFutureTimeHorizon=7 numberOfYearsBacklookingForForecasting=5 + +capacityMarketPriceCap=10000 +reserveMargin=0.5 +reserveDemandLowerMargin=0.05 +reserveDemandUpperMargin=0.05 diff --git a/emlab-generation/src/main/resources/scenarios/parametersC-ETS-CM-de.properties b/emlab-generation/src/main/resources/scenarios/parametersC-ETS-CM-de.properties new file mode 100644 index 00000000..60863dc2 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersC-ETS-CM-de.properties @@ -0,0 +1,124 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +#In EUR/GJ Real terms +coalPriceSeries=3.4342903691,2.8364179566,3.0588821101,3.2285110271,3.2451958386,3.2646614521,3.2813462636,3.300811877,3.3174966885,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3369623019,3.3318397721,3.3267172422,3.3215947124,3.3164721825,3.3113496527,3.3062271228,3.301104593,3.2959820631,3.2908595333,3.2857370034,3.2806144736,3.2754919437,3.2703694139,3.265246884,3.2601243542,3.2550018243,3.2498792945,3.2447567646,3.2396342348,3.2345117049,3.229389175,3.2242666452,3.2191441153,3.2140215855,3.2088990556,3.2037765258,3.1986539959,3.1935314661,3.1884089362,3.1832864064,3.1781638765,3.1730413467,3.1679188168,3.162796287,3.1576737571 +gasPriceSeries=6.1337281391,6.496939571,7.2868612059,8.0767828408,8.1488536615,8.2216174709,7.9256284194,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.6296393679,7.7083715378,7.7871037077,7.8658358777,7.9445680476,8.0233002175,8.1020323875,8.1807645574,8.2594967273,8.3382288973,8.4169610672,8.4956932371,8.5744254071,8.653157577,8.7318897469,8.8106219169,8.8893540868,8.9680862567,9.0468184267,9.1255505966,9.2042827665,9.2830149364,9.3617471064,9.4404792763,9.5192114462,9.5979436162,9.6766757861,9.7554079561,9.834140126,9.9128722959,9.9916044659,10.0703366358,10.1490688057,10.2278009757,10.3065331456,10.3852653156 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=1.00 +#biomassPriceTop=1.01 +biomassPriceTop=1.00 +#biomassPriceMax=1.05 +biomassPriceMax=1.00 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.00 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.00 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=351.75e6 +co2CapIncrement=-6.120624e6 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.99 +demandGrowthDETop=1.02 +demandGrowthDEMax=1.05 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.99 +demandGrowthNLTop=1.02 +demandGrowthNLMax=1.05 + +startCash=3e9 +priceMarkUp=1.1 + +co2TradingImplemented=true +simulationLength=50 + +interconnectorCapacity=4000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=true +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/parametersCM-SR.properties b/emlab-generation/src/main/resources/scenarios/parametersCM-SR.properties new file mode 100644 index 00000000..9b5004ac --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersCM-SR.properties @@ -0,0 +1,158 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=3.6917419368 +coalPriceMin=0.9707458246 +coalPriceTop=1.0107458246 +coalPriceMax=1.0507458246 + +gasPriceStart=7.5 +gasPriceMin=0.9446627902 +gasPriceTop=1.0146627902 +gasPriceMax=1.0846627902 + +biomassPriceStart=4.5 +biomassPriceMin=0.97 +biomassPriceTop=1.01 +biomassPriceMax=1.05 + +uraniumPriceStart=1.286 +uraniumPriceMin=1 +uraniumPriceMax=1.02 +uraniumPriceTop=1.01 + +#coalPriceStart=3.6917419368 +#coalPriceMin=1 +#coalPriceTop=1 +#coalPriceMax=1 + +#gasPriceStart=7.5 +#gasPriceMin=1 +#gasPriceTop=1 +#gasPriceMax=1 + +#biomassPriceStart=4.5 +#biomassPriceMin=1 +#biomassPriceTop=1 +#biomassPriceMax=1 + +#uraniumPriceStart=1.286 +#uraniumPriceMin=1 +#uraniumPriceMax=1 +#uraniumPriceTop=1 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +#co2CapStart=351.75e6 +co2CapStart=72e10 +co2CapIncrement=0 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2DEPriceStart=0 +minCo2DEPriceIncrement=0 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=0 +minCo2NLPriceIncrement=0 +minCo2NLPriceDuration=1 + +segment1nl=35311.89 +segment2nl=36657.44 +segment3nl=40401.68 +segment4nl=43606.1 +segment5nl=45600.58 +segment6nl=47414.54 +segment7nl=49337.31 +segment8nl=51439.43 +segment9nl=53771.93 +segment10nl=56143.54 +segment11nl=58402.19 +segment12nl=60234.9 +segment13nl=61923.03 +segment14nl=63697.04 +segment15nl=65580.2 +segment16nl=67797.75 +segment17nl=71192.97 +segment18nl=75390.2 +segment19nl=77408.11 +segment20nl=79884 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + + +demandGrowthDEStart=1 +demandGrowthDEMin=1 +demandGrowthDETop=1 +demandGrowthDEMax=1 + +demandGrowthNLStart=1 +demandGrowthNLMin=1 +demandGrowthNLTop=1 +demandGrowthNLMax=1 + +#demandGrowthDEStart=1 +#demandGrowthDEMin=0.99 +#demandGrowthDETop=1.02 +#demandGrowthDEMax=1.05 + +#demandGrowthNLStart=1 +#demandGrowthNLMin=0.99 +#demandGrowthNLTop=1.02 +#demandGrowthNLMax=1.05 + + +startCash=3e9 +priceMarkUp=1 + +co2TradingImplemented=false +simulationLength=50 + +interconnectorCapacity=5000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 +simpleCapacityMarketEnabled=1 + +capacityMarketPriceCap=58940 +reserveMargin=0.15 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/parametersE-MinCO2-resTarget-CM.properties b/emlab-generation/src/main/resources/scenarios/parametersE-MinCO2-resTarget-CM.properties new file mode 100644 index 00000000..15d9b350 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/parametersE-MinCO2-resTarget-CM.properties @@ -0,0 +1,139 @@ +#------------------------------------------------------------------------------- +# Copyright 2012 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#------------------------------------------------------------------------------- +coalPriceStart=100.8629923136 +#coalPriceStart=86.300754753 +#coalPriceStart=50.0 +#coalPriceMin=0.96 +coalPriceMin=0.9707458246 +#coalPriceTop=1.00 +coalPriceTop=1.0107458246 +#coalPriceMax=1.04 +coalPriceMax=1.0507458246 + +gasPriceStart=0.3246874961 +#gasPriceStart=0.2286412084 +#gasPriceMin=0.95 +gasPriceMin=0.9446627902 +#gasPriceTop=1.01 +gasPriceTop=1.0146627902 +#gasPriceMax=1.07 +gasPriceMax=1.0846627902 + +biomassPriceStart=112.5 +#biomassPriceMin=0.95 +biomassPriceMin=0.97 +#biomassPriceTop=1.01 +biomassPriceTop=1.01 +#biomassPriceMax=1.05 +biomassPriceMax=1.05 + +uraniumPriceStart=5000000 +uraniumPriceMin=1.00 +#uraniumPriceMax=1.02 +uraniumPriceMax=1.02 +#uraniumPriceTop=1.01 +uraniumPriceTop=1.01 + +co2TaxStart=0 +co2TaxIncrement=0 +co2TaxDuration=5 + +co2CapStart=351.75e6 +co2CapIncrement=-6.120624e6 +#co2CapIncrement=0 +co2CapDuration=1 + +minCo2EUPriceStart=0 +minCo2EUPriceIncrement=0 +minCo2PriceDuration=1 + +minCo2DEPriceStart=25 +minCo2DEPriceIncrement=1.5 +minCo2DEPriceDuration=1 + +minCo2NLPriceStart=25 +minCo2NLPriceIncrement=1.5 +minCo2NLPriceDuration=1 + +segment1nl=8160.778 +segment2nl=8390.36 +segment3nl=8961.656 +segment4nl=9448.219 +segment5nl=9828.25 +segment6nl=10333.58 +segment7nl=10887.66 +segment8nl=11438.97 +segment9nl=11957.73 +segment10nl=12498.55 +segment11nl=13155.53 +segment12nl=13819.34 +segment13nl=14395.3 +segment14nl=14826.11 +segment15nl=15221.23 +segment16nl=15797.4 +segment17nl=16622.16 +segment18nl=17535.46 +segment19nl=18179.78 +segment20nl=18390.00 + +segment1de=35311.89 +segment2de=36657.44 +segment3de=40401.68 +segment4de=43606.1 +segment5de=45600.58 +segment6de=47414.54 +segment7de=49337.31 +segment8de=51439.43 +segment9de=53771.93 +segment10de=56143.54 +segment11de=58402.19 +segment12de=60234.9 +segment13de=61923.03 +segment14de=63697.04 +segment15de=65580.2 +segment16de=67797.75 +segment17de=71192.97 +segment18de=75390.2 +segment19de=77408.11 +segment20de=79884 + +demandGrowthDEStart=1 +demandGrowthDEMin=0.98 +demandGrowthDETop=1.00 +demandGrowthDEMax=1.03 + +demandGrowthNLStart=1 +demandGrowthNLMin=0.99 +demandGrowthNLTop=1.02 +demandGrowthNLMax=1.05 + +startCash=5e9 +priceMarkUp=1.1 + +co2TradingImplemented=true +simulationLength=50 + +interconnectorCapacity=3000 + +investmentFutureTimeHorizon=7 + +numberOfYearsBacklookingForForecasting=5 + +simpleCapacityMarketEnabled=true +capacityMarketPriceCap=58940 +reserveMargin=0.156 +reserveDemandLowerMargin=0.025 +reserveDemandUpperMargin=0.025 diff --git a/emlab-generation/src/main/resources/scenarios/parametersE-WithCSVFileReader.properties.orig b/emlab-generation/src/main/resources/scenarios/parametersE-WithCSVFileReader.properties.orig new file mode 100644 index 00000000..e69de29b diff --git a/emlab-generation/src/main/resources/scenarios/scenarioA-Old-CM.xml b/emlab-generation/src/main/resources/scenarios/scenarioA-Old-CM.xml new file mode 100644 index 00000000..97e7c04e --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioA-Old-CM.xml @@ -0,0 +1,727 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.56 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.45 + + + + + + 0.20 + + + + + + 0.05 + + + + + + 0.20 + + + + + + 0.10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-CapacityMarket.xml b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-CapacityMarket.xml new file mode 100644 index 00000000..1c2e3bab --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-CapacityMarket.xml @@ -0,0 +1,842 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES-CM.xml b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES-CM.xml new file mode 100644 index 00000000..f43e759a --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES-CM.xml @@ -0,0 +1,887 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES.xml b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES.xml new file mode 100644 index 00000000..bcac9f98 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry-RES.xml @@ -0,0 +1,861 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry.xml b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry.xml index aabb1e89..ed4a69c2 100644 --- a/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry.xml +++ b/emlab-generation/src/main/resources/scenarios/scenarioB-OneCountry.xml @@ -117,7 +117,7 @@ + p:referencePrice="40" p:valueOfLostLoad="2000" p:lookback="5" p:backlookingForDemandForecastinginDismantling="5"> diff --git a/emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE.xml b/emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE-CapacityMarket.xml similarity index 96% rename from emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE.xml rename to emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE-CapacityMarket.xml index c318d2be..99fcc101 100644 --- a/emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE.xml +++ b/emlab-generation/src/main/resources/scenarios/scenarioB-ThermalMixDE-CapacityMarket.xml @@ -27,9 +27,26 @@ p:co2TradingImplemented="false" p:realRenewableDataImplemented="false" p:iterationSpeedFactor="3" p:iterationSpeedCriterion="0.005" p:capDeviationCriterion="0.03" + p:simpleCapacityMarketEnabled="${simpleCapacityMarketEnabled}" p:deletionOldPPDPBidsAndCashFlowsEnabled="true" p:deletionAge="4"> + + + + + + + + + + + @@ -312,6 +329,7 @@ + value="classpath:scenarios/parametersB-OneCountry-CapacityMarket.properties" /> - + \ No newline at end of file diff --git a/emlab-generation/src/main/resources/scenarios/scenarioC-ETS-CM-de.xml b/emlab-generation/src/main/resources/scenarios/scenarioC-ETS-CM-de.xml new file mode 100644 index 00000000..330dde60 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioC-ETS-CM-de.xml @@ -0,0 +1,1479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioC-MinCO2-CM.xml b/emlab-generation/src/main/resources/scenarios/scenarioC-MinCO2-CM.xml new file mode 100644 index 00000000..4ae52e90 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioC-MinCO2-CM.xml @@ -0,0 +1,1471 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioU-MinCO2-resTargetwithCM.xml b/emlab-generation/src/main/resources/scenarios/scenarioU-MinCO2-resTargetwithCM.xml new file mode 100644 index 00000000..9180645e --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioU-MinCO2-resTargetwithCM.xml @@ -0,0 +1,1575 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.33 + + + + + + 0.40 + + + + + + 0.16 + + + + + + 0.01 + + + + + + 0.03 + + + + + + 0.07 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1436 + + + + + + 0.1931 + + + + + + 0.1071 + + + + + + 0.0851 + + + + + + 0.0302 + + + + + + 0.072376 + + + + + + 0.1725 + + + + + + 0.1453 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/scenarios/scenarioU-bothMin-resTarget-ecoDism.xml b/emlab-generation/src/main/resources/scenarios/scenarioU-bothMin-resTarget-ecoDism.xml new file mode 100644 index 00000000..5c7d5e58 --- /dev/null +++ b/emlab-generation/src/main/resources/scenarios/scenarioU-bothMin-resTarget-ecoDism.xml @@ -0,0 +1,1652 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.123 + + + + + + 0.061 + + + + + + 0.134 + + + + + + 0.108 + + + + + + 0.008 + + + + + + 0.012 + + + + + + 0.080 + + + + + + 0.270 + + + + + + 0.107 + + + + + + 0.058 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.307 + + + + + + 0.262 + + + + + + 0.188 + + + + + + 0.0302 + + + + + + 0.119 + + + + + + 0.047 + + + + + + 0.0 + + + + + + 0.018 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/main/resources/settings.xml b/emlab-generation/src/main/resources/settings.xml index ad7faa7d..4dceee5b 100644 --- a/emlab-generation/src/main/resources/settings.xml +++ b/emlab-generation/src/main/resources/settings.xml @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/emlab-generation/src/test/java/emlab/gen/role/IntermittentElectricityMarketWithInterconnectorTest.java b/emlab-generation/src/test/java/emlab/gen/role/IntermittentElectricityMarketWithInterconnectorTest.java index e6ddfea7..eefc732f 100644 --- a/emlab-generation/src/test/java/emlab/gen/role/IntermittentElectricityMarketWithInterconnectorTest.java +++ b/emlab-generation/src/test/java/emlab/gen/role/IntermittentElectricityMarketWithInterconnectorTest.java @@ -709,10 +709,13 @@ public void electricityMarketTestWithALotRenewablesForCurrentTick() { assertEquals("CoalInM1 right amount", 700, plan.getAmount(), 0.001); switch (s.getSegmentID()) { case 1: + logger.warn("CoalInM1, S1 , " + plan.getAcceptedAmount()); assertEquals("CoalInM1 right accepted amount in S1", 700, plan.getAcceptedAmount(), 0.001); break; case 2: + logger.warn("CoalInM1, S2 , " + plan.getAcceptedAmount()); assertEquals("CoalInM1 right accepted amount in S2", 572.055, plan.getAcceptedAmount(), 0.001); + break; } } else if (plan.getPowerPlant().getName().equals("CoalInM2")) { assertEquals("CoalInM2 right price", 27, plan.getBidWithoutCO2(), 0.001); diff --git a/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRoleTest.java b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRoleTest.java new file mode 100644 index 00000000..a325eeff --- /dev/null +++ b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ClearCapacityMarketRoleTest.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.repository.CapacityMarketRepository; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/emlab-gen-test-context.xml" }) +@Transactional +public class ClearCapacityMarketRoleTest { + + Logger logger = Logger.getLogger(ClearCapacityMarketRole.class); + + @Autowired + Reps reps; + + @Autowired + CapacityMarketRepository capacityMarketRepository; + + @Autowired + ClearCapacityMarketRole clearCapacityMarketRoleTest; + + @Test + public void ClearCapacityMarketBasicFunctionality() { + + CapacityMarket market = new CapacityMarket(); + market.persist(); + + Zone zone = new Zone(); + zone.persist(); + + Regulator regulator = new Regulator(); + + regulator.setDemandTarget(100); + regulator.setCapacityMarketPriceCap(10); + // regulator.setReserveMargin(0.156); + regulator.setReserveDemandLowerMargin(0.15); + regulator.setReserveDemandUpperMargin(0.05); + regulator.setZone(zone); + regulator.persist(); + + CapacityDispatchPlan cdp1 = new CapacityDispatchPlan(); + cdp1.setAmount(8); + cdp1.setPrice(0); + cdp1.setTime(0l); + cdp1.setStatus(1); + cdp1.persist(); + + CapacityDispatchPlan cdp2 = new CapacityDispatchPlan(); + cdp2.setAmount(20); + cdp2.setPrice(0); + cdp2.setTime(0l); + cdp2.setStatus(1); + cdp2.persist(); + + CapacityDispatchPlan cdp3 = new CapacityDispatchPlan(); + cdp3.setAmount(70); + cdp3.setPrice(1); + cdp3.setTime(0l); + cdp3.setStatus(1); + cdp3.persist(); + + CapacityDispatchPlan cdp4 = new CapacityDispatchPlan(); + cdp4.setAmount(10); + cdp4.setPrice(20); + cdp4.setTime(0l); + cdp4.setStatus(1); + cdp4.persist(); + + clearCapacityMarketRoleTest.act(regulator); + + logger.warn("Status of CDP 1 is " + cdp1.getStatus()); + logger.warn("Status of CDP 2 is " + cdp2.getStatus()); + logger.warn("Status of CDP 3 is " + cdp3.getStatus()); + logger.warn("Status of (overpriced) CDP 4 is " + cdp4.getStatus()); + + // CapacityClearingPoint capacityClearingPoint = + // reps.capacityMarketRepository + // .findOneCapacityClearingPointForTime(0); + + // logger.warn("Clearing point Price" + + // capacityClearingPoint.getPrice()); + // logger.warn("Clearing Point Volume" + + // capacityClearingPoint.getVolume()); + + } + +} diff --git a/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest.java b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest.java new file mode 100644 index 00000000..3cd978d7 --- /dev/null +++ b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest.java @@ -0,0 +1,137 @@ +/******************************************************************************* +` * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import static org.junit.Assert.assertTrue; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.Segment; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.repository.MarketRepository; +import emlab.gen.repository.Reps; +import emlab.gen.trend.TriangularTrend; + +/** + * @author Kaveri + * + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/emlab-gen-test-context.xml" }) +@Transactional +public class ForecastDemandRoleTest { + Logger logger = Logger.getLogger(ForecastDemandRole.class); + + @Autowired + Reps reps; + + @Autowired + MarketRepository marketRepository; + + @Autowired + ForecastDemandRole fDemandRole; + + @Test + public void checkForecastDemandFunctionality() { + + Zone zone = new Zone(); + zone.persist(); + Regulator regulator = new Regulator(); + regulator.setTargetPeriod(0); + regulator.setReserveMargin(0.15); + regulator.setNumberOfYearsLookingBackToForecastDemand(3); + regulator.setZone(zone); + regulator.persist(); + + Segment S1 = new Segment(); + S1.setLengthInHours(20); + S1.persist(); + + Segment S2 = new Segment(); + S2.setLengthInHours(30); + S2.persist(); + + SegmentLoad SG1 = new SegmentLoad(); + SG1.setSegment(S2); + SG1.setBaseLoad(2500); + SG1.persist(); + // SegmentLoad SG2 = new SegmentLoad(); + // SG2.setSegment(S2); + // SG2.setBaseLoad(2000); + + SegmentLoad SG3 = new SegmentLoad(); + SG3.setSegment(S1); + SG3.setBaseLoad(3700); + + // SegmentLoad SG4 = new SegmentLoad(); + // SG4.setSegment(S1); + // SG4.setBaseLoad(4000); + + // SG2.persist(); + SG3.persist(); + // SG4.persist(); + + Set segmentLoads1 = new HashSet(); + segmentLoads1.add(SG1); + segmentLoads1.add(SG3); + // + // TimeSeriesImpl demandGrowthTrend = new TimeSeriesImpl(); + // int lengthOfSeries = 50; + // double[] timeSeries = new double[lengthOfSeries]; + // timeSeries[0] = 1; + // for (int i = 1; i <= lengthOfSeries; i++) { + // timeSeries[i] = timeSeries[i - 1] * 1.02; + // } + + TriangularTrend demandGrowthTrend = new TriangularTrend(); + demandGrowthTrend.setMax(2); + demandGrowthTrend.setMin(1); + demandGrowthTrend.setStart(1); + demandGrowthTrend.setTop(1); + + // demandGrowthTrend.setTimeSeries(timeSeries); + // demandGrowthTrend.setStartingYear(0); + demandGrowthTrend.persist(); + + ElectricitySpotMarket market1 = new ElectricitySpotMarket(); + market1.setName("Market1"); + market1.setLoadDurationCurve(segmentLoads1); + market1.setDemandGrowthTrend(demandGrowthTrend); + market1.setZone(zone); + market1.persist(); + + fDemandRole.act(regulator); + + logger.warn("Target Demand for this tick: " + regulator.getDemandTarget()); + assertTrue(regulator.getDemandTarget() == 4255); + // logger.warn("Target Demand for this tick: " + + // fDemandRole.expectedDemandFactor); + + } +} diff --git a/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest2.java b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest2.java new file mode 100644 index 00000000..5d6678f7 --- /dev/null +++ b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/ForecastDemandRoleTest2.java @@ -0,0 +1,361 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.agent.Regulator; +import emlab.gen.domain.contract.Loan; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.PowerPlantDispatchPlan; +import emlab.gen.domain.market.electricity.Segment; +import emlab.gen.domain.market.electricity.SegmentClearingPoint; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.domain.technology.PowerGeneratingTechnology; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.repository.BidRepository; +import emlab.gen.repository.MarketRepository; +import emlab.gen.repository.PowerPlantDispatchPlanRepository; +import emlab.gen.repository.Reps; +import emlab.gen.repository.SegmentLoadRepository; +import emlab.gen.repository.ZoneRepository; +import emlab.gen.trend.TriangularTrend; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/emlab-gen-test-context.xml" }) +@Transactional +public class ForecastDemandRoleTest2 { + Logger logger = Logger.getLogger(ForecastDemandRole.class); + + @Autowired + Reps reps; + + @Autowired + SegmentLoadRepository segmentLoadRepository; + + @Autowired + MarketRepository marketRepository; + + @Autowired + BidRepository bidRepository; + + @Autowired + PowerPlantDispatchPlanRepository plantDispatchPlanRepository; + + @Autowired + ZoneRepository zoneRepository; + + @Autowired + ForecastDemandRole fDemandRole; + + @Test + public void ZonalTest() { + + Zone zone1 = new Zone(); + // Zone zone2 = new Zone(); + zone1.setName("Zone 1"); + + // zone2.setName("Zone2"); + + zone1.persist(); + + // zone2.persist(); + + Segment S1 = new Segment(); + S1.setLengthInHours(20); + S1.persist(); + + Segment S2 = new Segment(); + S2.setLengthInHours(30); + S2.persist(); + + SegmentLoad SG1 = new SegmentLoad(); + SG1.setSegment(S2); + SG1.setBaseLoad(2500); + + // SegmentLoad SG2 = new SegmentLoad(); + // SG2.setSegment(S2); + // SG2.setBaseLoad(2000); + + SegmentLoad SG3 = new SegmentLoad(); + SG3.setSegment(S1); + SG3.setBaseLoad(3700); + + // SegmentLoad SG4 = new SegmentLoad(); + // SG4.setSegment(S1); + // SG4.setBaseLoad(4000); + + SG1.persist(); + // SG2.persist(); + SG3.persist(); + // SG4.persist(); + + Set segmentLoads1 = new HashSet(); + segmentLoads1.add(SG1); + segmentLoads1.add(SG3); + + // Set segmentLoads2 = new HashSet(); + // segmentLoads2.add(SG2); + // segmentLoads2.add(SG4); + + TriangularTrend demandGrowthTrend = new TriangularTrend(); + demandGrowthTrend.setMax(2); + demandGrowthTrend.setMin(0); + demandGrowthTrend.setStart(1); + demandGrowthTrend.setTop(1); + + demandGrowthTrend.persist(); + + ElectricitySpotMarket market1 = new ElectricitySpotMarket(); + market1.setName("Market1"); + market1.setZone(zone1); + market1.setLoadDurationCurve(segmentLoads1); + market1.setDemandGrowthTrend(demandGrowthTrend); + market1.persist(); + + // ElectricitySpotMarket market2 = new ElectricitySpotMarket(); + // market2.setZone(zone2); + // market2.setName("Market2"); + // market2.setLoadDurationCurve(segmentLoads2); + // market2.setDemandGrowthTrend(demandGrowthTrend); + // market2.persist(); + + PowerGeneratingTechnology coal1 = new PowerGeneratingTechnology(); + + PowerGeneratingTechnology coal2 = new PowerGeneratingTechnology(); + + PowerGeneratingTechnology gas1 = new PowerGeneratingTechnology(); + + PowerGeneratingTechnology gas2 = new PowerGeneratingTechnology(); + + coal1.persist(); + coal2.persist(); + gas1.persist(); + gas2.persist(); + + EnergyProducer e1 = new EnergyProducer(); + e1.setName("E1"); + e1.setCash(0); + e1.setPriceMarkUp(1); + + EnergyProducer e2 = new EnergyProducer(); + e2.setCash(0); + e2.setPriceMarkUp(1); + e2.setName("E2"); + + EnergyProducer e3 = new EnergyProducer(); + e3.setCash(0); + e3.setPriceMarkUp(1); + e3.setName("E3"); + + e1.persist(); + e2.persist(); + e3.persist(); + + Loan l1 = new Loan(); + l1.setAmountPerPayment(6000); + l1.setNumberOfPaymentsDone(10); + l1.setTotalNumberOfPayments(15); + + Loan l2 = new Loan(); + l2.setAmountPerPayment(5000); + l2.setNumberOfPaymentsDone(29); + l2.setTotalNumberOfPayments(19); + + Loan l3 = new Loan(); + l3.setAmountPerPayment(4000); + l3.setNumberOfPaymentsDone(8); + l3.setTotalNumberOfPayments(13); + + Loan l4 = new Loan(); + l4.setAmountPerPayment(3000); + l4.setNumberOfPaymentsDone(7); + l4.setTotalNumberOfPayments(12); + + Loan l5 = new Loan(); + l5.setAmountPerPayment(2000); + l5.setNumberOfPaymentsDone(6); + l5.setTotalNumberOfPayments(11); + + Loan l6 = new Loan(); + l6.setAmountPerPayment(1000); + l6.setNumberOfPaymentsDone(5); + l6.setTotalNumberOfPayments(10); + + l1.persist(); + l2.persist(); + l3.persist(); + l4.persist(); + l5.persist(); + l6.persist(); + + PowerPlant pp1 = new PowerPlant(); + pp1.setTechnology(coal1); + pp1.setOwner(e1); + pp1.setActualFixedOperatingCost(99000); + pp1.setLoan(l1); + // pp1.setName("PP1"); + + PowerPlant pp2 = new PowerPlant(); + pp2.setTechnology(coal2); + pp2.setOwner(e2); + pp2.setActualFixedOperatingCost(111000); + pp2.setLoan(l2); + // pp2.setName("PP2"); + + PowerPlant pp3 = new PowerPlant(); + pp3.setTechnology(gas1); + pp3.setOwner(e3); + pp3.setActualFixedOperatingCost(56000); + pp3.setLoan(l3); + + PowerPlant pp4 = new PowerPlant(); + pp4.setTechnology(gas2); + pp4.setOwner(e3); + pp4.setActualFixedOperatingCost(65000); + pp4.setLoan(l4); + + PowerPlant pp5 = new PowerPlant(); + pp5.setTechnology(gas1); + pp5.setOwner(e2); + pp5.setActualFixedOperatingCost(56000); + pp5.setLoan(l5); + + PowerPlant pp6 = new PowerPlant(); + pp6.setTechnology(gas2); + pp6.setOwner(e1); + pp6.setActualFixedOperatingCost(65000); + pp6.setLoan(l6); + + pp1.persist(); + pp2.persist(); + pp3.persist(); + pp4.persist(); + pp5.persist(); + pp6.persist(); + + // for Zone 1 Segment 1 + PowerPlantDispatchPlan p1 = new PowerPlantDispatchPlan(); + p1.setAmount(1500.0d); + p1.setSegment(S1); + p1.setPrice(5.0d); + p1.setTime(0l); + p1.setBiddingMarket(market1); + p1.setPowerPlant(pp1); + p1.setBidder(e1); + p1.setStatus(3); + p1.setAcceptedAmount(1500); + p1.persist(); + + PowerPlantDispatchPlan p11 = new PowerPlantDispatchPlan(); + p11.setAmount(1000.0d); + p11.setSegment(S1); + p11.setPrice(15.0d); + p11.setTime(0l); + p11.setBiddingMarket(market1); + p11.setPowerPlant(pp2); + p11.setBidder(e2); + p11.setStatus(3); + p11.setAcceptedAmount(1000); + p11.persist(); + + PowerPlantDispatchPlan p111 = new PowerPlantDispatchPlan(); + p111.setAmount(1200.0d); + p111.setSegment(S1); + p111.setPrice(7.0d); + p111.setTime(0l); + p111.setBiddingMarket(market1); + p111.setPowerPlant(pp3); + p111.setBidder(e3); + p111.setStatus(3); + p111.setAcceptedAmount(1200); + p111.persist(); + + // For Zone 1 segment 2 + PowerPlantDispatchPlan p1111 = new PowerPlantDispatchPlan(); + p1111.setAmount(1500.0d); + p1111.setSegment(S2); + p1111.setPrice(5.0d); + p1111.setTime(0l); + p1111.setBiddingMarket(market1); + p1111.setPowerPlant(pp1); + p1111.setBidder(e1); + p1111.setStatus(3); + p1111.setAcceptedAmount(1500); + p1111.persist(); + + PowerPlantDispatchPlan p11111 = new PowerPlantDispatchPlan(); + p11111.setAmount(1000.0d); + p11111.setSegment(S2); + p11111.setPrice(15.0d); + p11111.setTime(0l); + p11111.setBiddingMarket(market1); + p11111.setPowerPlant(pp2); + p11111.setBidder(e2); + p11111.setStatus(-1); + p11111.setAcceptedAmount(0); + p11111.persist(); + + PowerPlantDispatchPlan p111111 = new PowerPlantDispatchPlan(); + p111111.setAmount(1200.0d); + p111111.setSegment(S2); + p111111.setPrice(7.0d); + p111111.setTime(0l); + p111111.setBiddingMarket(market1); + p111111.setPowerPlant(pp3); + p111111.setBidder(e3); + p111111.setStatus(2); + p111111.setAcceptedAmount(1000); + p111111.persist(); + + SegmentClearingPoint clearingPoint1 = new SegmentClearingPoint(); + clearingPoint1.setSegment(S1); + clearingPoint1.setAbstractMarket(market1); + clearingPoint1.setPrice(25); + clearingPoint1.setTime(0l); + + SegmentClearingPoint clearingPoint111 = new SegmentClearingPoint(); + clearingPoint111.setSegment(S2); + clearingPoint111.setAbstractMarket(market1); + clearingPoint111.setPrice(7); + clearingPoint111.setTime(0l); + + clearingPoint1.persist(); + clearingPoint111.persist(); + + Regulator regulator = new Regulator(); + regulator.setTargetPeriod(0); + regulator.setReserveMargin(0.15); + regulator.setNumberOfYearsLookingBackToForecastDemand(3); + regulator.setZone(zone1); + regulator.persist(); + + fDemandRole.act(regulator); + + logger.warn("Target Demand for this tick: " + regulator.getDemandTarget()); + } +} \ No newline at end of file diff --git a/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerforCapacityRoleTest.java b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerforCapacityRoleTest.java new file mode 100644 index 00000000..b747fe25 --- /dev/null +++ b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/PaymentFromConsumerToProducerforCapacityRoleTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.EnergyConsumer; +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.capacity.CapacityClearingPoint; +import emlab.gen.domain.market.capacity.CapacityDispatchPlan; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.repository.Reps; + +/** + * @author Kaveri + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/emlab-gen-test-context.xml" }) +@Transactional +public class PaymentFromConsumerToProducerforCapacityRoleTest { + + @Autowired + Reps reps; + + /** + * + */ + + @Autowired + PaymentFromConsumerToProducerForCapacityRole paymentFromConsumerToProducerForCapacityRole; + + Logger logger = Logger.getLogger(PaymentFromConsumerToProducerForCapacityRole.class); + + @Test + public void capacityMarketPaymentFunctionality() { + + Zone zone = new Zone(); + zone.persist(); + + EnergyProducer ep1 = new EnergyProducer(); + EnergyProducer ep2 = new EnergyProducer(); + ep1.persist(); + ep2.persist(); + + EnergyConsumer consumer = new EnergyConsumer(); + consumer.persist(); + + CapacityMarket market = new CapacityMarket(); + market.setConsumer(consumer); + market.setZone(zone); + market.persist(); + + ElectricitySpotMarket esm = new ElectricitySpotMarket(); + esm.setZone(zone); + esm.persist(); + + CapacityClearingPoint clearingPoint = new CapacityClearingPoint(); + clearingPoint.setCapacityMarket(market); + clearingPoint.setPrice(1); + clearingPoint.setTime(0l); + clearingPoint.persist(); + + PowerPlant pp1 = new PowerPlant(); + PowerPlant pp2 = new PowerPlant(); + PowerPlant pp3 = new PowerPlant(); + PowerPlant pp4 = new PowerPlant(); + + pp1.persist(); + pp2.persist(); + pp3.persist(); + pp4.persist(); + + CapacityDispatchPlan cdp1 = new CapacityDispatchPlan(); + cdp1.setBidder(ep1); + cdp1.setBiddingMarket(market); + cdp1.setTime(0l); + cdp1.setAcceptedAmount(100); + cdp1.setPlant(pp1); + cdp1.setStatus(3); + cdp1.persist(); + + CapacityDispatchPlan cdp2 = new CapacityDispatchPlan(); + cdp2.setBidder(ep1); + cdp2.setBiddingMarket(market); + cdp2.setTime(0l); + cdp2.setAcceptedAmount(80); + cdp2.setPlant(pp2); + cdp2.setStatus(2); + cdp2.persist(); + + CapacityDispatchPlan cdp3 = new CapacityDispatchPlan(); + cdp3.setBidder(ep2); + cdp3.setBiddingMarket(market); + cdp3.setTime(0l); + cdp3.setAcceptedAmount(150); + cdp3.setPlant(pp3); + cdp3.setStatus(3); + cdp3.persist(); + + CapacityDispatchPlan cdp4 = new CapacityDispatchPlan(); + cdp4.setBidder(ep2); + cdp4.setBiddingMarket(market); + cdp4.setTime(0l); + cdp4.setAcceptedAmount(100); + cdp4.setPlant(pp4); + cdp4.setStatus(3); + cdp4.persist(); + + logger.warn("Consumer's Cash before Payment Process " + consumer.getCash()); + logger.warn("Energy Producer1's Cash before Payment Process" + ep1.getCash()); + logger.warn("Energy Producer2's Cash before Payment Process" + ep2.getCash()); + + paymentFromConsumerToProducerForCapacityRole.act(market); + + logger.warn("Consumer's Cash After Payment Process " + consumer.getCash()); + logger.warn("Energy Producer1's Cash After Payment Process" + ep1.getCash()); + logger.warn("Energy Producer2's Cash After Payment Process" + ep2.getCash()); + + } + +} diff --git a/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRoleTest.java b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRoleTest.java new file mode 100644 index 00000000..200f64f4 --- /dev/null +++ b/emlab-generation/src/test/java/emlab/gen/role/capacitymarket/SubmitCapacityBidToMarketRoleTest.java @@ -0,0 +1,303 @@ +/******************************************************************************* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package emlab.gen.role.capacitymarket; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import emlab.gen.domain.agent.EnergyProducer; +import emlab.gen.domain.gis.Zone; +import emlab.gen.domain.market.capacity.CapacityMarket; +import emlab.gen.domain.market.electricity.ElectricitySpotMarket; +import emlab.gen.domain.market.electricity.PowerPlantDispatchPlan; +import emlab.gen.domain.market.electricity.Segment; +import emlab.gen.domain.market.electricity.SegmentClearingPoint; +import emlab.gen.domain.market.electricity.SegmentLoad; +import emlab.gen.domain.technology.PowerGeneratingTechnology; +import emlab.gen.domain.technology.PowerGridNode; +import emlab.gen.domain.technology.PowerPlant; +import emlab.gen.repository.Reps; +import emlab.gen.trend.TriangularTrend; + +/** + * @author Kaveri + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/emlab-gen-test-context.xml" }) +@Transactional +public class SubmitCapacityBidToMarketRoleTest { + + Logger logger = Logger.getLogger(SubmitCapacityBidToMarketRole.class); + + @Autowired + Reps reps; + + @Autowired + SubmitCapacityBidToMarketRole submitCapacityBidRole; + + @Test + public void testSubmitBidFunctionality1() { + // for bidding a positive value + Segment S1 = new Segment(); + S1.setLengthInHours(20); + S1.persist(); + + Segment S2 = new Segment(); + S2.setLengthInHours(30); + S2.persist(); + + SegmentLoad SG1 = new SegmentLoad(); + SG1.setSegment(S2); + SG1.setBaseLoad(2500); + + // SegmentLoad SG2 = new SegmentLoad(); + // SG2.setSegment(S2); + // SG2.setBaseLoad(2000); + + SegmentLoad SG3 = new SegmentLoad(); + SG3.setSegment(S1); + SG3.setBaseLoad(3700); + + // SegmentLoad SG4 = new SegmentLoad(); + // SG4.setSegment(S1); + // SG4.setBaseLoad(4000); + + SG1.persist(); + // SG2.persist(); + SG3.persist(); + // SG4.persist(); + + Set segmentLoads = new HashSet(); + segmentLoads.add(SG1); + segmentLoads.add(SG3); + + // Set segmentLoads2 = new HashSet(); + // segmentLoads2.add(SG2); + // segmentLoads2.add(SG4); + + /* + * TriangularTrend demandGrowthTrend = new TriangularTrend(); + * demandGrowthTrend.setMax(2); demandGrowthTrend.setMin(0); + * demandGrowthTrend.setStart(1); demandGrowthTrend.setTop(1); + * + * demandGrowthTrend.persist(); + */ + + Zone zone = new Zone(); + zone.persist(); + + PowerGridNode location = new PowerGridNode(); + location.setZone(zone); + location.persist(); + + ElectricitySpotMarket market = new ElectricitySpotMarket(); + market.setName("Market1"); + market.setZone(zone); + market.setLoadDurationCurve(segmentLoads); + // market.setDemandGrowthTrend(demandGrowthTrend); + market.persist(); + + TriangularTrend gasFixedOperatingCostTimeSeries = new TriangularTrend(); + // gasFixedOperatingCostTimeSeries[0] + gasFixedOperatingCostTimeSeries.setMax(1.10); + gasFixedOperatingCostTimeSeries.setMin(0.96); + gasFixedOperatingCostTimeSeries.setStart(0.25); + gasFixedOperatingCostTimeSeries.setTop(1.03); + gasFixedOperatingCostTimeSeries.persist(); + + TriangularTrend coalFixedOperatingCostTimeSeries = new TriangularTrend(); + coalFixedOperatingCostTimeSeries.setMax(1.05); + coalFixedOperatingCostTimeSeries.setMin(0.97); + coalFixedOperatingCostTimeSeries.setStart(100); + coalFixedOperatingCostTimeSeries.setTop(1.01); + coalFixedOperatingCostTimeSeries.persist(); + + PowerGeneratingTechnology coal1 = new PowerGeneratingTechnology(); + coal1.setFixedOperatingCostTimeSeries(coalFixedOperatingCostTimeSeries); + PowerGeneratingTechnology coal2 = new PowerGeneratingTechnology(); + coal2.setFixedOperatingCostTimeSeries(coalFixedOperatingCostTimeSeries); + PowerGeneratingTechnology gas1 = new PowerGeneratingTechnology(); + gas1.setFixedOperatingCostTimeSeries(gasFixedOperatingCostTimeSeries); + PowerGeneratingTechnology gas2 = new PowerGeneratingTechnology(); + gas2.setFixedOperatingCostTimeSeries(gasFixedOperatingCostTimeSeries); + + coal1.persist(); + coal2.persist(); + gas1.persist(); + gas2.persist(); + + EnergyProducer e1 = new EnergyProducer(); + e1.setName("E1"); + e1.setCash(0); + e1.setPriceMarkUp(1); + + EnergyProducer e2 = new EnergyProducer(); + e2.setCash(0); + e2.setPriceMarkUp(1); + e2.setName("E2"); + + e1.persist(); + e2.persist(); + + PowerPlant pp1 = new PowerPlant(); + pp1.setName("plant 1"); + pp1.setTechnology(coal1); + pp1.setOwner(e1); + pp1.setActualFixedOperatingCost(99000); + pp1.setActualNominalCapacity(700); + pp1.setActualPermittime(0); + pp1.setActualLeadtime(0); + pp1.setConstructionStartTime(-1); + pp1.setDismantleTime(99); + pp1.setLocation(location); + // pp1.setName("PP1"); + + PowerPlant pp2 = new PowerPlant(); + pp2.setName("Plant 2"); + pp2.setActualPermittime(0); + pp2.setActualLeadtime(0); + pp2.setDismantleTime(99); + pp2.setConstructionStartTime(-1); + pp2.setTechnology(coal2); + pp2.setActualNominalCapacity(700); + pp2.setOwner(e2); + pp2.setActualFixedOperatingCost(111000); + pp2.setLocation(location); + // pp2.setName("PP2"); + + PowerPlant pp3 = new PowerPlant(); + pp3.setName("Plant 3"); + pp3.setActualPermittime(0); + pp3.setDismantleTime(99); + pp3.setActualLeadtime(0); + pp3.setConstructionStartTime(-1); + pp3.setTechnology(gas1); + pp3.setActualNominalCapacity(600); + pp3.setOwner(e2); + pp3.setActualFixedOperatingCost(56000); + + pp3.setLocation(location); + + PowerPlant pp4 = new PowerPlant(); + pp4.setName("Plant 4"); + pp4.setActualPermittime(0); + pp4.setActualLeadtime(0); + pp4.setConstructionStartTime(-1); + pp4.setDismantleTime(99); + pp4.setTechnology(gas2); + pp4.setActualNominalCapacity(600); + pp4.setOwner(e1); + pp4.setActualFixedOperatingCost(65000); + pp4.setLocation(location); + + PowerPlant pp5 = new PowerPlant(); + pp5.setName("Plant 5"); + pp5.setActualPermittime(0); + pp5.setActualLeadtime(0); + pp5.setConstructionStartTime(-1); + pp5.setDismantleTime(99); + pp5.setTechnology(gas1); + pp5.setActualNominalCapacity(600); + pp5.setOwner(e2); + pp5.setActualFixedOperatingCost(56000); + pp5.setLocation(location); + + PowerPlant pp6 = new PowerPlant(); + pp6.setName("Plant 6"); + pp6.setActualPermittime(0); + pp6.setActualLeadtime(0); + pp6.setConstructionStartTime(-1); + pp6.setDismantleTime(99); + pp6.setTechnology(gas2); + pp6.setActualNominalCapacity(600); + pp6.setOwner(e1); + pp6.setActualFixedOperatingCost(65000); + pp6.setLocation(location); + + pp1.persist(); + pp2.persist(); + pp3.persist(); + pp4.persist(); + pp5.persist(); + pp6.persist(); + + PowerPlantDispatchPlan ppdp1 = new PowerPlantDispatchPlan(); + ppdp1.setPowerPlant(pp1); + ppdp1.setStatus(-1); + ppdp1.persist(); + + PowerPlantDispatchPlan ppdp2 = new PowerPlantDispatchPlan(); + ppdp2.setPowerPlant(pp2); + ppdp2.setStatus(2); + ppdp2.persist(); + + PowerPlantDispatchPlan ppdp3 = new PowerPlantDispatchPlan(); + ppdp3.setPowerPlant(pp3); + ppdp3.setStatus(3); + ppdp3.persist(); + + PowerPlantDispatchPlan ppdp4 = new PowerPlantDispatchPlan(); + ppdp4.setPowerPlant(pp4); + ppdp4.setStatus(-1); + ppdp4.persist(); + + PowerPlantDispatchPlan ppdp5 = new PowerPlantDispatchPlan(); + ppdp5.setPowerPlant(pp5); + ppdp5.setStatus(2); + ppdp5.persist(); + + PowerPlantDispatchPlan ppdp6 = new PowerPlantDispatchPlan(); + ppdp6.setPowerPlant(pp6); + ppdp6.setStatus(3); + ppdp6.persist(); + + CapacityMarket cMarket = new CapacityMarket(); + cMarket.setName("Capaciteit Markt"); + cMarket.setZone(zone); + cMarket.persist(); + + SegmentClearingPoint clearingPoint1 = new SegmentClearingPoint(); + clearingPoint1.setSegment(S1); + clearingPoint1.setAbstractMarket(market); + clearingPoint1.setPrice(25); + clearingPoint1.setTime(0); + clearingPoint1.persist(); + + SegmentClearingPoint clearingPoint2 = new SegmentClearingPoint(); + clearingPoint2.setSegment(S2); + clearingPoint2.setAbstractMarket(market); + clearingPoint2.setPrice(7); + clearingPoint2.setTime(0); + clearingPoint2.persist(); + + for (EnergyProducer ep : reps.energyProducerRepository + .findAllEnergyProducersExceptForRenewableTargetInvestorsAtRandom()) { + submitCapacityBidRole.act(ep); + logger.warn("Submitted"); + + } + + } +} diff --git a/rscripts/asHeadlessQueryReader.py b/rscripts/asHeadlessQueryReader.py new file mode 100644 index 00000000..02334d5e --- /dev/null +++ b/rscripts/asHeadlessQueryReader.py @@ -0,0 +1,260 @@ +# -*- coding: utf-8 *-* +import json +import glob +import re +import csv +import sys + + +def check_that_dict_has_equal_length(resultDict): + i = 0 + for key, value in resultDict.iteritems(): + if i == 0: + length = len(value) + if not length == len(value): + return False + i = i + 1 + return True + + +def read_query_of_runid(path, runName, runId, queryName, resultDict): + filename = runId + "-" + queryName + filepath = path + runName + "/" + filename + json_data = open(filepath, 'r') + resultList = [] + line = json_data.readline() + jsonLine = json.loads(line[:-2], encoding="ascii") + #In case its a pure list of numbers or strings + if len(jsonLine) == 1 and \ + isinstance(jsonLine[0], (int, float, long, complex, basestring)): + while line: + resultList.append(json.loads(line[:-2], encoding="ascii")[0]) + line = json_data.readline() + resultDict[queryName] = resultList + return resultDict + wrapperCounter = 0 + tempJsonLine = jsonLine + #Unwrapping the json lists, in case it is wrapped + while (tempJsonLine is not None) and len(tempJsonLine) == 1 and \ + isinstance(tempJsonLine, (list)) and \ + (not isinstance(tempJsonLine[0][0], (basestring))): + tempJsonLine = tempJsonLine[0] + wrapperCounter = wrapperCounter + 1 + #Checking if it conforms to the standard and starting the dictionary. + if tempJsonLine is None: + return None + elif len(tempJsonLine[0]) == 2: + return read_standard_conform_key_value_pairs(tempJsonLine, + wrapperCounter, runId, queryName, json_data, resultDict) + else: + #print("Non-Standard: " + queryName) + raise NameError("Query returns in " + runId + " ," + queryName + + " are not standard [Name, Value] for each tick!") + #return read_nonstandard_conform_key_value_pairs(tempJsonLine,\ + # wrapperCounter,runId,queryName,json_data,resultDict) + + +def read_nonstandard_conform_key_value_pairs(tempJsonLine, wrapperCounter, +runId, queryName, json_data, resultDict): + subElementNumber = 0 + for subelement in tempJsonLine: + for subsubelement in subelement: + if not len(subsubelement) == 2: + print(wrapperCounter) + print(subsubelement) + raise NameError("Query returns in " + runId + " ," + + queryName + " are not [Name, Value] for each tick!") + for content in subsubelement: + if isinstance(content, list): + raise NameError("Query returns in " + runId + " ," + + queryName + " are not [Name, Value] for each tick!") + resultDict[(queryName + "_" + + subsubelement[0]).encode("ascii")] = [subsubelement[1]] + subElementNumber = subElementNumber + 1 + #Reading the rest of the file + line = json_data.readline() + while line: + counter = 0 + tempJsonLine = json.loads(line[:-2], encoding="ascii") + while counter < wrapperCounter: + tempJsonLine = tempJsonLine[0] + counter = counter + 1 + subElementCounter = 0 + for subelement in tempJsonLine: + for subsubelement in subelement: + if not len(subsubelement) == 2: + raise NameError("Query returns should be \ + [Name, Value] for each tick!") + for content in subsubelement: + if isinstance(content, list): + raise NameError("Query returns should be \ + [Name, Value] for each tick!") + resultDict[(queryName + "_" + + subsubelement[0]).encode("ascii")].append(subsubelement[1]) + subElementCounter = subElementCounter + 1 + if not subElementCounter == subElementNumber: + raise NameError("Number of subresults is not consistent!") + line = json_data.readline() + #print(resultDict) + return resultDict + + +def read_standard_conform_key_value_pairs(tempJsonLine, wrapperCounter, runId, +queryName, json_data, resultDict): + subElementNumber = 0 + for subelement in tempJsonLine: + if not len(subelement) == 2: + print(wrapperCounter) + print(subelement) + raise NameError("Query returns in " + runId + " ," + queryName + + " are not [Name, Value] for each tick!") + for content in subelement: + if isinstance(content, list): + raise NameError("Query returns in " + runId + " ," + queryName + + " are not [Name, Value] for each tick!") + resultDict[(queryName + "_" + + subelement[0]).encode("ascii")] = [subelement[1]] + subElementNumber = subElementNumber + 1 + #Reading the rest of the file + line = json_data.readline() + while line: + counter = 0 + tempJsonLine = json.loads(line[:-2], encoding="ascii") + while counter < wrapperCounter: + tempJsonLine = tempJsonLine[0] + counter = counter + 1 + subElementCounter = 0 + for subelement in tempJsonLine: + if not len(subelement) == 2: + raise NameError("Query returns should be [Name, Value] for \ + each tick!") + for content in subelement: + if isinstance(content, list): + raise NameError("Query returns should be [Name, Value]\ + for each tick!") + resultDict[(queryName + "_" + + subelement[0]).encode("ascii")].append(subelement[1]) + subElementCounter = subElementCounter + 1 + if not subElementCounter == subElementNumber: + raise NameError("Number of subresults is not consistent!") + line = json_data.readline() + #print(resultDict) + return resultDict + + +def find_query_names_in_directory_for_runId(path, runName, runId): + listOfQueryPaths = glob.glob(path + runName + "/" + runId + "-*") + listOfQueries = [] + listOfTableQueries = [] + for query in listOfQueryPaths: + m = re.search('(?<={0}{1}/{2}-).*'.format(path, runName, runId), query) + if not m.group(0).startswith("TABLE_"): + listOfQueries.append(m.group(0)) + else: + listOfTableQueries.append(m.group(0)) + listOfQueries.sort() + listOfQueryPaths.sort() + #return listOfQueries,listOfQueryPaths + return listOfQueries, listOfTableQueries + + +def find_runIds_based_on_logfiles_and_runname(path, runName): + listOfQueryPaths = glob.glob(path + runName + "/*.log") + listOfRunIds = [] + for query in listOfQueryPaths: + m = re.search('(?<={0}{1}/).*'.format(path, runName), query) + n = re.sub("^(.*).log$", "\\1", m.group(0)) + listOfRunIds.append(n) + return listOfRunIds + + +def read_runId_to_dictionary(path, runName, runId, ignoredQueries): + print("Reading " + runId) + queryNames, tableQueryNames = find_query_names_in_directory_for_runId(path, + runName, runId) + for ignoredQuery in ignoredQueries: + queryNames.remove(ignoredQuery) + resultDict = {} + for queryName in queryNames: + singleQueryResult = read_query_of_runid(path, runName, runId, + queryName, resultDict) + if singleQueryResult is not None: + resultDict.update(singleQueryResult) + if not check_that_dict_has_equal_length(resultDict): + raise NameError("Results of uneven time step length in ." + runName) + return resultDict + + +def write_first_runid_dictionary_to_csv(path, runName, runId, +resultDict, noOfTicks): + queryNames = ["tick", "runId"] + queryNames = set(queryNames) + queryNames.update(resultDict.keys()) + with open(path + runName + ".csv", 'w') as csvfile: + csvwriter = csv.DictWriter(csvfile, fieldnames=queryNames) + headers = {} + for n in csvwriter.fieldnames: + headers[n] = n + csvwriter.writerow(headers) + i = 0 + while i < noOfTicks: + singleTickDict = {} + for key, value in resultDict.iteritems(): + singleTickDict.update({key: value[i]}) + singleTickDict.update({"tick": i}) + singleTickDict.update({"runId": runId}) + csvwriter.writerow(singleTickDict) + i = i + 1 + + +def write_following_runids_to_csv(path, runName, runId, resultDict, noOfTicks): + queryNames = {} + with open(path + runName + ".csv", 'rb') as csvtoupdate: + dictReader = csv.DictReader(csvtoupdate) + queryNames = dictReader.fieldnames + with open(path + runName + ".csv", 'a') as csvfile: + csvwriter = csv.DictWriter(csvfile, fieldnames=queryNames) + i = 0 + while i < noOfTicks: + singleTickDict = {} + for key, value in resultDict.iteritems(): + singleTickDict.update({key: value[i]}) + singleTickDict.update({"tick": i}) + singleTickDict.update({"runId": runId}) + csvwriter.writerow(singleTickDict) + i = i + 1 + + +def write_csv_for_run_name(path, runName, ignoredQueries): + runIds = find_runIds_based_on_logfiles_and_runname(path, runName) + totalRunIdNo = len(runIds) + j = 0 + for runId in runIds: + resultDict = read_runId_to_dictionary(path, runName, + runId, ignoredQueries) + noOfTicks = len(resultDict.items()[1][1]) + if j == 0: + write_first_runid_dictionary_to_csv(path, runName, runId, + resultDict, noOfTicks) + else: + write_following_runids_to_csv(path, runName, runId, + resultDict, noOfTicks) + j = j + 1 + percentage = 1.0 * j / totalRunIdNo * 100 + print((str(percentage) + "% done.")) + + +def main(outputPath, runName, ignoredQueries): + if(not outputPath.endswith("/")): + outputPath = outputPath + "/" + print((find_runIds_based_on_logfiles_and_runname(outputPath, runName))) + write_csv_for_run_name(outputPath, runName, ignoredQueries) + +if __name__ == "__main__": + if len(sys.argv[1:]) > 2: + main(sys.argv[1], sys.argv[2], sys.argv[3:]) + elif len(sys.argv[1:]) == 2: + main(sys.argv[1], sys.argv[2], []) + else: + print("This script needs to be called with: outputPath, \ + runName (, ignoredQueries)") diff --git a/rscripts/asHeadlessTableReader.py b/rscripts/asHeadlessTableReader.py new file mode 100644 index 00000000..d75e2566 --- /dev/null +++ b/rscripts/asHeadlessTableReader.py @@ -0,0 +1,93 @@ +import csv +import sys +import json + + +def read_tableQuery_of_runid(path, runName, runId, tableName): + resultDict = {} + filename = runId + "-" + "TABLE_" + tableName + filepath = path + runName + "/" + filename + json_data = open(filepath, 'r') + line = json_data.readline() + jsonLine = json.loads(line[:-2], encoding="ascii") + wrapperCounter = 0 + tempJsonLine = jsonLine + #Unwrapping the json lists, in case it is wrapped + while (tempJsonLine is not None) and len(tempJsonLine) == 1 and \ + isinstance(tempJsonLine, (list)) and \ + (not isinstance(tempJsonLine[0][0], (basestring))): + tempJsonLine = tempJsonLine[0] + wrapperCounter = wrapperCounter + 1 + headers = tempJsonLine[0] + tempJsonLine = tempJsonLine[1:] + headerNumber = 0 + for header in headers: + resultDict[(headers[headerNumber]).encode("ascii")] = [] + headerNumber = headerNumber + 1 + for subelement in tempJsonLine: + headerNumber = 0 + if not len(subelement) == len(headers): + raise NameError("Table length differs from header length!") + for content in subelement: + resultDict[(headers[headerNumber]).encode("ascii")].append(content) + headerNumber = headerNumber + 1 + line = json_data.readline() + while line and (line is not None) and isinstance(line, (list)): + counter = 0 + tempJsonLine = json.loads(line[:-2], encoding="ascii") + while counter < wrapperCounter: + tempJsonLine = tempJsonLine[0] + counter = counter + 1 + tempJsonLine = tempJsonLine[1:] + for subelement in tempJsonLine: + headerNumber = 0 + if not len(subelement) == len(headers): + raise NameError("Table length differs from header length!") + for content in subelement: + resultDict[(headers[headerNumber]). + encode("ascii")].append(content) + headerNumber = headerNumber + 1 + line = json_data.readline() + return resultDict + + +def write_tableResultDict_to_csv(path, runName, runId, tableName, +resultDict): + queryNames = resultDict.keys() + #queryNames.update(resultDict.keys()) + noOfTicks = len(resultDict.items()[1][1]) + with open(path + runId + "-" + tableName + ".csv", 'w') as csvfile: + csvwriter = csv.DictWriter(csvfile, fieldnames=queryNames) + csvwriter.writeheader() + i = 0 + while i < noOfTicks: + singleTickDict = {} + for key, value in resultDict.iteritems(): + singleTickDict.update({key: value[i]}) + csvwriter.writerow(singleTickDict) + i = i + 1 + + +def write_tableQuery_to_csv(path, runName, runId, tableName): + resultDict = read_tableQuery_of_runid(path, runName, runId, tableName) + write_tableResultDict_to_csv(path, runName, runId, tableName, resultDict) + + +def main(path, runName, runId, tableName): + if(not path.endswith("/")): + path = path + "/" + write_tableQuery_to_csv(path, runName, runId, tableName) + +if __name__ == "__main__": + if len(sys.argv[1:]) == 4: + main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) + else: + print("This script needs to be called with: outputPath, \ + runName, runId, tableName") + +#path='/home/jrichstein/Desktop/emlabGen/output/' +#runName="scriptTest" +#tableName='PowerPlantDispatchPlans' +#runId="scriptTest-1" + +#main(path, runName, runId, tableName) diff --git a/rscripts/batchRunAnalysis.R b/rscripts/batchRunAnalysis.R index d8c21046..db32a0e1 100644 --- a/rscripts/batchRunAnalysis.R +++ b/rscripts/batchRunAnalysis.R @@ -146,11 +146,14 @@ plotTimeSeriesWithConfidenceIntervalByFacettedGroup <- function(df, variable, yl #stat_summary(aes_string(fill="modelRun"), fun.data=fun.data, conf.int=conf.int, geom="smooth") + stat_summary(fun.data=fun.data, conf.int=conf.int, geom="smooth", colour="black") + stat_summary(fun.data=fun.data, conf.int=conf.int2, geom="smooth", colour="black")+ + stat_summary(fun.y="mean", conf.int=.95, geom="smooth", lty="dashed", colour="black") + + #facet_grid(. ~ modelRun)+ facet_wrap(~ modelRun, nrow=nrow)+ theme(legend.position="none")+ xlab("Time [a]")+ - ylab(ylabel) + ylab(ylabel)+ + scale_linetype_manual(breaks=c("a","b")) }