1 | package geniusweb.boa.biddingstrategy;
|
---|
2 |
|
---|
3 | import geniusweb.actions.Action;
|
---|
4 | import geniusweb.actions.PartyId;
|
---|
5 | import geniusweb.boa.BoaParty;
|
---|
6 | import geniusweb.boa.NegoState;
|
---|
7 | import geniusweb.boa.OpponentModel;
|
---|
8 | import geniusweb.boa.acceptancestrategy.AcceptanceStrategy;
|
---|
9 | import geniusweb.party.Party;
|
---|
10 | import geniusweb.progress.Progress;
|
---|
11 | import tudelft.utilities.logging.Reporter;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Interface to objects that can determines when to bid what. Implementors are
|
---|
15 | * assumed to model all opponents using the provided {@link OpponentModel}, and
|
---|
16 | * to evaluate the offered bids using the provided {@link AcceptanceStrategy}.
|
---|
17 | * <p>
|
---|
18 | * To avoid the need for the event handling as in {@link Party}, this class
|
---|
19 | * interfaces through different classes than Party:
|
---|
20 | * <ul>
|
---|
21 | * <li>Incoming "Settings" events are now
|
---|
22 | * {@link #with(Progress, PartyId, Class, Class, Reporter)}
|
---|
23 | * <li>Incoming notifications now {@link #with(Action)}
|
---|
24 | * <li>Progress advancing is now triggered with {@link #with(Progress)}
|
---|
25 | * <li>Outgoing actions are replaced with {@link #getAction()} and
|
---|
26 | * {@link #getActionTime()}.
|
---|
27 | * </ul>
|
---|
28 | * <p>
|
---|
29 | * Usually part of a {@link BoaParty}.
|
---|
30 | *
|
---|
31 | * <p>
|
---|
32 | * MUST * have an empty constructor. Implementations are supposed to be
|
---|
33 | * immutable.
|
---|
34 | */
|
---|
35 | public interface BiddingStrategy {
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * @return unix time (ms since 1970 ) at which the value from
|
---|
39 | * {@link #getAction()} becomes valid. This allows the strategy to
|
---|
40 | * delay actions after it has got the turn, or to wait for other
|
---|
41 | * events to happen. Action will be executed as soon as possible
|
---|
42 | * after the indicated time.
|
---|
43 | */
|
---|
44 | default Long getActionTime(NegoState state) {
|
---|
45 | return 0l;
|
---|
46 | }
|
---|
47 |
|
---|
48 | /**
|
---|
49 | *
|
---|
50 | * @return the suggested next Action. Valid only after
|
---|
51 | * {@link #getActionTime()} > System.currentTimeMillis().
|
---|
52 | */
|
---|
53 | Action getAction(NegoState state);
|
---|
54 |
|
---|
55 | }
|
---|