src/main/java/org/geppetto/frontend/controllers/ConnectionHandler.java
public void newExperimentBatch(String requestID, long projectId, BatchExperiment batchExperiment)
	{
		IGeppettoProject project = retrieveGeppettoProject(projectId);
		Gson gson = new Gson();
		List<IExperiment> experiments = new ArrayList<IExperiment>();
		try
		{
			for(NewExperiment e : batchExperiment.experiments)
			{
				IExperiment experiment = geppettoManager.newExperiment(requestID, project);
				experiment.setName(e.name);
				// set watched variables
				geppettoManager.setWatchedVariables(e.watchedVariables, experiment, project, true);
				
				// set model paramerers
				for (Map.Entry<String, String> entry : e.modelParameters.entrySet()) {
				    String key = entry.getKey();
				    String value = entry.getValue();
				    Map<String, String> modelParam = new HashMap<String, String>();
				    modelParam.put(key, value);
				    geppettoManager.setModelParameters(modelParam, experiment, project);
				}
				IGeppettoDataManager dataManager = DataManagerHelper.getDataManager();
				// set simulator parameters
				for(IAspectConfiguration aspectConfiguration : experiment.getAspectConfigurations())
				{
					if(aspectConfiguration.getInstance().equals(e.aspectPath))
					{
						aspectConfiguration.getSimulatorConfiguration().setTimestep(e.timeStep);
						aspectConfiguration.getSimulatorConfiguration().setLength(e.duration);
						aspectConfiguration.getSimulatorConfiguration().setSimulatorId(e.simulator);
						aspectConfiguration.getSimulatorConfiguration().getParameters().putAll(e.simulatorParameters);
						dataManager.saveEntity(aspectConfiguration.getSimulatorConfiguration());
					}
				}
				experiments.add(experiment);
			}

			websocketConnection.sendMessage(requestID, OutboundMessages.EXPERIMENT_BATCH_CREATED, gson.toJson(experiments));
		}
		catch(GeppettoExecutionException | GeppettoAccessException e)
		{
			error(e, "Error creating batch experiments");
		}

	}
/**
	 * Creates new experiments in a batch
	 * 
	 * @param requestID
	 * @param projectId
	 * @param batchSize
	 *            - how many experiments we need to create
	 * @param names
	 *            - experiment names
	 */
Creates new experiments in a batch

@param requestID
@param projectId
@param batchSize
- how many experiments we need to create
@param names
- experiment names
Creates new experiments in a batch @param requestID @param projectId @param batchSize - how many experiments we need to create @param names - experiment names
public void newExperimentBatch(String requestID, long projectId, BatchExperiment batchExperiment)
	{
		IGeppettoProject project = retrieveGeppettoProject(projectId);
		Gson gson = new Gson();
		List<IExperiment> experiments = new ArrayList<IExperiment>();
		try
		{
			for(NewExperiment e : batchExperiment.experiments)
			{
				IExperiment experiment = geppettoManager.newExperiment(requestID, project);
				experiment.setName(e.name);
				geppettoManager.setWatchedVariables(e.watchedVariables, experiment, project, true);
				for (Map.Entry<String, String> entry : e.modelParameters.entrySet()) {
				    String key = entry.getKey();
				    String value = entry.getValue();
				    Map<String, String> modelParam = new HashMap<String, String>();
				    modelParam.put(key, value);
				    geppettoManager.setModelParameters(modelParam, experiment, project);
				}
				IGeppettoDataManager dataManager = DataManagerHelper.getDataManager();
				for(IAspectConfiguration aspectConfiguration : experiment.getAspectConfigurations())
				{
					if(aspectConfiguration.getInstance().equals(e.aspectPath))
					{
						aspectConfiguration.getSimulatorConfiguration().setTimestep(e.timeStep);
						aspectConfiguration.getSimulatorConfiguration().setLength(e.duration);
						aspectConfiguration.getSimulatorConfiguration().setSimulatorId(e.simulator);
						aspectConfiguration.getSimulatorConfiguration().getParameters().putAll(e.simulatorParameters);
						dataManager.saveEntity(aspectConfiguration.getSimulatorConfiguration());
					}
				}
				experiments.add(experiment);
			}
			websocketConnection.sendMessage(requestID, OutboundMessages.EXPERIMENT_BATCH_CREATED, gson.toJson(experiments));
		}
		catch(GeppettoExecutionException | GeppettoAccessException e)
		{
			error(e, "Error creating batch experiments");
		}
	}
public void newExperimentBatch ( String requestID , long projectId , BatchExperiment batchExperiment ) { IGeppettoProject project = retrieveGeppettoProject ( projectId ) ; Gson gson = new Gson ( ) ; List < IExperiment > experiments = new ArrayList < IExperiment > ( ) ; try { for ( NewExperiment e : batchExperiment . experiments ) { IExperiment experiment = geppettoManager . newExperiment ( requestID , project ) ; experiment . setName ( e . name ) ; geppettoManager . setWatchedVariables ( e . watchedVariables , experiment , project , true ) ; for ( Map . Entry < String , String > entry : e . modelParameters . entrySet ( ) ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; Map < String , String > modelParam = new HashMap < String , String > ( ) ; modelParam . put ( key , value ) ; geppettoManager . setModelParameters ( modelParam , experiment , project ) ; } IGeppettoDataManager dataManager = DataManagerHelper . getDataManager ( ) ; for ( IAspectConfiguration aspectConfiguration : experiment . getAspectConfigurations ( ) ) { if ( aspectConfiguration . getInstance ( ) . equals ( e . aspectPath ) ) { aspectConfiguration . getSimulatorConfiguration ( ) . setTimestep ( e . timeStep ) ; aspectConfiguration . getSimulatorConfiguration ( ) . setLength ( e . duration ) ; aspectConfiguration . getSimulatorConfiguration ( ) . setSimulatorId ( e . simulator ) ; aspectConfiguration . getSimulatorConfiguration ( ) . getParameters ( ) . putAll ( e . simulatorParameters ) ; dataManager . saveEntity ( aspectConfiguration . getSimulatorConfiguration ( ) ) ; } } experiments . add ( experiment ) ; } websocketConnection . sendMessage ( requestID , OutboundMessages . EXPERIMENT_BATCH_CREATED , gson . toJson ( experiments ) ) ; } catch ( GeppettoExecutionException | GeppettoAccessException e ) { error ( e , "Error creating batch experiments" ) ; } }
Creates new experiments in a batch
Creates new experiments in a batch
// set watched variables // set model paramerers // set simulator parameters