immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
214 stars 41 forks source link

Saving all the experiment trial settings on AWS DynamoDB without running through all trials #127

Open AbhayKoushik opened 2 years ago

AbhayKoushik commented 2 years ago

Hi,

For my experiment, I am planning to have one large DynamoDB dictionary (eg: 100,000 trials) which is updated across multiple trials from different participants online. In order to be able to set and update such a dictionary given the 400kb limit of DynamoDB transactions, I thought of having an experimenter PPID through which I can set that initial database with all the relevant trial settings online.

Can all the trial settings generated through the GenerateExperiment (eg: from a loop of 100,000 trials) be saved in a table online without having to run through the experiment? Perhaps with an experimenter's PPID to reset such a big table with all trial settings online?

Right now, the UXFData.ExperimentName.Settings Table in DynamoDB only has one entry "ppid_session_dataname":{"S": "000_s001_settings"} once I stop the experiment after a few example trials even though the entire set of 100,000 trials stimuli settings is generated with the experimenters PPID.

Conversely, is there a way to upload a table (dictionary) which can be updated by different subjects running our experiment online simultaneously?

Thanks a lot in advance! Warmly, Abhay

jackbrookes commented 2 years ago

I am quite confused what you are trying to do, why do you need to create an initial database? Once you run your participants, it would just overwrite the data

AbhayKoushik commented 2 years ago

I have a custom database from which unique trials are developed and updated online to exhaust the full set of trials distributed across multiple participants, I just ended up using AWS Lambda function and S3 to create that.

Now I need a DDB_BatchGetItem function and realized only DDB_BatchWriteItem, DDB_PutItem, DDB_GetItem functions are implemented in the WebAWSDynamoDB.cs, do you have any suggestions for implementing DDB_BatchGetItem? I am confused from where the [DllImport("__Internal")] is importing from. I wanted to know the exact function parameters so that I can create my own DDB_BatchGetItem function.

Looking forward to your response!

AbhayKoushik commented 2 years ago

Hello Jack, I realized we need to update the AWSJS.jslib plugin on UXF too in order to implement DDB_BatchGetItem, I am new to JS and AWS, would really appreciate your help @jackbrookes, thanks a lot for your time in advance!

jackbrookes commented 2 years ago

Yes these are implemented in the AWSJS.jslib, which is a set of javascript functions that run in when deploying to WebGL. You could possibly implement it yourself. I can't help with specifics right now, but it is on the list for something to possibly add in the future!