Destroy Connection
Description
Destroys a connection.
(destroy-connection ... )
Lisp Syntax and Default Values
The (destroy-connection ... ) function can be used via the following Lisp syntax:
(destroy-connection connection_reference )
Parameters
The (destroy-connection ...) function takes one argument:
- connection_reference: any connection.
Discussion
This function should be used with care, as it is tricky to use. It is useful if you are writing a Modalys component and you want it to be very efficient, or if you are trying to make an overly slow synthesis run a bit faster. The idea is if you make a “pluck” connection between two objects, they are always “watching” each other. The “watching” takes a certain amount of computation time, and continues even when you know the objects cannot possibly touch because the pluck is finished. (Modalys can never know for sure whether the objects will touch again, since the plucker could always return for another pluck...) So you can write:
(define my-connection (make-connection 'pluck ... ))
...
(run 3) ; we know the pluck happens during these 3 seconds of synthesis
(destroy-connection my-connection)
(run 1)
In some cases, you might want to first test to see if a connection is currently active or inactive before you destroy it. To do this you could use:
(get-info 'connection my-connection 'state)
Options
There are no special options for this function.
★