-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemand-satisfaction.H
More file actions
42 lines (29 loc) · 885 Bytes
/
Copy pathdemand-satisfaction.H
File metadata and controls
42 lines (29 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# ifndef DEMAND_SATISFACTION_H
# define DEMAND_SATISFACTION_H
# include <htlist.H>
# include <tpl_dynListQueue.H>
# include <tpl_dynSetTree.H>
# include <net.H>
struct DemandSatisfaction
{
using PQ = pair<MetaProducto *, double>;
using IQ = pair<MetaInsumo *, double>;
using Result = tuple<bool, DynList<PQ>, DynList<IQ>>;
MetaMapa * map;
DemandSatisfaction(MetaMapa * m = nullptr)
: map(m) { }
struct CmpNetArcs
{
bool operator () (Net::Arc * a, Net::Arc * e)
{
return a->get_info().arco_id < e->get_info().arco_id;
}
};
using ArcsIndex = DynSetTreap<Net::Arc *, CmpNetArcs>;
Net::Arc * search_net_arc(ArcsIndex &, Uid);
using Tuple = tuple<string, Uid, double>;
using QTuple = tuple<MetaProducto *, double>;
double infer_increase(const Tuple &);
Result simple_aproach(MetaProducto *, double, size_t);
};
# endif