mpacts.contact.detectors. bruteforce

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

import mpacts.contact.detectors.bruteforce
#or assign it to a shorter name
import mpacts.contact.detectors.bruteforce as bru

NoContactStateBruteForce

class mpacts.contact.detectors.bruteforce.NoContactStateBruteForce

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

The most simple Brute Force contact detector, cannot hold contactstates at all.
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)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, [gate, contact_data_storage_factory, contact_data]
NoContactStateBruteForce(name, parent, **kwargs)

SmartBruteForce

class mpacts.contact.detectors.bruteforce.SmartBruteForce

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

A Brute Force contact detector that runs over all contacts every now and then and reserves memory only memory for relevant contacts.
This requires the contact model to return a relevant distance to compare with keep_distance.
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 brute-force, every n times a complete bruteforce is performed
  • 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)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, update_every, keep_distance, [gate, contact_data_storage_factory, contact_data, counter]
SmartBruteForce(name, parent, **kwargs)