This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def askAdvice(self, state): | |
global msgGive, msgAsk | |
msgGive[self.agentNumber] = [] | |
for i in range(numAgents): | |
msgAsk[i][self.agentNumber] = state | |
while True: | |
self.giveAdvice() | |
if len(msgGive[self.agentNumber]) == numAgents - 1: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import argparse | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torchvision import datasets, transforms | |
from torch.autograd import Variable | |
import threading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import copy | |
import time | |
import random | |
import threading | |
import matplotlib | |
import numpy as np | |
from envHandler import Env | |
import torch |