Exemplo n.º 1
0
 public static void main(String[] args) {
   ModelParallel m = DataSetLoader.getRegularGrid(100, 800, 40); // Try those configurations
   // Model m=DataSetLoader.getRandomRotatingGrid(100, 800, 40);
   // Model m=DataSetLoader.getRandomSet(100, 800, 1000);
   // Model m=DataSetLoader.getRandomGrid(100, 800, 30);
   scheduler.schedule(new MainLoop(m), 500, TimeUnit.MILLISECONDS);
   SwingUtilities.invokeLater(new BuildNewGui(m));
 }
Exemplo n.º 2
0
  /** Change if you want to change the amount of steps are called */
  @Test
  public void RegularGrid() {
    // Make two identical models but one parallel and one sequential
    AbstractModel paraModel = DataSetLoader.getRegularGrid(100, 800, 40, new ModelParallel());
    AbstractModel seqModel = DataSetLoader.getRegularGrid(100, 800, 40, new Model());

    // Step through each model stepNumber
    stepModel(paraModel);
    stepModel(seqModel);

    // An error check that makes sure there models passed in have some particles
    if (paraModel.p.size() == 0 || seqModel.p.size() == 0)
      fail("Error the model had nothing in it");

    // success or fail check
    if (!checkModels(paraModel.p, seqModel.p)) {
      fail("The particles were not equal between the two models");
    }
  }