protected override double OverrideFunction(string[] parameters, XMParser xmParser, List<XArray> arrs) { double sum = 0; int s = (int)xmParser.GetDouble(parameters[1], 0, arrs); int e = (int)xmParser.GetDouble(parameters[2], 0, arrs); List<XArray> arrList = new List<XArray>(); arrList.Add(new XArray("n", 1)); for (int i = s; i <= e; i++) { arrList[0].vars[0] = i; sum += xmParser.GetDouble(parameters[0], 0, XArray.ConnectLists(arrs, arrList)); } return sum; }
protected override double OverrideFunction(string[] parameters, XMParser xmParser, List <XArray> arrs) { double sum = 0; int s = (int)xmParser.GetDouble(parameters[1], 0, arrs); int e = (int)xmParser.GetDouble(parameters[2], 0, arrs); List <XArray> arrList = new List <XArray>(); arrList.Add(new XArray("n", 1)); for (int i = s; i <= e; i++) { arrList[0].vars[0] = i; sum += xmParser.GetDouble(parameters[0], 0, XArray.ConnectLists(arrs, arrList)); } return(sum); }
protected override double OverrideFunction(string[] parameters, XMParser xmParser, List<XArray> arrs) { Random r = new Random(); if (parameters.Length == 1) { int len = (int)xmParser.GetDouble(parameters[0], 0, arrs); return (double)r.Next(len); } else if (parameters.Length == 2) { int a = (int)xmParser.GetDouble(parameters[0], 0, arrs); int b = (int)xmParser.GetDouble(parameters[1], 0, arrs); return (double)r.Next(a, b); } return r.NextDouble(); }
protected override double OverrideFunction(string[] parameters, XMParser xmParser, List <XArray> arrs) { Random r = new Random(); if (parameters.Length == 1) { int len = (int)xmParser.GetDouble(parameters[0], 0, arrs); return((double)r.Next(len)); } else if (parameters.Length == 2) { int a = (int)xmParser.GetDouble(parameters[0], 0, arrs); int b = (int)xmParser.GetDouble(parameters[1], 0, arrs); return((double)r.Next(a, b)); } return(r.NextDouble()); }
protected override double OverrideFunction(string[] parameters, XMParser xmParser, List <XArray> arrs) { return((int)xmParser.GetDouble(parameters[0], 0, arrs)); }
protected override double OverrideFunction(string[] parameters, XMParser xmParser, List<XArray> arrs) { return (int)xmParser.GetDouble(parameters[0], 0, arrs); }