I ran simulations and i realised that non annex1 countries respond to all broadcast messages whether it is CDM or Trade BUY or Trade SELL. So I got results such as BGD buying from Ukraine. The bug is the following:
if (this.tradeProtocol.canHandle(in)) {
this.tradeProtocol.handle(in);
}
else {
if(in instanceof Message){
try{
@SuppressWarnings("unchecked")
Message<OfferMessage> m = (Message<OfferMessage>) in;
OfferMessage o = m.getData();
if(!this.tradeProtocol
.getActiveConversationMembers()
.contains(m.getFrom())){
try {
/*You should not respond to all the offers. You should see if the offer is of type that you want. If its a buy or sell offer you should ignore it as a non annex one country.*/
//TODO insert your logic here
this.tradeProtocol.offer(
m.getFrom(),
o.getOfferQuantity(),
o);
} catch (FSMException e) {
logger.warn(e);
}
}
}catch(ClassCastException e){
logger.warn("Class cast exception");
logger.warn(e);
}
}
}
In the above function NonAnnexOne exactly copies what was given in the wiki. You have to insert your country logic where I have given a TODO in the above function.
I ran simulations and i realised that non annex1 countries respond to all broadcast messages whether it is CDM or Trade BUY or Trade SELL. So I got results such as BGD buying from Ukraine. The bug is the following:
In the above function NonAnnexOne exactly copies what was given in the wiki. You have to insert your country logic where I have given a TODO in the above function.
Let me know if you have any problems :)