# How should I model the state and action spaces for a problem where the goal is to draw a line between two points?

I have a problem where the goal is for the agent to draw a single line between two points on a $$500 \times 500$$ white image.

I have built my DQN. For now, the output layer's size of the network is $$[1, 500 * 500]$$. This way, when a Q value is given within a single step, it can be mapped to a single coordinate within the space of the image.

So, with that, I'm able to get a starting point for the line. However, what that doesn't give me is the location of the second point for completion of the line.

One thing I have tried is drawing a line for every two steps. However, this means that the state of the environment does not change for each step.

Should the goal be to change the environment/state for each step or does this not matter? Maybe I have not found the ideal way of modelling the state and action spaces for this problem.

• hi @junfanbl, what actions can the agent take? Feb 19, 2021 at 19:39
• I have edited this post to try to save it by asking the question "How to model the action and state space in this problem?". Make sure that you agree with these changes. If not, edit the post again.
– nbro
Mar 10, 2021 at 13:37