コード例 #1
0
  public boolean readFilesFromInput() {

    // NB: when simDesc.getStartingIteration() == 0, subsolids are read from
    // DFS.
    return simDesc.isFirstOfSequence()
        && configuration.getStartingIteration() == simDesc.getStartingIteration()
        && configuration.getStartingIteration() > 0;
  }
コード例 #2
0
  public SimulationParameters(int simNum, LaBoGridConfiguration laboConf, DistributedAgent da)
      throws LBException {

    this.simNum = simNum;
    this.laboConf = laboConf;

    simDesc = laboConf.getExperienceDescription().getSimulationDescription(simNum);

    LBConfiguration lbConf = laboConf.getLBConfiguration(simDesc.getLBConfigurationId());
    latticeClass = lbConf.getLatticeDescription().getClassName();
    solidClass = lbConf.getSolidDescription().getClassName();

    String chainId = simDesc.getProcessingChainId();
    ProcessingChainDescription pcd = laboConf.getProcessingChain(chainId);
    powerDesc = SimulationDescription.getPowerDescriptor(latticeClass, pcd);
    procChain = ProcessingChain.getOperatorsChain(pcd, false);

    // Set output client.
    IODescription outDesc = simDesc.getOutput();
    if (outDesc != null) {

      try {
        outputClient = outDesc.getOutputClient();
        outputClient.setDistributedAgent(da);
      } catch (Exception e) {
        throw new LBException("Could not start output client", e);
      }
    }

    // Set input client.
    IODescription inDesc = simDesc.getInput();
    if (inDesc != null) {

      try {
        inputClient = inDesc.getInputClient();
        inputClient.setDistributedAgent(da);
      } catch (Exception e) {
        throw new LBException("Could not start input client", e);
      }
    }
  }
コード例 #3
0
  public ModelGraph generateModelGraph() throws ReflectionException {
    LBConfiguration lbConf = laboConf.getLBConfiguration(simDesc.getLBConfigurationId());

    SubLatticesConfiguration subConf = lbConf.getSubLatticesConfiguration();
    ModelGraphGenerator mGraphGen =
        (ModelGraphGenerator) Reflection.newInstance(subConf.getGeneratorClassName());

    LatticeDescription lattDesc = lbConf.getLatticeDescription();
    int[] size = lattDesc.getSize();
    Lattice latt = (Lattice) Reflection.newInstance(lattDesc.getClassName());
    LatticeDescriptor desc = latt.getLatticeDescriptor();
    mGraphGen.setParameters(size, subConf.getMinSubLatticesCount(), desc);

    return mGraphGen.generateModelGraph();
  }
コード例 #4
0
 public boolean isFirstOfSequence() {
   return simDesc.isFirstOfSequence();
 }
コード例 #5
0
  public boolean getKeepFinalState() {

    return simDesc.getKeepStateForNextSimulation();
  }
コード例 #6
0
  public int getIterationCount() {

    return simDesc.getLastIteration() - configuration.getStartingIteration();
  }
コード例 #7
0
  public int getLastIteration() {

    return simDesc.getLastIteration();
  }
コード例 #8
0
  public ProcessingChainDescription getProcessingChainDescription() {

    String chainId = simDesc.getProcessingChainId();
    return laboConf.getProcessingChain(chainId);
  }