// Path: cas-control/src/main/java/com/ghjansen/cas/control/exception/InvalidSimulationParameterException.java
// public class InvalidSimulationParameterException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = -6035012354830467870L;
// 
//     public InvalidSimulationParameterException(String message) {
//         super(message);
//     }
// 
//     public InvalidSimulationParameterException() {
//         super();
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/InitialConditionParameter.java
// public abstract class InitialConditionParameter {
// 
//     private final List<SequenceParameter> sequences;
// 
//     protected InitialConditionParameter(List<SequenceParameter> sequences) {
//         this.sequences = sequences;
//     }
// 
//     public List<SequenceParameter> getSequences() {
//         return sequences;
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/LimitsParameter.java
// public abstract class LimitsParameter {
// 
//     private final int cells;
//     private final int iterations;
// 
//     protected LimitsParameter(int cells, int iterations) {
//         this.cells = cells;
//         this.iterations = iterations;
//     }
// 
//     public int getCells() {
//         return cells;
//     }
// 
//     public int getIterations() {
//         return iterations;
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/RuleConfigurationParameter.java
// public abstract class RuleConfigurationParameter {
// 
//     private final int[] stateValues;
// 
//     protected RuleConfigurationParameter(int... stateValues) {
//         this.stateValues = stateValues;
//     }
// 
//     public int[] getStateValues() {
//         return stateValues;
//     }
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/RuleTypeParameter.java
// public abstract class RuleTypeParameter {
// 
//     private final boolean elementar;
// 
//     protected RuleTypeParameter(boolean elementar) {
//         this.elementar = elementar;
//     }
// 
//     public boolean isElementar() {
//         return elementar;
//     }
// 
// }


import com.ghjansen.cas.control.exception.InvalidSimulationParameterException;
import com.ghjansen.cas.control.parameter.InitialConditionParameter;
import com.ghjansen.cas.control.parameter.LimitsParameter;
import com.ghjansen.cas.control.parameter.RuleConfigurationParameter;
import com.ghjansen.cas.control.parameter.RuleTypeParameter;
/*
 * CAS - Cellular Automata Simulator
 * Copyright (C) 2016  Guilherme Humberto Jansen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ghjansen.cas.control.simulation;


/**
 * @author Guilherme Humberto Jansen (contact.ghjansen@gmail.com)
 */
public abstract class SimulationParameter {

    private final RuleTypeParameter ruleTypeParameter;
    private final RuleConfigurationParameter ruleConfigurationParameter;
    private final LimitsParameter limitsParameter;
    private final InitialConditionParameter initialConditionParameter;

    protected SimulationParameter(RuleTypeParameter ruleTypeParameter,
                                  RuleConfigurationParameter ruleConfigurationParameter, LimitsParameter limitsParameter,
                                  InitialConditionParameter initialConditionParameter) throws InvalidSimulationParameterException {
        this.ruleTypeParameter = ruleTypeParameter;
        this.ruleConfigurationParameter = ruleConfigurationParameter;
        this.limitsParameter = limitsParameter;
        this.initialConditionParameter = initialConditionParameter;
        validate();
    }

    public RuleTypeParameter getRuleTypeParameter() {
        return ruleTypeParameter;
    }

    public RuleConfigurationParameter getRuleConfigurationParameter() {
        return ruleConfigurationParameter;
    }

    public LimitsParameter getLimitsParameter() {
        return limitsParameter;
    }

    public InitialConditionParameter getInitialConditionParameter() {
        return initialConditionParameter;
    }

// Path: cas-control/src/main/java/com/ghjansen/cas/control/exception/InvalidSimulationParameterException.java
// public class InvalidSimulationParameterException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = -6035012354830467870L;
// 
//     public InvalidSimulationParameterException(String message) {
//         super(message);
//     }
// 
//     public InvalidSimulationParameterException() {
//         super();
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/InitialConditionParameter.java
// public abstract class InitialConditionParameter {
// 
//     private final List<SequenceParameter> sequences;
// 
//     protected InitialConditionParameter(List<SequenceParameter> sequences) {
//         this.sequences = sequences;
//     }
// 
//     public List<SequenceParameter> getSequences() {
//         return sequences;
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/LimitsParameter.java
// public abstract class LimitsParameter {
// 
//     private final int cells;
//     private final int iterations;
// 
//     protected LimitsParameter(int cells, int iterations) {
//         this.cells = cells;
//         this.iterations = iterations;
//     }
// 
//     public int getCells() {
//         return cells;
//     }
// 
//     public int getIterations() {
//         return iterations;
//     }
// 
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/RuleConfigurationParameter.java
// public abstract class RuleConfigurationParameter {
// 
//     private final int[] stateValues;
// 
//     protected RuleConfigurationParameter(int... stateValues) {
//         this.stateValues = stateValues;
//     }
// 
//     public int[] getStateValues() {
//         return stateValues;
//     }
// }
// 
// Path: cas-control/src/main/java/com/ghjansen/cas/control/parameter/RuleTypeParameter.java
// public abstract class RuleTypeParameter {
// 
//     private final boolean elementar;
// 
//     protected RuleTypeParameter(boolean elementar) {
//         this.elementar = elementar;
//     }
// 
//     public boolean isElementar() {
//         return elementar;
//     }
// 
// }


// Path: cas-control/src/main/java/com/ghjansen/cas/control/simulation/SimulationParameter.java
import com.ghjansen.cas.control.exception.InvalidSimulationParameterException;
import com.ghjansen.cas.control.parameter.InitialConditionParameter;
import com.ghjansen.cas.control.parameter.LimitsParameter;
import com.ghjansen.cas.control.parameter.RuleConfigurationParameter;
import com.ghjansen.cas.control.parameter.RuleTypeParameter;

/*
 * CAS - Cellular Automata Simulator
 * Copyright (C) 2016  Guilherme Humberto Jansen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ghjansen.cas.control.simulation;


/**
 * @author Guilherme Humberto Jansen (contact.ghjansen@gmail.com)
 */
public abstract class SimulationParameter {

    private final RuleTypeParameter ruleTypeParameter;
    private final RuleConfigurationParameter ruleConfigurationParameter;
    private final LimitsParameter limitsParameter;
    private final InitialConditionParameter initialConditionParameter;

    protected SimulationParameter(RuleTypeParameter ruleTypeParameter,
                                  RuleConfigurationParameter ruleConfigurationParameter, LimitsParameter limitsParameter,
                                  InitialConditionParameter initialConditionParameter) throws InvalidSimulationParameterException {
        this.ruleTypeParameter = ruleTypeParameter;
        this.ruleConfigurationParameter = ruleConfigurationParameter;
        this.limitsParameter = limitsParameter;
        this.initialConditionParameter = initialConditionParameter;
        validate();
    }

    public RuleTypeParameter getRuleTypeParameter() {
        return ruleTypeParameter;
    }

    public RuleConfigurationParameter getRuleConfigurationParameter() {
        return ruleConfigurationParameter;
    }

    public LimitsParameter getLimitsParameter() {
        return limitsParameter;
    }

    public InitialConditionParameter getInitialConditionParameter() {
        return initialConditionParameter;
    }

    public void validate() throws InvalidSimulationParameterException {