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/transport6_8cpp.html below:

transport6.cpp File Reference

Get model as string.

50{

51 return "Sets \n"

52 " i canning plants / seattle, san-diego / \n"

53 " j markets / new-york, chicago, topeka / ; \n"

54 " \n"

55 "Parameters \n"

56 " \n"

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

58 " / seattle 350 \n"

59 " san-diego 600 / \n"

60 " \n"

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

62 " / new-york 325 \n"

63 " chicago 300 \n"

64 " topeka 275 / ; \n"

65 " \n"

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

67 " new-york chicago topeka \n"

68 " seattle 2.5 1.7 1.8 \n"

69 " san-diego 2.5 1.8 1.4; \n"

70 " \n"

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

72 "Scalar bmult demand multiplier / 1 / ; \n"

73 " \n"

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

75 " \n"

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

77 " \n"

78 "Variables \n"

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

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

81 " \n"

82 "Positive Variable x; \n"

83 " \n"

84 "Equations \n"

85 " cost define objective function \n"

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

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

88 " \n"

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

90 " \n"

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

92 " \n"

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

94 " \n"

95 "Model transport / all / ; \n"

96 "Scalar ms 'model status', ss 'solve status' \n";

97}


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