Package aima.test.core.unit.search.local

Source Code of aima.test.core.unit.search.local.SimulatedAnnealingSearchTest

package aima.test.core.unit.search.local;

import org.junit.Assert;
import org.junit.Test;

import aima.core.search.local.SimulatedAnnealingSearch;

public class SimulatedAnnealingSearchTest {

  @Test
  public void testForGivenNegativeDeltaEProbabilityOfAcceptanceDecreasesWithDecreasingTemperature() {
    // this isn't very nice. the object's state is uninitialized but is ok
    // for this test.
    SimulatedAnnealingSearch search = new SimulatedAnnealingSearch(null);
    int deltaE = -1;
    double higherTemperature = 30.0;
    double lowerTemperature = 29.5;

    Assert.assertTrue(search.probabilityOfAcceptance(lowerTemperature,
        deltaE) < search.probabilityOfAcceptance(higherTemperature,
        deltaE));
  }

}
TOP

Related Classes of aima.test.core.unit.search.local.SimulatedAnnealingSearchTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.