anchor.diff:          %io:format("ok is da~n"),
           ok
       end.
  - 
  --endif.
  -
  --ifdef(SIMULATION).
  -loop(Module, State, {Options, Slowest} = _ComponentState) ->
  -    
  -    receive
  -    Message ->
  -        %io:format("~p ~p ~n", [Message, Module]),
  -        case Module:on(Message, State) of
  -        unknown_event ->
  -            {NewState, NewComponentState} = 
  -            handle_unknown_event(Message, State, 
  -                         {Options, Slowest},Module),
  -            yield(),
  -            loop(Module, NewState, NewComponentState);
  -        kill ->
  -            yield(),
  -            ok;
  -        NewState ->
  -            yield(),
  -            loop(Module, NewState, {Options, Slowest})
  -        end
  -    end.
  -wait_for_ok() ->
  -    %io:format("Warte auf ok~n"),
  -    release_ok(),
  -    receive
  -    {ok} ->
  -        %io:format("ok is da~n"),
  -        ok
  -    end.
  -
  -release_ok() ->
  -    scheduler ! {release_ok}.
  -
  -yield() ->
  -    scheduler ! {yield}.
  -
  --endif.
  -
  -
  -
   
   handle_unknown_event(UnknownMessage, State, ComponentState,Module) ->
      log:log(error,"unknown message: ~p in Module: ~p ~n in State ~p ~n",[UnknownMessage,Module,State]),
  
positive.code:                 {exception, Exception} ->
                      log:log(error,"Error: exception ~p during handling of ~p in module ~p~n",
                                [Exception, Message, Module]),
                      loop(Module, State, {Options, Slowest});
                  unknown_event ->
                      {NewState, NewComponentState} =
                          handle_unknown_event(Message, State,
                           {Options, Slowest},Module),
                      loop(Module, NewState, NewComponentState);
                  kill ->
                      ok;
                  NewState ->
                      %Stop = erlang:now(),
                      %Span = timer:now_diff(Stop, Start),
  
negative.code: sleep(Pid, Time) ->
      Pid ! {'$gen_component', time, Time}.
  
  %% @edoc change the handler for handling messages
  change_handler(State, Handler) when is_atom(Handler) ->
      {'$gen_component', [{on_handler, Handler}], State}.
  
  %================================================================================
  % generic framework
  %================================================================================
  