|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cfpm.caves.za.SortValues
public class SortValues
This class implements a user function in Jess. The function "sort-values" is used to sort a list of endorsement values in either descending or ascending order to allow the agent calling this function to pick the best / worst out of a group of endorsed agents.
Constructor Summary | |
---|---|
SortValues()
|
Method Summary | |
---|---|
jess.Value |
call(jess.ValueVector vv,
jess.Context context)
The first argument of the call is a list of numerical values, e.g. |
java.lang.String |
getName()
returns the name of the function in Jess |
(package private) static void |
merge(java.lang.Double[] values,
int lo,
int m,
int hi)
internal function: the merge step in Mergesort |
static void |
mergesort(java.lang.Double[] values,
int lo,
int hi)
internal function: recursive mergesort |
private void |
print(java.lang.Double[] list)
internal helper function for debugging: prints the given list of doubles |
private void |
print(int[] list)
internal helper function for debugging: prints the given list of integers |
private void |
print(jess.ValueVector list)
internal helper function for debugging: prints the given list of Values |
private int[] |
sort(java.lang.Double[] values)
internal function: sorts the list of given values and returns the sorted list of indices. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortValues()
Method Detail |
---|
public java.lang.String getName()
getName
in interface jess.Userfunction
public jess.Value call(jess.ValueVector vv, jess.Context context) throws jess.JessException
call
in interface jess.Userfunction
vv
- -- the ValueVector containing the header and parameterscontext
- -- the context of the Rete engine
jess.JessException
Userfunction.call(jess.ValueVector, jess.Context)
private int[] sort(java.lang.Double[] values)
public static void mergesort(java.lang.Double[] values, int lo, int hi)
static void merge(java.lang.Double[] values, int lo, int m, int hi)
private void print(java.lang.Double[] list)
private void print(int[] list)
private void print(jess.ValueVector list) throws jess.JessException
jess.JessException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |