-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathactivity_cognition_30.plantuml
60 lines (55 loc) · 1.14 KB
/
activity_cognition_30.plantuml
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
@startuml
|Pandora Contract|
|Validators|
|Pandora Contract|
start
partition validateCognition {
repeat
:lottery|
:validationJobCreated/
fork
:waitingForResponses;
detach
fork again
|Validators|
start
if (busy) then (yes)
:busy>
else (no)
:downloadData]
:downloadResults]
:launchModel]
:checkResults]
if (worker results are correct) then (no)
:wrongResults>
else (yes)
:ready>
endif
endif
end fork
|Pandora Contract|
fork
:validatorResponse<
fork again
:validatorResponse<
fork again
:...<
end fork
if (∃ response = wrongResults) then (yes)
:Cognition arbitrage|
detach
elseif (∃ response = busy) then (yes)
:penaltyToValidator#1]
elseif (noTries > N) then (yes)
:paybackClient(onlyPartOfValidation)]
:cognitiveJobCompleted(partialValidation)/
stop
else (timeout)
:penaltyToValidator#2]
endif
repeat while (∄ responses = busy | timeout) is (no)
:payoutsAndMining|
:cognitiveJobCompleted/
stop
}
@enduml