anchor.diff:      work_dir,       %%  Work dir.
       port_name,      %%  Port program name.
       port,           %%  Current port.
  -    model           %%  Current model.
  +    sim             %%  Current simulation.
   }).
   
   
  
positive.code: %%
  %%
  %%
  -spec solve(pid(), #model{})
          -> ok | {error, Reason :: term()}.
  
  solve(Pid, Model) ->
      gen_fsm:sync_send_event(Pid, {solve, Model}).
  
  
  
  
negative.code:     ]),
      NewStateData = StateData#state{
          port = Port,
          sim = Simulation
      },
      {ok, NewStateData}.
  
  
  handle_solver_response(ResponseLine, #state{sim = #simulation{id = SimulationId}}) ->
      [Status | Other] = string:tokens(ResponseLine, "\t\n "),
      case Status of
          "DONE" ->
              [TimeStr, _StepCountStr, CurrentDensityStr] = Other,
              ok = ebi_store:simulation_done(             % TODO
                  SimulationId,
                  {file, SimulationId ++ ".tar.gz"},
                  to_number(TimeStr),
                  to_number(CurrentDensityStr)
              );
          "ERROR" ->
              ok = ebi_store:simulation_failed(SimulationId)  % TODO
      end.
  
  
  