]> git.llucax.com Git - z.facultad/71.14/clases.git/commitdiff
Modelos y Optimización I. master svn_import
authorLeandro Lucarella <llucax@gmail.com>
Mon, 27 Mar 2006 00:50:45 +0000 (00:50 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Mon, 27 Mar 2006 00:50:45 +0000 (00:50 +0000)
Makefile [new file with mode: 0644]
clase1.mod [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..9ae1001
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,22 @@
+
+mods = $(wildcard *.mod)
+
+results = $(patsubst %.mod,%.result,$(mods))
+
+all: $(results)
+
+%.result: %.mod
+       @echo Resolviendo $^...
+       @glpsol --model $^ --bounds $^.bounds > $@
+       @echo >> $@
+       @echo ------------------------------------------------------------------------ >> $@
+       @echo >> $@
+       @cat $^.bounds >> $@
+       @$(RM) $^.bounds
+
+clean:
+       @echo Limpiando...
+       @rm -fv *.result
+
+.PHONY: clean
+
diff --git a/clase1.mod b/clase1.mod
new file mode 100644 (file)
index 0000000..7f7b3f2
--- /dev/null
@@ -0,0 +1,13 @@
+
+var baguettes, >= 0; /* baguettes a producir por día */
+var panes, >= 0;     /* panes a producir por día */
+
+maximize
+       value: 0.3 * baguettes + 0.8 * panes;
+
+subject to
+       agua:     0.06 * baguettes + 0.2 * panes   <= 80;
+       levadura: 0.01 * baguettes + 0.012 * panes <= 8;
+       bolsas:   baguettes                        <= 450;
+       harina:   0.1 * baguettes + 0.25 * panes   <= 100;
+end;