1 package Analysis.Scheduling;
3 import Analysis.TaskStateAnalysis.*;
6 /* Edge *****************/
8 public class ScheduleEdge extends Edge {
11 private final TaskDescriptor td;
12 private final ClassDescriptor cd;
14 private FlagState targetFState;
15 private ClassNode sourceCNode;
16 private ClassNode targetCNode;
18 private int probability;
19 //private int parameterindex;
24 public ScheduleEdge(ScheduleNode target, String label, TaskDescriptor td, ClassDescriptor cd/*, int parameterindex*/) {
27 this.targetFState = null;
28 this.sourceCNode = null;
29 this.targetCNode = null;
34 this.probability = 100;
35 //this.parameterindex = parameterindex;
38 public void setTarget(ScheduleNode sn) {
42 public String getLabel() {
43 String completeLabel = label + ":" + Integer.toString(this.newRate) + ":(" + Integer.toString(this.probability) + ")";
47 public int hashCode(){
48 return target.hashCode()^label.hashCode();
51 public TaskDescriptor getTask() {
55 public ClassDescriptor getClassDescriptor() {
59 public FEdge getFEdge() {
63 public void setFEdge(FEdge fEdge) {
67 public FlagState getSourceFState() {
68 if(this.fedge == null) {
71 return (FlagState)this.fedge.getTarget();
74 public void setTargetFState(FlagState targetFState) {
75 this.targetFState = targetFState;
78 public FlagState getTargetFState() {
79 return this.targetFState;
82 public int getProbability() {
83 return this.probability;
86 public int getNewRate() {
90 public ClassNode getSourceCNode() {
91 return this.sourceCNode;
94 public void setSourceCNode(ClassNode sourceCNode) {
95 this.sourceCNode = sourceCNode;
98 public ClassNode getTargetCNode() {
99 return this.targetCNode;
102 public void setTargetCNode(ClassNode targetCNode) {
103 this.targetCNode = targetCNode;
106 /* public int getIndex() {
107 return parameterindex;
110 public boolean equals(Object o) {
111 if (o instanceof ScheduleEdge) {
112 ScheduleEdge e=(ScheduleEdge)o;
113 if ((e.label.equals(label))&&
114 (e.target.equals(target))&&
117 (e.fedge.equals(fedge)) &&
118 (e.targetFState.equals(targetFState)) &&
119 (e.sourceCNode.equals(sourceCNode)) &&
120 (e.targetCNode.equals(targetCNode)) &&
121 (e.newRate == newRate) &&
122 (e.probability == probability)/*&&
123 e.getIndex()==parameterindex*/)
129 public void setProbability(int prob) {
130 this.probability = prob;
133 public void setNewRate(int nr) {