wip: don't lock command mutex for each mass/spring in FillGraph()
This commit is contained in:
@ -83,7 +83,7 @@ public:
|
||||
std::unordered_map<std::pair<State, State>, int> state_springs;
|
||||
|
||||
public:
|
||||
MassSpringSystem() {
|
||||
MassSpringSystem() : threads(std::thread::hardware_concurrency() - 1) {
|
||||
#ifndef BARNES_HUT
|
||||
last_build = REPULSION_GRID_REFRESH;
|
||||
std::cout << "Using uniform grid repulsion force calculation." << std::endl;
|
||||
@ -188,6 +188,10 @@ public:
|
||||
auto AddSpringCmd(const State &a, const State &b) -> void;
|
||||
|
||||
auto ClearCmd() -> void;
|
||||
|
||||
auto AddMassSpringsCmd(const std::unordered_set<State> &masses,
|
||||
const std::vector<std::pair<State, State>> &springs)
|
||||
-> void;
|
||||
};
|
||||
|
||||
// https://en.cppreference.com/w/cpp/utility/variant/visit
|
||||
|
||||
Reference in New Issue
Block a user