Esempio n. 1
0
void Stats::onSegmentNew(Segment::PtrConst _p) {
    FWK_DEBUG("Stats::onSegmentNew(" << _p->name() << ")");
    if (_p->type() == Segment::boatSegment()) {
        boatSegmentCount_++;
    } else if (_p->type() == Segment::truckSegment()) {
        truckSegmentCount_++;
    } else if (_p->type() == Segment::planeSegment()) {
        planeSegmentCount_++;
    }

    if (_p->expediteSupport() == Segment::fullExpediteSupport()) {
        expeditedSupportCount_++;
    }
    totalSegmentCount_++;
    updateExpPercentage();
}
Esempio n. 2
0
float PathTree::segmentTime(Segment::PtrConst s,Segment::ExpediteSupport expediteSupport) const{
    Segment::SegmentType st = s->type();
    float tSpeed = speed(st).value();
    if (s->expediteSupport() == Segment::fullExpediteSupport() && expediteSupport == Segment::fullExpediteSupport()){
        tSpeed *= 1.3;
    };
    return s->length().value() / tSpeed;
};
Esempio n. 3
0
float PathTree::segmentCost(Segment::PtrConst s, Segment::ExpediteSupport expediteSupport) const{
    Segment::SegmentType st = s->type();
    float newCost = s->length().value() * cost(st).value() * s->difficulty().value();
    if (s->expediteSupport() == Segment::fullExpediteSupport() && expediteSupport == Segment::fullExpediteSupport()){
        newCost*= 1.5;
    };
    return newCost;
};