Source code for espressomd.actors
# Copyright (C) 2010-2022 The ESPResSo project
# This file is part of ESPResSo.
# ESPResSo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ESPResSo is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import highlander
from . import script_interface
Container for actor objects.
active_actors = 
def __setstate__(self, active_actors):
self.active_actors[:] = 
for actor in active_actors:
[docs] def add(self, actor):
Actor to add to this container.
if actor in Actors.active_actors:
if isinstance(actor, script_interface.ScriptInterfaceHelper):
if not isinstance(actor, script_interface.ScriptInterfaceHelper):
[docs] def remove(self, actor):
Actor to remove from this container.
if actor not in self.active_actors:
raise Exception("Actor is not active")
[docs] def clear(self):
"""Remove all actors."""
# The order in which actors are removed matters. Some actors set up
# global bitfields that activate sanity checks on the MD cellsystem,
# and reset these bitfields when removed. Actors need to be removed
# in the reverse order they were inserted to guarantee pre-conditions
# and post-conditions are always met.
def __getitem__(self, key):
for actor in self.active_actors:
def __delitem__(self, idx):
actor = self[idx]