コード例 #1
0
 private static void AddJasonFunction(Type c)
 {
     try
     {
         ArithFunction af = (ArithFunction)Activator.CreateInstance(typeof(ArithFunction));
         functions.Add(af.GetName(), af);
     }
     catch (Exception e)
     {
     }
 }
コード例 #2
0
 /** 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)
     {
     }
 }
コード例 #3
0
ファイル: as2jHeader.cs プロジェクト: nasa03/Jasonity
        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);
        }
コード例 #4
0
 //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);
     }
 }
コード例 #5
0
 public ArithFunctionTerm(ArithFunctionTerm af) : base(af)
 {
     function = af.function;
     agent    = af.agent;
 }
コード例 #6
0
 public ArithFunctionTerm(ArithFunction function) : base(function.GetName(), 2)
 {
     this.function = function;
 }