private ResourceSimulation newConfig(final ConfigPattern pattern) { final Type type = getType(pattern); if (type == null) { appMan.getLogger().warn("Could not determine simulation type for target {}, configuration {}", pattern.target.getLocation(), pattern.model); return null; } final ReadOnlyTimeSeries timeSeries; try { timeSeries = getSimulationTemplate(type); if (timeSeries == null) { appMan.getLogger().warn("Simulation template for type {} not found. Cannot simulate resource {}, config {}",type, pattern.target.getLocation(), pattern.model); return null; } } catch (UncheckedIOException e) { appMan.getLogger().error("Failed to load simulation template",e.getCause()); return null; } try { final ResourceSimulation sim = new ResourceSimulation(pattern, timeSeries, appMan); final ResourceSimulation old = simulations.put(pattern.model.getPath(), sim); if (old != null) old.close(); return sim; } catch (SecurityException e) { return null; } }