Beispiel #1
0
/** Farkas pricing method of variable pricer for infeasible LPs */
static
SCIP_DECL_PRICERFARKAS(pricerFarkasStp)
{ /*lint --e{715}*/
   SCIP_CALL( pricing(scip, pricer,  NULL, TRUE) );

   return SCIP_OKAY;
}
Beispiel #2
0
/** reduced cost pricing method of variable pricer for feasible LPs */
static
SCIP_DECL_PRICERREDCOST(pricerRedcostStp)
{ /*lint --e{715}*/
   SCIP_CALL( pricing(scip, pricer, lowerbound, FALSE) );

   /* set result pointer */
   *result = SCIP_SUCCESS;
   return SCIP_OKAY;
}
Beispiel #3
0
void firm::activate(string market_type)
{
    if (market_type == "labor_market")
    {
        set_vacancies();
    }
    else
    {
        if (type == "foreign")
        {
            storage = std::numeric_limits<float>::max();
        }
        else
        {
            produce();
            storage += production;
            price = pricing();
        }
    }
}
Beispiel #4
0
double solve_lp(int cleaning)

{
    double lb;
    float  t1;
    
    t1 = seconds();
    if ( JJdualopt(lp) ){        
        std::cout << " it was not possible to solve with DUALOPT " << std::endl;
        CSPexit(EXIT_LPSOLVER); //exit(1);
    }
    toptimize += seconds()-t1;
    if( pricing_util%5==0 ){
PRIC:
        while( pricing(cleaning) ){
            pricing_util = -1;
            t1 = seconds();
            if ( JJoptimize(lp) ){                
                std::cout << " it was not possible to solve with OPTIMIZE " << std::endl;
                CSPexit(EXIT_LPSOLVER); //exit(1);
            }
            toptimize += seconds()-t1;
        }
        pricing_done = 1;
    } else {
        pricing_done = 0;
    }
    pricing_util ++;


#ifdef STAMP
    if( JJgetitc(lp)==0 ){
        std::cout << "WARNING: no LP iterations!" << std::endl;
    }
#endif


    switch( JJgetstat(lp) ){
        case JJ_OPTIMAL:
        case JJ_OPTIMAL_INFEAS:
            JJgetobjval( lp , &lb );
            lb += lowerb1;
            if( ceil(lb-ZERO) > upperb-ZERO && pricing_done==0 )
                goto PRIC;            
            return(lb);
        case JJ_INFEASIBLE:
            if( pricing_done==0 )
                goto PRIC;
#ifdef STAMP
            std::cout << " WARNING: non-feasible LP problem" << std::endl;
#endif
            return( (double)upperb );
        case JJ_UNBOUNDED:
            if( pricing_done==0 )
                goto PRIC;
#ifdef STAMP
            std::cout << " WARNING: non-bounded LP problem" << std::endl;
#endif
            return( (double)upperb );
        default:            
            std::cout << " ERROR: pstat=" << JJgetstat(lp)  << std::endl;
            JJlpwrite(lp,"sdc.lp");
            CSPexit(EXIT_ERROR); //exit(1);
    }
    return(0.0);
}