A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.gams.com/latest/docs/apis/examples_cpp/transport9_8cpp.html below:

transport9.cpp File Reference

Get model as string.

53{

54 return " Sets \n"

55 " i canning plants \n"

56 " j markets \n"

57 " \n"

58 " Parameters \n"

59 " a(i) capacity of plant i in cases \n"

60 " b(j) demand at market j in cases \n"

61 " d(i,j) distance in thousands of miles \n"

62 " Scalar f freight in dollars per case per thousand miles /90/; \n"

63 " \n"

64 "$if not set gdxincname $abort 'no include file name for data file provided' \n"

65 "$gdxin %gdxincname% \n"

66 "$load i j a b d \n"

67 "$gdxin \n"

68 " \n"

69 " Parameter c(i,j) transport cost in thousands of dollars per case ; \n"

70 " \n"

71 " c(i,j) = f * d(i,j) / 1000 ; \n"

72 " \n"

73 " Variables \n"

74 " x(i,j) shipment quantities in cases \n"

75 " z total transportation costs in thousands of dollars ; \n"

76 " \n"

77 " Positive Variable x ; \n"

78 " \n"

79 " Equations \n"

80 " cost define objective function \n"

81 " supply(i) observe supply limit at plant i \n"

82 " demand(j) satisfy demand at market j ; \n"

83 " \n"

84 " cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ; \n"

85 " \n"

86 " supply(i) .. sum(j, x(i,j)) =l= a(i) ; \n"

87 " \n"

88 " demand(j) .. sum(i, x(i,j)) =g= b(j) ; \n"

89 " \n"

90 " Model transport /all/ ; \n"

91 " \n"

92 " Solve transport using lp minimizing z ; \n"

93 " \n"

94 " Display x.l, x.m ; \n"

95 " \n";

96}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4