make_env.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. function make_env(system)
  2. global mtt_environment
  3. start_time = mttGetTime ;
  4. input = [] ;
  5. env = [] ;
  6. switch class(system)
  7. case 'char',
  8. input = 'spec' ;
  9. case 'struct',
  10. if isfield(system,'representation')
  11. input = system.representation ;
  12. end
  13. end
  14. if strcmp(input,'spec')
  15. mttWriteNewLine ;
  16. mttNotify('Making "env" representation') ;
  17. mttWriteNewLine ;
  18. env = mttCreateEnvironment(system) ;
  19. input = 'env' ;
  20. end
  21. mttAssert(strcmp(input,'env'),'Input representation not recognised') ;
  22. if isempty(env)
  23. mttWriteNewLine ;
  24. mttNotify('Copying "env" representation') ;
  25. mttWriteNewLine ;
  26. mttNotify('...INFO: Input already defined as a "env": copying to Output') ;
  27. mttWriteNewLine ;
  28. mttWriteNewLine ;
  29. env = system ;
  30. end
  31. elapsed_time = mttElapseTime(start_time) ;
  32. cpu_utilisation = round(100*elapsed_time.cpu/elapsed_time.clock) ;
  33. mttWriteNewLine ;
  34. mttNotify(['Completed in ',num2str(elapsed_time.clock),' seconds']) ;
  35. mttNotify([' (',num2str(cpu_utilisation),'%% cpu)']) ;
  36. mttWriteNewLine ;
  37. mttWriteNewLine ;
  38. mtt_environment = env ;