public SetValuePointXValueCommand(TableFormula tableFormula, ValuePoint valuePoint, double newBaseValue, IBuildingBlock buildingBlock)
     : base(tableFormula, valuePoint, newBaseValue, buildingBlock)
 {
     _oldBaseValue = valuePoint.X;
 }
Esempio n. 2
0
 public RemoveActiveTransportBuilderCommand(TransporterMoleculeContainer parent, ITransportBuilder itemToRemove, IBuildingBlock buildingBlock)
     : base(parent, itemToRemove, buildingBlock)
 {
 }
Esempio n. 3
0
 public RemoveMatchAllConditionCommand(T taggedObject, IBuildingBlock buildingBlock, Func <T, DescriptorCriteria> descriptorCriteriaRetriever)
     : base(string.Empty, taggedObject, buildingBlock, descriptorCriteriaRetriever)
 {
     ObjectType = AppConstants.Commands.MatchAllCondition;
 }
 public bool Uses(IBuildingBlock buildingBlock)
 {
     return((refersTo(buildingBlock, SpatialStructureId)) ||
            (refersTo(buildingBlock, MoleculeBuildingBlockId)));
 }
 public override IMoBiCommand GetRemoveCommand(IEventGroupBuilder eventGroupBuilderToRemove, IEventGroupBuildingBlock parent, IBuildingBlock buildingBlock)
 {
     return(new RemoveRootEventGroupBuilderCommand(parent, eventGroupBuilderToRemove));
 }
 private void checkBuildingBlock <TBuildingBlock>(TBuildingBlock buildingBlock) where TBuildingBlock : IBuildingBlock
 {
     // We keep actual BB to provide Information to user
     _buildingBlock = buildingBlock;
     checkObjectBase(buildingBlock);
 }
Esempio n. 7
0
        private async Task exportToFolder(string exportFolder)
        {
            var project    = new Project();
            var individual = await _snapshotObjectCreator.DefaultIndividual();

            project.Individuals = new[] { individual };

            var compound = await _snapshotObjectCreator.StandardCompound(lipophilicity : 3, fractionUnbound : 0.1, molWeight : 400, name : "Standard Molecule");

            compound.Name     = "Standard Molecule";
            project.Compounds = new[] { compound };

            var intrevanousBolusMgPerKg = await _snapshotObjectCreator.SimpleProtocol(dose : 1, doseUnit : "mg/kg", applicationType : ApplicationTypes.IntravenousBolus);

            var intrevanousBolusMg = await _snapshotObjectCreator.SimpleProtocol(dose : 1, doseUnit : "mg", applicationType : ApplicationTypes.IntravenousBolus);

            project.Protocols = new[] { intrevanousBolusMgPerKg, intrevanousBolusMg };

            var snapshotConfiguration = new SimulationConstruction
            {
                Individual = individual,
                Compounds  = new[] { compound },
                Protocols  = new [] { intrevanousBolusMgPerKg },
                ModelName  = CoreConstants.Model.FourComp,
            };

            var fourCompIvBolusMgPerKg = await configurationFrom(snapshotConfiguration);

            snapshotConfiguration.ModelName = CoreConstants.Model.TwoPores;
            var twoPore = await configurationFrom(snapshotConfiguration);

            snapshotConfiguration.Protocols = new[] { intrevanousBolusMg };
            snapshotConfiguration.ModelName = CoreConstants.Model.FourComp;
            var fourCompIvBolusMg = await configurationFrom(snapshotConfiguration);


            twoPore.SpatialStructure.Name  = "Human 2 Pores";
            twoPore.PassiveTransports.Name = "2 Pores Passive Transports";

            fourCompIvBolusMgPerKg.SpatialStructure.Name  = "Human Standard";
            fourCompIvBolusMgPerKg.PassiveTransports.Name = "Standard Passive Transports";
            fourCompIvBolusMgPerKg.EventGroups.Name       = "IV Bolus";
            fourCompIvBolusMgPerKg.Molecules.Name         = "Standard Molecule";
            fourCompIvBolusMgPerKg.Observers.Name         = "Standard Observer";


            fourCompIvBolusMg.EventGroups.Name = "IV Bolus (mg)";

            var defaultCompound = fourCompIvBolusMgPerKg.Molecules.First();

            defaultCompound.Name = string.Empty;
            defaultCompound.Parameter(CoreConstants.Parameters.LIPOPHILICITY).Value    = double.NaN;
            defaultCompound.Parameter(CoreConstants.Parameters.MOLECULAR_WEIGHT).Value = double.NaN;
            defaultCompound.Parameter(CoreConstants.Parameters.FRACTION_UNBOUND_PLASMA_REFERENCE_VALUE).Value = double.NaN;
            defaultCompound.Parameter(CoreConstants.Parameters.SOLUBILITY_AT_REFERENCE_PH).Value = double.NaN;

            _moBiExportTask.UpdateObserverForAllFlag(fourCompIvBolusMgPerKg.Observers);

            var buildingBlocks = new IBuildingBlock[]
            {
                twoPore.SpatialStructure,
                twoPore.PassiveTransports,
                fourCompIvBolusMgPerKg.SpatialStructure,
                fourCompIvBolusMgPerKg.PassiveTransports,
                fourCompIvBolusMgPerKg.EventGroups,
                fourCompIvBolusMgPerKg.Molecules,
                fourCompIvBolusMgPerKg.Observers,
                fourCompIvBolusMg.EventGroups
            };

            buildingBlocks.Each(bb => saveToPKML(bb, exportFolder));
        }
 protected RemoveChildFromEventGroupCommand(IEventGroupBuilder parent, TChild itemToRemove, IBuildingBlock buildingBlock)
     : base(parent, itemToRemove, buildingBlock)
 {
 }
 public RemoveContainerFromEventGroupCommand(IEventGroupBuilder parent, IContainer itemToRemove, IBuildingBlock buildingBlock) : base(parent, itemToRemove, buildingBlock)
 {
 }
Esempio n. 10
0
 public AddActiveTransportBuilderContainerCommand(IMoleculeBuilder parent, TransporterMoleculeContainer itemToAdd, IBuildingBlock buildingBlock)
     : base(parent, itemToAdd, buildingBlock)
 {
 }
Esempio n. 11
0
 protected ChangeTableFormulaWithReferencePathCommandBase(TFormula tableFormulaWithReference,
                                                          IFormulaUsablePath newFormulaUsablePath, IBuildingBlock buildingBlock, Func <TFormula, string> aliasFunc, Action <IFormulaUsablePath> addAction)
     : base(buildingBlock)
 {
     _tableFormulaWithReference   = tableFormulaWithReference;
     _tableFormulaWithReferenceId = _tableFormulaWithReference.Id;
     _newFormulaUsablePath        = newFormulaUsablePath;
     _aliasFunc = aliasFunc;
     _addAction = addAction;
 }
 protected override void Because()
 {
     _result = sut.Active <IBuildingBlock>();
 }
Esempio n. 13
0
 public AddInteracionContainerCommand(IMoleculeBuilder parent, InteractionContainer itemToAdd, IBuildingBlock buildingBlock) : base(parent, itemToAdd, buildingBlock)
 {
 }
Esempio n. 14
0
 public RemoveInteracionContainerCommand(IMoleculeBuilder parent, InteractionContainer itemToRemove, IBuildingBlock buildingBlock) : base(parent, itemToRemove, buildingBlock)
 {
 }
Esempio n. 15
0
 public TestAddObjectBaseCommand(IObjectBase parent, IObjectBase itemToAdd, IBuildingBlock buildingBlock) : base(parent, itemToAdd, buildingBlock)
 {
 }
 public AddContainerToEventGroupCommand(IEventGroupBuilder parent, IContainer itemToAdd, IBuildingBlock buildingBlock) : base(parent, itemToAdd, buildingBlock)
 {
 }
 public void Visit(IBuildingBlock buildingBlock)
 {
     checkBuildingBlock(buildingBlock);
 }
 protected AddChildToEventGroupCommand(IEventGroupBuilder parent, TChild itemToAdd, IBuildingBlock buildingBlock) : base(parent, itemToAdd, buildingBlock)
 {
 }
Esempio n. 19
0
        private void saveToPKML(IBuildingBlock buildingBlock, string folder)
        {
            var fileName = Path.Combine(folder, buildingBlock.Name + ".pkml");

            _pkmlPersistor.SaveToPKML(buildingBlock, fileName);
        }
 public RemoveTransportBuilderFromApplicationBuilderCommand(IApplicationBuilder parent, ITransportBuilder itemToRemove, IBuildingBlock buildingBlock)
     : base(parent, itemToRemove, buildingBlock)
 {
 }
 private void setMoleculeStartValueFormula(IFormula formula, IMoleculeStartValue moleculeStartValue, IBuildingBlock moleculesStartValues)
 {
     if (!formula.IsConstant())
     {
         moleculeStartValue.Formula = _cloneManagerForBuildingBlock.Clone(formula, moleculesStartValues.FormulaCache);
     }
 }
 public AddTransportBuilderToApplicationBuilderCommand(IApplicationBuilder parent, ITransportBuilder itemToAdd, IBuildingBlock buildingBlock)
     : base(parent, itemToAdd, buildingBlock)
 {
 }
 private bool refersTo(IBuildingBlock buildingBlock, string idToCheck)
 {
     return(string.Equals(idToCheck, buildingBlock.Id));
 }
 public AddEventGroupBuilderCommand(IEventGroupBuilder parent, IEventGroupBuilder itemToAdd, IBuildingBlock buildingBlock) : base(parent, itemToAdd, buildingBlock)
 {
 }
 public override IMoBiCommand GetAddCommand(IEventGroupBuilder eventGroupBuilder, IEventGroupBuildingBlock parent, IBuildingBlock buildingBlock)
 {
     return(GetAddCommand(eventGroupBuilder, buildingBlock as IEventGroupBuildingBlock));
 }
 public RemoveEventGroupBuilderCommand(IEventGroupBuilder parent, IEventGroupBuilder itemToRemove, IBuildingBlock buildingBlock) : base(parent, itemToRemove, buildingBlock)
 {
 }
Esempio n. 27
0
 protected RemoveTagConditionCommandBase(string tagToRemove, T taggedObject, IBuildingBlock buildingBlock, Func <T, DescriptorCriteria> descriptorCriteriaRetriever)
     : base(tagToRemove, taggedObject, buildingBlock, descriptorCriteriaRetriever)
 {
     CommandType = AppConstants.Commands.DeleteCommand;
 }
Esempio n. 28
0
 /// <summary>
 ///    Initializes a new instance of the <see cref="ValidationMessage" /> class.
 /// </summary>
 /// <param name="notificationType">Type of the message.</param>
 /// <param name="text">The text describing the validation problem</param>
 /// <param name="objectBase">The invalid object .</param>
 /// <param name="buildingBlock">Building block where the invalid object is defined. </param>
 public ValidationMessage(NotificationType notificationType, string text, IObjectBase objectBase, IBuildingBlock buildingBlock)
 {
     NotificationType = notificationType;
     Text             = text;
     Object           = objectBase;
     BuildingBlock    = buildingBlock;
     _details         = new List <string>();
 }
Esempio n. 29
0
 public RemoveInContainerConditionCommand(string tag, T taggedObject, IBuildingBlock buildingBlock, Func <T, DescriptorCriteria> descriptorCriteriaRetriever)
     : base(tag, taggedObject, buildingBlock, descriptorCriteriaRetriever)
 {
     ObjectType = AppConstants.Commands.InContainerCondition;
 }
 private bool containsEntity(IBuildingBlock buildingBlock)
 {
     buildingBlock.AcceptVisitor(this);
     return(_found);
 }