jadex.bdi.planlib.protocols.contractnet.CNPEvaluateProposalsPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-applib-bdi Show documentation
Show all versions of jadex-applications-applib-bdi Show documentation
The Jadex applib BDI package contains ready to use functionalities for BDI agents mostly in form of modules called capabilities.
The newest version!
package jadex.bdi.planlib.protocols.contractnet;
import jadex.bdi.planlib.protocols.IProposalEvaluator;
import jadex.bdi.planlib.protocols.NegotiationRecord;
import jadex.bdi.planlib.protocols.ParticipantProposal;
import jadex.bdiv3x.runtime.Plan;
/**
* Evaluate proposals using the proposal evaluator interface.
*/
public class CNPEvaluateProposalsPlan extends Plan
{
/**
* Plan body.
*/
public void body()
{
Object cfp = getParameter("cfp").getValue();
Object cfp_info = getParameter("cfp_info").getValue();
NegotiationRecord[] history = (NegotiationRecord[])getParameterSet("history").getValues();
ParticipantProposal[] proposals = (ParticipantProposal[])getParameterSet("proposals").getValues();
IProposalEvaluator evaluator = (IProposalEvaluator)cfp_info;
ParticipantProposal[] acceptables = evaluator.evaluateProposals(cfp, cfp_info, history, proposals);
getParameterSet("acceptables").addValues(acceptables);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy