I just started to use GAMS (so I have no experience whatsoever). I wanted to know whether and how it is possible to model the absolute values of binary variables. So I want to maximize the difference:

max: SUM(t=0 to T) {abs(x_t - c_t)}

where x_t is a binary decision variable and c_t is also a binary variable (but not decision variable; the values are fixed). Of course there are contraints such that just flipping the value of c_t for every time slot is not feasible.

Does anyone have an idea whether something like this is possible or not.

Hi, Sorry that I have not written anything since a fairly long time. But I do not really understand the approach form Manassaldi and my objective has slightly changed. So I want to maximize the difference:
max: SUM(t=0 to T) {abs(x_t - y_t)}

where x_t is a binary decision variable and y_t is also a binary decision variable.

I heard that something like this is solable with the Gurobi Solver by introducing an auxiliary variable z(t) = x(t) - y(t) for each t. However adding the following equations to GAMS:

If x = 1 and c = 0 then for eq1 absvalue = 1 (equal to abs(x-c)) (the remaining restrictions are also satisfied)
If x = 1 and c = 1 then for eq2 absvalue = 0 (equal to abs(x-c)) (the remaining restrictions are also satisfied)
If x = 0 and c = 1 then for eq3 absvalue = 1 (equal to abs(x-c)) (the remaining restrictions are also satisfied)
If x = 0 and c = 0 then for eq4 absvalue = 0 (equal to abs(x-c)) (the remaining restrictions are also satisfied)

Now, using the basic steps you can transform the logical proposition #1 into an algebraic equation.
BASIC STEPS
Goal is to Convert Logical Expression into Conjunctive Normal Form (CNF)
1. REPLACE IMPLICATION BY DISJUNCTION
¬(X ^ Y)˅¬Z
2. MOVE NEGATION INWARD APPLYING DE MORGAN’S THEOREM
¬X ˅ ¬Y ˅¬Z
3. RECURSIVELY DISTRIBUTE OR OVER AND
(not necessary in this case)

Finally,
¬X ˅ ¬Y ˅¬Z (CNF)
So, you can replace any CNF for a summatory of each term.
Because at least one of a term has to be true, the sumatory has to be greater than 1
¬X equivalent to 1-x
¬Y equivalent to 1-y
¬Z equivalent to 1-z
So, this CNF generate equation "eq2" of my example
1 - x + 1 - y + 1 - z =g= 1;