[Scip] New Solution Callback
Jakob Breier
Jakob.Breier at rwth-aachen.de
Tue Jul 20 18:49:16 MEST 2010
Hi,
with the help of your reply I got it to work that night, thanks :) .
For those that are interested in a C++-ish solution I attached my class
files. The SCIPcatchEvent and SCIPdropEvent calls are essentially in the
same place as in Stefan Heinz' example.
Regards,
Jakob Breier
On 07/16/2010 10:43 PM, Stefan Vigerske wrote:
> Hi,
>
> Jakob Breier wrote:
>
>> SolFoundEventHandler::SolFoundEventHandler() :
>> ObjEventhdlr("SOLFOUND","desc")
>> // As far as I understand the interface the above line should tell
>> // scip that I want to catch the SOLFOUND event.
>> {
>>
>> }
>>
> No, "SOLFOUND" is just the name of your eventhandler.
> I think you need to catch and drop the solfound event by call something like
> SCIP_CALL( SCIPcatchEvent(scip, SCIP_EVENTTYPE_SOLFOUND, eventhdlr,
> eventdata, NULL) );
> in scip_initsol and
> SCIP_CALL( SCIPdropEvent(scip, SCIP_EVENTTYPE_SOLFOUND, eventhdlr,
> eventdata, -1) );
> in scip_exitsol.
>
> Stefan
>
>
>>
>> SCIP_RETCODE SolFoundEventHandler::scip_exec(
>> SCIP* scip,
>> SCIP_EVENTHDLR* eventhdlr,
>> SCIP_EVENT* event,
>> SCIP_EVENTDATA* eventdata
>> )
>> {
>>
>> SCIPerrorMessage("This message will never be printed.");
>> SCIPABORT();
>>
>> return SCIP_OKAY;
>>
>>
>> }
>>
>> Also "SCIP_CALL_ABORT(SCIPincludeObjEventhdlr(scip_,
>> &solFoundEventHandler, false));" is called before the solving begins
>> (solFoundEventHandler is of course an object of type
>> SolFoundEventHandler). Yet SCIP_RETCODE SolFoundEventHandler::scip_exec
>> is never called.
>> Do you know what I do wrong?
>>
>> Regards,
>> Jakob Breier
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
>>
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SolFoundEventHandler.h
Type: text/x-chdr
Size: 840 bytes
Desc: not available
Url : http://listserv.zib.de/mailman/private/scip/attachments/20100720/5a3fcaf8/SolFoundEventHandler.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SolFoundEventHandler.cpp
Type: text/x-c++src
Size: 1293 bytes
Desc: not available
Url : http://listserv.zib.de/mailman/private/scip/attachments/20100720/5a3fcaf8/SolFoundEventHandler-0001.bin
More information about the Scip
mailing list