Пример #1
0
/*!
  \param[in] pred The node preceding this node (in the path).
  \param[in] cargoLimit The cargo limit of the vehicle.
  */
void
Vehicle_node::evaluate(const Vehicle_node &pred, double cargoLimit) {
    /* time */
    m_travel_time    = pred.travel_time_to(*this);
    m_arrival_time   = pred.departure_time() + travel_time();
    m_wait_time      = is_early_arrival(arrival_time()) ?
                       opens() - m_arrival_time :
                       0;
    m_departure_time = arrival_time() + wait_time() + service_time();

    /* time aggregates */
    m_tot_travel_time = pred.total_travel_time() + travel_time();
    m_tot_wait_time    = pred.total_wait_time()    + wait_time();
    m_tot_service_time = pred.total_service_time() + service_time();

    /* cargo aggregates */
    if (is_dump() &&  pred.cargo() >= 0) {
        m_demand = -pred.cargo();
    }
    m_cargo = pred.cargo() + demand();

    /* cargo aggregates */

    m_twvTot = has_twv() ? pred.twvTot() + 1 : pred.twvTot();
    m_cvTot = has_cv(cargoLimit) ? pred.cvTot() + 1 : pred.cvTot();
    m_delta_time = departure_time() - pred.departure_time();
}
    void evaluate (const pathNode &pred,double cargoLimit){  
        distPrev=distance(pred);      //vehicle last move
        totDist=pred.gettotDist();
        twv=lateArrival(totDist);     //Time Window Violation
             
        waitTime=earlyArrival(totDist)? opens()-totDist:0;
        totDist+=waitTime+getServiceTime(); //totDist=opens()   should gice the same result

        cargo=pred.getcargo()+getdemand();       //loading or unloading 
        cv= cargo>cargoLimit or cargo < 0;  //capacity Violation
        twvTot = (twv)? pred.twvTot+pred.twvTot:pred.twvTot;
        cvTot = (cv)? pred.cvTot+1:pred.cvTot;
   };
Пример #3
0
/*!
 * \param[in] cargoLimit of the vehicle
 */
void
Vehicle_node::evaluate(double cargoLimit) {
    if (is_start()) {
        /* time */
        m_travel_time = 0;
        m_arrival_time = opens();
        m_wait_time = 0;
        m_departure_time = arrival_time() + service_time();

        /* time aggregates */
        m_tot_travel_time = 0;
        m_tot_wait_time = 0;
        m_tot_service_time = service_time();

        /* cargo aggregates */
        m_cargo = demand();

        /* violation aggregates */
        m_twvTot = m_cvTot = 0;
        m_cvTot = has_cv(cargoLimit) ? 1 : 0;
        m_delta_time = 0;
    }
}