Package org.ptolemy.machineImprovisation
Class FactorOracle.ChordFunction
- java.lang.Object
-
- org.ptolemy.machineImprovisation.FactorOracle.ChordFunction
-
- All Implemented Interfaces:
Function
- Enclosing class:
- FactorOracle
protected class FactorOracle.ChordFunction extends java.lang.Object implements Function
A function that evaluates to true if the "pitch" that would be produced as a result of taking this transition satisfies chord specifications. In the current application, the specifications are given byMusicSpecs.getChordPitches(String, boolean)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FactorOracle.ChordFunction.ChordFunctionToken
A chord function token.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChordFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Token
apply(Token[] arguments)
Apply the function to the list of arguments, which are tokens.int
getNumberOfArguments()
Return the number of arguments of the function.boolean
isCongruent(Function function)
Return true if this function is congruent to the given function.java.lang.String
toString()
Return a string representation.
-
-
-
Method Detail
-
apply
public Token apply(Token[] arguments) throws IllegalActionException
Description copied from interface:Function
Apply the function to the list of arguments, which are tokens.- Specified by:
apply
in interfaceFunction
- Parameters:
arguments
- The list of arguments.- Returns:
- The result of applying the function to the given arguments.
- Throws:
IllegalActionException
- If thrown during evaluating the function.
-
getNumberOfArguments
public int getNumberOfArguments()
Description copied from interface:Function
Return the number of arguments of the function.- Specified by:
getNumberOfArguments
in interfaceFunction
- Returns:
- The number of arguments of the function.
-
isCongruent
public boolean isCongruent(Function function)
Description copied from interface:Function
Return true if this function is congruent to the given function. Classes should implement this method so that two functions are congruent under any renaming of the bound variables of the function. For simplicity, a function need only be congruent to other functions of the same class.- Specified by:
isCongruent
in interfaceFunction
- Parameters:
function
- The function to check congruency against.- Returns:
- True if this function is congruent with the given function.
-
-