Exemplo n.º 1
0
        public static Col Create(string colName)
        {
            Col output = null;

            colName = colName.Trim();
            bool hasMin     = Test(MINIMIZE_CHAR, colName);
            bool hasMax     = Test(MAXIMIZE_CHAR, colName);
            bool hasNumeric = Test(NUMERIC_CHAR, colName);
            bool hasGoal    = Test(GOAL_CHAR, colName);

            if (hasMin || hasMax || hasNumeric)
            {
                output = new Num(colName);
            }
            else
            {
                output = new Sym(colName);
            }


            output.Goal     = hasGoal || hasMin || hasMax;
            output.Minimize = hasMin;
            output.Weight   = hasMin ? -1 : 1;

            return(output);
        }
Exemplo n.º 2
0
        public override Col Clone()
        {
            Sym result = (Sym)this.MemberwiseClone();

            result.N         = 0;
            result.counts    = new Dictionary <string, int>();
            result.modeCount = 0;
            result.Mode      = null;
            return(result);
        }
Exemplo n.º 3
0
        public override bool IsCentralTendencyDifferent(Col other, double epsilon)
        {
            Sym otherSym = other as Sym;

            if (otherSym == null)
            {
                return(true);
            }
            return(otherSym.Mode != this.Mode);
        }
Exemplo n.º 4
0
        public override Col Clone()
        {
            Sym result = (Sym)this.MemberwiseClone();

            result.N         = 0;
            result.counts    = new Dictionary <string, int>();
            result.modeCount = 0;
            result.Mode      = null;
            result.cells     = new List <Cell>();
            foreach (var cell in cells)
            {
                result.AddCell(cell);
            }
            return(result);
        }