help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [Fwd: Implementation problems]


From: glpk xypron
Subject: Re: [Help-glpk] [Fwd: Implementation problems]
Date: Thu, 30 Aug 2012 16:50:10 +0200

Hello Sascha,

variables cannot be used to define which row of the problem exists.

s.t. Position{c in Krane, i in Aktionen[c], t in
{S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i];

You could replace S[c,i] by binary variables and use a big M approach.

Best regards

Xypron

> -------- Forwarded Message --------
> Subject: Implementation problems
> Date: Thu, 30 Aug 2012 03:30:13 +0200
> 
> Hi,
> 
> 
> 
> 
> I am trying to implement a model that is only given to me in a
> conceptual form in GUSEK using GLPK.
> When I try to solve the following model, I receive an error message
> concerning an operand with invalid type.
> I was wondering if someone could give me a pointer on how to fix this. I
> am rather new to GUSEK and GLPK
> and your help is highly appreciated.
> 
> 
> Kind regards.
> 
> 
> 
> 
> Model:
> 
> 
> set Krane;
> set Aktionen {c in Krane};
> set Zeiten;
> 
> 
> param P {c in Krane, i in Aktionen[c]};
> param D; 
> param L;
> param X {c in Krane, i in Aktionen[c]};
> param V {c in Krane};
> 
> 
> var S {c in Krane, i in Aktionen[c]} >= 0, integer;
> var x {c in Krane, t in Zeiten} >= 0, integer;
> 
> 
> minimize z: sum{c in Krane} S[c,card(Aktionen[c])];
> 
> 
> s.t. Reihenfolge{c in Krane, i in {1..card(Aktionen[c])-1}} : S[c,i] +
> P[c,i] <= S[c,i+1];
> s.t. Position{c in Krane, i in Aktionen[c], t in
> {S[c,i]..(S[c,i]+P[c,i])}} : x[c,t] = X[c,i];
> s.t. Geschwindigkeit1{t in Zeiten, c in Krane} : x[c,t] - V[c] <= x[c,t
> +1]
> s.t. Geschwindigkeit2 {t in Zeiten, c in Krane} : x[c,t] + V[c] >= x[c,t
> +1]
> s.t. Sicherheitsabstand{c == "G", i in Aktionen, t in
> {S[i]..S[i]+P["g",i]}} : abs(x["K",t]-x["G",t]) >= D
> s.t. Startposition{c in Krane} : x[c,0] == X[c,0]
> s.t. max_Position{t in Zeiten, c in Krane} : x[c,t] <= L
> s.t. min_Position{t in Zeiten, c in Krane} : x[c,t] >= 0
> 
> 
> 
> 
> 
> 
> data;
> 
> 
> set Krane := "K" "G";
> set Aktionen := 
> "K" 1 2 3 4 5 6 7 8 9 10 11 12
> "G" 1 2 3 4 5 6 7 8 9 10 11 12;
> set Zeiten := {0..900}
> param P: 1 2 3 4 5 6 7 8 9 10 11 12:=
> "K" 20 20 20 20 20 20 20 20 20 20 20 20
> "G" 20 20 20 20 20 20 20 20 20 20 20 20;
> param D := 5;
> param L := 81;
> param X: 1 2 3 4 5 6 7 8 9 10 11 12:=
> "K" 2 10 9 14 9 14 9 3 80 6 40 2
> "G" 79 5 1 77 77 3 40 41 40 39 80 30;
> param V:=
> "K" (1/5)
> "G" (1/5);
> end;
> 
> 
> Error:
> GLPSOL: GLPK LP/MIP Solver, v4.45
> Parameter(s) specified in the command line:
>  --check --cover --clique --gomory --mir -m Dorndorf.mod
> Reading model section from Dorndorf.mod...
> Dorndorf.mod:26: operand preceding .. has invalid type
> Context: ...n { c in Krane , i in Aktionen [ c ] , t in { S [ c , i ] ..
> MathProg model processing error
> >Exit code: 1    Time: 0.212
> 
> 
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]