Added a convenient constructor using EulerSchemeFromProcessModel
@@ -45,11 +45,22 @@ public class MonteCarloAssetModel implements AssetModelMonteCarloSimulationModel
this.process = process;
}
+ /**
+ * Convenient constructor being the same as this(new EulerSchemeFromProcessModel(model, stochasticDriver))
+ *
+ * @param model The model to use for the EulerSchemeFromProcessModel.
+ * @param stochasticDriver The stochatic driver to use.
+ */
+ public MonteCarloAssetModel(ProcessModel model, IndependentIncrements stochasticDriver) {
+ this(new EulerSchemeFromProcessModel(model, stochasticDriver));
+ }
+
/**
* Create a Monte-Carlo simulation using given process discretization scheme.
*
* @param model The model to be used.
* @param process The numerical scheme to be used.
+ * @deprecated May be made private in future releases.
*/
public MonteCarloAssetModel(
final ProcessModel model,
@@ -60,13 +71,6 @@ public class MonteCarloAssetModel implements AssetModelMonteCarloSimulationModel
this.process = process;
}
- public MonteCarloAssetModel(ProcessModel model, IndependentIncrements stochasticDriver) {
- super();
-
- this.model = model;
- this.process = new EulerSchemeFromProcessModel(model, stochasticDriver);
- }
-
@Override
public RandomVariable getAssetValue(final double time, final int assetIndex) throws CalculationException {
int timeIndex = getTimeIndex(time);
@@ -108,7 +112,7 @@ public class MonteCarloAssetModel implements AssetModelMonteCarloSimulationModel
}
@Override
- public AssetModelMonteCarloSimulationModel getCloneWithModifiedData(final Map<String, Object> dataModified) throws CalculationException {
+ public MonteCarloAssetModel getCloneWithModifiedData(final Map<String, Object> dataModified) throws CalculationException {
final ProcessModel newModel = model.getCloneWithModifiedData(dataModified);
MonteCarloProcess newProcess;
