Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
+ deployment (simulated)
+ clean/fix
  • Loading branch information
mikyll committed May 29, 2023
1 parent 324f2f6 commit 9fa753f
Show file tree
Hide file tree
Showing 192 changed files with 4,985 additions and 3,379 deletions.
274 changes: 77 additions & 197 deletions Sprint0/Sprint0_RequirementAnalysis/Api_demo.txt

Large diffs are not rendered by default.

314 changes: 77 additions & 237 deletions Sprint0/Sprint0_RequirementAnalysis/Api_sprint0_system_overview.txt

Large diffs are not rendered by default.

264 changes: 77 additions & 187 deletions Sprint0/Sprint0_RequirementAnalysis/Api_test_storerequest.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Sprint0/Sprint0_RequirementAnalysis/build2022.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ eclipse {

application {
// Define the main class for the application.
mainClass = 'it.unibo.ctx_basicrobot.MainCtx_basicrobotKt'
mainClass = 'it.unibo.ctx_test_storerequest.MainCtx_test_storerequestKt'
}

jar {
Expand Down
2 changes: 1 addition & 1 deletion Sprint0/Sprint0_RequirementAnalysis/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "unibo.sprint0_system_overview"
rootProject.name = "unibo.test_storerequest"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_system_overview.pl", "sysRules.pl","ctx_basicrobot"
"localhost", this, "demo.pl", "sysRules.pl","ctx_basicrobot"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_system_overview.pl", "sysRules.pl","ctx_monitor"
"localhost", this, "demo.pl", "sysRules.pl","ctx_monitor"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_system_overview.pl", "sysRules.pl","ctx_raspdevice"
"localhost", this, "demo.pl", "sysRules.pl","ctx_raspdevice"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_system_overview.pl", "sysRules.pl","ctx_smartdevice_test"
"localhost", this, "demo.pl", "sysRules.pl","ctx_smartdevice_test"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_test_storerequest.pl", "sysRules.pl","ctx_test_storerequest"
"localhost", this, "test_storerequest.pl", "sysRules.pl","ctx_test_storerequest"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
QakContext.createContexts(
"localhost", this, "sprint0_system_overview.pl", "sysRules.pl","ctx_wasteservice"
"localhost", this, "demo.pl", "sysRules.pl","ctx_wasteservice"
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class Test_wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm
return { //this:ActionBasciFsm
state("state_init") { //this:State
action { //it:State

var CurrentPlastic = 0.0f
var CurrentGlass = 0.0f
println("$name in ${currentState.stateName} | $currentMsg")
println("[WasteService] Reset:")
println(" Plastic: $CurrentPlastic")
println(" Glass: $CurrentGlass")
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand All @@ -32,43 +39,36 @@ class Test_wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm
}
state("state_idle") { //this:State
action { //it:State
println("[Test_WasteService] Waiting for messages...")
//genTimer( actor, state )
}
//After Lenzi Aug2002
sysaction { //it:State
}
transition(edgeName="t10",targetState="state_handle_store",cond=whenRequest("storerequest"))
transition(edgeName="t00",targetState="state_handle_store",cond=whenRequest("storerequest"))
}
state("state_handle_store") { //this:State
action { //it:State
println(" dioporco")
println("$name in ${currentState.stateName} | $currentMsg")
if( checkMsgContent( Term.createTerm("storerequest(TYPE,TRUCKLOAD)"), Term.createTerm("storerequest(TYPE,TRUCKLOAD)"),
currentMsg.msgContent()) ) { //set msgArgList
println(" dioporco2")

Type = wasteservice.WasteType.valueOf(payloadArg(0))
TruckLoad = payloadArg(1).toFloat()
if(
// enough space
(Type == wasteservice.WasteType.PLASTIC && CurrentPlastic + TruckLoad <= wasteservice.Constants.MAXPB) ||
(Type == wasteservice.WasteType.GLASS && CurrentGlass + TruckLoad <= wasteservice.Constants.MAXGB)
){
if (Type == wasteservice.WasteType.PLASTIC) {
CurrentPlastic += TruckLoad
}
else {
CurrentGlass += TruckLoad
}
println("[Test_WasteService] Load accepted ($TruckLoad KG of $Type).")
){println(" OK")
answer("storerequest", "loadaccepted", "loadaccepted(_)" )
}
else
{println("[Test_WasteService] Load rejected")
{println(" NO")
answer("storerequest", "loadrejected", "loadaccepted(_)" )
}
println("[Test_WasteService] State:")
println(" Plastic: ${CurrentPlastic}/ ${wasteservice.Constants.MAXPB} KG, Glass: ${CurrentGlass} / ${wasteservice.Constants.MAXPB} KG")
}
delay(1000)
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
var CurrentGlass = 0.0f
println("$name in ${currentState.stateName} | $currentMsg")
println("[WasteService] Reset:")
println(" Plastic: $CurrentPlastic / ${wasteservice.Constants.MAXPB} KG")
println(" Glass: $CurrentGlass / ${wasteservice.Constants.MAXGB} KG")
println(" Plastic: $CurrentPlastic")
println(" Glass: $CurrentGlass")
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand All @@ -39,7 +39,6 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
}
state("state_idle") { //this:State
action { //it:State
println("[WasteService] Idle...")
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand All @@ -60,24 +59,15 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
// enough space
(Type == wasteservice.WasteType.PLASTIC && CurrentPlastic + TruckLoad <= wasteservice.Constants.MAXPB) ||
(Type == wasteservice.WasteType.GLASS && CurrentGlass + TruckLoad <= wasteservice.Constants.MAXGB)
){
if (Type == wasteservice.WasteType.PLASTIC) {
CurrentPlastic += TruckLoad
}
else {
CurrentGlass += TruckLoad
}
answer("storerequest", "loadaccepted", "loadaccepted(_)" )
){answer("storerequest", "loadaccepted", "loadaccepted(_)" )
forward("doDeposit", "doDeposit(TYPE,WEIGHT)" ,"transporttrolley" )
delay(1000)
}
else
{answer("storerequest", "loadrejected", "loadaccepted(_)" )
}
forward("updategui", "updategui(_)" ,"wasteservicestatusgui" )
println(" Plastic: $CurrentPlastic / ${wasteservice.Constants.MAXPB} KG")
println(" Glass: $CurrentGlass / ${wasteservice.Constants.MAXGB} KG")
}
delay(1000)
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand All @@ -87,15 +77,12 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
}
state("state_handle_distance") { //this:State
action { //it:State
if( checkMsgContent( Term.createTerm("distance(V)"), Term.createTerm("distance(V)"),
currentMsg.msgContent()) ) { //set msgArgList
if( payloadArg(0).toFloat() >= wasteservice.Constants.DLIMT
){forward("stop", "stop(_)" ,"transporttrolley" )
}
else
{forward("resume", "resume(_)" ,"transporttrolley" )
}
if( payloadArg(0).toFloat() >= wasteservice.Constants.DLIMT
){forward("stop", "stop(_)" ,"transporttrolley" )
}
else
{forward("resume", "resume(_)" ,"transporttrolley" )
}
//genTimer( actor, state )
}
//After Lenzi Aug2002
Expand Down

0 comments on commit 9fa753f

Please sign in to comment.