Last change
on this file since 263 was 253, checked in by Faria Nassiri Mofakham, 5 years ago |
Commit #1 of:
+ negotiator.onetomany package refactored into onetomany package.
+ info created for all contained the packages.
+ current work defined under onetomany.bargainingchipsgame.
+ in this package, onetomany.bargainingchipsgame.players package includes packages for utility function, coordinator, negotiatior, and buyer and seller.
+ negotiator.onetomany package now contains nothing, can be deleted.
+ Interaction thread
|
File size:
1.5 KB
|
Rev | Line | |
---|
[244] | 1 | /**
|
---|
| 2 | * Action class
|
---|
| 3 | */
|
---|
| 4 | package onetomany.bargainingchipsgame.interactions;
|
---|
| 5 |
|
---|
| 6 | import onetomany.bargainingchipsgame.players.Agent;
|
---|
| 7 |
|
---|
| 8 | /**
|
---|
| 9 | * Offers are being exchanged in the forms of actions.
|
---|
| 10 | * Each action contains the offer as well as sender and receiver agents, and the sequence number of the action in the thread.
|
---|
| 11 | *
|
---|
| 12 | *
|
---|
| 13 | * @author Faria Nassiri-Mofakham
|
---|
| 14 | *
|
---|
| 15 | */
|
---|
| 16 | public class Action
|
---|
| 17 | {
|
---|
| 18 | private Offer offer;
|
---|
| 19 | private Agent sender;
|
---|
| 20 | private Agent receiver;
|
---|
| 21 | private long sequence;
|
---|
| 22 |
|
---|
[253] | 23 |
|
---|
| 24 | @Override
|
---|
| 25 | public String toString()
|
---|
| 26 | {
|
---|
| 27 | return " Action "+this.getSequence()+"\n from "+this.getSender()+"\n to \n"+this.getReceiver()+"\n by offering \n "+this.getOffer();
|
---|
| 28 | }
|
---|
[244] | 29 |
|
---|
| 30 | /**
|
---|
| 31 | * @return the sequence
|
---|
| 32 | */
|
---|
| 33 | public long getSequence() {
|
---|
| 34 | return sequence;
|
---|
| 35 | }
|
---|
| 36 | /**
|
---|
| 37 | * @param sequence the sequence to set
|
---|
| 38 | */
|
---|
| 39 | public void setSequence(long sequence) {
|
---|
| 40 | this.sequence = sequence;
|
---|
| 41 | }
|
---|
| 42 | /**
|
---|
| 43 | * @return the offer
|
---|
| 44 | */
|
---|
| 45 | public Offer getOffer() {
|
---|
| 46 | return offer;
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * @param offer the offer to set
|
---|
| 50 | */
|
---|
| 51 | public void setOffer(Offer offer) {
|
---|
| 52 | this.offer = offer;
|
---|
| 53 | }
|
---|
| 54 | /**
|
---|
| 55 | * @return the sender
|
---|
| 56 | */
|
---|
| 57 | public Agent getSender() {
|
---|
| 58 | return sender;
|
---|
| 59 | }
|
---|
| 60 | /**
|
---|
| 61 | * @param sender the sender to set
|
---|
| 62 | */
|
---|
| 63 | public void setSender(Agent sender) {
|
---|
| 64 | this.sender = sender;
|
---|
| 65 | }
|
---|
| 66 | /**
|
---|
| 67 | * @return the receiver
|
---|
| 68 | */
|
---|
| 69 | public Agent getReceiver() {
|
---|
| 70 | return receiver;
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * @param receiver the receiver to set
|
---|
| 74 | */
|
---|
| 75 | public void setReceiver(Agent receiver) {
|
---|
| 76 | this.receiver = receiver;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.