01: /*
02: * <copyright>
03: *
04: * Copyright 1997-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: package org.cougaar.planning.ldm.measure;
27:
28: /** Interface for all Derivative or "Rate" Measures.
29: **/
30:
31: public interface Derivative extends Measure {
32: /** @return the numerator class of the derivative measure (dx of dx/dy) **/
33: Class getNumeratorClass();
34:
35: /** @return the denominator class of the derivative measure (dy of dx/dy) **/
36: Class getDenominatorClass();
37:
38: /** The value of the canonical instance will have no relationship to
39: * the value of the Derivative Measure, but is to be used for introspection
40: * purposes.
41: * @return a canonical instance of the numerator class.
42: **/
43: Measure getCanonicalNumerator();
44:
45: /** The value of the canonical instance will have no relationship to
46: * the value of the Derivative Measure, but is to be used for introspection
47: * purposes.
48: * @return a canonical instance of the denominator class.
49: **/
50: Measure getCanonicalDenominator();
51:
52: /** Get the value of the derivative measure by specifying both numerator and
53: * denominator units.
54: * @param numerator_unit to use
55: * @param denominator_unit to use
56: * @return value given these units
57: **/
58: double getValue(int numerator_unit, int denominator_unit);
59:
60: /** integrate the denominator, resulting in a non-derivative numerator.
61: * For example, computes a Distance given a Speed and a Duration.
62: *
63: * This is a synonym for multiply
64: * @param denominator to use
65: * @return a newly created Numerator measure.
66: **/
67: Measure computeNumerator(Measure denominator);
68:
69: double divideRate(Rate other);
70: }
|