예제 #1
0
        public bool Equals(Synapse obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null)
            {
                return(false);
            }

            if (InputIndex != obj.InputIndex)
            {
                return(false);
            }

            //
            // Synapses are equal if they belong to the same segment.
            if (this.SegmentIndex != ((Synapse)obj).SegmentIndex)
            {
                return(false);
            }

            if (SourceCell == null)
            {
                if (obj.SourceCell != null)
                {
                    return(false);
                }
            }
            else if (!SourceCell.Equals(obj.SourceCell))
            {
                return(false);
            }
            if (SynapseIndex != obj.SynapseIndex)
            {
                return(false);
            }
            if (Permanence != obj.Permanence)
            {
                return(false);
            }
            if (IsDestroyed != obj.IsDestroyed)
            {
                return(false);
            }
            if (BoxedIndex == null)
            {
                if (obj.BoxedIndex != null)
                {
                    return(false);
                }
            }
            return(true);
        }
예제 #2
0
        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
        // @Override
        public bool Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (typeof(Synapse) != obj.GetType())
            {
                return(false);
            }
            Synapse other = (Synapse)obj;

            if (InputIndex != other.InputIndex)
            {
                return(false);
            }
            if (Segment == null)
            {
                if (other.Segment != null)
                {
                    return(false);
                }
            }
            else if (!Segment.Equals(other.Segment))
            {
                return(false);
            }
            if (SourceCell == null)
            {
                if (other.SourceCell != null)
                {
                    return(false);
                }
            }
            else if (!SourceCell.Equals(other.SourceCell))
            {
                return(false);
            }
            if (SynapseIndex != other.SynapseIndex)
            {
                return(false);
            }
            if (Permanence != other.Permanence)
            {
                return(false);
            }
            return(true);
        }
예제 #3
0
        public bool Equals(Synapse obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null)
            {
                return(false);
            }

            if (InputIndex != obj.InputIndex)
            {
                return(false);
            }

            //
            // Synapses are equal if they belong to the same segment.
            if (Segment == null && obj.Segment != null)
            {
                return(false);
            }
            else if (!Segment.Equals(obj.Segment))
            {
                return(false);
            }

            if (SourceCell == null)
            {
                if (obj.SourceCell != null)
                {
                    return(false);
                }
            }
            else if (!SourceCell.Equals(obj.SourceCell))
            {
                return(false);
            }
            if (SynapseIndex != obj.SynapseIndex)
            {
                return(false);
            }
            if (Permanence != obj.Permanence)
            {
                return(false);
            }
            return(true);
        }