Last change
on this file since 26 was 26, checked in by bart, 4 years ago |
Voting requests now contain Offers. Fixed windows whitespace issue. Partiesserver now supports up to 8 parties simultaneously.
|
File size:
910 bytes
|
Rev | Line | |
---|
[26] | 1 | package geniusweb.bidspace;
|
---|
| 2 |
|
---|
| 3 | import static org.junit.Assert.assertEquals;
|
---|
| 4 |
|
---|
| 5 | import java.io.IOException;
|
---|
| 6 | import java.nio.file.Files;
|
---|
| 7 | import java.nio.file.Paths;
|
---|
| 8 |
|
---|
| 9 | import org.junit.Test;
|
---|
| 10 |
|
---|
| 11 | import com.fasterxml.jackson.databind.ObjectMapper;
|
---|
| 12 |
|
---|
| 13 | import geniusweb.profile.Profile;
|
---|
| 14 | import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
|
---|
| 15 |
|
---|
| 16 | public class PartialSpaceFromUtilityTest {
|
---|
| 17 | private final static ObjectMapper jackson = new ObjectMapper();
|
---|
| 18 |
|
---|
| 19 | @Test
|
---|
| 20 | public void createPartialSpaceJobs() throws IOException {
|
---|
| 21 | String file1 = new String(Files.readAllBytes(Paths.get("src/test/resources/jobs/jobs1.json")));
|
---|
| 22 | LinearAdditiveUtilitySpace profile = (LinearAdditiveUtilitySpace) jackson.readValue(file1, Profile.class);
|
---|
| 23 | PartialSpaceFromUtility partial = new PartialSpaceFromUtility(profile, 20);
|
---|
| 24 | System.out.println(jackson.writeValueAsString(partial));
|
---|
| 25 | assertEquals(20, partial.getBetter().size());
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.