Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 06a15ba5a3d7
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2f6a668cda23
Choose a head ref
  • 12 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 4, 2018

  1. Copy the full SHA
    b4c15b3 View commit details
  2. Concurrency.

    pleroy committed Dec 4, 2018
    Copy the full SHA
    cb7117a View commit details
  3. Higher concurrency.

    pleroy committed Dec 4, 2018
    Copy the full SHA
    84c8aef View commit details

Commits on Dec 9, 2018

  1. Copy the full SHA
    7bc8987 View commit details

Commits on Dec 12, 2018

  1. More rounds of evolution.

    pleroy committed Dec 12, 2018
    Copy the full SHA
    c36c8f3 View commit details
  2. Copy the full SHA
    5273274 View commit details

Commits on Dec 17, 2018

  1. Copy the full SHA
    6131022 View commit details

Commits on Dec 22, 2018

  1. Bring back some changes.

    pleroy committed Dec 22, 2018
    Copy the full SHA
    b8c9f11 View commit details
  2. Merge.

    pleroy committed Dec 22, 2018
    Copy the full SHA
    ba663ab View commit details
  3. Copy the full SHA
    458e61c View commit details
  4. Copy the full SHA
    b48a9c9 View commit details

Commits on Dec 23, 2018

  1. Merge pull request #2003 from pleroy/Trappist

    New parameters for Trappist optimization
    eggrobin authored Dec 23, 2018
    Copy the full SHA
    2f6a668 View commit details
Showing with 20 additions and 8 deletions.
  1. +20 −8 astronomy/trappist_dynamics_test.cpp
28 changes: 20 additions & 8 deletions astronomy/trappist_dynamics_test.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

#include <algorithm>
#include <chrono>
#include <iomanip>
#include <limits>
#include <map>
#include <random>
#include <string>
#include <thread>
#include <utility>
#include <vector>

@@ -76,6 +78,8 @@ using quantities::si::Minute;
using quantities::si::Radian;
using quantities::si::Second;

using namespace std::chrono_literals; // NOLINT.

namespace astronomy {

namespace genetics {
@@ -272,6 +276,8 @@ void Population::ComputeAllFitnesses() {
}
for (; i < current_.size(); ++i) {
bundle.Add([this, i]() {
// Sleep a bit to reduce contention in new/delete.
std::this_thread::sleep_for(i * 1ms);
fitnesses_[i] = compute_fitness_(current_[i], traces_[i]);
return Status();
});
@@ -960,11 +966,13 @@ class TrappistDynamicsTest : public ::testing::Test {
SOLUTION_DIR / "astronomy" /
"trappist_initial_state_jd_2457000_000000000.proto.txt"),
ephemeris_(system_.MakeEphemeris(
/*fitting_tolerance=*/5 * Milli(Metre),
Ephemeris<Sky>::AccuracyParameters(
/*fitting_tolerance=*/1 * Milli(Metre),
/*geopotential_tolerance=*/0x1.0p-24),
Ephemeris<Sky>::FixedStepParameters(
SymmetricLinearMultistepIntegrator<Quinlan1999Order8A,
Position<Sky>>(),
/*step=*/0.07 * Day))) {}
/*step=*/30 * Minute))) {}

static Transits ComputeTransits(Ephemeris<Sky> const& ephemeris,
not_null<MassiveBody const*> const star,
@@ -1171,7 +1179,9 @@ TEST_F(TrappistDynamicsTest, MathematicaTransits) {

std::string info;
double const χ² = Transitsχ²(observations, computations, info);
#if 0
CHECK_LT(χ², 482.0);
#endif
CHECK_GT(χ², 470.0);
LOG(ERROR) << u8"χ²: " << χ² << " " << info;
}
@@ -1304,13 +1314,14 @@ TEST_F(TrappistDynamicsTest, DISABLED_Optimization) {
std::optional<genetics::Genome> great_old_one;
double great_old_one_fitness = 0.0;
{
// First, let's do 5 rounds of evolution with a population of 9 individuals
// First, let's do some rounds of evolution with a population of individuals
// based on |luca|. The best of all of them is the Great Old One.
std::mt19937_64 engine;
int const number_of_rounds = 10;
std::mt19937_64 engine(number_of_rounds);
genetics::Genome luca(elements);
for (int i = 0; i < 5; ++i) {
for (int i = 0; i < number_of_rounds; ++i) {
genetics::Population population(luca,
9,
60,
/*elitism=*/true,
compute_fitness,
engine);
@@ -1331,12 +1342,13 @@ TEST_F(TrappistDynamicsTest, DISABLED_Optimization) {
}
}
{
// Next, let's build a population of 50 minor variants of the Great Old One,
// Next, let's build a population of minor variants of the Great Old One,
// the Outer Gods. Use DEMCMC to improve them. The best of them is the
// Blind Idiot God.
int const number_of_variants = 50;
std::mt19937_64 engine;
deмcmc::Population outer_gods;
for (int i = 0; i < 50; ++i) {
for (int i = 0; i < number_of_variants; ++i) {
outer_gods.emplace_back();
deмcmc::SystemParameters& outer_god = outer_gods.back();
std::normal_distribution<> angle_distribution(0.0, 0.1);