lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]





On Fri, Nov 30, 2012 at 1:20 AM, Philipp Kraus <philipp.kraus@flashpixx.de> wrote:

Am 29.11.2012 um 23:53 schrieb David Given:

> On 29/11/12 22:25, Philipp Kraus wrote:
> [...]
>> std::vector<state> l_state;
>> create_init_states( l_states, number_of_individuals );
>> for(std::size_t t=0; t < simulation_time; ++i {
>>      for (std::size_t i=0; i < l_state.size; ++i)
>>              l_state[i] = run_lua_script( l_state[i], environment, t );
>> }
>
> I assume 'state' here is referring to a simulation state, and not to a
> Lua state (lua_State*)?

Yes, sorry. "state" in this case is a state of one individual element in the time step t
I have got on each time step t more million elements and each element must run
a lua function with its individual state.


 
Lua function with individual state... You may look to the Lua coroutines... may be the one you need