本文整理汇总了C++中Eref::id方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::id方法的具体用法?C++ Eref::id怎么用?C++ Eref::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eref
的用法示例。
在下文中一共展示了Eref::id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: zombify
void HSolve::zombify( Eref hsolve ) const
{
vector< Id >::const_iterator i;
vector< ObjId > temp;
for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i )
temp.push_back( ObjId( *i, 0 ) );
for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i )
CompartmentBase::zombify( i->eref().element(),
ZombieCompartment::initCinfo(), hsolve.id() );
temp.clear();
for ( i = caConcId_.begin(); i != caConcId_.end(); ++i )
temp.push_back( ObjId( *i, 0 ) );
// Shell::dropClockMsgs( temp, "process" );
for ( i = caConcId_.begin(); i != caConcId_.end(); ++i )
CaConcBase::zombify( i->eref().element(), ZombieCaConc::initCinfo(), hsolve.id() );
temp.clear();
for ( i = channelId_.begin(); i != channelId_.end(); ++i )
temp.push_back( ObjId( *i, 0 ) );
for ( i = channelId_.begin(); i != channelId_.end(); ++i )
HHChannelBase::zombify( i->eref().element(),
ZombieHHChannel::initCinfo(), hsolve.id() );
}
示例2: setTableA
void HHGate::setTableA( const Eref& e, vector< double > v )
{
if ( v.size() < 2 ) {
cout << "Warning: HHGate::setTableA: size must be >= 2 entries on "
<< e.id().path() << endl;
return;
}
if ( checkOriginal( e.id(), "tableA" ) ) {
isDirectTable_ = 1;
A_ = v;
unsigned int xdivs = A_.size() - 1;
invDx_ = static_cast< double >( xdivs ) / ( xmax_ - xmin_ );
}
}
示例3: setAlpha
void HHGate::setAlpha( const Eref& e, vector< double > val )
{
if ( val.size() != 5 ) {
cout << "Error: HHGate::setAlpha on " << e.id().path() <<
": Number of entries on argument vector should be 5, was " <<
val.size() << endl;
return;
}
if ( checkOriginal( e.id(), "alpha" ) ) {
alpha_ = val;
updateTauMinf();
updateTables();
}
}
示例4: setMinfinity
void HHGate::setMinfinity( const Eref& e, vector< double > val )
{
if ( val.size() != 5 ) {
cout << "Error: HHGate::setMinfinity on " << e.id().path() <<
": Number of entries on argument vector should be 5, was " <<
val.size() << endl;
return;
}
if ( checkOriginal( e.id(), "mInfinity" ) ) {
mInfinity_ = val;
updateAlphaBeta();
updateTables();
}
}
示例5: setupEnzymaticReaction
/* Enzymatic Reaction */
void SbmlReader::setupEnzymaticReaction( const EnzymeInfo & einfo,string name )
{
static const Cinfo* enzymeCinfo = initEnzymeCinfo();
static const Finfo* k1Finfo = enzymeCinfo->findFinfo( "k1" );
static const Finfo* k2Finfo = enzymeCinfo->findFinfo( "k2" );
static const Finfo* k3Finfo = enzymeCinfo->findFinfo( "k3" );
Eref E = ( einfo.enzyme )();
Element* enzyme_ = Neutral::create( "Enzyme",name,E.id(),Id::scratchId() );//create Enzyme
Eref complx = einfo.complex();
Eref(enzyme_).add( "enz",E,"reac",ConnTainer::Default );
Eref(enzyme_).add( "cplx",complx,"reac",ConnTainer::Default );
vector< Id >::const_iterator sub_itr;
for ( sub_itr = einfo.substrates.begin(); sub_itr != einfo.substrates.end(); sub_itr++ )
{ Eref S = (*sub_itr)();
Eref( enzyme_ ).add( "sub",S,"reac",ConnTainer::Default );
}
vector< Id >::const_iterator prd_itr;
for ( prd_itr = einfo.products.begin(); prd_itr != einfo.products.end(); prd_itr++ )
{ Eref P = (*prd_itr)();
Eref( enzyme_ ).add( "prd",P,"prd",ConnTainer::Default );
}
::set< double >( enzyme_, k1Finfo, einfo.k1 );
::set< double >( enzyme_, k2Finfo, einfo.k2 );
::set< double >( enzyme_, k3Finfo, einfo.k3 );
::set< bool >( enzyme_,"mode",0 );
::set( complx,"destroy" );
}
示例6: innerInitialiseFunc
void OutputEventPort::innerInitialiseFunc( Eref e,
unsigned int width,
unsigned int offset,
MUSIC::EventOutputPort*
mPort)
{
myWidth_ = width;
myOffset_ = offset;
mPort_ = mPort;
for(unsigned int i = 0; i < width; i++)
{
ostringstream name;
name << "channel[" << i + offset << "]";
Element* channel = Neutral::create( "OutputEventChannel", name.str(),
e.id(), Id::scratchId() );
channels_.push_back(channel);
set< unsigned int, MUSIC::EventOutputPort* >
(channel, "initialise", i, mPort);
}
}
示例7: setName
void Neutral::setName( const Eref& e, string name )
{
if ( e.id().value() <= 3 ) {
cout << "Warning: Neutral::setName on '" << e.id().path() <<
"'.Cannot rename core objects\n";
return;
}
ObjId pa = parent( e );
Id sibling = Neutral::child( pa.eref(), name );
if ( sibling == Id() ) { // OK, no existing object with same name.
e.element()->setName( name );
} else {
cout << "Warning: Neutral::setName: an object with the name '" <<
name << "'\n already exists on the same parent. Not changed\n";
}
}
示例8: setNinit
void GslStoich::setNinit( const Eref& e, double v )
{
unsigned int i = e.index().value();
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
pools_[i].varSinit()[j] = v;
}
示例9: getNinit
double GslStoich::getNinit( const Eref& e ) const
{
unsigned int i = e.index().value();
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
return pools_[i].Sinit()[j];
}
示例10: lookupVolumeFromMesh
/// Utility function to find the size of a pool. We assume one-to-one
/// match between pool indices and mesh indices: that is what they are for.
double lookupVolumeFromMesh( const Eref& e )
{
ObjId compt = getCompt( e.id() );
if ( compt == ObjId() )
return 1.0;
return LookupField< unsigned int, double >::
get( compt, "oneVoxelVolume", e.dataIndex() );
}
示例11: if
void HHChannel2D::destroyGate( const Eref& e, const Qinfo* q,
string gateType )
{
if ( !checkOriginal( e.id() ) ) {
cout << "Warning: HHChannel2D::destroyGate: Not allowed from copied channel:\n" << e.id().path() << "\n";
return;
}
if ( gateType == "X" )
innerDestroyGate( "xGate", &xGate_, e.id() );
else if ( gateType == "Y" )
innerDestroyGate( "yGate", &yGate_, e.id() );
else if ( gateType == "Z" )
innerDestroyGate( "zGate", &zGate_, e.id() );
else
cout << "Warning: HHChannel2D::destroyGate: Unknown gate type '" <<
gateType << "'. Ignored\n";
}
示例12: setTableB
void HHGate::setTableB( const Eref& e, vector< double > v )
{
if ( checkOriginal( e.id(), "tableB" ) ) {
isDirectTable_ = 1;
if ( A_.size() != v.size() ) {
cout << "Warning: HHGate::setTableB: size should be same as table A: " << v.size() << " != " << A_.size() << ". Ignoring.\n";
return;
}
B_ = v;
}
}
示例13: setN
void GslStoich::setN( const Eref& e, double v )
{
unsigned int i = e.index().value(); // Later: Handle node location.
unsigned int j = coreStoich()->convertIdToPoolIndex( e.id() );
assert( i < pools_.size() );
assert( j < pools_[i].size() );
pools_[i].varS()[j] = v;
assert( i < y_.size() );
assert( j < y_[i].size() );
y_[i][j] = v;
}
示例14: setupTau
void HHGate::setupTau( const Eref& e,
vector< double > parms )
{
if ( checkOriginal( e.id(), "setupTau" ) ) {
if ( parms.size() != 13 ) {
cout << "HHGate::setupTau: Error: parms.size() != 13\n";
return;
}
setupTables( parms, true );
}
}
示例15:
vector< Id > Neutral::getNeighbors( const Eref& e, string field ) const
{
vector< Id > ret;
const Finfo* finfo = e.element()->cinfo()->findFinfo( field );
if ( finfo )
e.element()->getNeighbors( ret, finfo );
else
cout << "Warning: Neutral::getNeighbors: Id.Field '" <<
e.id().path() << "." << field <<
"' not found\n";
return ret;
}