config.py 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. from intelligine.core.Context import Context
  2. from intelligine.display.Pygame import Pygame
  3. import argparse
  4. parser = argparse.ArgumentParser(description='Select sandbox.')
  5. parser.add_argument('sandbox', metavar='sandbox', type=str, nargs=1,
  6. help='Name of sandbox: ' + ', '.join(['exploration', 'all', 'test', 'load']))
  7. #parser.add_argument('path', metavar='sandbox', type=str, nargs=1)
  8. args = parser.parse_args()
  9. if 'all' in args.sandbox:
  10. from intelligine.sandbox.all.all import simulations, visualisation as pygame_visualisation
  11. elif 'exploration' in args.sandbox:
  12. from intelligine.sandbox.exploration.exploration import simulations, visualisation as pygame_visualisation
  13. elif 'test' in args.sandbox:
  14. from intelligine.sandbox.test.test import simulations, visualisation as pygame_visualisation
  15. elif 'load' in args.sandbox:
  16. from os import getcwd
  17. from intelligine.display.pygame.config import map_config
  18. from intelligine.display.pygame.visualisation import get_standard_extract_from_map
  19. simulations, pygame_visualisation = get_standard_extract_from_map(getcwd()+args.path[0],
  20. map_config)
  21. else:
  22. parser.parse_args(['-h'])
  23. config = {
  24. 'app': {
  25. 'name': 'StigEngine',
  26. 'classes': {
  27. 'Context': Context
  28. }
  29. },
  30. 'engine': {
  31. 'fpsmax': 2555,
  32. 'debug': {
  33. 'mainprocess': True,
  34. 'cycles': -1,
  35. 'seed': 42
  36. },
  37. 'clean_each_cycle': 100
  38. },
  39. 'simulations': simulations,
  40. 'connections': [Pygame],
  41. 'terminal': {
  42. 'pygame': {
  43. 'visualisation': pygame_visualisation,
  44. 'window_size': (800, 600),
  45. 'app': {
  46. 'name': 'SocialIntengine'
  47. },
  48. 'display': {
  49. 'grid': {
  50. 'size': 20
  51. }
  52. },
  53. 'font': {
  54. 'name': 'arial',
  55. 'size': 13
  56. },
  57. 'background': {
  58. 'color': (125, 125, 125)
  59. }
  60. }
  61. },
  62. 'ant': {
  63. 'take': {
  64. 'cant_put_still': 5
  65. },
  66. 'put': {
  67. 'max_objects_at_same_position': 5,
  68. 'max_put_fail_count': 20
  69. }
  70. },
  71. 'stigmergy': {
  72. 'molecule': {
  73. 'evaporate_decrement': 5,
  74. 'evaporate_min_age': 1000,
  75. 'evaporate_each_cycle': 100
  76. }
  77. }
  78. }