Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyAmak - noyau
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMAC
AMAK
Python
PyAMAK
pyAmak - noyau
Commits
b5fbfa58
Commit
b5fbfa58
authored
4 years ago
by
shinedday
Browse files
Options
Downloads
Patches
Plain Diff
Mail now have sending date
parent
850479ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyAmakCore/classes/communicating_agent.py
+9
-2
9 additions, 2 deletions
pyAmakCore/classes/communicating_agent.py
pyAmakCore/tests/test_communicating_agent/test_mail.py
+4
-3
4 additions, 3 deletions
pyAmakCore/tests/test_communicating_agent/test_mail.py
with
13 additions
and
5 deletions
pyAmakCore/classes/communicating_agent.py
+
9
−
2
View file @
b5fbfa58
...
...
@@ -17,10 +17,11 @@ class Mail:
Class message
"""
def
__init__
(
self
,
id_sender
:
int
,
id_receiver
:
int
,
message
:
Any
)
->
None
:
def
__init__
(
self
,
id_sender
:
int
,
id_receiver
:
int
,
message
:
Any
,
sending_date
:
int
)
->
None
:
self
.
__id_sender
=
id_sender
self
.
__id_receiver
=
id_receiver
self
.
__message
=
message
self
.
__sending_date
=
sending_date
def
get_id_sender
(
self
):
"""
...
...
@@ -40,6 +41,12 @@ class Mail:
"""
return
self
.
__message
def
get_sending_date
(
self
):
"""
return sending_date
"""
return
self
.
__sending_date
class
Mailbox
:
"""
...
...
@@ -72,7 +79,7 @@ class Mailbox:
"""
this method is called to send a message
"""
mail
=
Mail
(
self
.
__owner_id
,
id_receiver
,
message
)
mail
=
Mail
(
self
.
__owner_id
,
id_receiver
,
message
,
self
.
__amas
.
get_cycle
()
)
for
agent
in
self
.
__amas
.
get_agents
():
if
agent
.
get_id
()
==
id_receiver
:
...
...
This diff is collapsed.
Click to expand it.
pyAmakCore/tests/test_communicating_agent/test_mail.py
+
4
−
3
View file @
b5fbfa58
...
...
@@ -15,17 +15,18 @@ class TestMail(TestCase):
"""
Test mail init
"""
mail
=
Mail
(
1
,
5
,
None
)
mail
=
Mail
(
1
,
5
,
None
,
0
)
self
.
assertEqual
(
mail
.
get_id_sender
(),
1
)
self
.
assertEqual
(
mail
.
get_id_receiver
(),
5
)
self
.
assertEqual
(
mail
.
get_message
(),
None
)
self
.
assertEqual
(
mail
.
get_sending_date
(),
0
)
mail
=
Mail
(
255
,
0
,
"
test
"
)
mail
=
Mail
(
255
,
0
,
"
test
"
,
12
)
self
.
assertEqual
(
mail
.
get_id_sender
(),
255
)
self
.
assertEqual
(
mail
.
get_id_receiver
(),
0
)
self
.
assertEqual
(
mail
.
get_message
(),
"
test
"
)
self
.
assertEqual
(
mail
.
get_sending_date
(),
12
)
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment