Skip to main content
. 2021 Jun 14;7:e594. doi: 10.7717/peerj-cs.594
Algorithm 2: Pricing video transaction algorithm
Input: videoconsumeroutput,videoconsumerinput,priavgin,priavgout
Output: The income of the seller producer is profitproducer, and the amount paid by the buyer is payconsumer.
initialization:videoinput = 0, videooutput
videooutput=i=1mvideoioutput
videoinput=j=1m+nvideojinput
ifvideooutput ≥ videoinput
According to Formula(24)and Formula(25), the purchase pricepriinand the sale priceprioutare calculated
else
According to Formula(27)and Formula(28), the purchase pricepriinand the sale priceprioutare calculated
end if
fori = 0;i<=m;i++ do
profitproducer=prioutvideoioutput
end for
forj = 0;j<=m+n;j++ do
payconsumer=priinvideojinput
end for