1 package Analysis.Scheduling;
3 import Analysis.TaskStateAnalysis.FEdge;
4 import Analysis.TaskStateAnalysis.FlagState;
5 import IR.ClassDescriptor;
7 public class ObjectSimulator {
18 // TODO, crack for KMeans
21 public ObjectSimulator(ClassDescriptor cd,
22 FlagState currentFS) {
24 this.oid = ObjectSimulator.objid++;
26 this.currentFS = currentFS;
31 if(this.cd.getSymbol().equals("Cluster")) {
32 this.counter = 83 * 2 + 1; //102 * 2 + 1; //83 * 2 + 1;
38 public void applyEdge(FEdge fedge) {
39 if(!currentFS.equals((FlagState)fedge.getTarget())) {
41 currentFS = (FlagState)fedge.getTarget();
42 if(this.counter > 0) {
43 //System.err.println(this.counter);
46 if((this.cd.getSymbol().equals("Cluster")) && (this.counter == 0)) {
48 this.currentFS = new FlagState(this.cd);
59 public ClassDescriptor getCd() {
63 public FlagState getCurrentFS() {
67 public boolean isChanged() {
71 public void setCurrentFS(FlagState currentFS) {
73 this.currentFS = currentFS;
76 public boolean isHold() {
80 public void setHold(boolean hold) {
84 public boolean isShared() {
88 public void setShared(boolean shared) {
92 public int getVersion() {
96 public void increaseVersion() {