Hi
I want to create a custom enviorment where the agent learns to place small boxes into big boxes by certain criterias. The size and amount of the boxes will change after the model predicted the positions. So that I once can call my model to predict me the correct postions for a new given set of boxes.
I do not find any documentation/tutorial what so ever on how to create an observation space for this as I think I need to define my observation space as a List or Tuple of my elements.
I have to classes:
class BOXSmall:
def __init__(self, points, id, r_angle, i_point, bb_id):
self.points = points
self.id = id
self.r_angle = r_angle
self.i_point = i_point
self.bb_id = bb_id
class BOXBig:
def __init__(self, id, width, height):
self.id = id
self.width = width
self.height = height
And define them like this:
boxSmall1 = BOXSmall([(0, 0), (1, 1), (2, 2)], 1, 0, (0, 0), None)
boxSmall2 = BOXSmall([(3, 3), (4, 4), (5, 5)], 2, 0, (0, 0), None)
smallboxes = (boxSmall1, boxSmall2)
boxBig1 = BOXBig(1, 10, 10)
boxBig2 = BOXBig(2, 20, 20)
bigboxes = (boxBig1, boxBig2)
My custom enviroment looks like this:
class PlacmentEnv(gym.Env):
def __init__(self,bs, bb):
self.reward = None
self.boxessmall = bs
self.boxesbig = bb
self.observation_space = spaces.Tuple((
spaces.Box(low=0, high=len(self.boxessmall), shape=(len(self.boxessmall),),),
spaces.Box(low=0, high=len(self.boxesbig), shape=(len(self.boxesbig),),)
))
Sadly I always get the following error:
TypeError: float() argument must be a string or a number, not ‘BOXSmall’
Is there any way to pass this lists into an obersavtion space?
Thank you!
I tried to search the internet but without success.