src/infinity/ecs/scheduling/AdvancedRRScheduler.java
/**
     * Adds a system to the right frames. 
     * @param system
     * @param frames
     * @param parameter
     * @return 
     */
Adds a system to the right frames.
Adds a system to the right frames .
private ArrayList<ArrayList<EntitySystem>> addSystemToFrames(EntitySystem system, 
	    ArrayList<ArrayList<EntitySystem>> frames, Integer parameter) {
	int i = 0;
	List<ArrayList<EntitySystem>> nextLists;
	List<ArrayList<EntitySystem>> minimalLists;
	ArrayList<EntitySystem> tempFrame;
	while(i < frames.size()) {
	  nextLists = frames.subList(i, i + parameter); 
	  minimalLists = smallestLists(nextLists); 
	  tempFrame = minimalLists.get(minimalLists.size() - 1 ); 
	  tempFrame.add(system);
	  i  += frames.indexOf(tempFrame);
	}
	nextLists = frames.subList(i, i + parameter);
	if(!contains(nextLists, system)){
	    minimalLists = smallestLists(nextLists);
	    tempFrame = minimalLists.get(minimalLists.size() - 1 ); 
	    tempFrame.add(system);
	}
	return frames;
    }
private ArrayList < ArrayList < EntitySystem > > addSystemToFrames ( EntitySystem system , ArrayList < ArrayList < EntitySystem > > frames , Integer parameter ) { int i = 0 ; List < ArrayList < EntitySystem > > nextLists ; List < ArrayList < EntitySystem > > minimalLists ; ArrayList < EntitySystem > tempFrame ; while ( i < frames . size ( ) ) { nextLists = frames . subList ( i , i + parameter ) ; minimalLists = smallestLists ( nextLists ) ; tempFrame = minimalLists . get ( minimalLists . size ( ) - 1 ) ; tempFrame . add ( system ) ; i += frames . indexOf ( tempFrame ) ; } nextLists = frames . subList ( i , i + parameter ) ; if ( ! contains ( nextLists , system ) ) { minimalLists = smallestLists ( nextLists ) ; tempFrame = minimalLists . get ( minimalLists . size ( ) - 1 ) ; tempFrame . add ( system ) ; } return frames ; }
Adds a system to the right frames.
Adds a system to the right frames .
//Gets all the lists in the right range. //Gets the smallests frames that still can be appended. //Gets the last frame that is the farest away from the last call. //This is needed to check if there is no gap (bigger than the paramter) at the end of the frame.  //Gets the last frame that is the farest away from the last call.