Exemple #1
0
        public override async Task <IndividualMolecule> MapToModel(Molecule snapshot, ModelIndividual individual)
        {
            var molecule = createMoleculeFrom(snapshot, individual);

            MapSnapshotPropertiesToModel(snapshot, molecule);

            //This call should happen before updating parameters from snapshot to ensure that default molecule
            //parameters that were updated by the user are taking precedence.
            _moleculeExpressionTask.SetDefaulMoleculeParameters(molecule);

            await UpdateParametersFromSnapshot(snapshot, molecule, snapshot.Type.ToString());

            updateMoleculePropertiesToMolecule(molecule, snapshot);

            var ontogeny = await _ontogenyMapper.MapToModel(snapshot.Ontogeny, individual);

            _ontogenyTask.SetOntogenyForMolecule(molecule, ontogeny, individual);

            await updateExpression(snapshot, new ExpressionContainerMapperContext { Molecule = molecule, SimulationSubject = individual });

            return(molecule);
        }
Exemple #2
0
 private void setDefaultFor(IndividualMolecule molecule, TSimulationSubject simulationSubject, string moleculeName)
 {
     setDefaultSettingsForTransporter(molecule, simulationSubject, moleculeName);
     setDefaultOntogeny(molecule, simulationSubject, moleculeName);
     _moleculeParameterTask.SetDefaulMoleculeParameters(molecule, moleculeName);
 }