1 package org.catacomb.numeric.difnet.model;
2
3 import org.catacomb.numeric.difnet.DiffusibleQuantity;
4 import org.catacomb.numeric.difnet.StateNode;
5 import org.catacomb.numeric.difnet.Stimulus;
6 import org.catacomb.numeric.difnet.StructureNode;
7
8
9
10 public class BasicStateNode implements StateNode {
11
12 BasicStructureNode structure;
13
14 double value;
15 double current;
16
17 double capacitance;
18
19 Stimulus stimulus;
20
21 double appliedValue;
22
23
24 public BasicStateNode(BasicStructureNode bsn) {
25 structure = bsn;
26 value = structure.getInitialValue();
27
28 capacitance = structure.getCapacitance();
29
30 if (structure.fixed) {
31 appliedValue = structure.getInitialValue();
32 } else {
33 appliedValue = -999.;
34 }
35 }
36
37
38
39
40 public double getValue(DiffusibleQuantity dq) {
41 return value;
42 }
43
44 public double getAppliedValue(DiffusibleQuantity dq) {
45 return appliedValue;
46 }
47
48 public void setValue(DiffusibleQuantity dq, double d) {
49 value = d;
50 }
51
52
53 public void setFlux(DiffusibleQuantity dq, double d) {
54 current = d;
55 }
56
57
58 public void setStimulus(Stimulus stim) {
59 stimulus = stim;
60 }
61
62 public Stimulus getStimulus() {
63 return stimulus;
64 }
65
66
67
68
69
70
71
72
73
74 public double getCapacitance(DiffusibleQuantity dq) {
75 return capacitance;
76 }
77
78 public StructureNode getStructureNode() {
79 return structure;
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126