Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/18 13:05:29 (6 years ago)
Author:
lkammere
Message:

#2957: Fixed visibility of regression instance providers for physics benchmark problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Physics/PhysicsInstanceProvider.cs

    r16394 r16431  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Random;
    2425
    2526namespace HeuristicLab.Problems.Instances.DataAnalysis {
    26   class PhysicsInstanceProvider : ArtificialRegressionInstanceProvider {
    27     public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    28       return new List<IDataDescriptor>()
    29       {
    30          new RocketFuelFlow(123),
    31          new AircraftLift(456),
    32          new FluidDynamics(789),
    33          new AircraftMaximumLift(321)
    34       };
    35     }
    36 
     27  public class PhysicsInstanceProvider : ArtificialRegressionInstanceProvider {
    3728    public override string Name { get { return "Physics Benchmark Problems"; } }
    3829    public override string Description { get { return ""; } }
     
    4334      }
    4435    }
     36
     37    public int Seed { get; private set; }
     38
     39    public PhysicsInstanceProvider() : this((int)DateTime.Now.Ticks) { }
     40
     41    public PhysicsInstanceProvider(int seed) : base() {
     42      Seed = seed;
     43    }
     44
     45    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
     46      var rand = new FastRandom(Seed);
     47
     48      return new List<IDataDescriptor>()
     49      {
     50         new RocketFuelFlow(rand.Next()),
     51         new AircraftLift(rand.Next()),
     52         new FluidDynamics(rand.Next()),
     53         new AircraftMaximumLift(rand.Next())
     54      };
     55    }
    4556  }
    4657}
Note: See TracChangeset for help on using the changeset viewer.