Exemplo n.º 1
0
 public override Dictionary <ChemEObject, float> CalculatePossiblePositions(Quantum quantum)
 {
     possiblePositions.Clear();
     for (int i = 0; i < NextPosition.Count; i++)
     {
         possiblePositions.Add(NextPosition.Keys.ElementAt(i), NextPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
     }
     return(possiblePositions);
 }
Exemplo n.º 2
0
 public virtual bool QuantumSpace(Quantum quantum)
 {
     // Before movement is initiated each Quantum checks whether there is pressure
     // and it needs to move in the first place. Default virtual function is used
     // in for simple instruments, like pipes, but when it comes to instruments
     // that operate with different molecules such instrument handles the space
     // for each molecule type (for example CO2 column)
     return(this.Quantums.Count > this.volume * SimulationModel.VolumeMultiplier);
 }
Exemplo n.º 3
0
 public override float QuantumProbabilityCalc(Quantum quantum)
 {
     if (Quantums.Count < volume * 2)
     {
         return(1f);
     }
     else
     {
         return(0f);
     }
 }
Exemplo n.º 4
0
        public override Dictionary <ChemEObject, float> CalculatePossiblePositions(Quantum quantum)
        {
            possiblePositions.Clear();
            quantumPreviousPositionPoint = quantum.EntryPoint;
            for (int i = 0; i < NextPosition.Count; i++)
            {
                instrumentNextPositionPoint = PointOfExit2(NextPosition.Keys.ElementAt(i));
                Debug.Log(quantum.EntryPoint.ToString());
                if ((quantumPreviousPositionPoint == Inlet2 && instrumentNextPositionPoint == Outlet2) ||
                    (quantumPreviousPositionPoint == Outlet2 && instrumentNextPositionPoint == Inlet2))
                {
                    possiblePositions.Add(NextPosition.Keys.ElementAt(i), NextPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }

                if ((quantumPreviousPositionPoint == Inlet && instrumentNextPositionPoint == Outlet) ||
                    (quantumPreviousPositionPoint == Outlet && instrumentNextPositionPoint == Inlet))
                {
                    possiblePositions.Add(NextPosition.Keys.ElementAt(i), NextPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }

                if (quantumPreviousPositionPoint == instrumentNextPositionPoint)
                {
                    possiblePositions.Add(NextPosition.Keys.ElementAt(i), NextPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }
            }

            for (int i = 0; i < PreviousPosition.Count; i++)
            {
                instrumentNextPositionPoint = PointOfEntry2(PreviousPosition.Keys.ElementAt(i));
                if ((quantumPreviousPositionPoint == Inlet2 && instrumentNextPositionPoint == Outlet2) ||
                    (quantumPreviousPositionPoint == Outlet2 && instrumentNextPositionPoint == Inlet2))
                {
                    possiblePositions.Add(PreviousPosition.Keys.ElementAt(i), PreviousPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }

                if ((quantumPreviousPositionPoint == Inlet && instrumentNextPositionPoint == Outlet) ||
                    (quantumPreviousPositionPoint == Outlet && instrumentNextPositionPoint == Inlet))
                {
                    possiblePositions.Add(PreviousPosition.Keys.ElementAt(i), PreviousPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }

                if (quantumPreviousPositionPoint == instrumentNextPositionPoint)
                {
                    possiblePositions.Add(PreviousPosition.Keys.ElementAt(i), PreviousPosition.Keys.ElementAt(i).QuantumProbabilityCalc(quantum));
                }
            }
            return(possiblePositions);
        }
Exemplo n.º 5
0
 public override float QuantumProbabilityCalc(Quantum quantum)
 {
     return(1f);
 }
Exemplo n.º 6
0
 // Called by the Quanta inside the instrument
 public abstract Dictionary <ChemEObject, float> CalculatePossiblePositions(Quantum quantum);
Exemplo n.º 7
0
 // Called by the Quanta in the connected (previous or next) instrument
 public abstract float QuantumProbabilityCalc(Quantum quantum);
Exemplo n.º 8
0
 // The Generator?
 public override float QuantumProbabilityCalc(Quantum quantum)
 {
     return(0f);            // Acts as a stop plug
 }
Exemplo n.º 9
0
 public override float QuantumProbabilityCalc(Quantum quantum)
 {
     return(openValue);
 }
Exemplo n.º 10
0
 public override bool QuantumSpace(Quantum quantum)
 {
     // Should the quantum move out?
     return(this.Quantums.Count > this.volumeWater * SimulationModel.VolumeMultiplier);
 }