public bool DefineRule() { bool isNewRule = false; int minConfl = -1; //if (conflHist.Count > 0) //minConfl = currentConflict.conflicts.GetCountConfl(); //if (currentConflict != null) //minConfl foreach (ConflictNote nt in someConflicts) { int curIdx = conflHist.FindIndex(el => el.conflicts == nt.conflicts); if (((minConfl < 0) || (nt.conflicts.GetCountConfl() < minConfl)) && ((curIdx < 0) || (conflHist[curIdx].iterationNumber < 6)))//> minConfl { minConfl = nt.conflicts.GetCountConfl(); currentConflict = nt; } /*else if (nt.conflicts.GetCountConfl() < currentConflict.conflicts.GetCountConfl()) * { * currentConflict = nt; * isNewRule = SetConflictNext(); * }*/ } if ((conflHist.Count <= 0) && (minConfl < 0))//((currentConflict == null) || (currentConflict.name == "")) { return(false); } int idx = conflHist.FindIndex(el => el.conflicts == currentConflict.conflicts); if (idx >= 0) { if (conflHist[idx].iterationNumber >= 6) { return(false); } currentConflict = conflHist[idx]; isNewRule = SetConflictNext(); } else { isNewRule = true; conflHist.Add(currentConflict); } /*if (!isNewRule) * { * isNewRule = false;//SetConflictNext(); * }*/ return(isNewRule); }
public bool DefineRule() { bool isNewRule = false; int minConfl = -1; //if (conflHist.Count > 0) //minConfl = currentConflict.conflicts.GetCountConfl(); //if (currentConflict != null) //minConfl foreach (ConflictNote nt in someConflicts) { int curIdx = conflHist.FindIndex(el => el.conflicts == nt.conflicts); if (((minConfl < 0) || (nt.conflicts.GetCountConfl() < minConfl)) && ((curIdx < 0) || (conflHist[curIdx].iterationNumber < 6)))//> minConfl { minConfl = nt.conflicts.GetCountConfl(); currentConflict = nt; } /*else if (nt.conflicts.GetCountConfl() < currentConflict.conflicts.GetCountConfl()) { currentConflict = nt; isNewRule = SetConflictNext(); }*/ } if ((conflHist.Count <= 0) && (minConfl < 0))//((currentConflict == null) || (currentConflict.name == "")) return false; int idx = conflHist.FindIndex(el => el.conflicts == currentConflict.conflicts); if (idx >= 0) { if (conflHist[idx].iterationNumber >= 6) return false; currentConflict = conflHist[idx]; isNewRule = SetConflictNext(); } else { isNewRule = true; conflHist.Add(currentConflict); } /*if (!isNewRule) { isNewRule = false;//SetConflictNext(); }*/ return isNewRule; }
public void AddConnection(NodePoint pnt1, NodePoint pnt2, int inLayer, //int idxNumber1, int idxNumber2, int inNumber2, int inDistance, ConflictParametr param, int count1, int count2) //check repeat { ConflictNote nt = new ConflictNote(); nt.name = pnt1.name; nt.number1 = pnt1.numberNode; nt.number2 = pnt2.numberNode; nt.indexNumber1 = pnt1.number; nt.indexNumber2 = pnt2.number; nt.conflicts = param; nt.distance = inDistance; nt.priority = pnt1.priority; nt.iterationNumber = 0; isBlockade = false; blockadedNumber = count2; if (inLayer == Layers.metal1Trace) { nt.border1Met = 1000; nt.border1Sil = 0; nt.border2Met = 0; nt.border2Sil = 0; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } else { nt.border1Met = 0; //pnt1.number; nt.border1Sil = 1000; //pnt1.number; nt.border2Met = 0; //pnt2.number; nt.border2Sil = 0; //pnt2.number; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } if ((count1 * 2) < count2) { blockadedNumber = count1; if (inLayer == Layers.metal1Trace) { nt.border1Met = 0; nt.border1Sil = 0; nt.border2Met = 1000; nt.border2Sil = 0; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } else { nt.border1Met = 0; nt.border1Sil = 0; nt.border2Met = 0; nt.border2Sil = 1000; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } isBlockade = true; } if ((count2 * 2) < count1) { isBlockade = true; } someConflicts.Add(nt); }
//check repeat public void AddConnection(NodePoint pnt1, NodePoint pnt2, int inLayer,//int idxNumber1, int idxNumber2, int inNumber2, int inDistance, ConflictParametr param, int count1, int count2) { ConflictNote nt = new ConflictNote(); nt.name = pnt1.name; nt.number1 = pnt1.numberNode; nt.number2 = pnt2.numberNode; nt.indexNumber1 = pnt1.number; nt.indexNumber2 = pnt2.number; nt.conflicts = param; nt.distance = inDistance; nt.priority = pnt1.priority; nt.iterationNumber = 0; isBlockade = false; blockadedNumber = count2; if (inLayer == Layers.metal1Trace) { nt.border1Met = 1000; nt.border1Sil = 0; nt.border2Met = 0; nt.border2Sil = 0; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } else { nt.border1Met = 0;//pnt1.number; nt.border1Sil = 1000;//pnt1.number; nt.border2Met = 0;//pnt2.number; nt.border2Sil = 0;//pnt2.number; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } if ((count1*2) < count2) { blockadedNumber = count1; if (inLayer == Layers.metal1Trace) { nt.border1Met = 0; nt.border1Sil = 0; nt.border2Met = 1000; nt.border2Sil = 0; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } else { nt.border1Met = 0; nt.border1Sil = 0; nt.border2Met = 0; nt.border2Sil = 1000; nt.compare1Met = true; nt.compare2Met = true; nt.compare1Sil = true; nt.compare2Sil = true; } isBlockade = true; } if ((count2*2) < count1) isBlockade = true; someConflicts.Add(nt); }