EMlab-generation Documentation  1.0
Documentation of the EMLab-Generation model.
IntermittentTechnologyNodeLoadFactor.java
1 /*******************************************************************************
2  * Copyright 2013 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 package emlab.gen.domain.market.electricity;
17 
18 import org.neo4j.graphdb.Direction;
19 import org.springframework.data.neo4j.annotation.NodeEntity;
20 import org.springframework.data.neo4j.annotation.RelatedTo;
21 
24 
29 @NodeEntity
31 
32  @RelatedTo(type = "LOADFACTOR_TECHNOLOGY", elementClass = PowerGeneratingTechnology.class, direction = Direction.OUTGOING)
33  private PowerGeneratingTechnology technology;
34 
35  @RelatedTo(type = "LOADFACTOR_NODE", elementClass = PowerGridNode.class, direction = Direction.OUTGOING)
36  private PowerGridNode node;
37 
38  private double[] loadFactors;
39 
40  public PowerGeneratingTechnology getTechnology() {
41  return technology;
42  }
43 
44  public void setTechnology(PowerGeneratingTechnology technology) {
45  this.technology = technology;
46  }
47 
48  public PowerGridNode getNode() {
49  return node;
50  }
51 
52  public void setNode(PowerGridNode node) {
53  this.node = node;
54  }
55 
56  public double[] getLoadFactors() {
57  return loadFactors;
58  }
59 
60  public void setLoadFactors(double[] loadFactors) {
61  this.loadFactors = loadFactors;
62  }
63 
64  public double getLoadFactorForSegmentId(int segmentId) {
65  return loadFactors[segmentId - 1];
66  }
67 
68  public double getLoadFactorForSegment(Segment segment) {
69  return getLoadFactorForSegmentId(segment.getSegmentID());
70  }
71 
72  public void setLoadFactorForSegmentId(int segmentId, double loadFactor) {
73  loadFactors[segmentId - 1] = loadFactor;
74  }
75 
76  public void setLoadFactorForSegment(Segment segment, double loadFactor) {
77  setLoadFactorForSegmentId(segment.getSegmentID(), loadFactor);
78  }
79 
80 }