01 package dk.deepthought.sidious.supportsystem;
02
03 import java.util.Collection;
04
05 /**
06 * This interface represents an adjustable in the system.
07 * <p>
08 * Note that all timerelated calculations must adhere to the systemwide
09 * <code>timestep</code> property.
10 * <p>
11 * All Implementing classes <i>MUST</i> adhere to the following:
12 * <li> contain a field representing its current setting.
13 * <li> override <code>hashCode</code> and <code>equals</code> with respect
14 * to its setting.
15 * <li> be immutable.
16 *
17 * @see SystemSettings
18 * @author Deepthought
19 *
20 */
21 public interface Adjustable {
22
23 /**
24 * Calculates the consequense of applying this adjustable to the specified
25 * state.
26 * <p>
27 * Returns a new <code>State</code> as the calculated consequence of
28 * applying this adjustable to the specified <code>state</code>.
29 *
30 * @param state
31 * the input state
32 * @return the resulting <code>State</code> from applying this adjustable
33 * to <code>state</code>
34 */
35 public State consequence(State state);
36
37 /**
38 * Returns the possible adjustments from the current setting of this
39 * <code>Adjustable</code>.
40 * <p>
41 * The resulting adjustments represent all currently possible adjustments
42 * that can be applied to this adjustable.
43 *
44 * @return the new possible settings
45 */
46 public Collection<Adjustable> possibleAdjustments();
47
48 /**
49 * Returns the id of this <code>Adjustable</code>.
50 *
51 * @return the id of this adjustable
52 */
53 public SuperLinkID getID();
54
55 /**
56 * Returns the setting of this <code>Adjustable</code>.
57 *
58 * @return the setting of this adjustable
59 */
60 public double getSetting();
61 }
|