Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jmetal.music;
- import jmetal.util.JMException;
- import jmetal.util.wrapper.XInt;
- public class Evaluator extends XInt{
- public static double evaluateF1(XInt wrappedArray) {
- // TODO Auto-generated method stub
- return 0;
- }
- double singingEvents = 0;
- public double findSingingEvent(XInt wrappedArray) throws JMException{
- double numberOfPairs = 0;
- if(getNumberOfDecisionVariables()== 2 && getValue(0) != getValue(1)){
- singingEvents++;
- }
- for(int index = 0; index < getNumberOfDecisionVariables(); index++){
- if(getValue(index) == getValue(index + 1)){
- if(index % 2 == 0){numberOfPairs++;}
- }
- }
- if(numberOfPairs % 2 == 0){singingEvents++;}
- return singingEvents;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement