Class SearchPath
java.lang.Object
com.softsynth.jmsl.score.transcribe.SearchPath
- All Implemented Interfaces:
java.lang.Cloneable
public class SearchPath
extends java.lang.Object
implements java.lang.Cloneable
A vector of BeatDivisions that asserts a solution for transcribing the events within one measure.
These compete against each other in HeuristicSearch. Clone is implemented so this path can be copied and
expanded with the next set of beat divisions.
- Author:
- Nick Didkovsky, Feb 10, 2002 , (c) 2002 Nick Didkovsky, All Rights reserved.
-
Constructor Summary
Constructors Constructor Description SearchPath()
-
Method Summary
Modifier and Type Method Description void
addBeatDivision(BeatDivision bd)
Add a beat division to this path, update the scorejava.lang.Object
clone()
override because we want a copy of the vector of beat divisions, not the same vectorjava.util.Vector
getBeatDivisions()
java.lang.String
getName()
int
getNextLegalBeat()
double
getScore()
java.lang.String
getTimePointIndexListing()
static void
main(java.lang.String[] args)
void
setNextLegalBeat(int b)
Set the next beat that this searchpath reaches.java.lang.String
toString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SearchPath
public SearchPath()
-
-
Method Details
-
setNextLegalBeat
public void setNextLegalBeat(int b)Set the next beat that this searchpath reaches. This is used to stall paths that jump ahead of others because their beat division spans two beats, for example -
getNextLegalBeat
public int getNextLegalBeat()- Returns:
- the next beat that this SearchPath reaches. For example, if this path contains on BeatDivision starting at beat 0, with a timespan of 2, the next legal beat is 2
-
addBeatDivision
Add a beat division to this path, update the score -
getScore
public double getScore()- Returns:
- sum of all scores of all beat divisions in this path
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionoverride because we want a copy of the vector of beat divisions, not the same vector- Throws:
java.lang.CloneNotSupportedException
-
getName
public java.lang.String getName() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getTimePointIndexListing
public java.lang.String getTimePointIndexListing()- Returns:
- listing all time points hit by the search path and the indexes of the MusicShape they contain.
-
getBeatDivisions
public java.util.Vector getBeatDivisions() -
main
public static void main(java.lang.String[] args)
-