Ejemplo n.º 1
0
/** creates the stp variable pricer and includes it in SCIP */
SCIP_RETCODE SCIPincludePricerStp(
   SCIP*                 scip                /**< SCIP data structure */
   )
{

   SCIP_PRICERDATA* pricerdata;
   SCIP_PRICER* pricer;
   SCIPdebugPrintf("include Pricer \n");

   /* create stp variable pricer data */
   SCIP_CALL( SCIPallocMemory(scip, &pricerdata) );
   pricerdata->scip = scip;

   /* include variable pricer */
   pricer = NULL;
   SCIP_CALL( SCIPincludePricerBasic(scip, &pricer, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY,
         pricerRedcostStp, pricerFarkasStp, pricerdata) );
   assert(pricer != NULL);

   /* set non fundamental callbacks via setter functions */
   SCIP_CALL( SCIPsetPricerCopy(scip, pricer, pricerCopyStp) );
   SCIP_CALL( SCIPsetPricerFree(scip, pricer, pricerFreeStp) );
   SCIP_CALL( SCIPsetPricerInit(scip, pricer, pricerInitStp) );
   SCIP_CALL( SCIPsetPricerInitsol(scip, pricer, pricerInitsolStp) );
   SCIP_CALL( SCIPsetPricerExitsol(scip, pricer, pricerExitsolStp) );

   return SCIP_OKAY;
}
Ejemplo n.º 2
0
/** creates the binpacking variable pricer and includes it in SCIP */
SCIP_RETCODE SCIPincludePricerBinpacking(
   SCIP*                 scip                /**< SCIP data structure */
   )
{
   SCIP_PRICERDATA* pricerdata;
   SCIP_PRICER* pricer;

   /* create binpacking variable pricer data */
   SCIP_CALL( SCIPallocMemory(scip, &pricerdata) );

   pricerdata->conshdlr = SCIPfindConshdlr(scip, "samediff");
   assert(pricerdata->conshdlr != NULL);

   pricerdata->conss = NULL;
   pricerdata->weights = NULL;
   pricerdata->ids = NULL;
   pricerdata->nitems = 0;
   pricerdata->capacity = 0;

   /* include variable pricer */
   SCIP_CALL( SCIPincludePricerBasic(scip, &pricer, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY,
         pricerRedcostBinpacking, pricerFarkasBinpacking, pricerdata) );

   SCIP_CALL( SCIPsetPricerFree(scip, pricer, pricerFreeBinpacking) );
   SCIP_CALL( SCIPsetPricerInit(scip, pricer, pricerInitBinpacking) );
   SCIP_CALL( SCIPsetPricerExitsol(scip, pricer, pricerExitsolBinpacking) );

   /* add binpacking variable pricer parameters */
   /* TODO: (optional) add variable pricer specific parameters with SCIPaddTypeParam() here */

   return SCIP_OKAY;
}
Ejemplo n.º 3
0
/** creates the xyz variable pricer and includes it in SCIP */
SCIP_RETCODE SCIPincludePricerXyz(
   SCIP*                 scip                /**< SCIP data structure */
   )
{
   SCIP_PRICERDATA* pricerdata;
   SCIP_PRICER* pricer;

   /* create xyz variable pricer data */
   pricerdata = NULL;
   /* TODO: (optional) create variable pricer specific data here */

   pricer = NULL;

   /* include variable pricer */
#if 0
   /* use SCIPincludePricer() if you want to set all callbacks explicitly and realize (by getting compiler errors) when
    * new callbacks are added in future SCIP versions
    */
   SCIP_CALL( SCIPincludePricer(scip, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY,
         pricerCopyXyz, pricerFreeXyz, pricerInitXyz, pricerExitXyz, 
         pricerInitsolXyz, pricerExitsolXyz, pricerRedcostXyz, pricerFarkasXyz,
         pricerdata) );
#else
   /* use SCIPincludePricerBasic() plus setter functions if you want to set callbacks one-by-one and your code should
    * compile independent of new callbacks being added in future SCIP versions
    */
   SCIP_CALL( SCIPincludePricerBasic(scip, &pricer, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY,
         pricerRedcostXyz, pricerFarkasXyz, pricerdata) );
   assert(pricer != NULL);

   /* set non fundamental callbacks via setter functions */
   SCIP_CALL( SCIPsetPricerCopy(scip, pricer, pricerCopyXyz) );
   SCIP_CALL( SCIPsetPricerFree(scip, pricer, pricerFreeXyz) );
   SCIP_CALL( SCIPsetPricerInit(scip, pricer, pricerInitXyz) );
   SCIP_CALL( SCIPsetPricerExit(scip, pricer, pricerExitXyz) );
   SCIP_CALL( SCIPsetPricerInitsol(scip, pricer, pricerInitsolXyz) );
   SCIP_CALL( SCIPsetPricerExitsol(scip, pricer, pricerExitsolXyz) );
#endif

   /* add xyz variable pricer parameters */
   /* TODO: (optional) add variable pricer specific parameters with SCIPaddTypeParam() here */

   return SCIP_OKAY;
}