Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null OutcomeSpace #7

Closed
tomvand opened this issue Feb 3, 2014 · 1 comment
Closed

Null OutcomeSpace #7

tomvand opened this issue Feb 3, 2014 · 1 comment

Comments

@tomvand
Copy link
Contributor

tomvand commented Feb 3, 2014

Hey @alexwalterbos , I just looked into your problem with getting a null OutcomeSpace, and I am able to reproduce it. I think you can solve this by using new OutcomeSpace(negoSession.getUtilitySpace());, but I haven't checked in detail.

package negotiator.group1;

import java.util.HashMap;

import negotiator.bidding.BidDetails;
import negotiator.boaframework.NegotiationSession;
import negotiator.boaframework.OMStrategy;
import negotiator.boaframework.OfferingStrategy;
import negotiator.boaframework.OpponentModel;
import negotiator.boaframework.OutcomeSpace;

public class Group1_BS extends OfferingStrategy {
    NegotiationSession negoSession;

    @Override
    public void init(NegotiationSession negoSession,
            OpponentModel oppModel,
            OMStrategy oms,
            HashMap<String,Double> parameters) {

        this.negoSession=negoSession;
    }


    @Override
    public BidDetails determineNextBid() {
        // TODO Auto-generated method stub
        return determineOpeningBid();
    }

    @Override
    public BidDetails determineOpeningBid() {
        OutcomeSpace myOutcomeSpace = new OutcomeSpace(negoSession.getUtilitySpace());
        OutcomeSpace myOtherOutcomeSpace = negoSession.getOutcomeSpace();

        // Show if outcomespace is null
        if(myOutcomeSpace==null)
            System.out.println("OutcomeSpace is null!");
        else
            System.out.println("OutcomeSpace: "+myOutcomeSpace);

        // Show if otheroutcomespace is null
                if(myOtherOutcomeSpace==null)
                    System.out.println("OtherOutcomeSpace is null!");
                else
                    System.out.println("OtherOutcomeSpace: "+myOutcomeSpace);

        // Hang
        while(true);
    }

}
@alexwalterbos
Copy link
Collaborator

Yeah, @AlexKolpa just said that over the whatsapp. Thanks for helping, both of you!

Would've been awesome if I hadn't spent 2 hours on this =D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants