Esempio n. 1
0
void Synapse::addSpike( const Eref& e, double time )
{
	static bool report = false;
	static unsigned int tgtDataIndex = 0;
	// static unsigned int tgtFieldIndex = 0;
	if ( report && e.dataIndex() == tgtDataIndex ) {
		cout << "	" << time << "," << e.fieldIndex();
	}
	handler_->addSpike( e.fieldIndex(), time + delay_, weight_ );
}
SingleMsg::SingleMsg( const Eref& e1, const Eref& e2, unsigned int msgIndex)
	: Msg( ObjId( managerId_, (msgIndex != 0 ) ? msgIndex: msg_.size() ), 
					e1.element(), e2.element() ),
	i1_( e1.dataIndex() ), 
	i2_( e2.dataIndex() ),
	f2_( e2.fieldIndex() )
{
	if ( msgIndex == 0 ) {
		msg_.push_back( this );
		return;
	} else if ( msg_.size() <= msgIndex ) {
		msg_.resize( msgIndex + 1 );
	}
	msg_[ msgIndex ] = this;
}
Esempio n. 3
0
// Static function 
string Neutral::path( const Eref& e )
{
	static const Finfo* pf = neutralCinfo->findFinfo( "parentMsg" );
	static const DestFinfo* pf2 = dynamic_cast< const DestFinfo* >( pf );
	static const FuncId pafid = pf2->getFid();

	vector< ObjId > pathVec;
	ObjId curr = e.objId();
	stringstream ss;

	pathVec.push_back( curr );
	while ( curr.id != Id() ) {
		ObjId mid = curr.eref().element()->findCaller( pafid );
		if ( mid == ObjId() ) {
			cout << "Error: Neutral::path:Cannot follow msg of ObjId: " <<
				   	e.objId() << " for func: " << pafid << endl;
			break;
		}
		curr = Msg::getMsg( mid )->findOtherEnd( curr );
		pathVec.push_back( curr );
	}
	if ( pathVec.size() <= 1 )
		return "/";
	for ( unsigned int i = 1; i < pathVec.size(); ++i ) {
		ss << "/";
		ObjId& oid = pathVec[ pathVec.size() - i - 1 ];
		ss << oid.element()->getName();
		if ( !oid.element()->hasFields() )
			ss << "[" << oid.dataIndex << "]";
		/*
		if ( !oid.element()->hasFields() )
			ss << "[" << oid.dataIndex << "]";
		if ( oid.element()->numData() > 1 )
			ss << "[" << oid.dataIndex << "]";
			*/
	}
	// Append braces if Eref was for a fieldElement. This should
	// work even if it is off-node.
	if ( e.element()->hasFields() ) {
		ss << "[" << e.fieldIndex() << "]";
	}

	return ss.str();
}
Esempio n. 4
0
unsigned int Neutral::getFieldIndex( const Eref& e ) const
{
	return e.fieldIndex();
}
Esempio n. 5
0
vector< double >MeshEntry::getDiffusionScaling( const Eref& e ) const
{
	return parent_->getDiffusionScaling( e.fieldIndex() );
}
Esempio n. 6
0
vector< unsigned int >MeshEntry::getNeighbors( const Eref& e ) const
{
	return parent_->getNeighbors( e.fieldIndex() );
}
Esempio n. 7
0
vector< double >MeshEntry::getCoordinates( const Eref& e ) const
{
	return parent_->getCoordinates( e.fieldIndex() );
}
Esempio n. 8
0
unsigned int MeshEntry::getMeshType( const Eref& e ) const
{
	return parent_->getMeshType( e.fieldIndex() );
}
Esempio n. 9
0
unsigned int MeshEntry::getDimensions( const Eref& e ) const
{
	return parent_->getMeshDimensions( e.fieldIndex() );
}
Esempio n. 10
0
double Synapse::getTopSpike( const Eref& e ) const
{
	return handler_->getTopSpike( e.fieldIndex() );
}