Line | |
---|
1 | package geniusweb.protocol.tournament.allpermutationslearn;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import com.fasterxml.jackson.annotation.JsonCreator;
|
---|
7 | import com.fasterxml.jackson.annotation.JsonProperty;
|
---|
8 |
|
---|
9 | import geniusweb.protocol.session.SessionResult;
|
---|
10 | import geniusweb.protocol.tournament.allpermutations.AllPermutationsSettings;
|
---|
11 | import geniusweb.protocol.tournament.allpermutations.AllPermutationsState;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * A non-parallel simple implementation of all-permutations
|
---|
15 | */
|
---|
16 | public class AllPermutationsLearnState extends AllPermutationsState {
|
---|
17 |
|
---|
18 | @JsonCreator
|
---|
19 | public AllPermutationsLearnState(
|
---|
20 | @JsonProperty("toursettings") AllPermutationsSettings toursettings,
|
---|
21 | @JsonProperty("results") List<SessionResult> results) {
|
---|
22 | super(toursettings, results);
|
---|
23 | }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | *
|
---|
27 | * @param result the next {@link SessionResult}
|
---|
28 | * @return new state
|
---|
29 | * @throws IllegalArgumentException if the result participants are not
|
---|
30 | * matching the expected participants
|
---|
31 | */
|
---|
32 | @Override
|
---|
33 | public AllPermutationsLearnState with(List<SessionResult> result) {
|
---|
34 | ArrayList<SessionResult> newresults = new ArrayList<>(results);
|
---|
35 | newresults.addAll(result);
|
---|
36 | return new AllPermutationsLearnState(
|
---|
37 | (AllPermutationsLearnSettings) toursettings, newresults);
|
---|
38 | }
|
---|
39 |
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.