com.github.rinde.rinsim.experiment.DefaultMASConfiguration.java Source code

Java tutorial

Introduction

Here is the source code for com.github.rinde.rinsim.experiment.DefaultMASConfiguration.java

Source

/*
 * Copyright (C) 2011-2015 Rinde van Lon, iMinds-DistriNet, KU Leuven
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.rinde.rinsim.experiment;

import java.io.Serializable;

import com.github.rinde.rinsim.core.model.Model;
import com.github.rinde.rinsim.pdptw.common.DynamicPDPTWProblem.Creator;
import com.github.rinde.rinsim.scenario.AddDepotEvent;
import com.github.rinde.rinsim.scenario.AddParcelEvent;
import com.github.rinde.rinsim.util.StochasticSupplier;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;

/**
 * Implementation of {@link MASConfiguration} which implements most method using
 * default values.
 * @author Rinde van Lon 
 */
public abstract class DefaultMASConfiguration implements MASConfiguration, Serializable {
    private static final long serialVersionUID = 4815504615843930209L;

    @Override
    public ImmutableList<? extends StochasticSupplier<? extends Model<?>>> getModels() {
        return ImmutableList.of();
    }

    @Override
    public Optional<? extends Creator<AddDepotEvent>> getDepotCreator() {
        return Optional.absent();
    }

    @Override
    public Optional<? extends Creator<AddParcelEvent>> getParcelCreator() {
        return Optional.absent();
    }

    @Override
    public String toString() {
        return getClass().getSimpleName();
    }
}