Пример #1
0
        public static LearningAlgorithm GetAlgorithm(string name, GetterParameter par)
        {
            switch (par)
            {
                case GetterParameter.AlgorithmName:
                    foreach (Type item in typesOfLA)
                    {
                        LearningAlgorithm la = (LearningAlgorithm)Activator.CreateInstance(item);
                        if (String.Compare(la.Name, name) == 0)
                        {
                            return la;
                        }
                    }
                    throw new Exception("Invalid topology name");

                case GetterParameter.TypeOfAlgorithmName:
                    foreach (Type item in typesOfLA)
                    {
                        if (String.Compare(item.Name, name) == 0)
                        {
                            return (LearningAlgorithm)Activator.CreateInstance(item);
                        }
                    }
                    throw new Exception("Invalid topology type name");

                default:
                    throw new Exception("Invalid mode");
            }
        }
Пример #2
0
        public static Topology GetTopology(string name, GetterParameter par)
        {
            switch (par)
            {
            case GetterParameter.TopologyName:
                foreach (Type item in topologyTypes)
                {
                    Topology tp = (Topology)Activator.CreateInstance(item);
                    if (String.Compare(tp.Name, name) == 0)
                    {
                        return(tp);
                    }
                }
                throw new Exception("Invalid topology name");

            case GetterParameter.TypeOfTopologyName:
                foreach (Type item in topologyTypes)
                {
                    if (String.Compare(item.Name, name) == 0)
                    {
                        return((Topology)Activator.CreateInstance(item));
                    }
                }
                throw new Exception("Invalid topology type name");

            default:
                throw new Exception("Invalid mode");
            }
        }
Пример #3
0
        static public ActivateFunction GetActivateFunction(string name, GetterParameter par)
        {
            switch (par)
            {
            case GetterParameter.ActivateFunctionName:
                for (int i = 0; i < activateFunctionsTypes.Count; i++)
                {
                    string nameBf = GetActivateFunctionName(activateFunctionsTypes[i].Name);
                    if (String.Compare(nameBf, name) == 0)
                    {
                        return((ActivateFunction)Activator.
                               CreateInstance(activateFunctionsTypes[i]));
                    }
                }
                throw new Exception("Incorrect name of activate function");

            case GetterParameter.TypeOfActivateFunctionName:
                for (int i = 0; i < activateFunctionsTypes.Count; i++)
                {
                    if (String.Compare(activateFunctionsTypes[i].Name, name) == 0)
                    {
                        return((ActivateFunction)Activator.
                               CreateInstance(activateFunctionsTypes[i]));
                    }
                }
                throw new Exception("Incorrect name of type of activate function");

            default:
                throw new Exception("Invalid mode");
            }
        }
Пример #4
0
        public static LearningAlgorithm GetAlgorithm(string name, GetterParameter par)
        {
            switch (par)
            {
            case GetterParameter.AlgorithmName:
                foreach (Type item in typesOfLA)
                {
                    LearningAlgorithm la = (LearningAlgorithm)Activator.CreateInstance(item);
                    if (String.Compare(la.Name, name) == 0)
                    {
                        return(la);
                    }
                }
                throw new Exception("Invalid topology name");

            case GetterParameter.TypeOfAlgorithmName:
                foreach (Type item in typesOfLA)
                {
                    if (String.Compare(item.Name, name) == 0)
                    {
                        return((LearningAlgorithm)Activator.CreateInstance(item));
                    }
                }
                throw new Exception("Invalid topology type name");

            default:
                throw new Exception("Invalid mode");
            }
        }
Пример #5
0
        public static Topology GetTopology(string name, GetterParameter par)
        {
            switch (par)
            {
                case GetterParameter.TopologyName:
                    foreach (Type item in topologyTypes)
                    {
                        Topology tp = (Topology)Activator.CreateInstance(item);
                        if (String.Compare(tp.Name, name) == 0)
                        {
                            return tp;
                        }
                    }
                    throw new Exception("Invalid topology name");

                case GetterParameter.TypeOfTopologyName:
                    foreach (Type item in topologyTypes)
                    {
                        if (String.Compare(item.Name, name) == 0)
                        {
                            return (Topology)Activator.CreateInstance(item);
                        }
                    }
                    throw new Exception("Invalid topology type name");

                default:
                    throw new Exception("Invalid mode");
            }
        }
Пример #6
0
 public static double GetDefaultValueOfParameterAF(string name, string namePar, GetterParameter par)
 {
     switch (par)
     {
         case GetterParameter.ActivateFunctionName:
             for (int i = 0; i < activateFunctionsTypes.Count; i++)
             {
                 string nameBf = GetActivateFunctionName(activateFunctionsTypes[i].Name);
                 if (String.Compare(nameBf, name) == 0)
                     return ((ActivateFunction)Activator.
                         CreateInstance(activateFunctionsTypes[i])).
                         GetDefaultValueOfParameter(namePar);
             }
             throw new Exception("Incorrect name of activate function");
         case GetterParameter.TypeOfActivateFunctionName:
             for (int i = 0; i < activateFunctionsTypes.Count; i++)
             {
                 if (String.Compare(activateFunctionsTypes[i].Name, name) == 0)
                     return ((ActivateFunction)Activator.
                         CreateInstance(activateFunctionsTypes[i])).
                         GetDefaultValueOfParameter(namePar);
             }
             throw new Exception("Incorrect name of type of activate function");
         default:
             throw new Exception("Invalid mode");
     }
 }