public double randomFunction(double x, double y){
         
         switch(randomFunc){
             case 0: 
                 random = Math.sin(Math.PI*nextNode.randomFunction(x,y));
                 break;
             case 1: 
                 random = Math.cos(Math.PI*nextNode.randomFunction(x,y));
                 break;
             case 2: 
                 random =  ((nextNode.randomFunction(x,y)) + (nextNode2.randomFunction(x,y)) )/2;
                
                 break;
             default:
                 random = 0;
                 break;
         }
         return random;
     }