This repository has been archived by the owner on Aug 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
486 lines (376 loc) · 40.8 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
File: README
— Documentation by YARD 0.9.8
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "README";
relpath = '';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> »
<span class="title">File: README</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><div id='filecontents'><h1>Consumer</h1>
<p>This repository contains the Consumer-component of the Price Wars simulation. The consumer represents the costumers arriving at the marketplace and buying products. How often and which products they buy is decided based on custom consumer-behaviors that can be configured and changed.</p>
<p>The consumer is realized using a Ruby-app implementing the MVC pattern including continuous integration and deployment via Codeship. Please make sure tests are running before committing.</p>
<p>The meta repository containing general information can be found <a href="https://github.com/hpi-epic/masterproject-pricewars">here</a></p>
<h2>Application Overview</h2>
<table><thead>
<tr>
<th>Repo</th>
<th>Branch</th>
<th>Deployment to</th>
<th>Status</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-mgmt-ui">UI</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-02.eaalab.hpi.uni-potsdam.de">vm-mpws2016hp1-02.eaalab.hpi.uni-potsdam.de</a></td>
<td><a href="https://app.codeship.com/projects/184009"> <img src="https://app.codeship.com/projects/d91a8460-88c2-0134-a385-7213830b2f8c/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-mgmt-ui"></a></td>
<td>Stable</td>
</tr>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-consumer">Consumer</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-01.eaalab.hpi.uni-potsdam.de">vm-mpws2016hp1-01.eaalab.hpi.uni-potsdam.de</a></td>
<td><a href="https://app.codeship.com/projects/180119"> <img src="https://app.codeship.com/projects/96f32950-7824-0134-c83e-5251019101b9/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-consumer"></a></td>
<td>Stable</td>
</tr>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-producer">Producer</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-03.eaalab.hpi.uni-potsdam.de">vm-mpws2016hp1-03eaalab.hpi.uni-potsdam.de</a></td>
<td><a href="https://app.codeship.com/projects/184016"> <img src="https://app.codeship.com/projects/0328e450-88c6-0134-e3d6-7213830b2f8c/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-producer"></a></td>
<td>Stable</td>
</tr>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-marketplace">Marketplace</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-04.eaalab.hpi.uni-potsdam.de/marketplace/offers">vm-mpws2016hp1-04.eaalab.hpi.uni-potsdam.de/marketplace</a></td>
<td><a href="https://app.codeship.com/projects/184015"> <img src="https://app.codeship.com/projects/e9d9b3e0-88c5-0134-6167-4a60797e4d29/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-marketplace"></a></td>
<td>Stable</td>
</tr>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-merchant">Merchant</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-06.eaalab.hpi.uni-potsdam.de/">vm-mpws2016hp1-06.eaalab.hpi.uni-potsdam.de/</a></td>
<td><a href="https://app.codeship.com/projects/184013"> <img src="https://app.codeship.com/projects/a7d3be30-88c5-0134-ea9c-5ad89f4798f3/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-merchant"></a></td>
<td>Stable</td>
</tr>
<tr>
<td><a href="https://github.com/hpi-epic/pricewars-kafka-rest">Kafka RESTful API</a></td>
<td>master</td>
<td><a href="http://vm-mpws2016hp1-05.eaalab.hpi.uni-potsdam.de">vm-mpws2016hp1-05.eaalab.hpi.uni-potsdam.de</a></td>
<td><a href="https://app.codeship.com/projects/186252"> <img src="https://app.codeship.com/projects/f59aa150-92f0-0134-8718-4a1d78af514c/status?branch=master" alt="Codeship Status for hpi-epic/pricewars-kafka-rest"></a></td>
<td>Stable</td>
</tr>
</tbody></table>
<h2>Requirements</h2>
<p>The consumer is written in Rails. Ensure to have the following components installed and set up on your computer:</p>
<ul>
<li>Ruby 2.3</li>
<li>Rails 4.2</li>
</ul>
<h2>Setup</h2>
<p>After cloning the repo, install the necessary dependencies with <code>bundle exec bundle install</code>.</p>
<p>Afterwards you may start the webserver with <code>rails s -b 0.0.0.0</code> where the ENV variables PRICEWARS_MARKETPLACE_URL and PRICEWARS_PRODUCER_URL point to the actual path of the marketplace and the producer.</p>
<p>If all worked out, see the results at _ <a href="http://localhost:3000">http://localhost:3000</a> _ .</p>
<h2>Configuration</h2>
<p>Currently, two ENV params are needed:</p>
<ul>
<li>PRICEWARS_PRODUCER_URL</li>
<li>PRICEWARS_MARKETPLACE_URL</li>
</ul>
<p>If they are not set, the deployed VM urls are automatically used.</p>
<p>One may simple export them to the related system:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_export'>export</span> <span class='const'>PRICEWARS_MARKETPLACE_URL</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://vm-mpws2016hp1-04.eaalab.hpi.uni-potsdam.de:8080/marketplace</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_export'>export</span> <span class='const'>PRICEWARS_PRODUCER_URL</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://vm-mpws2016hp1-03.eaalab.hpi.uni-potsdam.de</span><span class='tstring_end'>'</span></span>
</code></pre>
<h2>Concept</h2>
<p>The consumer is defined via behaviors which are implemented in <em>lib/buyingbehavior.rb</em>. All available behaviors are included and exposed with their default settings and description in <em>app/controllers/behavior_controller.rb</em> .</p>
<h3>Consumer Behaviors</h3>
<p>Via settings, the distribution across those available behaviors is defined as percentage. In the consumer logic then, each behavior is <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/app/controllers/setting_controller.rb#L142">called and executed</a> dynamically based on the provided behavior method name and its distribution.</p>
<h4>Existing behaviors</h4>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L29">buy_first</a></li>
</ul>
<blockquote>
<p>buying the first item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L33">buy_random</a></li>
</ul>
<blockquote>
<p>buying a random item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L37">buy_cheap</a></li>
</ul>
<blockquote>
<p>buying the cheapest item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L41">buy_n_cheap(n)</a></li>
</ul>
<blockquote>
<p>buying the n-cheapest item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L50">buy_second_cheap</a></li>
</ul>
<blockquote>
<p>buying the second cheapest item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L54">buy_third_cheap</a></li>
</ul>
<blockquote>
<p>buying the third cheapest item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L58">buy_cheap_and_prime</a></li>
</ul>
<blockquote>
<p>buying the cheapest item out of the marketplace offer list filtered by prime</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L62">buy_expensive</a></li>
</ul>
<blockquote>
<p>buying the most expensive item out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L66">buy_cheapest_best_quality_with_prime</a></li>
</ul>
<blockquote>
<p>buying the cheapest item with the best possible quality out of
the marketplace offer list filtered by prime</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L71">buy_cheapest_best_quality</a></li>
</ul>
<blockquote>
<p>buying the cheapest item with the best possible quality out of the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L77">buy_sigmoid_distribution_price</a></li>
</ul>
<blockquote>
<p>buying items with sigmoid distribution around twice the producer price from the marketplace offer list</p>
</blockquote>
<ul>
<li><a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L99">buy_logit_coefficients</a></li>
</ul>
<blockquote>
<p>buying items based on the provided logit coefficients from the marketplace offer list</p>
</blockquote>
<h4>Sigmoid distribution behavior in detail</h4>
<p>The <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L77">sigmoid distribution</a> behavior realizes a sigmoid(-x) distribution of consumer purchases over <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L88">twice the producer price</a> which is used as mean.</p>
<p>The following figures delineate the sigmoid distribution where y is the probability of purchase and x the price of an offer. In the given example, the mean is twice the producer price (15€) therefore 30€.</p>
<p><img src="/public/doc/sigmoid.png?raw=true" alt="alt tag">
<img src="/public/doc/sigmoid_2.png?raw=true" alt="alt tag"></p>
<p>Consequently, the cheaper the offer is, the higher the purchase probability; the higher the price the lower the purchase probability.</p>
<h4>Logistic regression behavior in detail</h4>
<p>The <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L99">logit behavior</a> implements a logistic regression with feature scaling and calculates for each offer the buying probability based on the feature coefficients provided in the behavior settings. Based on this buying probability for each offer, the consumer will actually choose an offer to buy.
In this way, potential consumer behavior can be learned on real world data and imitated in the simulation solution.</p>
<p>Logistic regression is a regression model where the dependent variable -- in our case the selling of an offer -- is categorical. This categorization outcome must be discrete and should be dichotomous in nature simply expressed by a boolean whether a purchase happened or not. To determine this, this behavior consumes features and their coefficients can be altered within runtime and will then be applied to the next calculation iteration taking place. The describing hashmap of features and their coefficients contains only available features which are already implemented otherwise they will be ignored.</p>
<p>The default settings for the logit behavior holds the following settings:</p>
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>coefficients</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>intercept</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>6.6177961</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>price_rank</span><span class='label_end'>":</span><span class='float'>0.2083944</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount_of_all_competitors</span><span class='label_end'>":</span><span class='float'>0.253481</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>average_price_on_market</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>0.0079326</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>quality_rank</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>0.1835972</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span>
</code></pre>
<p>which were extracted from a real world use case provided by a big book retail company.
For deeper insights in the concepts of logistic regression, the reader is kindly referred to <a href="https://www.researchgate.net/profile/Andrew_Cucchiara/publication/261659875_Applied_Logistic_Regression/links/542c7eff0cf277d58e8c811e/Applied-Logistic-Regression.pdf">DW Hosmer Jr et al. work</a>.</p>
<h4>Adding new features for logit behaviors</h4>
<p>For adding a new feature for the logit behavior, one simply needs to extend the logic in <em>lib\features.rb</em>. In particular, one may implement a new method and include it in the switch case starting in L9.</p>
<h4>Adding new behaviors</h4>
<p>For adding a new buying behavior, one simply needs to add the buying logic as method in <em>lib/buyingbehavior.rb</em> starting with the prefix <em>buy_</em> returning the item (only one!), which is supposed to be bought.</p>
<p>If wished, <em>validate_max_price()</em> can be used to validate whether the selected item comply the settings (e.g. max price).</p>
<p>If the new behavior has individual settings, they can be accessed via <em>@behavior_settings</em>.</p>
<p>All available product (ids) are included in <em>$products</em> and <em>$items</em> contains all offer items for one preselected product category. This preselection is done during the <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L26">initialization</a> and can be realized either by selecting a random product or by selecting a product based on the provided product popularity via settings.</p>
<pre class="code ruby"><code class="ruby"><span class='comment'># OPTIONS: select_random_product | select_based_on_product_popularity
</span></code></pre>
<p>Keep in mind to add the new behavior with its description, default settings and method name in the <em>app/controller/behavior_controller.rb</em> in the way that it will be included and listed in the default setting return value.</p>
<h3>Selection of one product & its market situation</h3>
<p>The current implementation supports an even distributed selection of items (random selection). Additionally, one may define product popularity via the consumer settings which is evaluated instead of a random distribution.</p>
<p>The relative selection method can be defined in the <a href="https://github.com/hpi-epic/pricewars-consumer/blob/master/lib/buyingbehavior.rb#L25">initialize method of the buyingbehavior.rb</a> by either using <em>select_random_product</em> or <em>select_based_on_product_popularity</em> (see comments).</p>
<h2>Host entries</h2>
<p>When working on the provided VMs make sure to including DNS routing in the local /etc/hosts file. We experienced a lot of issues with TCP connection timeouts if those are not set. Also within the CI & CD pipeline in the way that github was not reachable due to connection timeouts.
Different resolvers were tried out, however, the only working solution is to expand the host file,</p>
<pre class="code ruby"><code class="ruby">/etc/hosts
# Reducing DNS lookups by assigning statically marketplace host
192.168.31.90 vm-mpws2016hp1-04.eaalab.hpi.uni-potsdam.de
192.168.31.89 vm-mpws2016hp1-03.eaalab.hpi.uni-potsdam.de
</code></pre>
<h2>Sample Configuration</h2>
<p>Like described in the <a href="https://hpi-epic.github.io/masterproject-pricewars/api/">API documentation</a>, a sample setting json for the consumer looks like the following:</p>
<blockquote>
<p>HTTP GET <a href="http://localhost:3000/setting/">http://localhost:3000/setting/</a></p>
</blockquote>
<pre class="code ruby"><code class="ruby"><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>consumer_per_minute</span><span class='label_end'>":</span><span class='float'>100.0</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount_of_consumers</span><span class='label_end'>":</span><span class='int'>1</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>probability_of_buy</span><span class='label_end'>":</span><span class='int'>100</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>min_buying_amount</span><span class='label_end'>":</span><span class='int'>1</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>max_buying_amount</span><span class='label_end'>":</span><span class='int'>1</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>min_wait</span><span class='label_end'>":</span><span class='float'>0.1</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>max_wait</span><span class='label_end'>":</span><span class='int'>2</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>behaviors</span><span class='label_end'>":</span><span class='lbracket'>[</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>first</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the first possible item</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>random</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying random items</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cheap</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the cheapest item</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>expensive</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the most expensive item</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cheap_and_prime</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the cheapest item which supports prime shipping</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cheapest_best_quality</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the cheapest best quality available.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cheapest_best_quality_with_prime</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the cheapest best quality available which supports prime.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>second_cheap</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the second cheapest item</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>third_cheap</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am buying the third cheapest item</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sigmoid_distribution_price</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am with sigmoid distribution on the price regarding the producer prices</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Behavior settings not necessary</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>name</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>logit_coefficients</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>I am with logit coefficients</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>coefficients</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>intercept</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>6.6177961</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>price_rank</span><span class='label_end'>":</span><span class='float'>0.2083944</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount_of_all_competitors</span><span class='label_end'>":</span><span class='float'>0.253481</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>average_price_on_market</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>0.0079326</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>quality_rank</span><span class='label_end'>":</span><span class='op'>-</span><span class='float'>0.1835972</span>
<span class='rbrace'>}</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>settings_description</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Key Value map for Feature and their coeffient</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amount</span><span class='label_end'>":</span><span class='int'>9</span>
<span class='rbrace'>}</span>
<span class='rbracket'>]</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>timeout_if_no_offers_available</span><span class='label_end'>":</span><span class='int'>2</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>timeout_if_too_many_requests</span><span class='label_end'>":</span><span class='int'>30</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>max_buying_price</span><span class='label_end'>":</span><span class='int'>80</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>debug</span><span class='label_end'>":</span><span class='kw'>true</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>producer_url</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://vm-mpws2016hp1-03.eaalab.hpi.uni-potsdam.de</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>product_popularity</span><span class='label_end'>":</span><span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1</span><span class='label_end'>":</span><span class='float'>25.0</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2</span><span class='label_end'>":</span><span class='float'>25.0</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>3</span><span class='label_end'>":</span><span class='float'>25.0</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>4</span><span class='label_end'>":</span><span class='float'>25.0</span>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>marketplace_url</span><span class='label_end'>":</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://vm-mpws2016hp1-04.eaalab.hpi.uni-potsdam.de:8080/marketplace</span><span class='tstring_end'>"</span></span>
<span class='rbrace'>}</span>
</code></pre>
<h2>Source Code</h2>
<p>Detailed information regarding method and function usage and behavior can be found within the <a href="public/doc/index.html">public/doc/ directory</a> of this repository or within the deployed service by <a href="http://vm-mpws2016hp1-01.eaalab.hpi.uni-potsdam.de/doc/index.html">clicking here</a>.</p>
</div></div>
<div id="footer">
Generated on Tue Mar 28 15:46:49 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.8 (ruby-2.3.1).
</div>
</div>
</body>
</html>