hill() public static method

public static hill ( float x, float threshold, float stepness, float min, float max ) : float
x float
threshold float
stepness float
min float
max float
return float
Esempio n. 1
0
    /*!
     * \brief This function is called as Update in Monobehaviour.
     * \details This function is called in the Phenotype class in the Update function
     * This function should be implemented and all the graphical action has to be implemented in it.
     * \sa Phenotype
     */
    public override void UpdatePhenotype()
    {
        if (!String.IsNullOrEmpty(fluorescenceProtein))
        {
            _mol = ReactionEngine.getMoleculeFromName(fluorescenceProtein, _molecules);
            if (_mol == null)
            {
                return;
            }

            float intensity = Phenotype.hill(_mol.getConcentration(), 100.0f, 1f, 0f, 7f);
            float colRadius = Phenotype.hill(_mol.getConcentration(), 100.0f, 1f, 0f, 7f);

            phenoLight.intensity = intensity;

            if (null != _triggered)
            {
                if (_mol.getConcentration() > _triggered.threshold)
                {
                    if (!isSystemTriggered)
                    {
                        turnLightOn();
                    }
                    else
                    {
                        _triggered.triggerStay();
                    }
                }
                // The concentration fell below the threshold and the light must
                // consequently be switched off
                else if (isSystemTriggered)
                {
                    turnLightOff();
                }
            }
        }
    }