-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsatNode.java
More file actions
82 lines (63 loc) · 1.3 KB
/
Copy pathsatNode.java
File metadata and controls
82 lines (63 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Jack Pharies
CSC 372
A3
SatNode
Used to construct the tree for the DPLL search.
Contains an Integer and a parent satNode.
*/
import java.util.*;
public class satNode {
private int val;
private satNode parent;
private int repeat;
private boolean used;
/*
Constructor for the satNode
Params: int val that is the value of the current node
satNode parent that is the parent of this current node
Example: Used to make a satNode within a DPLL search.
*/
public satNode(int val, satNode parent)
{
this.val = val;
this.parent = parent;
this.repeat = 0;
this.used = false;
}
/*
getters and setters for the attributes
*/
public int getVal()
{
return this.val;
}
public void setRepeat(int var)
{
this.repeat = var;
}
public int getRepeat()
{
return this.repeat;
}
public satNode getParent()
{
return this.parent;
}
public void setParent(satNode newParent)
{
this.parent = newParent;
}
public boolean getUsed()
{
return this.used;
}
public void setUsed(boolean change)
{
this.used = change;
}
public void changeCharge()
{
this.val = this.val * -1;
}
}