def METHOD_NAME(self, emulator: Emulator):
    registry = emulator.getRegistry()
    scopes = set()
    for (scope, _, _) in registry.getAll().keys(): scopes.add(scope)
    ix_nets = ''
    for ixnet in ScopedRegistry('ix', registry).getByType('net'):
        ix_nets += self.__compileIxNetWorker(ixnet)
    for scope in scopes:
        mkdir(scope)
        chdir(scope)
        services = ''
        networks = ''
        for ((_scope, type, name), obj) in registry.getAll().items():
            if _scope != scope: continue
            if type == 'rnode':
                self._log('compiling router node {} for as{}...'.format(name, scope))
                services += self._compileNode(obj)
            if type == 'hnode':
                self._log('compiling host node {} for as{}...'.format(name, scope))
                services += self._compileNode(obj)
            if type == 'rs':
                self._log('compiling rs node for {}...'.format(name))
                services += self._compileNode(obj)
            if type == 'snode':
                self._log('compiling service node {}...'.format(name))
                services += self._compileNode(obj)
            if type == 'net':
                self._log('creating network: {}/{}...'.format(scope, name))
                networks += self.__compileIxNetMaster(obj) if scope == 'ix' else self._compileNet(obj)
        if len(services) > 0 or len(networks) > 0 :
            if scope != 'ix': networks += ix_nets
            self._log('creating docker-compose.yml...'.format(scope, name))
            print(DockerCompilerFileTemplates['compose'].format(
                services = services,
                networks = networks,
                dummies = self._makeDummies()
            ), file=open('docker-compose.yml', 'w'))
            self._used_images = set()
            print('COMPOSE_PROJECT_NAME=sim_{}'.format(scope), file=open('.env', 'w'))
        chdir('..')
        if services == '' and networks == '': rmdir(scope)