int64_t append_empty_cluster() { assert(this->K == (int64_t) this->comms.size()); const int64_t new_cluster_id = this->K; this->comms.push_back( Community() ); assert(this->comms.at(new_cluster_id).get_num_edges() == 0); ++ this->K; assert(this->K == (int64_t)this->comms.size()); return new_cluster_id; }
Community spp_community_autostart(int num_agents, double speed, double box_size, Behavior* behavior) { double* pos = spp_community_alloc_space( num_agents) ; double* vel = spp_community_alloc_space( num_agents) ; Agent** neis = spp_community_alloc_neighbors( num_agents) ; Agent* ags = spp_community_build_agents(num_agents, pos, vel, neis, behavior) ; Community com = Community(num_agents, box_size , ags, pos, vel) ; /* Starting positions and velocities */ com.randomize_positions() ; com.randomize_directions(speed) ; return com ; }
void CCharacterInfo::InitSpecificCharacter (shared_str new_id) { R_ASSERT(new_id.size()); m_SpecificCharacterId = new_id; m_SpecificCharacter.Load(m_SpecificCharacterId); if(Rank().value() == NO_RANK) SetRank(m_SpecificCharacter.Rank()); if(Reputation().value() == NO_REPUTATION) SetReputation(m_SpecificCharacter.Reputation()); if(Community().index() == NO_COMMUNITY_INDEX) SetCommunity(m_SpecificCharacter.Community()); if(!m_StartDialog || !m_StartDialog.size() ) m_StartDialog = m_SpecificCharacter.data()->m_StartDialog; }