|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjm.music.tools.AdaptiveMatrix
AdaptiveMatrix is responsible for hold Markov information in an internal matrix which may be written to disk as a serialized java object The matrix itself will contain two arrays. The first array will contain historic information. The second array will contain weightings. These arrays will both allow for n level markov Matrix's.
| Constructor Summary | |
AdaptiveMatrix(int[] numArray,
int depth,
int indexRange)
This constructor is used when the Matrix is being created for the first time. |
|
AdaptiveMatrix(java.lang.String fileName)
This constructor is used when the matrix is being read from an existing file. |
|
| Method Summary | |
int[] |
generate(int length,
int[] seed)
Generate returns an array of generated index values |
java.util.Hashtable |
getCountMatrix()
retrieve the count matrix |
int |
getDepth()
get matrix's depth |
int |
getIndexRange()
retrieve the index range |
java.util.Hashtable |
getWeightMatrix()
retrieve the matrix |
void |
print()
A simple print method for displaying the contents of a matrix. |
void |
read(java.lang.String fileName)
Read the matrix to file |
void |
update(int[] numArray)
update an existing AdaptiveMatrix with new data |
void |
write(java.lang.String fileName)
Saves the matrix to file |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AdaptiveMatrix(int[] numArray,
int depth,
int indexRange)
numArray - are the values to use in the matriXdepth - the number of prior states.indexRange - the range of numbers to use for indexingpublic AdaptiveMatrix(java.lang.String fileName)
fileName - the fileName to read an existing Matrix from| Method Detail |
public void update(int[] numArray)
numArray - are the valuew to use in the matrix
public int[] generate(int length,
int[] seed)
length - the number of indexes to return. The
seed data is included in the length value.seed - the data to use as a starting point
public void read(java.lang.String fileName)
public void write(java.lang.String fileName)
public void print()
public int getDepth()
public java.util.Hashtable getWeightMatrix()
public java.util.Hashtable getCountMatrix()
public int getIndexRange()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||