12.4.2

[java]
class BelievePriceSIP extends BeliefTransferAdapter {
public BelievePriceSIP() {
super(BookSellerCapabilities.this,
SLPatternManip.fromFormula("(selling_price ??isbn ??price ??seller)"),
SLPatternManip.fromTerm("??agent"));
}

protected ArrayList doApply(MatchResult matchFormula, MatchResult matchAgent, ArrayList acceptResult, ArrayList refuseResult) {
return getAgentName().equals(matchFormula.term("seller") ?
// If the selling price to adopt is mine, refuse it
refuseResult :
// Else adopt it
acceptResult;
}
}
[/java]