Inheritance: BasicSynapse
        /// <summary>
        /// Clone this object.
        /// </summary>
        /// <returns>A clone of this object.</returns>
        public override object Clone()
        {
            DirectSynapse result = new DirectSynapse(this.FromLayer,
                                                     this.ToLayer);

            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Clone this object.
 /// </summary>
 /// <returns>A clone of this object.</returns>
 public override object Clone()
 {
     DirectSynapse result = new DirectSynapse(this.FromLayer,
            this.ToLayer);
     return result;
 }
 /// <summary>
 /// Load the specified Encog object from an XML reader.
 /// </summary>
 /// <param name="xmlIn">The XML reader to use.</param>
 /// <returns>The loaded object.</returns>
 public IEncogPersistedObject Load(ReadXML xmlIn)
 {
     DirectSynapse synapse = new DirectSynapse();
     return synapse;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Add a "next" layer.
        /// </summary>
        /// <param name="next">The next layer to add.</param>
        /// <param name="type">The synapse type to use for this layer.</param>
        public void AddNext(ILayer next, SynapseType type)
        {
            ISynapse synapse = null;

            switch (type)
            {
                case SynapseType.OneToOne:
                    synapse = new OneToOneSynapse(this, next);
                    break;
                case SynapseType.Weighted:
                    synapse = new WeightedSynapse(this, next);
                    break;
                case SynapseType.Weightless:
                    synapse = new WeightlessSynapse(this, next);
                    break;
                case SynapseType.Direct:
                    synapse = new DirectSynapse(this, next);
                    break;
                case SynapseType.NEAT:
                    synapse = new NEATSynapse(this, next);
                    break;
                default:
                    throw new NeuralNetworkError("Unknown synapse type");
            }

            if (synapse == null)
            {
                String str = "Unknown synapse type.";
#if logging
                if (BasicLayer.logger.IsErrorEnabled)
                {
                    BasicLayer.logger.Error(str);
                }
#endif
                throw new NeuralNetworkError(str);
            }
            else
            {
                this.next.Add(synapse);
            }
        }