Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
autumn_rrs
autumn_agent_2023
Commits
49f2daeb
Commit
49f2daeb
authored
Nov 03, 2023
by
K20014
Browse files
進捗の保存
parent
b17b090b
Changes
3
Hide whitespace changes
Inline
Side-by-side
config/module.cfg
View file @
49f2daeb
...
...
@@ -105,5 +105,7 @@ DefaultTacticsFireBrigade.Search : autumn_2023.module.complex.AuctionFBSearch
DefaultTacticsFireBrigade.CommandExecutorFire : autumn_2023.centralized.AuctionCommandExecutorFire
DefaultTacticsFireStation.TargetAllocator : autumn_2023.module.complex.AuctionFireTargetAllocator
DefaultTacticsFireStation.CommandPicker : autumn_2023.centralized.AuctionCommandPickerFire
MessageManager.PlatoonMessageCoordinator : autumn_2023.module.comm.DefaultMessageCoordinator
MessageManager.CenterMessageCoordinator : autumn_2023.module.comm.DefaultMessageCoordinator
\ No newline at end of file
MessageManager.PlatoonMessageCoordinator : autumn_2023.module.comm.AuctionMessageCoordinator
MessageManager.CenterMessageCoordinator : autumn_2023.module.comm.AuctionMessageCoordinator
MessageManager.PlatoonChannelSubscriber : autumn_2023.module.comm.AuctionChannelSubscriber
MessageManager.CenterChannelSubscriber : autumn_2023.module.comm.AuctionChannelSubscriber
\ No newline at end of file
src/main/java/autumn_2023/centralized/AuctionCommandExecutorFire.java
View file @
49f2daeb
...
...
@@ -3,6 +3,7 @@ package autumn_2023.centralized;
import
adf.core.agent.action.common.ActionMove
;
import
adf.core.agent.action.common.ActionRest
;
import
adf.core.agent.communication.MessageManager
;
import
adf.core.agent.communication.standard.bundle.StandardMessageBundle
;
import
adf.core.agent.communication.standard.bundle.centralized.CommandFire
;
import
adf.core.agent.communication.standard.bundle.information.MessageCivilian
;
import
adf.core.agent.develop.DevelopData
;
...
...
@@ -91,6 +92,11 @@ public class AuctionCommandExecutorFire extends CommandExecutor<CommandFire> {
.
filter
(
e
->
!
this
.
bidCentreCivilians
.
contains
(
e
))
.
collect
(
Collectors
.
toSet
());
if
(
this
.
agentInfo
.
getTime
()
==
1
)
{
final
var
index
=
new
StandardMessageBundle
().
getMessageClassList
().
size
()
+
1
;
messageManager
.
registerMessageClass
(
index
,
MessageCost
.
class
);
}
// 新規メッセージクラスを用いてタスク実行時のコストを救急司令所に送信
if
(
this
.
commandType
==
-
1
)
{
...
...
src/main/java/autumn_2023/module/complex/AuctionFireTargetAllocator.java
View file @
49f2daeb
...
...
@@ -2,6 +2,7 @@ package autumn_2023.module.complex;
import
adf.core.agent.communication.MessageManager
;
import
adf.core.agent.communication.standard.bundle.MessageUtil
;
import
adf.core.agent.communication.standard.bundle.StandardMessageBundle
;
import
adf.core.agent.communication.standard.bundle.information.MessageCivilian
;
import
adf.core.agent.develop.DevelopData
;
import
adf.core.agent.info.AgentInfo
;
...
...
@@ -111,6 +112,10 @@ public class AuctionFireTargetAllocator extends FireTargetAllocator{
public
FireTargetAllocator
updateInfo
(
MessageManager
messageManager
)
{
super
.
updateInfo
(
messageManager
);
if
(
this
.
agentInfo
.
getTime
()
==
1
)
{
final
var
index
=
new
StandardMessageBundle
().
getMessageClassList
().
size
()
+
1
;
messageManager
.
registerMessageClass
(
index
,
MessageCost
.
class
);
}
// 受信処理
// そのステップで受信した(前ステップで送信された)メッセージ一覧
...
...
@@ -131,6 +136,7 @@ public class AuctionFireTargetAllocator extends FireTargetAllocator{
||
!
this
.
finishreceivedCivilians
.
contains
(
mesCiv
.
getAgentID
()))
{
this
.
receivedAgentCivilians
.
add
(
mesCiv
.
getAgentID
());
System
.
out
.
println
(
"receivedAgentCivilians = "
+
mesCiv
.
getAgentID
());
}
}
}
...
...
@@ -141,6 +147,7 @@ public class AuctionFireTargetAllocator extends FireTargetAllocator{
if
(
this
.
worldInfo
.
getEntity
(
mesCos
.
getSenderID
())
instanceof
FireBrigade
)
{
this
.
rescueCosts
.
add
(
mesCos
);
System
.
out
.
println
(
"rescueCosts = "
+
mesCos
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment