01: /*
02: * <copyright>
03: *
04: * Copyright 2002-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.core.adaptivity;
28:
29: /**
30: * A Condition holds a value that the {@link AdaptivityEngine} or
31: * {@link PolicyManager PolicyManager} uses for selecting
32: * {@link Play Play}s or
33: * {@link OperatingModePolicy OperatingModePolicy}s.
34: * Conditions include the measurements made by sensors, external
35: * conditions distributed throughout portions of the society and
36: * inputs from higher level adaptivity engines. This interface does
37: * not define a setValue method because establishing the current value
38: * is the responsibility of the owner of the Condition.
39: **/
40: public interface Condition extends java.io.Serializable {
41:
42: /**
43: * Gets the (distinct) name of this Condition. The names of all
44: * the Condition on a particular blackboard must be distinct. This
45: * can be achieved by establishing naming conventions such has
46: * including the class name of the plugin or other component that
47: * created the Condition in the name. Where the same component
48: * class may be instantiated multiple times, the multiple
49: * instances may already have some sor of name that can be used in
50: * addition to the class name. It is the responsibility of the
51: * component designer to insure that Condition names are not
52: * ambiguous.
53: * @return the name of this Condition
54: **/
55: String getName();
56:
57: /**
58: * Get the list of allowed value ranges for this OperatingMode.
59: * Attempts to set the value outside these ranges will fail.
60: * @return a list of allowed value ranges
61: **/
62: OMCRangeList getAllowedValues();
63:
64: /**
65: * Get the current value of this OperatingMode. This value must
66: * never be outside the allowed value ranges.
67: * @return the current value of this OperatingMode
68: **/
69: Comparable getValue();
70: }
|