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); }
private void setDefaultFor(IndividualMolecule molecule, TSimulationSubject simulationSubject, string moleculeName) { setDefaultSettingsForTransporter(molecule, simulationSubject, moleculeName); setDefaultOntogeny(molecule, simulationSubject, moleculeName); _moleculeParameterTask.SetDefaulMoleculeParameters(molecule, moleculeName); }