public override int GetHashCode()
    {
        int hash = 1;

        if (Optype != 0)
        {
            hash ^= Optype.GetHashCode();
        }
        if (Username.Length != 0)
        {
            hash ^= Username.GetHashCode();
        }
        if (Userpwd.Length != 0)
        {
            hash ^= Userpwd.GetHashCode();
        }
        if (Posx != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Posx);
        }
        if (Posy != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Posy);
        }
        if (Posz != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Posz);
        }
        if (Rotx != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotx);
        }
        if (Roty != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Roty);
        }
        if (Rotz != 0F)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Rotz);
        }
        if (Frame != 0)
        {
            hash ^= Frame.GetHashCode();
        }
        if (Nextattack != 0)
        {
            hash ^= Nextattack.GetHashCode();
        }
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
示例#2
0
        /// <summary>
        /// Load data dictionary from xmlnode
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public static DataField loadFromXmlNode(XmlNode node)
        {
            string name = node.Attributes["name"].Value;

            if (node.Attributes["optype"] == null)
            {
                throw new PmmlException("Invalid definition: [optype] required in datafield '" + name + "'");
            }
            Optype    optype   = OptypeFromString(node.Attributes["optype"].Value);
            string    dataType = node.Attributes["dataType"].Value;
            DataField field    = new DataField(name, optype, dataType);

            if (node.Attributes["displayName"] != null)
            {
                field.displayName = node.Attributes["displayName"].Value;
            }

            /*tree.ModelName = node.Attributes["modelName"].Value;
             *
             * if (node.Attributes["missingValueStrategy"] != null)
             *      tree.MissingValueStrategy = MissingValueStrategyfromString(node.Attributes["missingValueStrategy"].Value);
             *
             * // By default noTrueChildStrategy = returnNullPrediction
             * tree.noTrueChildStrategy = NoTrueChildStrategy.ReturnNullPrediction;
             * if (node.Attributes["noTrueChildStrategy"] != null)
             *      tree.noTrueChildStrategy = NoTrueChildStrategyfromString(node.Attributes["noTrueChildStrategy"].Value);
             */

            field.fInterval = new List <string>();
            field.fValues   = new List <DataFieldValue>();
            foreach (XmlNode item in node.ChildNodes)
            {
                if ("extension".Equals(item.Name.ToLowerInvariant()))
                {
                    //
                }
                else if ("Interval".Equals(item.Name))
                {
                    field.fInterval.Add(item.InnerText.Trim());
                }
                else if ("Value".Equals(item.Name))
                {
                    field.fValues.Add(DataFieldValue.loadFromXmlNode(item));
                }
                else
                {
                    throw new NotImplementedException();
                }
            }

            return(field);
        }
示例#3
0
        private static string OptypeToString(Optype val)
        {
            switch (val)
            {
            case Optype.categorical:
                return("categorical");

            case Optype.continuous:
                return("continuous");

            case Optype.ordinal:
                return("ordinal");

            default:
                throw new NotImplementedException();
            }
        }
示例#4
0
 /// <summary>
 /// Build data field.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="optype"></param>
 /// <param name="dataType"></param>
 public DataField(string name, Optype optype, string dataType)
 {
     this.name     = name;
     this.optype   = optype;
     this.dataType = dataType;
 }
示例#5
0
文件: LogBase2.cs 项目: abel/sinan
 protected LogBaseEx(int woldid, Optype optype, Actiontype actionid)
     : base(woldid, optype, actionid)
 {
 }