                 result = JSON.parse(stderr)
                 result.neural_network = fs.readFileSync(NN_PATH + "/#{result.neural_network}.txt", 'utf-8')
 
-                done(task._id, result)
+                done(task, result)
 
             processTask()
 

    catch e
        log.e "Error while performing redo request for #{taskid}: #{e.toString()}"

done = (taskid, result) ->
    currentTasks.splice(currentTasks.indexOf(taskid), 1)
    try
        res = request('POST', URL + 'finishTask', { json: { _id: taskid, result } })
        log.i "Finish request for #{taskid} handed:\n#{JSON.stringify(res, null, 2)}"
    catch e
        log.e "Error while performing done request for #{taskid}: #{e.toString()}"

perform = (task) ->
    argsString = _.toPairs(task.data.args).map((arg) -> if arg[1]? then arg.join('=') else '').join(' ')

available_threads = os.cpus().length

METERS = ['wins', 'completion']
URL = "http://localhost:3000/methods/"

# Bom's: n_rounds_powerpill=55 initial_scatter_cycle_rounds=40 initial_chase_cycle_rounds=10

