Funciones de transición
Jean GonzalesTarea7 de Abril de 2022
417 Palabras (2 Páginas)75 Visitas
- Funciones de transición
S1=s1 + 1 Para identificar las etapas
S2=s2-d Cantidad de APs disponibles para vender a los clientes
b)
ad(s)=Precio(s1)*d
c)
| Optimal Value Function, f(s) = 8160 |
| ||
| Number of solutions = 1 |
|
| |
| s1 | s2 | p(s) | f(s) |
Solution 1 | 1 | 270 | 36 | 8160 |
| 2 | 234 | 0 | 7188 |
| 3 | 234 | 54 | 7188 |
| 4 | 180 | 33 | 5784 |
| 5 | 147 | 48 | 4860 |
| 6 | 99 | 30 | 3324 |
| 7 | 69 | 30 | 2394 |
| 8 | 39 | 36 | 1224 |
| 9 | 3 | - | 0 |
El valor optimo es de $8160 que es el ingreso máximo.
Se debe atender 36 APs al cliente 1, ninguno al cliente 2, 54 unidades al cliente 3, 33 unidades al cliente 4, 48 unidades al cliente 5, 30 a los clientes 6 y 7 y 36 unidades al cliente 8.
Option Explicit
Dim Pedido(1 To 9), Precio(1 To 9)
Sub Preliminary_Definitions()
Call FILLARRAY(Pedido, "{36,42,54,66,48,54,30,36}", 1)
Call FILLARRAY(Precio, "{27,22,26,28,32,31,39,34}", 1)
End Sub
Sub Model_Structure()
NSV = 2
NCT = 2
End Sub
Sub Starting_State()
s1 = 1
s2 = 270
End Sub
Sub Decision_Set()
If s1 = 1 Or s1 = 8 Then
d = 12
Ds = ivalset(0, 36, 18)
End If
If s1 = 2 Then
d = 14
Ds = ivalset(0, 42, 21)
End If
If s1 = 3 Or s1 = 6 Then
d = 18
Ds = ivalset(0, 54, 27)
End If
If s1 = 4 Then
d = 11
Ds = ivalset(0, 66, 33)
End If
If s1 = 5 Then
d = 16
Ds = ivalset(0, 48, 24)
End If
If s1 = 6 Then
d = 10
Ds = ivalset(0, 30, 15)
End If
End Sub
Sub Transition_Function()
sn1 = s1 + 1
sn2 = s2 - d
End Sub
Sub State_Constraints()
Ct1 = (sn1 <= 9)
Ct2 = (sn2 >= 0)
End Sub
Sub Economic_Return()
ad(s) = Precio(s1) * d
End Sub
Sub Return_Function()
Rd(s) = ad(s) + f(sn)
End Sub
Sub Recursive_Equation()
...