1
2
3 package org.catacomb.numeric.difnet.model;
4
5 import org.catacomb.numeric.difnet.NetState;
6 import org.catacomb.numeric.difnet.StateLink;
7 import org.catacomb.numeric.difnet.StateNode;
8
9
10 public class BasicNetState implements NetState {
11
12
13 BasicNetStructure structure;
14
15 public BasicStateNode[] nodes;
16 public BasicStateLink[] links;
17
18
19
20 static int iok = 0;
21 static int ierr = 1;
22 static int istat = iok;
23
24 double time;
25
26
27 public BasicNetState(BasicNetStructure bns, BasicStateNode[] nds, BasicStateLink[] lks) {
28 structure = bns;
29 nodes = nds;
30 links = lks;
31 time = 0.;
32 }
33
34
35 public StateNode[] getNodes() {
36 return nodes;
37 }
38
39
40 public StateLink[] getLinks() {
41 return links;
42 }
43
44 public StateNode getNode(int inode) {
45 return nodes[inode];
46 }
47
48 public double getValueAt(int i) {
49 return nodes[i].getValue(null);
50 }
51
52
53 public void setNodes(BasicStateNode[] anp) {
54 nodes = anp;
55 }
56
57 public void setLinks(BasicStateLink[] alp) {
58 links = alp;
59 }
60
61
62
63
64
65
66 public boolean useIntrinsics() {
67 return false;
68 }
69
70
71 public boolean forceFullMatrix() {
72 return false;
73 }
74
75
76
77 public void setError() {
78 istat = ierr;
79 }
80
81 public void setOK() {
82 istat = iok;
83 }
84
85 public boolean isError() {
86 return (istat == ierr);
87 }
88
89 public double getTime() {
90 return time;
91 }
92
93 public void setTime(double t) {
94 time = t;
95 }
96
97 }
98