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;
}
Beispiel #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();
}
unsigned int Neutral::getFieldIndex( const Eref& e ) const
{
	return e.fieldIndex();
}
Beispiel #5
0
vector< double >MeshEntry::getDiffusionScaling( const Eref& e ) const
{
	return parent_->getDiffusionScaling( e.fieldIndex() );
}
Beispiel #6
0
vector< unsigned int >MeshEntry::getNeighbors( const Eref& e ) const
{
	return parent_->getNeighbors( e.fieldIndex() );
}
Beispiel #7
0
vector< double >MeshEntry::getCoordinates( const Eref& e ) const
{
	return parent_->getCoordinates( e.fieldIndex() );
}
Beispiel #8
0
unsigned int MeshEntry::getMeshType( const Eref& e ) const
{
	return parent_->getMeshType( e.fieldIndex() );
}
Beispiel #9
0
unsigned int MeshEntry::getDimensions( const Eref& e ) const
{
	return parent_->getMeshDimensions( e.fieldIndex() );
}
Beispiel #10
0
double Synapse::getTopSpike( const Eref& e ) const
{
	return handler_->getTopSpike( e.fieldIndex() );
}