public void Read(TProtocol iprot)
            {
                TField field;

                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            Ann = new CFastCyclicNetwork();
                            Ann.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
     public CFitnessInfo calculateXorPhenotypeFitness(CFastCyclicNetwork ann)
     {
 #if !SILVERLIGHT
         send_calculateXorPhenotypeFitness(ann);
         return(recv_calculateXorPhenotypeFitness());
 #else
         var asyncResult = Begin_calculateXorPhenotypeFitness(null, null, ann);
         return(End_calculateXorPhenotypeFitness(asyncResult));
 #endif
     }
Example #3
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 5:
                    if (field.Type == TType.I32)
                    {
                        Generation = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 10:
                    if (field.Type == TType.List)
                    {
                        {
                            Phenomes = new List <CFastCyclicNetwork>();
                            TList _list20 = iprot.ReadListBegin();
                            for (int _i21 = 0; _i21 < _list20.Count; ++_i21)
                            {
                                CFastCyclicNetwork _elem22 = new CFastCyclicNetwork();
                                _elem22 = new CFastCyclicNetwork();
                                _elem22.Read(iprot);
                                Phenomes.Add(_elem22);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
            public void send_calculateXorPhenotypeFitness(CFastCyclicNetwork ann)
      #endif
            {
                oprot_.WriteMessageBegin(new TMessage("calculateXorPhenotypeFitness", TMessageType.Call, seqid_));
                calculateXorPhenotypeFitness_args args = new calculateXorPhenotypeFitness_args();

                args.Ann = ann;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
        #if SILVERLIGHT
                return(oprot_.Transport.BeginFlush(callback, state));
        #else
                oprot_.Transport.Flush();
        #endif
            }
        public static CFastCyclicNetwork Convert(FastCyclicNetwork fcn) {
            var cfcn = new CFastCyclicNetwork();
            var numberOfNeurons = fcn._neuronActivationFnArray.Length;
            // Copy connections
            cfcn.Connections = new List<CConnection>(fcn._connectionArray.Length);
            foreach (var c in fcn._connectionArray)
            {
                var cc = new CConnection
                             {
                                 ToNeuronId = c._tgtNeuronIdx,
                                 FromNeuronId = c._srcNeuronIdx,
                                 Weight = c._weight
                             };
                cfcn.Connections.Add(cc);
            }

            // Copy activation functions
            cfcn.ActivationFunctions = new List<string>(numberOfNeurons);
            foreach (var s in fcn._neuronActivationFnArray)
            {
                if (s == null)
                    cfcn.ActivationFunctions.Add("");
                else
                    cfcn.ActivationFunctions.Add(s.FunctionId);
            }

            // Copy auxiliary arguments
            cfcn.NeuronAuxArgs = new List<List<double>>(numberOfNeurons);
            foreach (var aux in fcn._neuronAuxArgsArray)
            {
                if (aux == null)
                    cfcn.NeuronAuxArgs.Add(new List<double>());
                else
                    cfcn.NeuronAuxArgs.Add(new List<double>(aux));
            }
            cfcn.NeuronCount = fcn._neuronCount;
            cfcn.InputNeuronCount = fcn._inputNeuronCount;
            cfcn.OutputNeuronCount = fcn._outputNeuronCount;
            cfcn.TimestepsPerActivation = fcn._timestepsPerActivation;

            return cfcn;
        }
Example #6
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.List) {
           {
             Phenomes = new List<CFastCyclicNetwork>();
             TList _list20 = iprot.ReadListBegin();
             for( int _i21 = 0; _i21 < _list20.Count; ++_i21)
             {
               CFastCyclicNetwork _elem22 = new CFastCyclicNetwork();
               _elem22 = new CFastCyclicNetwork();
               _elem22.Read(iprot);
               Phenomes.Add(_elem22);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
 public IAsyncResult send_calculateXorPhenotypeFitness(AsyncCallback callback, object state, CFastCyclicNetwork ann)
 public IAsyncResult Begin_calculateXorPhenotypeFitness(AsyncCallback callback, object state, CFastCyclicNetwork ann)
 {
     return(send_calculateXorPhenotypeFitness(callback, state, ann));
 }
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           Ann = new CFastCyclicNetwork();
           Ann.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
 public void send_calculateXorPhenotypeFitness(CFastCyclicNetwork ann)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("calculateXorPhenotypeFitness", TMessageType.Call, seqid_));
   calculateXorPhenotypeFitness_args args = new calculateXorPhenotypeFitness_args();
   args.Ann = ann;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
 public IAsyncResult send_calculateXorPhenotypeFitness(AsyncCallback callback, object state, CFastCyclicNetwork ann)
      public CFitnessInfo calculateXorPhenotypeFitness(CFastCyclicNetwork ann)
      {
        #if !SILVERLIGHT
        send_calculateXorPhenotypeFitness(ann);
        return recv_calculateXorPhenotypeFitness();

        #else
        var asyncResult = Begin_calculateXorPhenotypeFitness(null, null, ann);
        return End_calculateXorPhenotypeFitness(asyncResult);

        #endif
      }
 public IAsyncResult Begin_calculateXorPhenotypeFitness(AsyncCallback callback, object state, CFastCyclicNetwork ann)
 {
   return send_calculateXorPhenotypeFitness(callback, state, ann);
 }