Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a805e20
test commit
Aug 19, 2013
5f531ce
Merge branch 'develop' of https://github.com/PCBhagwat/emlab-generati…
Nov 1, 2013
a8642c4
update1
Nov 6, 2013
b87e2db
Dismantling Alogrithm initial coding
Nov 12, 2013
b0275ce
Dismantling V1.01
Nov 12, 2013
42fb844
JUnit Test for dismantling algorithm and update
Nov 13, 2013
a318a90
updates
Nov 13, 2013
add7c10
update
Nov 13, 2013
97de092
Junit
Nov 18, 2013
dc9e436
Commit
Nov 19, 2013
7cd428f
updated dismantling algorithm
Feb 18, 2014
54e5978
done!..for now
Feb 20, 2014
3e7bb61
debugging
Feb 24, 2014
1bcf096
updated
Feb 25, 2014
909f4e0
debug
Feb 27, 2014
cb37646
update
Feb 27, 2014
3c9364a
rconfig
Feb 27, 2014
26df423
data
Feb 27, 2014
70edfc3
data
Feb 27, 2014
d06bab1
update
Feb 27, 2014
96e8551
Merged from develop.
Mar 6, 2014
6ad38af
forecasting interconnector use in two country system
Mar 14, 2014
a7f9cb5
update
Mar 14, 2014
02eb303
EconomicDismantling
May 1, 2014
94cedc6
Merge branch 'develop' into feature/economicDismantling
May 1, 2014
1b919b3
commit
May 1, 2014
cb6dad2
Delete .DS_Store
May 7, 2014
1c2a3f5
Delete .DS_Store
May 7, 2014
dd89dae
Economic Dismantling Update
May 7, 2014
30e9dd4
Merge branch 'feature/economicDismantling' of
May 7, 2014
b69142e
new dismantling commit
Oct 2, 2014
ba4d39b
commit
Oct 3, 2014
9da954c
Delete .DS_Store
Oct 3, 2014
83248cd
Delete .DS_Store
Oct 3, 2014
f061921
Delete .DS_Store
Oct 3, 2014
30346dc
Delete .DS_Store
Oct 3, 2014
80d7674
Delete .DS_Store
Oct 3, 2014
fa152a5
Delete .DS_Store
Oct 3, 2014
c75a687
Delete .DS_Store
Oct 3, 2014
1cb7ee2
Delete .DS_Store
Oct 3, 2014
9f289e6
Delete .DS_Store
Oct 3, 2014
8668b7e
MSR Update
Jan 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,275 changes: 1,275 additions & 0 deletions co2MarketStabilityReserve-scenarioFileCreator.R

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions emlab-generation/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions emlab-generation/.settings/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ sp_cleanup.always_use_this_for_non_static_method_access=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.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
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
Expand Down
98 changes: 89 additions & 9 deletions emlab-generation/queries.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
"AnnualSRFraction", "ElectricitySpotMarket", "sum=0;
sum1=0;
ppdps = v.inE("BIDDINGMARKET").outV.filter{it.SRstatus<=-10 && it.status>=2 && it.time==tick};
for (ppdp in ppdps){
totalAmount = ppdp.getProperty("acceptedAmount");
hoursInSegment = ppdp.out("SEGMENT_DISPATCHPLAN").next().getProperty("lengthInHours");
production = totalAmount * hoursInSegment;
sum = sum + production;
}
ppdpss = v.inE("BIDDINGMARKET").outV.filter{it.status>=2 && it.time==tick};
for(pppdp in ppdpss){
totalAmount1 = pppdp.getProperty("acceptedAmount");
hoursInSegment1 = pppdp.out("SEGMENT_DISPATCHPLAN").next().getProperty("lengthInHours");
production1 = totalAmount1 * hoursInSegment1;
sum1 = sum1 + production1;
}
Fraction = sum/sum1;
return [v.name, Fraction]",

"SRCost", "StrategicReserveOperator", "cost = v.inE('FROM_AGENT').outV.filter{it.time==tick}.sum{it.money}
revenues = v.inE('TO_AGENT').outV.filter{it.time==tick}.sum{it.money}
zone = v.outE.inV.name
if (revenues == null){
revenues = 0
}
return [v.name + ' Costs', cost];",

"SRProfits", "StrategicReserveOperator", "cost = v.inE('FROM_AGENT').outV.filter{it.time==tick}.sum{it.money}
revenues = v.inE('TO_AGENT').outV.filter{it.time==tick}.sum{it.money}
zone = v.outE.inV.name
if (revenues == null){
revenues = 0
}
if(cost==null){
cost=0
}
profit = revenues - cost
return [v.name + ' Profits', profit];",

"SRRevenue", "StrategicReserveOperator", "cost = v.inE('FROM_AGENT').outV.filter{it.time==tick}.sum{it.money}
revenues = v.inE('TO_AGENT').outV.filter{it.time==tick}.sum{it.money}
zone = v.outE.inV.name
if (revenues == null){
revenues = 0
}
return [v.name + ' Revenue', revenues];",

"MaxSRVolumeDispatched", "ElectricitySpotMarket", "counter=0
markets = v
segments = v.outE('SEGMENT_LOAD').inV.outE('SEGMENTLOAD_SEGMENT').inV
for(market in markets){
for(segment in segments){
ppdps = segment.inE('SEGMENT_DISPATCHPLAN').outV.filter{it.SRstatus<=-10 && it.status>=2 && it.time==tick}.sum{it.acceptedAmount}
if (ppdps > counter){
counter = ppdps
}
}
}
return[markets.name, counter]",

"SRDispatchDuration", "ElectricitySpotMarket", "sum1=0;
prevseg=0;
markets = v;
ppdpss = v.inE("BIDDINGMARKET").outV.filter{it.SRstatus<=-10 && it.status>=2 && it.time==tick}.out("SEGMENT_DISPATCHPLAN").sort{it.segmentID}._().lengthInHours;
segs = v.inE("BIDDINGMARKET").outV.filter{it.SRstatus<=-10 && it.status>=2 && it.time==tick}.out("SEGMENT_DISPATCHPLAN").sort{it.segmentID}._();
for (market in markets){
currentMarket = market;
for(seg in segs){
if(seg.segmentID != prevseg && v==currentMarket){
sum1=sum1+seg.getProperty("lengthInHours")
prevseg=seg.segmentID
}
}
return[v.name, sum1]

}",

"SRContractedVolume", "ElectricitySpotMarket", "markets = v
for (market in markets){
amounts = market.inE("BIDDINGMARKET").outV.filter{it.SRstatus<=-10 && it.time==tick}.amount.sum()
if (amounts == null){
amounts=0;
}
reserve = amounts/20
return[market.name, reserve]
}",

"SROperatorCashBalance", "StrategicReserveOperator", "[v.name, v.cash]",

"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]",
Expand Down Expand Up @@ -36,8 +125,6 @@ return productionsum;",
co2Allowances=0;
for(agent in agents){if(agent.co2Allowances!=null) co2Allowances+=agent.co2Allowances}; return co2Allowances",

"MarketStabilityReserve", "Government", "return v.stabilityReserve",

"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]",
Expand All @@ -46,9 +133,6 @@ return ['CO2_cap', cap]",
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;",

Expand Down Expand Up @@ -125,10 +209,6 @@ energyNotServed = demandSum - energyServed;
return [v.name, energyNotServed];
",

"Forc_Total_DemandinMWh", "Zone", "cp = v.in('ZONE').in('MARKET_POINT').filter{it.time==tick && 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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,30 @@ public class DecarbonizationAgent extends AbstractAgent {
private double co2Allowances;
private String name;
private double lastYearsCo2Allowances;
private double temporaryCashComparatorDismantling;
private double temporaryRESCapacityPredictor;

public double getTemporaryRESCapacityPredictor() {
return temporaryRESCapacityPredictor;
}

public void setTemporaryRESCapacityPredictor(double temporaryRESCapacityPredictor) {
this.temporaryRESCapacityPredictor = temporaryRESCapacityPredictor;
}

@Override
public String getName() {
return name;
}

public double getTemporaryCashComparatorDismantling() {
return temporaryCashComparatorDismantling;
}

public void setTemporaryCashComparatorDismantling(double temporaryCashComparatorDismantling) {
this.temporaryCashComparatorDismantling = temporaryCashComparatorDismantling;
}

@Override
public void setName(String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -56,7 +56,7 @@ public class EnergyProducer extends DecarbonizationAgent implements Agent {
@SimulationParameter(label = "Loan Interest Rate", from = 0, to = 1)
private double loanInterestRate;

//Forecasting
// Forecasting
private int numberOfYearsBacklookingForForecasting;

// Dismantling
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*******************************************************************************
* 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;

import org.springframework.data.neo4j.annotation.NodeEntity;

/**
* @author JCRichstein
*
*/
@NodeEntity
public class CO2MarketClearingPoint extends ClearingPoint {

boolean emergencyTriggerActivated;
double emergencyTriggerOutflow;

public boolean isEmergencyTriggerActivated() {
return emergencyTriggerActivated;
}

public void setEmergencyTriggerActivated(boolean emergencyTriggerActivated) {
this.emergencyTriggerActivated = emergencyTriggerActivated;
}

public double getEmergencyTriggerOutflow() {
return emergencyTriggerOutflow;
}

public void setEmergencyTriggerOutflow(double emergencyTriggerOutflow) {
this.emergencyTriggerOutflow = emergencyTriggerOutflow;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -30,11 +31,33 @@ public class ElectricitySpotMarket extends DecarbonizationMarket {
@RelatedTo(type = "SEGMENT_LOAD", elementClass = SegmentLoad.class, direction = Direction.OUTGOING)
private Set<SegmentLoad> 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<SegmentLoad> getLoadDurationCurve() {
return loadDurationCurve;
}
Expand All @@ -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;
}

Expand Down
Loading