-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.java
120 lines (93 loc) · 2.8 KB
/
Person.java
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
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
package com.salathegroup.contagion_vs_homophily;
import java.util.ArrayList;
public class Person {
private String id;
private int y;
private boolean tempValue = false;
private boolean adopted;
private int adoptionCause;
private ArrayList<Integer> exposures;
private ArrayList<Integer> exposureTimestamps;
public static final int NONE = 1 ;
public static final int SOCIAL = 2;
public static final int GEN_FIRST = 3;
public static final int SOC_FIRST = 4;
public static final int GENERAL = 5 ;
public Person(String id, int y) {
this.id = id;
this.y = y;
this.adopted = false;
this.adoptionCause = Person.NONE;
this.exposures = new ArrayList<Integer>();
this.exposureTimestamps = new ArrayList<Integer>();
}
public int getY() {
return this.y;
}
public boolean getAdopted() {
return this.adopted;
}
public void setAdopted(boolean adopted) {
this.adopted = adopted;
}
public void resetY(int y) {
this.y = y;
}
public void resetExposures() {
ArrayList<Integer> exposures;
ArrayList<Integer> exposureTimestamps;
exposures = new ArrayList<Integer>();
exposureTimestamps = new ArrayList<Integer>();
this.exposures = exposures;
this.exposureTimestamps = exposureTimestamps;
}
public String toString() {
return this.id;
}
public String getID() {
return this.id;
}
public Integer getIntID() {
return Integer.parseInt(this.id);
}
public int getNumberOfExposures() {
return this.exposures.size();
}
public ArrayList<Integer> getExposureList() {
return this.exposures;
}
public void increaseGeneralExposures(Integer exposureSource, Integer exposureTimestamp) {
this.exposures.add(exposureSource);
this.exposureTimestamps.add(exposureTimestamp);
}
public ArrayList<Integer> getExposureTimestamps() {
return this.exposureTimestamps;
}
public void setTempValue(boolean b) {
this.tempValue = b;
}
public boolean getTempValue() {
return this.tempValue;
}
public void setAdoptionCause(int adoptionCause) {
this.adoptionCause = adoptionCause;
}
public int getAdoptionCause() {
return this.adoptionCause;
}
public boolean isNONE() {
return this.adoptionCause==Person.NONE;
}
public boolean isSOCIAL() {
return this.adoptionCause==Person.SOCIAL;
}
public boolean isGENERAL() {
return this.adoptionCause==Person.GENERAL;
}
public boolean isGEN_FIRST() {
return this.adoptionCause==Person.GEN_FIRST;
}
public boolean isSOC_FIRST() {
return this.adoptionCause==Person.SOC_FIRST;
}
}