public void CreateListByName(string listName, int minLevels, int maxLevels)
 {
     if (!listOfSemantics.ContainsKey(listName))
     {
         SemanticaList list = new SemanticaList(listName, minLevels, maxLevels);
         listOfSemantics.Add(listName, list);
     }
 }
Example #2
0
        public solution.GPSolution CreateRandomSolution()
        {
            GPSolution solution = new GPSolution(this);

            foreach (string key in properties.Keys)
            {
                SemanticaList lista = properties[key];
                solution.SetValue(key, lista.CreateRandomNode(config, false));
            }
            return(solution);
        }
        /*public void AddSemantica(string listName, string holderName)
         * {
         *  GPSemantica semantica = holder.GetSemantica(holderName);
         *  AddSemantica(listName, semantica);
         * }*/

        public void AddSemanticaToList(string listName, GPSemantica semantica)
        {
            if (semantica == null)
            {
                throw new Exception("Semantica nula!");
            }
            SemanticaList list = GetListByName(listName);

            if (list.Contains(semantica))
            {
                throw new Exception("Tentando adicionar uma semantica que já existe:" + semantica.ToString());
            }
            list.Add(semantica);
        }
Example #4
0
 public void AddProperty(string name, SemanticaList lista)
 {
     properties.Add(name, lista);
 }