Пример #1
0
    void GenericDrug::PkPdParameterValidation()
    {
        if ( durability_time_profile == PKPDModel::CONCENTRATION_VERSUS_TIME )
        {
            // Validate that long-decay mode (slow_decay_time_constant) is longer than short-decay mode (fast_decay_time_constant)
            // N.B. In the case that they are equal, Vd is ignored and the system reverts to a single-compartment PkPd model.

            if ( slow_decay_time_constant < fast_decay_time_constant )
            {
                //throw IncoherentInitializationException( __FILE__, __LINE__, __FUNCTION__, "slow_decay_time_constant", slow_decay_time_constant, "fast_decay_time_constant", fast_decay_time_constant );
                throw InitializationException( __FILE__, __LINE__, __FUNCTION__, "Value of drug \'slow_decay_time_constant\' must be greater or equal to \'fast_decay_time_constant\'." );
            }

            // Validate that (slow_decay_time_constant/Vd) is greater than fast_decay_time_constant.
            // Or else, the input parameters do not make sense as a solution to the two-compartment PkPd model
            // with the concentration in the central compartment as the sum of two exponentials with the two eigenvalues
            // being the specified decay times.

            if ( (slow_decay_time_constant != fast_decay_time_constant) && (slow_decay_time_constant / Vd) <= fast_decay_time_constant )
            {
                throw InitializationException( __FILE__, __LINE__, __FUNCTION__, "Ratio of drug value \'slow_decay_time_constant\' over \'Drug_Vd\' must be greater than \'primary_decay_constant\'.  Otherwise, the parameters do not make sense as a solution to the two-compartment PkPd model, with the concentration in the central compartment as the sum of two exponentials with the two eigenvalues being the specified decay times:\n\n                     _______________________                     __________________________\n    Cmax(t=0) --->  /  Central compartment  \\  ---- k_CP --->   /  Peripheral compartment  \\\n                    \\_______________________/  <--- k_PC ----   \\__________________________/\n                               |\n                             k_out\n                               |\n                               v" );
            }

            //                     _______________________                     __________________________
            //    Cmax(t=0) --->  /  Central compartment  \  ---- k_CP --->   /  Peripheral compartment  \
            //                    \_______________________/  <--- k_PC ----   \__________________________/
            //                               |
            //                             k_out
            //                               |
            //                               v
        }
    }
Пример #2
0
void SocketTCP::connectSocket() {
	TRACE(logger, "connectSocket()");

	if (isConnected) {
		throw InitializationException("void SocketTCP::connectSocket()\n"
				"Socket is already connected.",
				"br::ufscar::lince::mmi::socketconn::SocketTCP",
				"connectSocket()");
	}
	int ret = connect(_socket, (struct sockaddr *) &addres, sizeof(addres));
	if (ret < 0) {
		string errMsg = strerror(errno);
		throw NetworkException("void SocketTCP::connectSocket()\n"
				"Couldn't connect:" + errMsg  + "\n",
				"br::ufscar::lince::mmi::socketconn::SocketTCP",
				"connectSocket()");
	}
	isConnected = true;
}