Running .model programs with open AI gym? [duplicate] - openai-gym

I am trying to extract the state space from Amidar in order to hard code an agent for some specific purposes. For example, I want the agent to go down whenever an enemy is 2 cells away or up until they hit a wall then go down again. However, I'm not quite sure how to extract the state space at a specific frame, or in general for that instance, and how to go about interpreting the output.
I have tried env.observation_space but that just returns the frame size (i.e: Box(250,160,3)). Anyone have an idea of how to go about doing this?
Thank you.

Related

Open multiple positions in Backtrader

Does someone know if it's possible to open multiple positions with only a single data feed? I am trying to do a second buy whilst in a position, which doesn't seem to be possible.
Nobody seems to adress this issue. Does anyone have any experience with Backtrader and have any input?
If you are just trying to buy more stock to add to your position, then yes, you should be able to do this and if you cannot recheck your strategy code in next.
If you are trying to track two separate positions of the same data...
One cannot have two separate positions in the same data feed. You may trade additional positions if you like but they will be combined in Backtrader. Even if you use two strategies you will still have one combined broker.
The reason for this is to simulate as near as possible real world conditions. If you have a brokerage account you most likely would have just one postion. (I know there are exceptions)
One solution would be to track your trading manually in a dictionary trades that result from different signals/sub-strategies. It's a bit more tedious to develop but very doable.

How to solve temperamental two list boxes stack each other in the user form?

I make two List Box in a user form.
In the design mode, the smaller List Box is behind the larger one.
There is no code at all in the user form module.
But when I launch the user form, the smaller list box is in front of the larger one,
as seen in the animation below
and follow by another weird thing - when I go back to the VBA editor,
magically the smaller LB is in front of the larger LB which of course when I launch the user form, the result show the same (smaller LB is in front of the larger LB)
And the next thing when I come back again to the VBA editor, now the smaller LB magically is behind the larger LB, as seen in the image above.
Pulling my hair.
Maybe there is an explanation about this behavior from the experts here ?
I've tried bring forward, send backward, bring to front, send to back but still the same result. My Excel is Excel 2010.
Thank you in advanced.

Extracting state-space from Atari games at specific frames and hard coding agents?

I am trying to extract the state space from Amidar in order to hard code an agent for some specific purposes. For example, I want the agent to go down whenever an enemy is 2 cells away or up until they hit a wall then go down again. However, I'm not quite sure how to extract the state space at a specific frame, or in general for that instance, and how to go about interpreting the output.
I have tried env.observation_space but that just returns the frame size (i.e: Box(250,160,3)). Anyone have an idea of how to go about doing this?
Thank you.

What is the best method to extract live data from an application? (details inside)

Since I have little experience programming, I first tried posting this "job" on a freelance website. Then, 4 programmers who seemed to what they were doing failed to solve it (maybe they didn't know what they were doing). After this, I decided to attempt it myself, and that is why I came to Stack Overflow, which I believe will point me in the right direction.
The problem appears quite simple: the program in question gives me rows and columns of data, just like a spreadsheet. As time goes by, new rows are added on top. It looks like this:
I just need to replicate this data inside an Excel spreadsheet, so that I can perform analysis.
I will keep it short, as I don't know what further detail I could give. Perhaps looking at the program files could help in establishing what sort of program it is. Download link: http://xpproupdate.xpi.com.br/xppro.zip
Thanks!
Some loose ideas:
Method 1 (assuming this is an app connected to the Internet):
Try packet-sniffing. Instead of extracting the data from the app download a packet sniffing app and look and the data-flow. See on what port the app is exchanging data. If the data is not encryped the tasks should be fairly easy.
As a reference see this packet sniffer in C#:
http://www.codeproject.com/Articles/17031/A-Network-Sniffer-in-C
Method 2 (assuming no connection to the Internet, or if there is encryption involved):
If the data is encrypted or the app simply does not interact with the Internet then try to access the app's Win32 window handle and traverse it's internal controls.
Method 3 (last resort):
Frequent window image screenshot and scraping the data from the image using a simple OCR.

How to make a series of dice rolls secure in a client/server scenario?

Imagine the following situation in a game: A series of random numbers is presented to the player. Each number is shown to the player for a short period of time before it goes to the next one. It is the player's aim to pick a high number. He or she just needs to 'click' in the right moment and then the number is chosen.
The question is about how to implement this scenario in a secure way in a client/server scenario.
That means there is a game client which displays the above mentioned scene and there is a server to which the chosen number (in whatever way) needs to be send. The catch is to get this thing secure so that cheating (e.g. by modifying the client) is not possible.
There's really no way to make this completely secure. Even without modifying your client, all someone needs to do is have another program running in the background reading the monitor and looking for a certain number to appear and then send a mouse click event to your client program. This can be done without modifying your client program at all. Even if you somehow managed to make it secure so that they couldn't run any other programs or services at the same time as your program, they could just point a webcam at the screen hooked to a different computer to do the optical digit recognition and send a mouse click event over USB to the computer running your program.
Fortunately, you may be able to get around the problem. Generally if something is to be a "dice roll" you want a random "luck based" outcome. By allowing them to click at a certain time you are making this a skill based game instead of luck based and therefore not really a dice roll. You could make it so there's a slight "delay" from when they click to when the dice stops rolling, so they see it rolling around, click, and it slows down and lands on a number. This way what number was displayed when they actually click does not determine the outcome, but the next (random) number after that one, which would eliminate the possibility of cheating and make this a luck based roll instead of skill based.

Resources