# List in which we store all incoming msgs
pending_comms: List[Tuple[Comm, PyGetAsync]] = []
this_actor.info(f"Wait for {self.messages_count} messages asynchronously")
- for i in range(self.messages_count):
+ for _ in range(self.messages_count):
pending_comms.append(self.mailbox.get_async())
while pending_comms:
index = Comm.wait_any([comm for (comm, _) in pending_comms])
"Retrieve the mailbox on which this comm acts.")
.def_property_readonly("sender", &Comm::get_sender,
py::call_guard<py::gil_scoped_release>())
- .def_property_readonly("state_str", [](Comm* self){ return std::string(self->get_state_str()); },
+ .def_property_readonly("state_str", [](const Comm* self){ return std::string(self->get_state_str()); },
py::call_guard<py::gil_scoped_release>(),
"Retrieve the Comm state as string")
.def_property_readonly("remaining", &Comm::get_remaining,
auto elem_it =
std::find_if(begin(var->cnsts_), end(var->cnsts_), [&cnst](Element const& x) { return x.constraint == cnst; });
- if (elem_it != end(var->cnsts_)) {
+ if (elem_it != end(var->cnsts_) && var->sharing_penalty_ != 0.0) {
/* before changing it, decreases concurrency on constraint, it'll be added back later */
- if (var->sharing_penalty_ != 0.0)
- elem_it->decrease_concurrency();
+ elem_it->decrease_concurrency();
}
Element& elem = elem_it != end(var->cnsts_) ? expand_add_to_elem(*elem_it, cnst, consumption_weight)
: expand_create_elem(cnst, var, consumption_weight);