private OOFactSet create_factset(Class<?> classObj, boolean all_discrete) {
    // System.out.println("WorkingMemory.create_factset element "+ element );

    OOFactSet newfs = new OOFactSet(classObj);

    Field[] element_fields = classObj.getDeclaredFields();
    for (Field f : element_fields) {
      String f_name = f.getName();
      Class<?>[] f_class = {f.getType()};
      System.out.println(
          "WHat is this f: "
              + f.getType()
              + " the name "
              + f_name
              + " class "
              + f.getClass()
              + " and the name"
              + f.getClass().getName());
      if (Util.isSimpleType(f_class)) {

        Domain<?> fieldDomain;
        if (!domainset.containsKey(f_name)) {
          fieldDomain = DomainFactory.createDomainFromClass(f.getType(), f_name);
          domainset.put(f_name, fieldDomain);
        } else fieldDomain = domainset.get(f_name);

        Annotation[] annotations = f.getAnnotations();
        // iterate over the annotations to locate the MaxLength constraint if it exists
        DomainSpec spec = null;
        for (Annotation a : annotations) {
          if (a instanceof DomainSpec) {
            spec = (DomainSpec) a; // here it is !!!
            break;
          }
        }

        if (spec != null) {
          fieldDomain.setReadingSeq(spec.readingSeq());
          if (!all_discrete) fieldDomain.setDiscrete(spec.discrete());
        }
        /*
         * ID3 would
         * if it is integer and the annotation saying that the field is continuous
         * 		ignore the domain
         * if it is double / float and the annotation saying that the field is continuous
         * 		ignore the domain if it has more than 10 values ?
         * if it is string and the annotation saying that the field is continuous
         * 		what to do??
         */

        newfs.addDomain(f_name, fieldDomain);
      }
    }
    factsets.put(classObj.getName(), newfs);
    return newfs;
  }
  public void insert(Object element, boolean only_discrete) {
    String element_class = element.getClass().getName();
    // System.out.println("Get the keys:"+ factsets.keys());
    // System.out.println("WorkingMemory.get class "+ element_class + " exist? "+
    // factsets.containsKey(element_class));

    OOFactSet fs;
    if (!factsets.containsKey(element_class))
      fs = create_factset(element.getClass(), only_discrete);
    else fs = (OOFactSet) factsets.get(element_class); // TODO should i cast

    fs.insert(element);
    System.out.println("WorkingMemory.insert(object) inserted element fs.size() " + fs.getSize());
  }
  private OOFactSet create_factset_(Class<?> classObj) {
    // System.out.println("WorkingMemory.create_factset element "+ element );

    OOFactSet newfs = new OOFactSet(classObj);

    Method[] element_methods = classObj.getDeclaredMethods();
    for (Method m : element_methods) {

      String m_name = m.getName();
      Class<?>[] returns = {m.getReturnType()};
      // System.out.println("WorkingMemory.create_factset m "+ m + " method name "+m_name+"
      // return_type_name: "+return_type_name+".");
      if (Util.isGetter(m_name) & Util.isSimpleType(returns)) {
        String field = Util.getAttributeName(m_name);
        /*
         * when u first read the element
         * 	if the domain specifications are already given
         * 		then read from there and
         * 			 dont add each new value you read, just check if it is valid
         * otherwise you create a new domain for that attribute
         * Domain attributeSpec = dataSetSpec.getDomain(attr_name);
         */

        Domain<?> fieldDomain;
        if (!domainset.containsKey(field))
          fieldDomain = DomainFactory.createDomainFromClass(m.getReturnType(), field);
        else fieldDomain = domainset.get(field);

        // System.out.println("WorkingMemory.create_factset field "+ field + " fielddomain name
        // "+fieldDomain.getName()+" return_type_name: "+return_type_name+".");

        domainset.put(field, fieldDomain);
        newfs.addDomain(field, fieldDomain);

        // System.out.println("START: WorkingMemory.create_factset domainset size "+
        // domainset.size() + " newfs size "+newfs.getFacts().size()+".");

      }
    }

    factsets.put(classObj.getName(), newfs);
    return newfs;
  }