# How to model this problem that contains two linked uncertainties?

A milk factory has to sign a weekly contract with consumer A and B, in advance, in order to sell its product. Consumer A, wants the average delivered milk during each week be equal to the contracted volume, otherwise the factory has to pay a penalty for scarcity. On the other hand, Consumer B wants the daily delivered volume to be equal to contracted volume, otherwise has to pay a penalty for daily scarcity. Practically, A cares about weekly uncertainty and B cares about daily uncertainty. However, it is evident that the two uncertainty are correlated.

$$c_A$$ /$$c_B$$ are positive prices for promising to sell $$X_A$$/$$X_B$$ milk to consumer A / B. $$c_a$$ and $$c_b$$ are negative prices for scarcity of the product in market A and B during the contracted period.$$x_A$$ / $$x_B$$ is the delivered milk in real time period. $${x_A}^{-}$$ and $${x_B}^{-}$$ measures the real-time scarcity of the promised delivery. $$X_{max}$$ is the capacity of milk company. The available daily and also weekly milk is uncertain and follow distribution $$\delta$$ and $$\omega$$.

given that the aim is to maximize the revenue, here is what I have done so far:

$$c_AX_A + c_BX_B + \mathbb{E_{\omega}}[{c_a x_A}^{-}]+\mathbb{E_{\delta}}[{c_b x_B}^{-}] \\ X_A + X_B \leq X_{max} \\ X_A - x_A \geq {x_A}^{-} \\ X_B - x_B \geq {x_B}^{-}\\ X_A, X_B, x_A, x_B, {x_B}^{-}, {x_A}^{-} \geq 0 \\$$

How can I link the uncertain product to the allocated ones to each consumer with a constraint.

How many stages does this stochastic program contain?

Given that we have historical daily milk product, how can one form the two distribution?

How does the scenario tree look like?