AndroMeta  2.0.0
AndroMeta/include/AndroMeta/MMLGrid.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009-2012 AndroMeta LLC. All rights reserved.
00003  *
00004  * AndroMeta LLC retains all intellectual property and proprietary 
00005  * rights to this software and related documentation and any modifications 
00006  * thereto.  Any use, reproduction, disclosure, or distribution of this 
00007  * software and related documentation without an express license agreement 
00008  * from AndroMeta LLC is strictly prohibited.
00009  * 
00010  */
00011 
00018 #ifndef ANDROMETA_MML_GRID_H
00019 #define ANDROMETA_MML_GRID_H
00020 
00021 #include <AndroMeta/MMLEntity.h>
00022 
00023 namespace Meta{
00024   
00056   class MMLGrid : public MMLEntity{
00057   public:
00058     
00062     MMLGrid(const mvec& dimensions, const mvar& locality);
00063     
00070     MMLGrid(const mstr& dataPath);
00071     
00075     ~MMLGrid();
00076     
00080     mnode process(mnode n, uint32_t flags=0);
00081     
00091     enum BoundaryRule{
00092       BoundaryError,
00093       BoundaryClamp,
00094       BoundaryWrap
00095     };
00096     
00100     void setBoundaryRule(size_t dimension, BoundaryRule rule);
00101     
00108     void setBoundaryRule(size_t dimension, const mstr& rule);
00109     
00116     void createAgent(const mvar& agent);
00117     
00122     virtual mvar initAgent(mvar& agent);
00123     
00128     virtual mvar initCell(mvar& cell);
00129     
00134     virtual mvar runAgent(mvar& agent, mvar& cell);
00135     
00144     void selectAgents(const mvar& params=undef);
00145     
00153     virtual mvar selectAgent(const mvar& params,
00154                              const mvar& cell,
00155                              const mvar& agent,
00156                              const mvar& selectCell,
00157                              const mvar& selectAgent);
00158     
00167     void applyAgents(const mvar& params=undef);
00168     
00177     virtual mvar applyAgent(const mvar& params, mvar& cell, mvar& agent);
00178     
00187     void selectCells(const mvar& params=undef);
00188     
00195     virtual mvar selectCell(const mvar& params,
00196                             const mvar& cell,
00197                             const mvar& selectCell);
00198     
00206     void applyCells(const mvar& params=undef);
00207     
00212     virtual mvar applyCell(const mvar& params, mvar& cell);
00213     
00218     void moveTo(const mvec& pos);
00219     
00224     void die();
00225     
00229     mvar run();
00230     
00235     void setRunCycles(size_t cycles);
00236     
00240     const mvec& dimensions() const;
00241     
00245     const mvar& data() const;
00246     
00247   private:
00248     MMLGrid& operator=(const MMLGrid&);
00249     MMLGrid(const MMLGrid&);
00250     
00251     class MMLGrid_* x_;
00252   };
00253   
00254 } // end namespace Meta
00255 
00256 #endif // ANDROMETA_MML_GRID_H