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

Is there a way to access your own utility weights? #5

Closed
jogrundy opened this issue Oct 30, 2017 · 5 comments
Closed

Is there a way to access your own utility weights? #5

jogrundy opened this issue Oct 30, 2017 · 5 comments

Comments

@jogrundy
Copy link

I can see the weights in the party domain xml file, but do I have to parse this file to access the weights or is there a better way?
Cheers, Jo

@tdgunes
Copy link
Owner

tdgunes commented Oct 30, 2017

Hi Jo,

You must access weights of each issue via Genius API.

Can you try this and let me know whether this works:

AbstractUtilitySpace utilitySpace = info.getUtilitySpace();
AdditiveUtilitySpace additiveUtilitySpace = (AdditiveUtilitySpace) utilitySpace;

List<Issue> issues = additiveUtilitySpace.getDomain().getIssues();

for (Issue issue : issues) {
    System.out.println(additiveUtilitySpace.getWeight(issue.getNumber()));
}

There can be different types of utility spaces, in this coursework (also in the international competition ANAC), AdditiveUtilitySpace is used.

@tdgunes tdgunes self-assigned this Oct 30, 2017
@jogrundy
Copy link
Author

jogrundy commented Oct 30, 2017 via email

@tdgunes
Copy link
Owner

tdgunes commented Oct 30, 2017

@DoctorJo make sure info is accessible. For example:

2017-10-30-163510_3000x1920_scrot

@jogrundy
Copy link
Author

jogrundy commented Oct 30, 2017 via email

@tdgunes
Copy link
Owner

tdgunes commented Oct 30, 2017

No worries, glad to hear that it works. I'll add this to wiki.

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

No branches or pull requests

2 participants