MODULE WBDevFunctionCovariate1;

	IMPORT
		WBDevScalar,
		Math,
		MathFunc;
		
	TYPE
		Function = POINTER TO RECORD (WBDevScalar.Node) END;
		Factory = POINTER TO RECORD (WBDevScalar.Factory) END;
		
	VAR
		fact-: WBDevScalar.Factory;
		
	PROCEDURE (func: Function) DeclareArgTypes (OUT args: ARRAY OF CHAR);
	BEGIN
		args := "s";
	END DeclareArgTypes;
	
	PROCEDURE (func: Function) Evaluate (OUT value: REAL);
	CONST
		 
	VAR
      SEXF: REAL;
		
	BEGIN
		SEXF := func.arguments[0][0].Value(); 
		
		IF SEXF  = 1  THEN;
			value := 1; 
		ELSE;
			value := 0;
		END; 

	END Evaluate;
	
	PROCEDURE (f: Factory) New (option: INTEGER): Function;
	VAR
		func: Function;
	BEGIN
		NEW(func); func.Initialize; RETURN func;
	END New;
	
	PROCEDURE Install*;
	BEGIN
		WBDevScalar.Install(fact);
	END Install;
	
	PROCEDURE Init;
	VAR
		f: Factory;
	BEGIN
		NEW(f); fact := f;
	END Init;
	
BEGIN
	Init;
END WBDevFunctionCovariate1.


