  In this paper, we deal with the problem of implementing an abstract machine
for a stochastic version of the Brane Calculus. Instead of defining an ad hoc
abstract machine, we consider the generic stochastic abstract machine
introduced by Lakin, Paulev\'e and Phillips. The nested structure of membranes
is flattened into a set of species where the hierarchical structure is
represented by means of names. In order to reduce the overhead introduced by
this encoding, we modify the machine by adding a copy-on-write optimization
strategy. We prove that this implementation is adequate with respect to the
stochastic structural operational semantics recently given for the Brane
Calculus. These techniques can be ported also to other stochastic calculi
dealing with nested structures.
