Advertisement
Guest User

Untitled

a guest
Dec 25th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. FUNCTION automaticSystem::INIT
  2. SELF.ptr=ptr_new(/ALLOCATE)
  3. RETURN, 1
  4. END
  5.  
  6. PRO automaticSystem__define
  7. void = {automaticSystem, ptr:ptr_new(), grid:[], cellCont:[1], agentID:[], agentCell:[], algorithmPurp:[], algorithms: []} ; not autoMATION, but -MATON
  8.  
  9. RETURN
  10. END
  11.  
  12.  
  13.  
  14. FUNCTION automaticSystem::makeGrid, size
  15.  
  16. old = 0
  17. FOR i = 0,N_Elements(size)-1 DO BEGIN
  18. new = []
  19. FOR j = 0, size[i]-1 DO BEGIN
  20. new = [new,old]
  21. ENDFOR
  22. old = new
  23. ENDFOR
  24.  
  25. ; the final new is the answer
  26. SELF.grid = new
  27. END
  28.  
  29.  
  30. FUNCTION automaticSystem::CLEANUP
  31.  
  32. ptr_free,self.ptr
  33. RETURN, 1
  34.  
  35. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement