public void perform(WriteGraph g) throws DatabaseException {\r
Builtins b = g.getBuiltins();\r
Resource report = GraphUtils.create2(g, b.Report, b.HasDocumentation, "===Report===");\r
+ \r
+ String name = GraphUtils.findFreshName(g, "Experiment", model, b.ConsistsOf, "%s%d");\r
+ \r
@SuppressWarnings("unused")\r
Resource experiment = GraphUtils.create2(g, b.Experiment,\r
- b.HasName, "Experiment",\r
- b.HasLabel, "Experiment",\r
+ b.HasName, name,\r
+ b.HasLabel, name,\r
b.HasReportFactory, report,\r
b.PartOf, model);\r
}\r
ModelingResources mr = ModelingResources.getInstance(g);\r
ModelingUtils mu = new ModelingUtils(g);\r
\r
+ String modelName = GraphUtils.findFreshName(g, "Model", SimanticsUI.getProject().get(), b.ConsistsOf, "%s%d");\r
+ \r
Resource model = g.newResource();\r
- g.claimValue(model, b.HasName, "Model1");\r
- g.claimValue(model, b.HasLabel, "Model1");\r
+ g.claimValue(model, b.HasName, modelName);\r
+ g.claimValue(model, b.HasLabel, modelName);\r
g.claim(model, b.InstanceOf, sr.SysdynModel);\r
g.claim(model, b.PartOf, SimanticsUI.getProject().get());\r
\r
Resource conf = GraphUtils.create2(g, \r
sr.Configuration,\r
b.PartOf, model,\r
- b.HasName, "Configuration",\r
- sr.HasStartTime, 0.0,\r
- sr.HasStopTime, 10.0);\r
+ b.HasName, modelName+"Configuration"\r
+ );\r
\r
g.claim(conf, mr.CompositeToDiagram, diagram);\r
g.claim(model, b.HasConfiguration, conf);\r
\r
Resource report = GraphUtils.create2(g, mu.b.Report, mu.b.HasDocumentation, "===Report===");\r
\r
- Resource experiment = GraphUtils.create2(g, mu.b.Experiment,\r
+ GraphUtils.create2(g, mu.b.Experiment,\r
mu.b.HasName, "Experiment",\r
mu.b.HasLabel, "Experiment",\r
mu.b.HasReportFactory, report,\r
SysdynResource sr = SysdynResource.getInstance(g);\r
ModelingUtils mu = new ModelingUtils(g);\r
\r
+ String name = GraphUtils.findFreshName(g, "Module type", model, mu.b.ConsistsOf, "%s %d");\r
+ \r
Resource moduleType = g.newResource();\r
- g.claimValue(moduleType, mu.b.HasName, "New Module Type");\r
+ g.claimValue(moduleType, mu.b.HasName, name);\r
g.claim(moduleType, mu.b.Inherits, sr.Module);\r
g.claim(moduleType, mu.b.PartOf, model);\r
\r
\r
Resource configuration = GraphUtils.create2(g, \r
sr.Configuration,\r
- mu.b.HasName, "ModuuliConffi",\r
- mu.mr.CompositeToDiagram, diagram);\r
+ mu.b.HasName, name.trim().replace(" ", ""),\r
+ mu.mr.CompositeToDiagram, diagram,\r
+ mu.b.PartOf, model);\r
\r
g.claim(moduleType, mu.sr.IsDefinedBy , configuration);\r
\r
\r
Resource moduleSymbol = g.newResource();\r
- g.claimValue(moduleSymbol, mu.b.HasName, "ModuuliSymboli");\r
- g.claimValue(moduleSymbol, mu.b.HasLabel, "ModuuliSymboliLabel");\r
+ g.claimValue(moduleSymbol, mu.b.HasName, name + " Symbol");\r
+ g.claimValue(moduleSymbol, mu.b.HasLabel, name + " SymbolLabel");\r
g.claim(moduleSymbol, mu.b.Inherits, sr.ModuleSymbol);\r
g.claim(moduleSymbol, mu.mr.SymbolToComponentType, moduleType);\r
\r