Exemplo n.º 1
0
 public bool exptEquals(SpatialContext other)
 {
     if (this.Position.exptEquals(other.Position) == false)
     {
         Console.Write("SpatialContext objects not equal: ");
         Console.WriteLine("this.Position=" + this.Position + "; other.Position=" + other.Position);
         return false;
     }
     if (this.Velocity.exptEquals(other.Velocity) == false)
     {
         Console.Write("SpatialContext objects not equal: ");
         Console.WriteLine("this.Velocity=" + this.Velocity + "; other.Velocity=" + other.Velocity);
         return false;
     }
     if (this.Radius != other.Radius == false)
     {
         Console.Write("SpatialContext objects not equal: ");
         Console.WriteLine("this.Volume=" + this.Radius + "; other.Volume=" + other.Radius);
         return false;
     }
     if (this.Orientation.exptEquals(other.Orientation) == false)
     {
         Console.Write("SpatialContext objects not equal: ");
         Console.WriteLine("this.Orientation=" + this.Orientation + "; other.Orientation=" + other.Orientation);
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for creating a cell instance with a cell definition
        /// </summary>
        /// <param name="cellDefinition">
        /// A <see cref="CellDefinition"/>
        /// </param>
        public CellInstance(CellDefinition cellDefinition)
        {
            this.cellInstanceDefinition = cellDefinition;
            SBML.Model model = cellDefinition.getModel();
            if (model != null)
            {
                this.species = cellDefinition.getModel().listOfSpecies;
            }
            // Initialize the specials Dictionary
            this.speciesVariables = new Dictionary<string, double>();

            this.localSpeciesVariables = new Dictionary<string, double>();
            this.localSpeciesDelta = new Dictionary<string, double>();

            this.speciesToIndexMap = new Dictionary<string, int>();
            this.indexToSpeciesMap = new Dictionary<int, string>();

            // set up the list
            this.convertSpeciesListToVariables();

            this.components = new List<MuCell.Model.SBML.ExtracellularComponents.ComponentWorldStateBase>();

            this.flaggy = new MuCell.Model.SBML.ExtracellularComponents.FlagellaComponent();

            cellInstanceSpatialContext = new SpatialContext();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Clone SpatialContext
 /// </summary>
 /// <returns></returns>
 public Object Clone()
 {
     SpatialContext newInstance = new SpatialContext(this.position, this.velocity, this.radius, this.orientation, this.mass);
     return newInstance;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Secondary constructor that takes a cell definition,
        /// a spatial context, a list of species and a species variables dictionary
        /// </summary>
        /// <param name="cellDefinition">
        /// A <see cref="CellDefinition"/>
        /// </param>
        /// <param name="spatialContext">
        /// A <see cref="SpatialContext"/>
        /// </param>
        /// <param name="species">
        /// A <see cref="List`1"/>
        /// </param>
        /// <param name="speciesVariables">
        /// A <see cref="Dictionary`2"/>
        /// </param>
        public CellInstance(CellDefinition cellDefinition, SpatialContext spatialContext,
            List<SBML.Species> species, Dictionary<string, double> speciesVariables,
            Dictionary<int, string> indexToSpeciesMap, Dictionary<string, int> speciesToIndexMap,
            Solver.SolverBase solver, List<SBML.ExtracellularComponents.ComponentWorldStateBase> components,
            System.Random random)
        {
            this.cellInstanceDefinition = cellDefinition;
            this.species = species;
            this.speciesVariables = speciesVariables;
            this.cellInstanceSpatialContext = spatialContext;
            this.indexToSpeciesMap = indexToSpeciesMap;
            this.speciesToIndexMap = speciesToIndexMap;
            this.solver = solver;
            this.components = components;
            this.randomObject = random;

            this.localSpeciesVariables = new Dictionary<string, double>();
            this.localSpeciesDelta = new Dictionary<string, double>();
        }