/AgentsTasksTimes.java Secret
Created
February 18, 2016 10:18
assigned()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks whether a condition is true, i.e., if a task is assigned | |
* to the current solution state | |
* @param task We want to assign, and we're going to look for it | |
* in the array of state (sol[]) | |
* @return True if the task is already assigned so it would not be | |
* valid to assign the same task again | |
*/ | |
private boolean assigned(int task) { | |
for (int i=0; i<n; i++) | |
if (sol[i]==task) //it is already assigned | |
return true; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment