anchor.diff:  %%
   %%  Start the solver program.
   %%
  -start_solver(Model, StateData) ->
  +start_solver(Simulation, StateData) ->
       #state{
           port_name = PortName,
           work_dir = WorkDir
       } = StateData,
  -    #model{
  -        ref = ModelRef,
  -        parameters = ModelParams
  -    } = Model,
  -    CfgName = ModelRef ++ ".cfg.xml",
  -    DirName = ModelRef,
  +    #simulation{
  +        id = SimulationId,
  +        model = #model{
  +            ref = ModelRef,
  +            parameters = ModelParams
  +        }
  +    } = Simulation,
  +    CfgName = SimulationId ++ ".cfg.xml",
  +    DirName = SimulationId,
       SymbolArgs = [ format_symbol_arg(P) || P <- ModelParams ],
   
       {ok, CfgBody} = ebi_store:get_model_representation(ModelRef, ?SUPPORTED_MODEL_TYPE),    % TODO
  
positive.code: handle_info({Port, {data, {eol, Line}}}, StateName = solving, StateData = #state{port = Port}) ->
      ok = handle_solver_response(Line, StateData),
      NewStateData = StateData#state{
          model = undefined
      },
      {next_state, StateName, NewStateData};
  
  handle_info({'EXIT', Port, _PosixCode}, solving, StateData = #state{port = Port, model = Model}) ->
      case Model of
          #model{} ->
              ok = handle_solver_response("ERROR", StateData);
          undefined ->
              ok
  
negative.code: %%
  %%  FSM State: waiting
  %%
  waiting({solve, Simulation}, _From, StateData) ->
      {ok, NewStateData} = start_solver(Simulation, StateData),
      {reply, ok, solving, NewStateData}.
  
  
  %%
  %%  FSM State: solving
  %%
  solving({solve, _Simulation}, _From, StateData) ->
      {reply, {error, bussy}, solving, StateData}.
  
  
  