Switch to side-by-side view

--- a/src/Common/QoSCube.cc
+++ b/src/Common/QoSCube.cc
@@ -31,7 +31,7 @@
 
 QoSCube::QoSCube() : qoSId(VAL_DEFQOS),
         avgBand(VAL_DEFQOS), avgSDUBand(VAL_DEFQOS), peakBandDuration(VAL_DEFQOS), peakSDUBandDuration(VAL_DEFQOS),
-        burstPeriod(VAL_DEFQOS), burstDuration(VAL_DEFQOS), undetectedBitErr(VAL_DEFQOS), maxSDUsize(VAL_DEFQOS),
+        burstPeriod(VAL_DEFQOS), burstDuration(VAL_DEFQOS), undetectedBitErr(VAL_DEFQOS), pduDropProbability(VAL_DEFQOS), maxSDUsize(VAL_DEFQOS),
         partDeliv(false), incompleteDeliv(false), forceOrder(false),
         maxAllowGap(VAL_DEFQOS), delay(VAL_DEFQOS), jitter(VAL_DEFQOS),
         costTime(VAL_DEFQOS), costBits(VAL_DEFQOS)
@@ -249,6 +249,9 @@
     if (getUndetectedBitErr() != VAL_QOSPARDONOTCARE)
         (getUndetectedBitErr() <= other.getUndetectedBitErr()) ? score++ : score--;
 
+    if (getPduDropProbability() != VAL_QOSPARDONOTCARE)
+        (getPduDropProbability() <= other.getPduDropProbability()) ? score++ : score--;
+
     if (getMaxSduSize() != VAL_QOSPARDONOTCARE)
         (getMaxSduSize() <= other.getMaxSduSize()) ? score++ : score--;
 
@@ -279,10 +282,76 @@
     return score;
 }
 
+bool QoSCube::isFeasibility(const QoSCube other) const {
+    if (getAvgBand() != VAL_QOSPARDONOTCARE && getAvgBand() > other.getAvgBand())
+        return false;
+
+    if (getAvgSduBand() != VAL_QOSPARDONOTCARE && getAvgSduBand() > other.getAvgSduBand())
+        return false;
+
+    if (getPeakBandDuration() != VAL_QOSPARDONOTCARE && getPeakBandDuration() > other.getPeakBandDuration())
+        return false;
+
+    if (getPeakSduBandDuration() != VAL_QOSPARDONOTCARE && getPeakSduBandDuration() > other.getPeakSduBandDuration())
+        return false;
+
+    if (getBurstPeriod() != VAL_QOSPARDONOTCARE && getBurstPeriod() > other.getBurstPeriod())
+        return false;
+
+    if (getBurstDuration() != VAL_QOSPARDONOTCARE && getBurstDuration() > other.getBurstDuration())
+        return false;
+
+    if (getUndetectedBitErr() != VAL_QOSPARDONOTCARE && getUndetectedBitErr() > other.getUndetectedBitErr())
+        return false;
+
+    if (getPduDropProbability() != VAL_QOSPARDONOTCARE && getPduDropProbability() > other.getPduDropProbability())
+        return false;
+
+    if (getMaxSduSize() != VAL_QOSPARDONOTCARE && getMaxSduSize() > other.getMaxSduSize())
+        return false;
+
+    if(!other.isPartialDelivery() && isPartialDelivery())
+        return false;
+
+    if(!other.isIncompleteDelivery() && isIncompleteDelivery())
+        return false;
+
+    if(!other.isForceOrder() && isForceOrder())
+        return false;
+
+    if (getMaxAllowGap() != VAL_QOSPARDONOTCARE && getMaxAllowGap() > other.getMaxAllowGap())
+        return false;
+
+    if (getDelay() != VAL_QOSPARDONOTCARE && getDelay() > other.getDelay())
+        return false;
+
+    if (getJitter() != VAL_QOSPARDONOTCARE && getJitter() > other.getJitter())
+        return false;
+
+    if (getCostTime() != VAL_QOSPARDONOTCARE && getCostTime() > other.getCostTime())
+        return false;
+
+    if (getCostBits() != VAL_QOSPARDONOTCARE && getCostBits() > other.getCostBits())
+        return false;
+
+    if (getATime() != VAL_QOSPARDONOTCARE && getATime() > other.getATime())
+        return false;
+
+    return true;
+}
+
 bool QoSCube::isDTCPNeeded()const {
   return isPartialDelivery() || isForceOrder() || isIncompleteDelivery() || avgBand >= 0;
 }
 
+double QoSCube::getPduDropProbability() const {
+    return pduDropProbability;
+}
+
+void QoSCube::setPduDropProbability(double pduDropProbability) {
+    this->pduDropProbability = pduDropProbability;
+}
+
 std::string QoSCube::info() const {
     std::ostringstream os;
 
@@ -333,6 +402,12 @@
     else
         os << this->getUndetectedBitErr() << "%";
 
+    os << "\n   PDU dropping probability = ";
+    if ( this->getPduDropProbability() < 0 )
+        os << STR_DONOTCARE;
+    else
+        os << this->getPduDropProbability() << "%";
+
     os << "\n   max SDU Size = ";
     if ( this->getMaxSduSize() < 0 )
         os << STR_DONOTCARE;