Package org.jamesii.core.parameters

Examples of org.jamesii.core.parameters.ParameterBlock


     * @param factories
     *          A list of factories to store in this model.
     */
    public FactoryComboBoxModel(List<F> factories) {
      for (F item : factories) {
        this.addElement(new ParameterizedFactory<>(item, new ParameterBlock()));
      }
    }
View Full Code Here


   *          the time
   */
  @SuppressWarnings("unchecked")
  protected void internalInit(IBasicCoupledModel model, double time) {
    // initialize event queue for current coupled model
    ParameterBlock eqfp = new ParameterBlock(getModel());
    IEventQueue<IBasicDEVSModel, Double> queue = eqFactory.createDirect(eqfp);
    events.put(model, queue);

    // iterate and initialize all sub-models
    Iterator<IBasicDEVSModel> it = model.getSubModelIterator();
View Full Code Here

  public IProcessor create(IModel model, IComputationTask computationTask,
      Partition partition, ParameterBlock parameters, Context context) {

    ISimulationRun simulation = (ISimulationRun) computationTask;

    ParameterBlock ef = null;

    // new ParameterBlock(
    // simulation.getParameters()
    // .getEventforwarding());

    ExternalEventForwardingHandlerFactory f =
        SimSystem.getRegistry().getFactory(
            AbstractExternalEventForwardingHandlerFactory.class, ef);
    ExternalEventForwardingHandler eefh = f.create(null, SimSystem.getRegistry().createContext());

    SimSystem.report(Level.CONFIG, "Using " + eefh.getClass().getName()
        + " as external event forwarding mechanism.");

    ParameterBlock eqfp = parameters.getSubBlock("eventqueue");

    // (IEventQueue<IBasicDEVSModel>)
    FlatSequentialProcessor p =
        new FlatSequentialProcessor(model, SimSystem.getRegistry().getFactory(
            AbstractEventQueueFactory.class, eqfp), eefh);
View Full Code Here

   *          the time
   */
  @Override
  @SuppressWarnings("unchecked")
  public void init(double time) {
    ParameterBlock eqfp = new ParameterBlock(getModel());
    events = eqf.createDirect(eqfp);

    ((DEVSProcessorState) getState()).setTole(time);
    Iterator<IBasicDEVSModel> modelIt =
        ((ICoupledModel) getModel()).getSubModelIterator();
View Full Code Here

    IAbstractSequentialProcessor aproc;

    // AbstractEventQueueFactory.getEventQueueFactory((IBasicDEVSModel)model,
    // simulation.getParameters()

    ParameterBlock aeqp = parameters.getSubBlock("eventqueue");

    if (model instanceof ICoupledModel) {
      aproc =
          new Coordinator((ICoupledModel) model, SimSystem.getRegistry()
              .getFactory(AbstractEventQueueFactory.class, aeqp));
View Full Code Here

  @Override
  public IPerformancePredictorGenerator createPredictorGenerator(
      ParameterBlock params, PerformanceTuple example) {
    return new EnsemblePredictorGenerator(params.getSubBlockValue(
        PREDICTOR_GEN_FACTORY, new RandomPredictorGeneratorFactory()),
        params.getSubBlockValue(PREDICTOR_GEN_PARAMS, new ParameterBlock()));
  }
View Full Code Here

  @Override
  public boolean better(ParameterBlock config1, ParameterBlock config2) {
    bonusRuns++;
    int runsConfig1 = getInformationSource().getNumberOfRuns(config1);
    int runsConfig2 = getInformationSource().getNumberOfRuns(config2);
    ParameterBlock minConfiguration, maxConfiguration;
    if (runsConfig1 <= runsConfig2) {
      minConfiguration = config1;
      maxConfiguration = config2;
      if (runsConfig1 == runsConfig2) {
        bonusRuns++;
View Full Code Here

   * <p/>
   * See algorithm 1 in Hutter et al. paper
   */
  public void run() {

    ParameterBlock thetaILS = initializeSearch();

    // Main search loop
    while (!shallTerminate()) {
      terminationIndicator.updateTerminationCriterion(this);

      // "Perturbation"
      ParameterBlock theta = thetaILS;
      for (int i = 0; i < changesPerRun; i++) {
        theta = getInformationSource().getRandomNeighbour(theta);
      }

      changed(new ParamILSMessage(ParamILSMessageType.ParameterAdjusting,
View Full Code Here

   *
   * @return the theta_{ils}, i.e. the configuration with which to start in the
   *         main loop
   */
  protected ParameterBlock initializeSearch() {
    ParameterBlock theta0 = getInformationSource().getInitialConfiguration();
    // initial configuration is the best one found before search started
    setMinimumConfiguration(theta0);

    // try to find a good starting Configuration by iteratively changing a
    // parameter of the default configuration to a random value
    for (int i = 0; i < getInformationSource().getNumberOfParameters(theta0); i++) {
      ParameterBlock theta =
          getInformationSource().getRandomNeighbour(theta0, i);
      if (better(theta, theta0)) {
        theta0 = theta;
      }
    }
View Full Code Here

   * @param configuration
   *          beginning of the iteration
   * @return a local optimum
   */
  private ParameterBlock iterativeFirstImprovement(ParameterBlock configuration) {
    ParameterBlock neighbourConfiguration;
    ParameterBlock config = configuration;
    // neighbours already calculated will be ignored to prevent circles
    Set<String> visitedNeighbours = new HashSet<>();
    do {
      // update the currently best configuration
      neighbourConfiguration = config;
View Full Code Here

TOP

Related Classes of org.jamesii.core.parameters.ParameterBlock

Copyright © 2018 www.massapicom. 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.