private static void AddJasonFunction(Type c) { try { ArithFunction af = (ArithFunction)Activator.CreateInstance(typeof(ArithFunction)); functions.Add(af.GetName(), af); } catch (Exception e) { } }
/** add new global function (shared among all agents in the JVM) */ public static void AddFunction(Type c) { try { ArithFunction af = (ArithFunction)Activator.CreateInstance(typeof(ArithFunction)); string error = CheckFunctionName(af.GetName()); if (error == null) { functions.Add(af.GetName(), af); } } catch (Exception) { } }
private ArithFunction GetArithFunction(Literal l) { ArithFunction af = null; if (curAg != null) { // try to find the function in agent register af = curAg.GetFunction(l.GetFunctor(), l.GetArity()); } if (af == null) { // try global function af = FunctionRegister.GetFunction(l.GetFunctor(), l.GetArity()); } return(af); }
//Class<? extends ArithFunction> c ?? wtf is this private void AddFunction(Type c, bool user) { try { ArithFunction af = (ArithFunction)Activator.CreateInstance(typeof(ArithFunction)); string error = null; if (user) { error = FunctionRegister.CheckFunctionName(af.GetName()); } if (error != null) { //logger.warning(error); } else { functions.Add(af.GetName(), af); } } catch (Exception e) { //logger.log(Level.SEVERE, "Error registering function " + c.getName(), e); } }
public ArithFunctionTerm(ArithFunctionTerm af) : base(af) { function = af.function; agent = af.agent; }
public ArithFunctionTerm(ArithFunction function) : base(function.GetName(), 2) { this.function = function; }