View Javadoc

1   /*
2    * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
3    *  
4    * Licensed under the Apache License, Version 2.0 (the "License"); 
5    * you may not use this file except in compliance with the License. 
6    * You may obtain a copy of the License at 
7    *  
8    *  http://www.apache.org/licenses/LICENSE-2.0
9    *  
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License. 
15   */
16  package p3j.simulation.assignments.exhaustive;
17  
18  import p3j.simulation.ISimulationParameters;
19  
20  /**
21   * Holds parameters for the exhaustive assignment generation approach.
22   * 
23   * Created: August 21, 2008
24   * 
25   * @author Christina Bohk
26   * @author Roland Ewald
27   */
28  public class ExhaustiveSimParameters implements ISimulationParameters {
29  
30  	/** Serialization ID. */
31  	private static final long serialVersionUID = -2083782392926642137L;
32  
33  	/** Maximal number of runs. Default is -1 (not restricted). */
34  	private Integer maxNumRuns = -1;
35  
36  	/**
37  	 * Maximal fraction of overall runs to be done. Default is 1 (not restricted).
38  	 */
39  	private Double maxRunFraction = 1.0;
40  
41  	/**
42  	 * Minimal probability a certain setup must at least have in order to be
43  	 * calculated. Default is 0 (unrestricted, all setups maybe computed).
44  	 */
45  	private Double cutOffProbability = 0.0;
46  
47  	/**
48  	 * Summing up the probabilities of all setups that already have been executed,
49  	 * when this sum is reached the simulator should stop.
50  	 */
51  	private Double desiredOverallProbability = 1.0;
52  
53  	/**
54  	 * Gets the max num runs.
55  	 * 
56  	 * @return the max num runs
57  	 */
58  	public int getMaxNumRuns() {
59  		return maxNumRuns;
60  	}
61  
62  	/**
63  	 * Sets the max num runs.
64  	 * 
65  	 * @param maxNumRuns
66  	 *          the new max num runs
67  	 */
68  	public void setMaxNumRuns(int maxNumRuns) {
69  		this.maxNumRuns = maxNumRuns;
70  	}
71  
72  	/**
73  	 * Gets the max run fraction.
74  	 * 
75  	 * @return the max run fraction
76  	 */
77  	public double getMaxRunFraction() {
78  		return maxRunFraction;
79  	}
80  
81  	/**
82  	 * Sets the max run fraction.
83  	 * 
84  	 * @param maxRunFraction
85  	 *          the new max run fraction
86  	 */
87  	public void setMaxRunFraction(double maxRunFraction) {
88  		this.maxRunFraction = maxRunFraction;
89  	}
90  
91  	/**
92  	 * Gets the cut off probability.
93  	 * 
94  	 * @return the cut off probability
95  	 */
96  	public double getCutOffProbability() {
97  		return cutOffProbability;
98  	}
99  
100 	/**
101 	 * Sets the cut off probability.
102 	 * 
103 	 * @param cutOffProbability
104 	 *          the new cut off probability
105 	 */
106 	public void setCutOffProbability(double cutOffProbability) {
107 		this.cutOffProbability = cutOffProbability;
108 	}
109 
110 	/**
111 	 * Gets the desired overall probability.
112 	 * 
113 	 * @return the desired overall probability
114 	 */
115 	public double getDesiredOverallProbability() {
116 		return desiredOverallProbability;
117 	}
118 
119 	/**
120 	 * Sets the desired overall probability.
121 	 * 
122 	 * @param desiredOverallProbability
123 	 *          the new desired overall probability
124 	 */
125 	public void setDesiredOverallProbability(double desiredOverallProbability) {
126 		this.desiredOverallProbability = desiredOverallProbability;
127 	}
128 
129 }