コード例 #1
0
 public void finalizeSuite()
 {
     try
     {
         CocoLibraryWrapper.cocoFinalizeSuite(this.pointer);
     }
     catch (Exception e)
     {
         throw new Exception("Suite finalization failed.\n" + e.Message);
     }
 }
コード例 #2
0
 public Observer(String observerName, String observerOptions)
 {
     try
     {
         this.pointer = CocoLibraryWrapper.cocoGetObserver(observerName, observerOptions);
         this.name    = observerName;
     }
     catch (Exception e)
     {
         throw new Exception("Observer constructor failed.\n" + e.Message);
     }
 }
コード例 #3
0
 public Suite(String suiteName, String suiteInstance, String suiteOptions)
 {
     try
     {
         long add = CocoLibraryWrapper.cocoGetSuite(suiteName, suiteInstance, suiteOptions);
         this.pointer = (long)((uint)add);
         this.name    = suiteName;
     }
     catch (Exception e)
     {
         throw new Exception("Suite constructor failed.\n" + e.Message);
     }
 }
コード例 #4
0
        /**
         * Function that returns the next problem in the suite. When it comes to the end of the suite,
         * it returns null.
         * @return the next problem in the suite or null when there is no next problem
         * @throws Exception
         */
        public Problem getNextProblem()
        {
            try
            {
                long problemPointer = CocoLibraryWrapper.cocoSuiteGetNextProblem(suite.getPointer(), observer.getPointer());

                if ((uint)problemPointer == 0)
                {
                    return(null);
                }

                return(new Problem(problemPointer));
            }
            catch (Exception e)
            {
                throw new Exception("Fetching of next problem failed.\n" + e.Message);
            }
        }
コード例 #5
0
        public Problem(long pointer)
        {
            try
            {
                this.dimension             = CocoLibraryWrapper.cocoProblemGetDimension(pointer);
                this.number_of_objectives  = CocoLibraryWrapper.cocoProblemGetNumberOfObjectives(pointer);
                this.number_of_constraints = CocoLibraryWrapper.cocoProblemGetNumberOfConstraints(pointer);

                this.lower_bounds = CocoLibraryWrapper.cocoProblemGetSmallestValuesOfInterest(pointer);
                this.upper_bounds = CocoLibraryWrapper.cocoProblemGetLargestValuesOfInterest(pointer);

                this.id   = CocoLibraryWrapper.cocoProblemGetId(pointer);
                this.name = CocoLibraryWrapper.cocoProblemGetName(pointer);

                this.index = CocoLibraryWrapper.cocoProblemGetIndex(pointer);

                this.pointer = pointer;
            }
            catch (Exception e)
            {
                throw new Exception("Problem constructor failed.\n" + e.Message);
            }
        }
コード例 #6
0
 public Boolean isFinalTargetHit()
 {
     return(CocoLibraryWrapper.cocoProblemIsFinalTargetHit(pointer) == 1);
 }
コード例 #7
0
 public long getEvaluations()
 {
     return(CocoLibraryWrapper.cocoProblemGetEvaluations(pointer));
 }
コード例 #8
0
 /**
  * Evaluates the constraint in point x and returns the result as an array of doubles.
  * @param x
  * @return the result of the constraint evaluation in point x
  */
 public double[] evaluateConstraint(double[] x)
 {
     return(CocoLibraryWrapper.cocoEvaluateConstraint(this.pointer, x));
 }
コード例 #9
0
 /**
  * Evaluates the function in point x and returns the result as an array of doubles.
  * @param x
  * @return the result of the function evaluation in point x
  */
 public double[] evaluateFunction(double[] x)
 {
     return(CocoLibraryWrapper.cocoEvaluateFunction(this.pointer, x));
 }