Open-Systems-Pharmacology / MoBi

MoBi® is a software tool for multiscale physiological modeling and simulation
Other
27 stars 9 forks source link

Error when a molecule is applied in an Application and the molecule is not in the MoleucleBuilding block #1377

Open msevestre opened 2 weeks ago

msevestre commented 2 weeks ago

Using project here https://github.com/esqLABS/bug-reports/blob/simplify-model/

selecitng everything image

Leads to

image

Application: MoBi® 12.0.0

Object reference not set to an instance of an object.

Stack trace:

at OSPSuite.Core.Domain.Mappers.MoleculeBuilderToMoleculeAmountMapper.MapFrom(MoleculeBuilder moleculeBuilder, IContainer targetContainer, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Mappers.EventGroupBuilderToEventGroupMapper.createApplication(ApplicationBuilder applicationBuilder, EventGroup eventGroup, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Mappers.EventGroupBuilderToEventGroupMapper.createEventGroupStructure(EventGroupBuilder eventGroupBuilder, EventGroup eventGroup, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Mappers.EventGroupBuilderToEventGroupMapper.MapFrom(EventGroupBuilder eventGroupBuilder, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Mappers.EventGroupBuilderToEventGroupMapper.createEventGroupStructure(EventGroupBuilder eventGroupBuilder, EventGroup eventGroup, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Mappers.EventGroupBuilderToEventGroupMapper.MapFrom(EventGroupBuilder eventGroupBuilder, SimulationBuilder simulationBuilder)
   at OSPSuite.Core.Domain.Services.EventBuilderTask.createEventGroupInContainer(EventGroupBuilder eventGroupBuilder, IContainer sourceContainer, ModelConfiguration modelConfiguration)
   at OSPSuite.Core.Domain.Services.EventBuilderTask.createEventGroupFrom(EventGroupBuilder eventGroupBuilder, ModelConfiguration modelConfiguration)
   at OSPSuite.Core.Domain.Services.EventBuilderTask.<>c__DisplayClass7_0.<CreateEvents>b__0(EventGroupBuilder x)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at OSPSuite.Core.Domain.Services.EventBuilderTask.CreateEvents(ModelConfiguration modelConfiguration)
   at OSPSuite.Core.Domain.Services.ModelConstructor.createObserversAndEvents(ModelConfiguration modelConfiguration)
   at OSPSuite.Core.Domain.Services.ModelConstructor.buildProcess(ModelConfiguration modelConfiguration, Func`2[] steps)
   at OSPSuite.Core.Domain.Services.ModelConstructor.CreateModelFrom(SimulationConfiguration simulationConfiguration, String modelName)
   at MoBi.Core.Domain.Services.SimulationFactory.createModel(SimulationConfiguration simulationConfiguration, String name) in C:\dev\MoBi\src\MoBi.Core\Domain\Services\SimulationFactory.cs:line 120
   at MoBi.Core.Domain.Services.SimulationFactory.<>c__DisplayClass14_0.<CreateModelAndValidate>b__0() in C:\dev\MoBi\src\MoBi.Core\Domain\Services\SimulationFactory.cs:line 101
   at OSPSuite.Presentation.Services.HeavyWorkManager.doWork()
   at OSPSuite.Presentation.Services.HeavyWorkManager.<.ctor>b__9_1(Object o, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
msevestre commented 2 weeks ago

@PavelBal @rwmcintosh

T3 was removed in the example? But it's used in the application. Not sure if this is something we want to deal with or not. image

PavelBal commented 2 weeks ago

Usually, creation of simulation fails with the message that the mocule is not found. Should not crash of course.