Пример #1
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;
};
Пример #2
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;
};
Пример #3
0
void Stats::onSegmentExpUpdate(Segment::PtrConst _p) {
    FWK_DEBUG("Stats::onSegmentUpdate with " << _p->name());
    if (_p->expediteSupport() == Segment::fullExpediteSupport()) {
        expeditedSupportCount_++;
    } else {
        expeditedSupportCount_--;
    }
    updateExpPercentage();
}
Пример #4
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();
}