Senhores, ao tentar otimizar a partir do arquivo abaixo:
library(boot)
z = c(1,1,1,1,1,1,1)
res2 =
matrix(c(1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1),7,7)
simplex(a=z,A1=NULL,b1=NULL,A2=rbind(res2),b2=c(18,12,15,19,14,16,11),A3=NULL,b3=NULL,maxi=FALSE)
Recebo a mensagem:
Erro em pivot(tableau,
prow, pcol) :
NAs não são permitidos em atribuições por subscritos
Calls: simplex -> simplex1 -> pivot
Execução interrompida
A título de elucidação, abaixo o arquivo utilizado pelo gurobi
(www.gurobi.com) ao qual realizo a tarefa normalmente.
Minimize
x1 + x2 + x3 + x4 + x5 + x6 + x7
Subject To
x1 + x2 + x3 + x4 + x5 >= 18
x2 + x3 + x4 + x5 + x6 >= 12
x3 + x4 + x5 + x6 + x7 >= 15
x4 + x5 + x6 + x7 + x1 >= 19
x5 + x6 + x7 + x1 + x2 >= 14
x6 + x7 + x1 + x2 + x3 >= 16
x7 + x1 + x2 + x3 + x4 >= 11
Bound
x1 >= 0
x2 >= 0
x3 >= 0
x4 >= 0
x5 >= 0
x6 >= 0
x7 >= 0
Integers
x1 x2 x3 x4 x5 x6 x7
End
Alias, como garantir lá no R que os resultados sejam números
inteiros apenas?
Obrigado
Att