Example #1
0
        public static TemporalLayer FromString(string str)
        {
            string[] parameters = str.Split(new string[] { "\nLConnection: " }, StringSplitOptions.RemoveEmptyEntries);
            string[] lP         = parameters[0].Split(new string[] { @"/\" }, StringSplitOptions.RemoveEmptyEntries);

            double             bias        = Convert.ToDouble(lP[0].Replace("bias", "").Replace("|", ""));
            List <NeuronTypes> neuronTypes = StringParser.StringToNeuronTypesList(lP[1].Replace("|", ""));

            string[]            neuronS = lP[2].Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
            List <NeuronValues> neurons = new List <NeuronValues>();

            for (int i = 0; i < neuronTypes.Count; i++)
            {
                neurons.Add(StringParser.GetNeuron(neuronS[i], neuronTypes[i]));
            }

            List <Interconnection> connections = new List <Interconnection>();

            if (parameters.Length > 1)
            {
                string lastParam = parameters[parameters.Length - 1];
                parameters[parameters.Length - 1] = lastParam.Replace("\n", "");
            }
            for (int i = 1; i < parameters.Length; i++)
            {
                connections.Add(Interconnection.FromString(parameters[i]));
            }

            TemporalLayer layer = new TemporalLayer(neurons[0].weigths.Count, neuronTypes, neurons, connections);

            layer.bias = bias;
            return(layer);
        }
Example #2
0
 /// <summary>
 /// Initialization to be done before the initial call to <see cref="Load"/>.
 /// </summary>
 public override void Initialize()
 {
     base.Initialize();
     m_nodeLookupList = Node.GetLookupList(null);
     m_concentratorDeviceLookupList = Device.GetLookupList(null, DeviceType.Concentrator, true);
     m_companyLookupList            = Company.GetLookupList(null, true);
     m_historianLookupList          = TimeSeries.UI.DataModels.Historian.GetLookupList(null, true, false);
     m_interconnectionLookupList    = Interconnection.GetLookupList(null, true);
     m_protocolLookupList           = Protocol.GetLookupList(null, true);
     m_vendorDeviceLookupList       = VendorDevice.GetLookupList(null, true);
     m_timezoneLookupList           = CommonFunctions.GetTimeZones(true);
 }
Example #3
0
        public void ConnectLayer(int fromI, int toI, List <List <double> > weigths = null, int lenght = -1, int connectedLenght = -1)
        {
            Interconnection connection = new Interconnection(fromI, weigths, connectedLenght, lenght);

            TemporalLayers[toI].Connections.Add(connection);
        }