public class RandomStudentFilter extends Object implements StudentFilter
Constructor and Description |
---|
RandomStudentFilter(double prob)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Student student)
A student is accepted with the given probability
|
String |
getName()
Filter name
|
void |
setProbability(double prob)
Set acceptance probability.
|
public RandomStudentFilter(double prob)
prob
- probability of acceptance of a studentpublic boolean accept(Student student)
accept
in interface StudentFilter
student
- a studentpublic void setProbability(double prob)
prob
- new acceptance probabilitypublic String getName()
StudentFilter
getName
in interface StudentFilter