I am trying to add a constraint_factory using OptaPy, the Python variant of OptaPlanner, (using the School Timetabling quickstart as a base) for scheduling sports matches. Each match has 2 teams, so there are 2 variables in the Match class : team1 and team2 along with a time_slot and pitch.
How can I have a constraint where I can reward or penalise if a team (in either team1 or team2 variable) has been assigned more than 2 matches in a day?