Class MonotonicityCounterexamples
- java.lang.Object
-
- ptolemy.data.ontologies.lattice.adapters.monotonicityAnalysis.MonotonicityCounterexamples
-
public class MonotonicityCounterexamples extends java.lang.ObjectRepresentation of a set of counterexamples to monotonicity. Each counterexample is of the form of a pair of elements (x1,x2) where x1 ≤ x2, but f(x1) \not ≤ f(x2), for the non-monotonic function f under consideration.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ben Lickly
- Pt.AcceptedRating:
- Red (blickly)
- Pt.ProposedRating:
- Red (blickly)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMonotonicityCounterexamples.ConceptPairEncapsulate counterexample pairs.
-
Constructor Summary
Constructors Constructor Description MonotonicityCounterexamples()Construct an empty set of counterexamples.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Concept x1, Concept x2)Add a pair of concepts as a counterexample to this set.booleancontainsCounterexamples()Determine if this set contains any counterexamples.MonotonicityCounterexamples.ConceptPair[]entryArraySorted()Return the sorted entry array.java.util.Set<MonotonicityCounterexamples.ConceptPair>entrySet()Return a set of all the counterexamples.booleanequals(java.lang.Object o)static MonotonicityCounterexamplesfromToken(Token token)Create a counterexample set from a specific representation as a Ptolemy Token.inthashCode()java.lang.StringtoString()Return the string representation of the counterexample set.ArrayTokentoToken()Return a representation of the counterexample set as a Ptolemy Token.
-
-
-
Method Detail
-
fromToken
public static MonotonicityCounterexamples fromToken(Token token) throws IllegalActionException
Create a counterexample set from a specific representation as a Ptolemy Token. This Token must be an ArrayToken whose entries are TupleTokens each of length 2, where the lesser concept is on the left hand side and the greater concept is on the right hand side.- Parameters:
token- The Ptolemy Token representing a set of counterexamples to monotonicity.- Returns:
- The counterexample set represented by the given token.
- Throws:
IllegalActionException- If the given Token does not conform to the required structure;- See Also:
toToken()
-
add
public void add(Concept x1, Concept x2)
Add a pair of concepts as a counterexample to this set. This means that x1 ≤ x2, but for the (non-monotonic) function in question, f(x1) \not ≤ f(x2).- Parameters:
x1- The lesser concept.x2- The greater concept.
-
containsCounterexamples
public boolean containsCounterexamples()
Determine if this set contains any counterexamples.- Returns:
- True, if this set contains at least one counterexample. False, otherwise.
-
entryArraySorted
public MonotonicityCounterexamples.ConceptPair[] entryArraySorted()
Return the sorted entry array.- Returns:
- The sorted entry array.
-
entrySet
public java.util.Set<MonotonicityCounterexamples.ConceptPair> entrySet()
Return a set of all the counterexamples. For each pair in the set returned, (x1, x2), we have x1 ≤ x2, but on the function under consideration f(x1) \not ≤ f(x2)- Returns:
- A set of pairs of counterexamples.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Return the string representation of the counterexample set.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string representation of this set.
- See Also:
Object.toString()
-
toToken
public ArrayToken toToken() throws IllegalActionException
Return a representation of the counterexample set as a Ptolemy Token. This Token is an ArrayToken whose entries are TupleTokens each of length 2, where the lesser concept is on the left hand side and the greater concept is on the right hand side.- Returns:
- The Token representation of this set.
- Throws:
IllegalActionException- If any of the concepts are null- See Also:
fromToken(Token)
-
-