public void useUserRatingsForContent(int userId) {
   // Use the user's ratings
   // Integer userIdDataset;
   // int current = content.getCurrentUser();
   /// content.restartUserId();
   // while( (userIdDataset= content.userId())!=null){
   //	content.setFixedUserId(userIdDataset);
   content.restart();
   // if (!content.hasNext())
   //	continue;
   Rating rec;
   while ((rec = (Rating) content.next()) != null) {
     // int userId = rec.getUserId();
     int objectId = rec.getObjectId();
     rec.setRating(usersRatings.get(userId).get(objectId));
   }
   // }
   // content.setFixedUserId(current);
 }
  public void usePredictedRatingsForContent(Method m, int userId) {
    // Store the original ratings in the map.
    Rating rec;
    content.setFixedUserId(userId);
    content.restart();
    while ((rec = (Rating) content.next()) != null) {
      int objectId = rec.getObjectId();
      double rating = rec.getRating();

      if (!usersRatings.containsKey(userId))
        usersRatings.put(userId, new HashMap<Integer, Double>());

      usersRatings.get(userId).put(objectId, rating);
    }
    // Use the ratings from the behaviour method
    content.restart();
    while ((rec = (Rating) content.next()) != null) {
      Double r = (Double) m.classifyRecord(rec);
      if (r != null) rec.setRating(r);
    }
  }
  @Override
  public void configDataSource(XMLConfiguration config, String section, String dataSourceName) {

    try {
      Configuration methodConf = config.configurationAt(section);

      List<String> datasourcesContent = methodConf.getList("content.datasources");
      List<String> datasourcesBehaviour = methodConf.getList("behaviour.datasources");
      behaviour =
          (ContentDataSource)
              PrefWork.getDataSource(
                  datasourcesBehaviour.get(0), methodConf.getString("behaviour.name"));
      content =
          (ContentDataSource)
              PrefWork.getDataSource(
                  datasourcesContent.get(0), methodConf.getString("content.name"));
      behaviour.configDataSource(config, section + ".behaviour", datasourcesBehaviour.get(0));
      content.configDataSource(config, section + ".content", datasourcesContent.get(0));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 @Override
 public String getName() {
   // if(name != null)
   //	return name;
   return behaviour.getName() + content.getName();
 }
 @Override
 public boolean hasNextUserId() {
   if (useBehaviour) return behaviour.hasNextUserId();
   else return content.hasNextUserId();
 }
 @Override
 public void restartUserId() {
   if (useBehaviour) behaviour.restartUserId();
   else content.restartUserId();
 }
 @Override
 public void setFixedUserId(Integer userId) {
   if (useBehaviour) behaviour.setFixedUserId(userId);
   else content.setFixedUserId(userId);
 }
 @Override
 public Integer userId() {
   if (useBehaviour) return behaviour.userId();
   else return content.userId();
 }
 @Override
 public void remove() {
   if (useBehaviour) behaviour.remove();
   else content.remove();
 }
 @Override
 public UserEval next() {
   if (useBehaviour) return behaviour.next();
   else return content.next();
 }
 @Override
 public void setLimit(int from, int to, boolean recordsFromRange) {
   if (useBehaviour) behaviour.setLimit(from, to, recordsFromRange);
   else content.setLimit(from, to, recordsFromRange);
 }
 @Override
 public int size() {
   if (useBehaviour) return behaviour.size();
   else return content.size();
 }
 @Override
 public void shuffleInstances(int userId) {
   if (useBehaviour) behaviour.shuffleInstances(userId);
   else content.shuffleInstances(userId);
 }