Well, as some other posts (look at this) in the forum describes, hard constrains only fullfilled in insertation phase, therefore the ruin strategy has to be altered to enforce them. Stefan could give you help how to do this.
I can only give you a hack, a workaround: unsing marker capacity dimensions. Let’s say, your vehicle has 5 seats. You define 5 dimensions: one for each seat and give them the maximal capacity value of 5. For all seats where a woman travels, set the initial capacity to the maximum (5), for all seats where man sits, left it 0. For all service jobs, set the capacity requirement as follows: if you serve a woman, set the capacity change for the seat you serve -5 and 0 to each others. If you serve a man, set 1 for each slots.
As a concrete exampe: let’s say, there are 2 women on seat 2 and 3. Then the initial capacity: 0 - 5 - 5 - 0 - 0 (maximum for each dimension is 5)
If we serve the second job first:
Original: 0 - 5 - 5 - 0 - 0
Require: 0 - (-5) - 0 - 0 - 0
Result: 0 - 0 - 5 - 0 - 0
Its ok.
Now try to serve the fourth seat:
Original: 0 - 0 - 5 - 0 - 0
Require: 1 - 1 - 1 - 1 - 1
Result: not ok!
You can see, that the third seat is overloaded, so this job can’t be served.
If you serve the third seat (the other women), the capacity of the vehicle sets to all zeros, therefore the men can be served.
This looks like a hack, but the technics to use capacity dimensions to control job availability could help to solve several ordering problems where hard constraints are hard to implement.