source: boa/src/main/java/geniusweb/boa/biddingstrategy/BiddingStrategy.java@ 16

Last change on this file since 16 was 16, checked in by bart, 4 years ago

Enhanced tournament runner

File size: 1.8 KB
Line 
1package geniusweb.boa.biddingstrategy;
2
3import geniusweb.actions.Action;
4import geniusweb.actions.PartyId;
5import geniusweb.boa.BoaParty;
6import geniusweb.boa.NegoState;
7import geniusweb.boa.OpponentModel;
8import geniusweb.boa.acceptancestrategy.AcceptanceStrategy;
9import geniusweb.party.Party;
10import geniusweb.progress.Progress;
11import 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 */
35public 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}
Note: See TracBrowser for help on using the repository browser.