-
Notifications
You must be signed in to change notification settings - Fork 10
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
Comments
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), |
Hi Taha
I got this error message when trying to build, after making sure both abstract and additive utility space were imported:
Error:(84, 45) java: info has private access in negotiator.parties.AbstractNegotiationParty
Error:(87, 14) java: cannot find symbol
symbol: class Issue
location: class ExampleAgent
Error:(89, 14) java: cannot find symbol
symbol: class Issue
location: class ExampleAgent
where lines 84 - 91 were the lines pasted in to otherwise working code.
I’m trying to work around it now..
Jo
… On 30 Oct 2017, at 12:51, Taha Doğan Güneş ***@***.***> wrote:
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()));
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#5 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/Ab9CE08OZWEmXd5XpBhoEnPDF-XxFiteks5sxcZdgaJpZM4QLHOz>.
|
@DoctorJo make sure |
I got this to work
AdditiveUtilitySpace additiveUtilitySpace = (AdditiveUtilitySpace) utilitySpace;
List<Issue> issues = additiveUtilitySpace.getDomain().getIssues();
for (Issue issue : issues) {
System.out.println(additiveUtilitySpace.getWeight(issue.getNumber()));
}
after making sure I imported negotiator issue.Issue ..
as it did not seem like AbstractUtilitySpace was used..
Thank you very much for your help again!
Jo
… On 30 Oct 2017, at 16:36, Taha Doğan Güneş ***@***.***> wrote:
@DoctorJo <https://github.com/doctorjo> make sure info is accessible. For example:
<https://user-images.githubusercontent.com/136392/32183132-60c30a22-bd90-11e7-87ac-a7e5ae46283a.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#5 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/Ab9CE4vdx9nQuraWPTNDPY94EDw40DAhks5sxfrwgaJpZM4QLHOz>.
|
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
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
The text was updated successfully, but these errors were encountered: