mpacts.contact.detectors. fixedlist

In order to be able to use this module import it like this:

import mpacts.contact.detectors.fixedlist
#or assign it to a shorter name
import mpacts.contact.detectors.fixedlist as fix

FixedListContactDetector

class mpacts.contact.detectors.fixedlist.FixedListContactDetector

Bases: mpacts.contact.detectors.contactdetectorbase.ContactDetectorBase, mpacts.core.baseobject.BaseObject

Special kind of contactdetector that allows to predefine the contacts that will be used.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • cmodel — The contactmodel that will be executed.
  • Optional keywords:
    • contact_data_storage_factory (default value = ContactDataStorageFactory) — The memory manager factory for contact data.
    • contact_data (default value = None) — Contact data itself note: may not always be present and writing to it is usually a bad idea.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • keep_distance (default value = -1) — The distance that considers contacts as relevant. If a contacts distance is longer than the keep_distance,it is removed from the contact list. If no keep_distance is given, then no contacts are removed.
    • new_contacts (default value = None) — List of contacts that are new and have never run before. This is exposed mostly for saving and loading
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, [gate, contact_data_storage_factory, contact_data, keep_distance, new_contacts]
FixedListContactDetector(name, parent, **kwargs)
addContact()

object addContact(tuple args, dict kwds)

add_contactlist((FixedListContactDetector)arg1, (list)arg2) → None
deleteContact((FixedListContactDetector)arg1, (int)arg2, (int)arg3) → None

PrunedFixedListContactDetector

class mpacts.contact.detectors.fixedlist.PrunedFixedListContactDetector

Bases: mpacts.contact.detectors.contactdetectorbase.ContactDetectorBase, mpacts.core.baseobject.BaseObject

Special kind of contactdetector that allows to predefine the contacts that will be used.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • cmodel — The contactmodel that will be executed.
    • keep_distance — The distance that considers contacts as relevant.
    • update_every — The frequency used to do re-iterate over the mother list.
  • Optional keywords:
    • contact_data_storage_factory (default value = ContactDataStorageFactory) — The memory manager factory for contact data.
    • contact_data (default value = None) — Contact data itself note: may not always be present and writing to it is usually a bad idea.
    • counter (default value = 0) — Internal counter kept for the update_every. Normally this should NOT be set unless you want to manually force a detection step!
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • mother_list (default value = None) — List of contacts that will be run over every ‘update_every’ steps.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, update_every, keep_distance, [gate, contact_data_storage_factory, contact_data, counter, mother_list]
PrunedFixedListContactDetector(name, parent, **kwargs)
addContact()

object addContact(tuple args, dict kwds)

add_contactlist((PrunedFixedListContactDetector)arg1, (list)arg2) → None
deleteContact((PrunedFixedListContactDetector)arg1, (int)arg2, (int)arg3) → None