Пример #1
0
	bool SLICKEnergy::setup()
	{
		setName("SLICKEnergy");

		options_.set(NonpolarSolvation::Option::NONPOLAR_METHOD, NonpolarSolvation::CALCULATION__PCM);
		options_.setInteger(PolarSolvation::Option::POLAR_METHOD, PolarSolvation::CALCULATION__FULL_CYCLE_FOCUSED);
		options_.setInteger(VanDerWaalsSlick::Option::VDW_METHOD, VanDerWaalsSlick::CALCULATION__SOFTENED_LJ_POTENTIAL_LOG);
		options_.setReal(VanDerWaalsSlick::Option::VDW_SOFTENING_LIMIT, 5.0f);

		float CONST = options_.setDefaultReal(SLICKEnergy::Option::CONST, SLICKEnergy::Default::CONST);
		setIntercept(CONST);

		// register all components of the force field
		registerComponents_();

		// check whether we know which molecule is the protein and which is the
		// ligand in this complex. In case we don't know, we have to guess.
		// This can be wrong if we got two PDB files which will both be tagged
		// as protein.
		if ((getReceptor() == 0) || (getLigand() == 0))
		{
			Log.error() << "I don't know what the protein and the ligand is." 
				<< std::endl;
			return false;
		}

		return true ;
	}
Пример #2
0
	bool SLICKScore::setup()
	{
		setName("SLICKScore");

		// Set VDW to use a cut repulsive potential with a limit of 5 kJ/mol per interaction
		options_.setInteger(VanDerWaalsSlick::Option::VDW_METHOD, VanDerWaalsSlick::CALCULATION__SOFTENED_LJ_POTENTIAL_LOG);
		options_.setReal(VanDerWaalsSlick::Option::VDW_SOFTENING_LIMIT, 5.0f);

		// Use simple (and fast) Coulomb interactions for the scoring
		options_.setInteger(PolarSolvation::Option::POLAR_METHOD, PolarSolvation::CALCULATION__COULOMB);

		// Now extract options_ from options table and set the coefficients of
		// the components accordingly.
		float CONST = options_.setDefaultReal(SLICKScore::Option::CONST, SLICKScore::Default::CONST);
		setIntercept(CONST);

		// register all components of the force field
		registerComponents_();

		// check whether we know which molecule is the protein and which is the
		// ligand in this complex. In case we don't know, we have to guess.
		// This can be wrong if we got two PDB files which will both be tagged
		// as protein.
		if ((getReceptor() == 0) || (getLigand() == 0))
		{
			Log.error() << "I don't know what the protein and the ligand is." 
				<< std::endl;
			return false;
		}

		return true;
	}
            void
            StopAndWaitRC::doOnData(const CompoundPtr& compound, Port<Ack>)
            {
                StopAndWaitRCCommand *command = getCommand(compound->getCommandPool());
                assure(command->peer.type == StopAndWaitRCCommand::RR,
                       "Received I frame via 'Data' port");

                MESSAGE_BEGIN(NORMAL, logger, m, getFUN()->getName());
                m << " processIncoming(compound), Received RR frame "
                  << " expected (this->NS) " << NS
                  << " received (command->peer.NS) " << command->peer.NS;
                MESSAGE_END();

                if(!(command->peer.NS == NS || command->peer.NS == NS-1))
                {
                    // this can not happen.
                    wns::Exception e;
                    e << "StopAndWait-ARQ received an ACK that with neither (NS) nor (NS-1). "
                      << "This cannot happen and is most probably an implementation error";
                    // stop here
                    throw e;
                }

                // only compounds with NS == NS or NS == NS-1 are left
                if(command->peer.NS == NS-1)
                {
                    // duplicate ACK (must be due to duplicate I)
                    MESSAGE_BEGIN(NORMAL, logger, m, getFUN()->getName());
                    m << " Unexpected RR frame (due to duplicate I frame).";
                    m << "\nHINT: Check your resend timeout. This indicates it is too short.";
                    MESSAGE_END();
                }
                else
                {
                    // this is the ACK we've been waiting for -> we can stop
                    // the timeout
                    MESSAGE_SINGLE(NORMAL, logger, getFUN()->getName()
                                   << " This is the RR frame (ACK) for the last sent I frame (compound)");
                    //        statusCollector->onSuccessfullTransmission(activeCompound);

                    activeCompound = CompoundPtr();

                    if (hasTimeoutSet() == true)
                    {
                        MESSAGE_SINGLE(VERBOSE, logger, getFUN()->getName() << "Stopping timeout.");
                        cancelTimeout();
                    }

                    MESSAGE_SINGLE(VERBOSE, logger, getFUN()->getName()
                                   << " Ready for next compound from higher FU.");

                    getReceptor()->wakeup();
                }
            }
            void
            StopAndWaitRC::doWakeup(Port<Data>)
            {
                if (sendNowData &&
                    getPortConnector< Port<Data> >()->hasAcceptor(activeCompound))
                {
                    setTimeout(resendTimeout);
                    getPortConnector< Port<Data> >()->getAcceptor(activeCompound)->sendData(activeCompound->copy());

                    sendNowData = false;
                }

                getReceptor()->wakeup();
            }
Пример #5
0
 virtual void
 doWakeup()
 {
     getReceptor()->wakeup();
 } // wakeup