Hello there again.
I am currently investigating this library and found out why I was stuck upon constraints. Having a clear and structured question is a half-solution to the problem, so let me state my problem very clear. So, my goal was to set a constraint on vehicles (all or some of them) on its capacity (some specific dimension). In order to achieve that I tried to link some states to state manager to monitor current weights of vehicles (I did so by creating states and adding them to state manager). Then everytime constraint listener invoke, I would get those state and check if the weight of current tour activity would fit into the vehicle. I also set up a state updater with activity visitor to update the current weights of vehicles each time they visit tour activity. But this did not work because, as I think now, I was using problem state to save current weights of vehicles. Today I found out that there are different kinds of state (activity state, route state, problem state). Also, there are different state updaters and they are invoked correspondingly (activity visitor state updater is invoked whenever some specific tour activity is changed or inserted into a route, route visitor state update is invoked whenever route has been changed, etc.).
So, I am currently trying to use both activity states and route states in order to solve my problem. Everytime constraint is being invoked, I get the current weight of vehicle from route-vehicle state, and see if my constraint is fulfilled. If it is, I save the weight if current activity into the activity-vehicle state. Then, everytime activity visitor is invoked, I get the weight of current activity being visited and add it to the current weights. But this approach also fails and currently I am finding out why. If someone knows how to deal this question, I would be very glad. I generally want to understand how these state updaters and constraint invokers work in general. There are listeners for every route and activity, and I want to know more about this. I will keep post anything that I find usefull here. For anyone having problems with states, I would recommend reading the comments in StateManager.java file.