示例#1
0
std::string tau_transition::fire(MLNetworkSharedPtr& mnet, const NodeSharedPtr& node, long time) {
    std::string current_status = mnet->actor_features()->getString(node->actor->id,_S_current);
    if (current_status==status) {
        if (time - mnet->actor_features()->getNumeric(node->actor->id,_S_time)>=tau) {
            return new_status;
        }
    }
    return "";
}
示例#2
0
std::string beta_transition::fire(MLNetworkSharedPtr& mnet, const NodeSharedPtr& node, long time) {
    std::string current_status = mnet->actor_features()->getString(node->actor->id,_S_current);
    if (current_status==status) {
        for (NodeSharedPtr n: mnet->neighbors(node,IN)) {
            if (mnet->actor_features()->getString(n->actor->id,_S_current)==neighbor_status && test(beta)) {
                return new_status;
            }
        }
    }
    return "";
}