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"); } }
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"); } }
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"); } }
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"); } }
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"); } }
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"); } }