I need to allocate resources via tune.PlacementGroupFactory

I guess this question is not so hard but i do not understand why this error comes up and how can i avoid it. Im new here and any help will be very much appreciated. I tried to read the docs, but i stiil can not get why it happens where and why should i input this lines.

Here is my code: