Beispiel #1
0
        public override string ToString()
        {
            string res = "Current state: " + StartState.GetHashCode() + Environment.NewLine +
                         "Accepting states: {";

            foreach (var state in AcceptingStates)
            {
                res += state.GetHashCode() + ", ";
            }

            res += "}" + Environment.NewLine + Environment.NewLine;
            res += "States:" + Environment.NewLine;

            foreach (var state in AllStates)
            {
                res += state.GetHashCode() + Environment.NewLine;
            }

            res += Environment.NewLine;

            res += "Transition table:" + Environment.NewLine;

            foreach (var state in TransitionTable.Keys)
            {
                foreach (var kvp in TransitionTable[state])
                {
                    res += state.GetHashCode() + " --[" + kvp.Key + "]--> " + kvp.Value.GetHashCode() + Environment.NewLine;
                }
            }

            return(res);
        }
Beispiel #2
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         return(((StartState != null ? StartState.GetHashCode() : 0) * 397) ^ (EndState != null ? EndState.GetHashCode() : 0));
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (ActId != 0)
            {
                hash ^= ActId.GetHashCode();
            }
            if (StartState != 0)
            {
                hash ^= StartState.GetHashCode();
            }
            if (ImmediateFinishState != 0)
            {
                hash ^= ImmediateFinishState.GetHashCode();
            }
            if (AwardState != 0)
            {
                hash ^= AwardState.GetHashCode();
            }
            if (AcceptTime != 0L)
            {
                hash ^= AcceptTime.GetHashCode();
            }
            return(hash);
        }
 public override int GetHashCode()
 {
     return(InputAlphabet.GetHashCode() ^
            StackAlphabet.GetHashCode() ^
            States.GetHashCode() ^
            StartState.GetHashCode() ^
            Transitions.GetHashCode());
 }
Beispiel #5
0
        /// <summary>
        /// Gets the hashcode used for hashing purposes in hashtables and dictionaries
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 13;

            hash = hash * 23 + StartState.GetHashCode();
            hash = hash * 23 + EndState.GetHashCode();
            hash = hash * 23 + Operation.GetHashCode();

            return(hash);
        }