16 package emlab.gen.repository;
18 import java.util.ArrayList;
20 import org.springframework.data.neo4j.annotation.Query;
21 import org.springframework.data.neo4j.annotation.QueryType;
22 import org.springframework.data.neo4j.repository.GraphRepository;
23 import org.springframework.data.repository.query.Param;
24 import org.springframework.stereotype.Repository;
50 @Query(
"start owner=node({owner}) match (owner)<-[:POWERPLANT_OWNER]-(plant) return plant")
53 @Query(
"start owner=node({owner}) match (owner)<-[:POWERPLANT_OWNER]-(plant) return count(plant)")
54 public long countPowerPlantsByOwner(@Param(
"owner")
EnergyProducer owner);
67 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin)
70 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}", type = QueryType.Gremlin)
71 public Iterable<PowerPlant> findExpectedOperationalPowerPlants(@Param(
"tick")
long tick);
73 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].as('x').out('TECHNOLOGY').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin)
74 Iterable<PowerPlant> findOperationalPowerPlantsWithFuelsGreaterZero(@Param(
"tick")
long tick);
82 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']] .propertyFilter('dismantleTime', FilterPipe.Filter.GREATER_THAN, tick)", type = QueryType.Gremlin)
83 Iterable<PowerPlant> findAllPowerPlantsWhichAreNotDismantledBeforeTick(@Param(
"tick")
long tick);
85 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']] .propertyFilter('dismantleTime', FilterPipe.Filter.LESS_THAN, tick)", type = QueryType.Gremlin)
86 Iterable<PowerPlant> findAllPowerPlantsDismantledBeforeTick(@Param(
"tick")
long tick);
88 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{it.constructionStartTime==tick}", type = QueryType.Gremlin)
89 Iterable<PowerPlant> findAllPowerPlantsWithConstructionStartTimeInTick(@Param(
"tick")
long tick);
101 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.technology.PowerPlant']].filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.toList()", type = QueryType.Gremlin)
104 @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)
105 double calculateCapacityOfOperationalPowerPlants(@Param(
"tick")
long tick);
107 @Query(value =
"t = new Table();" +
108 "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(); " +
109 "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;" , type = QueryType.Gremlin)
110 double calculatePeakCapacityOfOperationalPowerPlants(@Param(
"tick")
long tick);
121 @Query(value =
"g.v(owner).in('POWERPLANT_OWNER').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin)
123 @Param(
"tick")
long tick);
125 @Query(value =
"g.v(owner).in('POWERPLANT_OWNER').as('x').out('TECHNOLOGY').filter{it.out('FUEL').count()>0}.back('x').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin)
126 Iterable<PowerPlant> findOperationalPowerPlantsWithFuelsGreaterZeroByOwner(@Param(
"owner")
EnergyProducer owner,
127 @Param(
"tick")
long tick);
138 @Query(value =
"g.v(tech).in('TECHNOLOGY').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin)
140 @Param(
"tick")
long tick);
142 @Query(value =
"result = g.v(tech).as('x').in('TECHNOLOGY').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}.sum{it.actualNominalCapacity};"
143 +
"if(result == null){return 0;} else{return result;}", type = QueryType.Gremlin)
145 @Param(
"tick")
long tick);
147 @Query(
"start tech=node({tech}) match (tech)<-[:TECHNOLOGY]-(plant) return plant")
150 @Query(
"start gridnode=node({gridnode}) match (gridnode)<-[:LOCATION]-(plant) return plant")
151 public Iterable<PowerPlant> findPowerPlantsByPowerGridNode(@Param(
"gridnode")
PowerGridNode node);
153 @Query(value =
"g.v(gridnode).in('LOCATION').filter{(it.dismantleTime > tick) && ((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick)}", type = QueryType.Gremlin)
154 public Iterable<PowerPlant> findOperationalPowerPlantsByPowerGridNode(@Param(
"gridnode")
PowerGridNode node,
155 @Param(
"tick")
long tick);
157 @Query(
"START owner=node({owner}), market=node({market}) "
158 +
"MATCH (owner)<-[:POWERPLANT_OWNER]-(plant), (market)-[:ZONE]->()<-[:REGION]-()<-[:LOCATION]-(plant)"
160 public Iterable<PowerPlant> findPowerPlantsByOwnerAndMarket(@Param(
"owner")
EnergyProducer owner,
163 @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.dismantleTime > tick)}", type = QueryType.Gremlin)
164 public Iterable<PowerPlant> findOperationalPowerPlantsInMarket(@Param(
"market")
ElectricitySpotMarket market,
165 @Param(
"tick")
long tick);
167 @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.dismantleTime > tick)}.sum{it.actualNominalCapacity}", type = QueryType.Gremlin)
168 public double calculateCapacityOfOperationalPowerPlantsInMarket(@Param(
"market")
ElectricitySpotMarket market,
169 @Param(
"tick")
long tick);
171 @Query(value =
"t = new Table();" +
172 "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(); " +
173 "capacitySum = 0; for (row in t){capacitySum += row.get(0) * row.get(1);}; return capacitySum;" , type = QueryType.Gremlin)
174 public double calculatePeakCapacityOfOperationalPowerPlantsInMarket(@Param(
"market")
ElectricitySpotMarket market,
175 @Param(
"tick")
long tick);
177 @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)}", type = QueryType.Gremlin)
178 public Iterable<PowerPlant> findExpectedOperationalPowerPlantsInMarket(
181 @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)}.sum{it.actualNominalCapacity}", type = QueryType.Gremlin)
182 public double calculateCapacityOfExpectedOperationalPowerPlantsInMarket(
185 @Query(value =
"g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('x').out('TECHNOLOGY').filter{it==g.v(tech)}.back('x').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}", type = QueryType.Gremlin)
186 public Iterable<PowerPlant> findExpectedOperationalPowerPlantsInMarketAndTechnology(
189 @Query(value =
"result = 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)}.as('x').out('TECHNOLOGY').filter{it.name==g.v(tech).name}.back('x').sum{it.actualNominalCapacity};"
190 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
191 public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketAndTechnology(
193 @Param(
"tick")
long tick);
195 @Query(value =
"result = g.v(node).in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.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};"
196 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
197 public double calculateCapacityOfExpectedOperationalPowerPlantsByNodeAndTechnology(
199 @Param(
"tick")
long tick);
201 @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)
202 public Iterable<PowerPlant> findExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(
206 @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};"
207 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
208 public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwnerAndTechnology(
212 @Query(value =
"result = g.v(owner).in('POWERPLANT_OWNER').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.expectedEndOfLife > tick)}.sum{it.actualNominalCapacity};"
213 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
214 public double calculateCapacityOfExpectedOperationalPowerPlantsByOwner(@Param(
"tick")
long tick,
217 @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};"
218 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
219 public double calculateCapacityOfExpectedOperationalPowerPlantsByOwnerByTechnology(@Param(
"tick")
long tick,
222 @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};"
223 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
224 public double calculateCapacityOfExpectedDismantledPowerPlantsByOwnerByTechnology(@Param(
"tick")
long tick,
227 @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)
228 public Iterable<PowerPlant> findExpectedOperationalPowerPlantsInMarketByOwner(
232 @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};"
233 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
234 public double calculateCapacityOfExpectedOperationalPowerPlantsInMarketByOwner(
238 @Query(value =
"g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}", type = QueryType.Gremlin)
241 @Query(value =
"g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('plant').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('plant').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin)
242 public Iterable<PowerPlant> findOperationalPowerPlantsByOwnerAndMarket(@Param(
"owner")
EnergyProducer owner,
245 @Query(value =
"plantByOwnerMarket=g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'}.as('plant').out('POWERPLANT_OWNER').filter{it==g.v(owner)}.back('plant');"
246 +
"plantByOwnerMarket.filter{!((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick || it.dismantleTime == 0)}", type = QueryType.Gremlin)
247 public Iterable<PowerPlant> findPowerPlantsByOwnerAndMarketInPipeline(@Param(
"owner")
EnergyProducer owner,
250 @Query(value =
"plantByTechnology=g.v(tech).in('TECHNOLOGY');"
251 +
"plantByTechnology.filter{!((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick || it.dismantleTime == 0)}", type = QueryType.Gremlin)
252 public Iterable<PowerPlant> findPowerPlantsByTechnologyInPipeline(
255 @Query(value =
"plantByTechnology=g.v(tech).in('TECHNOLOGY');"
256 +
"result = plantByTechnology.filter{!((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick || it.dismantleTime == 0)}.sum{it.actualNominalCapacity};"
257 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
258 public double calculateCapacityOfPowerPlantsByTechnologyInPipeline(
261 @Query(value =
"plantByMarket=g.v(market).out('ZONE').in('REGION').in('LOCATION').filter{it.__type__=='emlab.gen.domain.technology.PowerPlant'};"
262 +
"result = plantByMarket.filter{!((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick || it.dismantleTime == 0)}.sum{it.actualNominalCapacity};"
263 +
"if(result == null){return 0} else{return result}", type = QueryType.Gremlin)
264 public double calculateCapacityOfPowerPlantsByMarketInPipeline(@Param(
"market")
ElectricitySpotMarket market,
265 @Param(
"tick")
long tick);
267 @Query(value =
"substanceShares = g.v(substance).in('SUBSTANCE').filter{it.__type__=='emlab.gen.domain.technology.SubstanceShareInFuelMix'};"
268 +
"sum=substanceShares.sum{it.share}; if(sum!=null) return sum else return 0;;", type = QueryType.Gremlin)
269 public double calculateSubstanceUsage(@Param(
"substance")
Substance substance);
271 @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)
272 Iterable<PowerPlant> findOperationalIntermittentPowerPlantsByPowerGridNode(@Param(
"gridnode")
PowerGridNode node,
273 @Param(
"tick")
long tick);
275 @Query(value =
"result = 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)}.out('TECHNOLOGY').sum{it.capacity};"
276 +
"if(result == null){return 0;} else{return result;}", type = QueryType.Gremlin)
277 double calculateCapacityOfIntermittentPowerPlantsByPowerGridNode(@Param(
"gridnode")
PowerGridNode node,
278 @Param(
"tick")
long tick);
280 @Query(value =
"g.v(gridnode).in('LOCATION').filter{(it.__type__=='emlab.gen.domain.technology.PowerPlant')}.as('p').out('TECHNOLOGY').filter{it.intermittent == true && it==g.v(technology)}.back('p').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}", type = QueryType.Gremlin)
281 Iterable<PowerPlant> findOperationalIntermittentPowerPlantsByPowerGridNodeAndTechnology(
285 @Query(value =
"result = g.v(gridnode).in('LOCATION').filter{(it.__type__=='emlab.gen.domain.technology.PowerPlant')}.as('p').out('TECHNOLOGY').filter{it.intermittent == true && it==g.v(technology)}.back('p').filter{((it.constructionStartTime + it.actualPermittime + it.actualLeadtime) <= tick) && (it.dismantleTime > tick)}.sum{it.actualNominalCapacity};"
286 +
"if(result == null){return 0;} else{return result;}", type = QueryType.Gremlin)
287 double calculateCapacityOfOperationalIntermittentPowerPlantsByPowerGridNodeAndTechnology(
291 @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)
292 double calculateSpotMarketRevenueOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
294 @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)
295 double calculateLongTermContractRevenueOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
297 @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)
298 double calculateStrategicReserveRevenueOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
300 @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)
301 double calculateCapacityMarketRevenueOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
303 @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)
304 double calculateCO2HedgingRevenueOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
306 @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)
307 double calculateCO2CostsOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
309 @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)
310 double calculateFixedCostsOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
312 @Query(value =
"ppdps=g.v(plant).in('POWERPLANT_DISPATCHPLAN').filter{it.time==tick}.propertyFilter('forecast', FilterPipe.Filter.EQUAL, false); sum=0;"
314 +
"for(ppdp in ppdps){"
315 +
"totalAmount = ppdp.getProperty('acceptedAmount') + ppdp.getProperty('capacityLongTermContract');"
316 +
"if(totalAmount==null) totalAmount=0;"
317 +
"hoursInSegment = ppdp.out('SEGMENT_DISPATCHPLAN').next().getProperty('lengthInHours');"
318 +
"production = totalAmount * hoursInSegment;"
319 +
"fullLoadHours = fullLoadHours + hoursInSegment * totalAmount / (ppdp.out('POWERPLANT_DISPATCHPLAN').next().actualNominalCapacity *1.0d);"
320 +
"}; return fullLoadHours;", type = QueryType.Gremlin)
321 double calculateFullLoadHoursOfPowerPlant(@Param(
"plant")
PowerPlant plant, @Param(
"tick")
long tick);
Iterable< PowerPlant > findPowerPlantsByOwner(@Param("owner") EnergyProducer owner)
Iterable< PowerPlant > findOperationalPowerPlantsByTechnology(@Param("tech") PowerGeneratingTechnology technology,@Param("tick") long tick)
Iterable< PowerPlant > findOperationalPowerPlants(@Param("tick") long tick)
ArrayList< PowerPlant > findOperationalPowerPlantsAsList(@Param("tick") long tick)
Iterable< PowerPlant > findOperationalPowerPlantsByOwner(@Param("owner") EnergyProducer owner,@Param("tick") long tick)