MindMap Gallery OPL algorithm
Mind map of basic usage of operations research software OPL
Edited at 2019-11-12 08:28:13Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Basic usage of operations research software OPL
Example 1
dvar float x1; dvar float x2; maximize 3*x1 5*x2; subject to { 4*x1 8*x2<=100; 7*x1-2*x2<=35; }
Main points
Keyword dvar defines decision variables
The keywords maximize/minimize define the objective function
The keyword "subject to" defines constraints
Decision variable type
Float (Float/Real) dvar float f; dvar float f; (Note: float represents non-negative real numbers)
float f = 3.2; (Note: cannot be written as float f = 3.2; )
Integer dvar int x; dvar int x; (Note: int represents a non-negative integer)
int n = 3; (Note: cannot be written as int n = 3; ) int size = n*n;
0-1 variable dvar boolean y;
String (string type) string Task = "ceiling";
Example 2 Define parameters
dvar float x1; dvar float x2; maximize 3*x1 5*x2; subject to { 4*x1 8*x2<=100; 7*x1-2*x2<=35; }
int c1=3; int c2=5; dvar float x1; dvar float x2; maximize c1*x1 c2*x2; subject to { 4*x1 8*x2<=100; 7*x1-2*x2<=35; }
/* .mod file */ int c1=...; int c2=...;
/* .dat file */ c1=3; c2=5;
Separation of data and programs
scope
(1) range Rows = 1..10; range float X = 1.0..100.0;
(2) int n = 8; range Rows = n 1..2*n 1;
(3) range R = 1..100; int A[R]; // A is an array of 100 integers
(4) range R = 1..100; forall(i in R) { //element of a loop loop statement }
array
one-dimensional array One-dimensional arrays
1. int a[1..4] = [10, 20, 30, 40]; 2. float f[1..4] = [1.2, 2.3, 3.4, 4.5]; 3. string d[1..2] = [“Monday”, “Wednesday”];
range R = 1..4; int a[R] = [10, 20, 30, 40];
Multidimensional Arrays Multidimensional Array
/* .mod file */ int a[1..2][1..3] = ...;
/* .dat file */ a = [ [10, 20, 30], [40, 50, 60] ];
Ranges and Arrays
range Range_A = 1..10; range Range_B = 1..20; dvar int y[Range_A][Range_B]; dvar int x[Range_A][Range_B] in 0..100;
constraint
range Range_A = 1..10; range Range_B = 1..20; dvar int x[Range_A][Range_B] in 0..100; dvar int y[Range_A][Range_B]; minimize…
subject to{ forall( i in Range_A) x[i][1] ==1; forall( i in Range_A) sum( j in Range_B) y[i][j] <= 200; //Sum keyword: sum … }
Example 3
model file
definition
int m=...; int n=...; int a[1..m] = ...; int b[1..n] = ...; int c[1..m][1..n] = ...; dvar float x[1..m][1..n];
objective function
minimize sum( i in 1..m, j in 1..n) c[i][j] * x[i][j];
constraint
subject to{ forall(i in 1..m) sum( j in 1..n) x[i][j] == a[i]; forall( j in 1..n ) sum( i in 1..m) x[i][j] == b[j]; }
data file
m=3; n=4; a =[7, 4, 9]; b =[3, 6, 5, 6]; c = [ [3, 11, 3, 10], [1, 9, 2, 8], [7, 4, 10, 5] ];