lua-users home
lua-l archive

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


Hi Alessandro,

thanks for this nice welcome :-)

Am 29.11.2012 um 21:55 schrieb Alessandro Delgado:

Hey Phil,

Nice to hear that Lua fits your use case.

IMHO Lua is a nice language for my problem, because I don't need any polymorphic feature, but some complex datatypes (struct, tuple). 
I need for my individuals some "intelligence" but I would like to change them in a fast way for creating new simulation context.


I'd just like to point out that the correct capitalization is "Lua", not "LUA", since it's not an acronym, it's the Portuguese word for "Moon".

sorry this was my mistake, because my test class, that calls the Lua interpreter is named "LUA" with capitalization.

On Thu, Nov 29, 2012 at 6:57 PM, Philipp Kraus <philipp.kraus@flashpixx.de> wrote:
Hello,

I would like to use LUA scripts for a simulation. The simulation should be iterative with time dependency, so the LUA script is called on the time step t and calculates the values for the step t+1. I think
one LUA function with signature is my target:

new_state = run( current_state, environment )

I will set up new_state, current_state and environment as tuple structures or dictionary. My problem is at the moment the LUA calls, because I have some LUA scripts with the run function and each LUA
script descripes an individual (independed) dataset. So I create around 10^6 - 10^12 states and the LUA script must run for all this states / tuples on each time step. I would like to do this in parallel (thread).
So I think 10^12 LUA parser etc is not recommand, so I would read the LUA script first, parse it (with syntax checking) and create the stack call (lua_call).

Is there any chance to optimize the LUA calls, because I think in large datasets caching can be very efficient and I don't want create a lot of work load for LUA.
I hope that you can send me some ideas

Thanks a lot

Phil