Skip to content

Instantly share code, notes, and snippets.

import math
import copy
import time
import random
import threading
import matplotlib
import numpy as np
from envHandler import Env
import torch
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
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