Пример #1
0
        public async Task <Model.Simulation> SimulationFor(SimulationConstruction simulationConstruction)
        {
            var project = new Project
            {
                Individuals = simulationConstruction.Individual != null ? new[] { simulationConstruction.Individual } : null,
                Populations = simulationConstruction.Population != null ? new[] { simulationConstruction.Population } : null,
                Compounds   = simulationConstruction.Compounds,
                Protocols   = simulationConstruction.Protocols,
            };

            var snapshotsimulation = await SnapshotSimulationFor(simulationConstruction);

            project.Simulations = new[] { snapshotsimulation };

            var pksimProject = await _projectMapper.MapToModel(project);

            return(pksimProject.BuildingBlockByName <Model.Simulation>(simulationConstruction.SimulationName));
        }
Пример #2
0
        public Task <Simulation> SnapshotSimulationFor(SimulationConstruction simulationConstruction)
        {
            var simulation = new Simulation
            {
                Name       = simulationConstruction.SimulationName,
                Individual = simulationConstruction.Individual?.Name,
                Population = simulationConstruction.Population?.Name,
                Model      = simulationConstruction.ModelName,
                AllowAging = simulationConstruction.AllowAging,

                Compounds = simulationConstruction.Compounds.Select((compound, index) => new CompoundProperties
                {
                    Name     = compound.Name,
                    Protocol = new ProtocolSelection
                    {
                        Name = simulationConstruction.Protocols[index].Name
                    }
                }).ToArray()
            };

            return(Task.FromResult(simulation));
        }