[CHiPPS] Questions on ALPS interface

Yan Xu Yan.Xu at sas.com
Tue Sep 14 10:11:45 EDT 2010


Very sorry for the late response. 

1. For serial code, they are the same. getIncumbentValue() is used by a process to query the quality of the best solution it stores. getBestQuality() is only used by the master process to query the quality of the best solution it knows.  For parallel code, see following code snippet from AlpsKnowledgeBrokerMPI.h

    /** @name Report search results. */
    //@{
    /** The process queries the quality of the incumbent this process stores. */
    virtual double getIncumbentValue() const {
        double bestObj = ALPS_OBJ_MAX;
        if (AlpsKnowledgeBroker::hasKnowledge(AlpsKnowledgeTypeSolution)) {
	    bestObj = getBestKnowledge(AlpsKnowledgeTypeSolution).second;
            if (incumbentValue_ > bestObj) {
                return bestObj;
            }
        }
	return incumbentValue_;
    }
 
    /** The master queries the quality of the best solution it knowns. */
    virtual double getBestQuality() const {
       if (globalRank_ == masterRank_) {
            if (getNumKnowledges(AlpsKnowledgeTypeSolution) > 0) {
                return getBestKnowledge(AlpsKnowledgeTypeSolution).second;   
            }
            else {
                return ALPS_OBJ_MAX;
            }
	}
        else {
            return ALPS_OBJ_MAX;
        }
    }


2. The return code of AlpsTreeNode::process is not actually used. So, you can simply return  0. I will update the comment.

Hope this helps & thanks for trying CHiPPS,

Yan


-----Original Message-----
From: chipps-bounces at list.coin-or.org [mailto:chipps-bounces at list.coin-or.org] On Behalf Of Hans Pirnay
Sent: Wednesday, September 08, 2010 11:31 AM
To: chipps at list.coin-or.org
Subject: [CHiPPS] Questions on ALPS interface

Hello everyone,

first of all, thanks for the great piece of code!

While using the ALPS interface I have come across two questions:

1. what is the difference between KnowledgeBroker::getIncumbentValue()
and KnowledgeBroker::getBestQuality() ?

2. what is the integer output of the function AlpsTreeNode::process that I am supposed to overload supposed to be? In the Knap example, this returns "false" (e.g. 0) if no solution was found and 1 otherwise. Is that how it's supposed to be done?

Thanks

Hans

_______________________________________________
CHiPPS mailing list
CHiPPS at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/chipps




More information about the CHiPPS mailing list