As the error message says, Jess doesn't support these functions, but
their implementation in Java would be trivial:
import jess.*;
public class Cosine implements Userfunction, Serializable
{
public String getName() { return "cos" ;}
public Value call( ValueVector vv, Context context ) throws JessException
{
Value v = vv.get( 1 ).resolveValue(context) ;
return new Value( Math.cos( v.numericValue(context) ), RU.FLOAT );
}
}
Manual section 5.1 tells you how to use this from Jess.
I think Raghavendra Jagirdar wrote:
> Hello Jess Users:
>
> I was trying to use trignometric functions like (sin, cos, tan.
> Jess gave the following error. To implement these functions, should I have
> to implement in Java, or I am calling in wrong way?
>
> Thank you
> Raghavendra
>
> Jess> (cos 0)
> Jess reported an error in routine Funcall.execute while executing (cos 0).
> Message: Unimplemented function cos.
> Program text: ( cos 0 ) at line 1.
> at jess.Funcall.execute(Funcall.java:234)
> at jess.Jesp.parseAndExecuteFuncall(Jesp.java:1585)
> at jess.Jesp.parseSexp(Jesp.java:185)
> at jess.Jesp.parse(Compiled Code)
> at jess.Main.execute(Compiled Code)
> at jess.Main.main(Main.java:28)
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------