# Path: spriteworld/factor_distributions.py
# _MAX_TRIES = int(1e5)
# class AbstractDistribution(object):
# class Continuous(AbstractDistribution):
# class Discrete(AbstractDistribution):
# class Mixture(AbstractDistribution):
# class Intersection(AbstractDistribution):
# class Product(AbstractDistribution):
# class SetMinus(AbstractDistribution):
# class Selection(AbstractDistribution):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def __str__(self):
#   def _get_rng(self, rng=None):
#   def keys(self):
#   def __init__(self, key, minval, maxval, dtype='float32'):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, key, candidates, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, index_for_sampling=0):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, hold_out):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, filtering):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
# 
# Path: spriteworld/sprite_generators.py
# def generate_sprites(factor_dist, num_sprites=1):
#   def _generate():
# def chain_generators(*sprite_generators):
#   def _generate():
# def sample_generator(sprite_generators, p=None):
#   def _generate():
# def shuffle(sprite_generator):
#   def _generate():
# 
# Path: spriteworld/tasks.py
# class AbstractTask(object):
# class NoReward(AbstractTask):
# class FindGoalPosition(AbstractTask):
# class Clustering(AbstractTask):
# class MetaAggregated(AbstractTask):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self):
#   def reward(self, unused_sprites):
#   def success(self, unused_sprites):
#   def __init__(self,
#                filter_distrib=None,
#                goal_position=(0.5, 0.5),
#                terminate_distance=0.05,
#                terminate_bonus=0.0,
#                weights_dimensions=(1, 1),
#                sparse_reward=False,
#                raw_reward_multiplier=50):
#   def _single_sprite_reward(self, sprite):
#   def _filtered_sprites_rewards(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                cluster_distribs,
#                termination_threshold=2.5,
#                terminate_bonus=0.0,
#                sparse_reward=False,
#                reward_range=10):
#   def _cluster_assignments(self, sprites):
#   def _compute_clustering_metric(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                subtasks,
#                reward_aggregator='sum',
#                termination_criterion='all',
#                terminate_bonus=0.0):
#   def reward(self, sprites):
#   def success(self, sprites):
#   REWARD_AGGREGATOR = {
#       'sum': np.nansum,
#       'max': np.nanmax,
#       'min': np.nanmin,
#       'mean': np.nanmean
#   }
#   TERMINATION_CRITERION = {'all': np.all, 'any': np.any}
# 
# Path: spriteworld/configs/cobra/common.py
# def action_space():
# def renderers():


import os
from spriteworld import factor_distributions as distribs
from spriteworld import sprite_generators
from spriteworld import tasks
from spriteworld.configs.cobra import common
there is one target, while in test mode there are two. All target sprites must
be brought to the goal location, which is the center of the arena.  There are
always two distractor sprites, which are blue-purple-ish color and do not
contribute to the reward.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


TERMINATE_DISTANCE = 0.075
NUM_DISTRACTORS = 2
MODES_NUM_TARGETS = {
    'train': 1,
    'test': 2,
}


def get_config(mode='train'):
  """Generate environment config.

  Args:
    mode: 'train' or 'test'.

  Returns:
    config: Dictionary defining task/environment configuration. Can be fed as
      kwargs to environment.Environment.
  """


# Path: spriteworld/factor_distributions.py
# _MAX_TRIES = int(1e5)
# class AbstractDistribution(object):
# class Continuous(AbstractDistribution):
# class Discrete(AbstractDistribution):
# class Mixture(AbstractDistribution):
# class Intersection(AbstractDistribution):
# class Product(AbstractDistribution):
# class SetMinus(AbstractDistribution):
# class Selection(AbstractDistribution):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def __str__(self):
#   def _get_rng(self, rng=None):
#   def keys(self):
#   def __init__(self, key, minval, maxval, dtype='float32'):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, key, candidates, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, probs=None):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components, index_for_sampling=0):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, components):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, hold_out):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
#   def __init__(self, base, filtering):
#   def sample(self, rng=None):
#   def contains(self, spec):
#   def to_str(self, indent):
#   def keys(self):
# 
# Path: spriteworld/sprite_generators.py
# def generate_sprites(factor_dist, num_sprites=1):
#   def _generate():
# def chain_generators(*sprite_generators):
#   def _generate():
# def sample_generator(sprite_generators, p=None):
#   def _generate():
# def shuffle(sprite_generator):
#   def _generate():
# 
# Path: spriteworld/tasks.py
# class AbstractTask(object):
# class NoReward(AbstractTask):
# class FindGoalPosition(AbstractTask):
# class Clustering(AbstractTask):
# class MetaAggregated(AbstractTask):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self):
#   def reward(self, unused_sprites):
#   def success(self, unused_sprites):
#   def __init__(self,
#                filter_distrib=None,
#                goal_position=(0.5, 0.5),
#                terminate_distance=0.05,
#                terminate_bonus=0.0,
#                weights_dimensions=(1, 1),
#                sparse_reward=False,
#                raw_reward_multiplier=50):
#   def _single_sprite_reward(self, sprite):
#   def _filtered_sprites_rewards(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                cluster_distribs,
#                termination_threshold=2.5,
#                terminate_bonus=0.0,
#                sparse_reward=False,
#                reward_range=10):
#   def _cluster_assignments(self, sprites):
#   def _compute_clustering_metric(self, sprites):
#   def reward(self, sprites):
#   def success(self, sprites):
#   def __init__(self,
#                subtasks,
#                reward_aggregator='sum',
#                termination_criterion='all',
#                terminate_bonus=0.0):
#   def reward(self, sprites):
#   def success(self, sprites):
#   REWARD_AGGREGATOR = {
#       'sum': np.nansum,
#       'max': np.nanmax,
#       'min': np.nanmin,
#       'mean': np.nanmean
#   }
#   TERMINATION_CRITERION = {'all': np.all, 'any': np.any}
# 
# Path: spriteworld/configs/cobra/common.py
# def action_space():
# def renderers():


# Path: spriteworld/configs/cobra/goal_finding_more_targets.py
import os
from spriteworld import factor_distributions as distribs
from spriteworld import sprite_generators
from spriteworld import tasks
from spriteworld.configs.cobra import common

there is one target, while in test mode there are two. All target sprites must
be brought to the goal location, which is the center of the arena.  There are
always two distractor sprites, which are blue-purple-ish color and do not
contribute to the reward.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


TERMINATE_DISTANCE = 0.075
NUM_DISTRACTORS = 2
MODES_NUM_TARGETS = {
    'train': 1,
    'test': 2,
}


def get_config(mode='train'):
  """Generate environment config.

  Args:
    mode: 'train' or 'test'.

  Returns:
    config: Dictionary defining task/environment configuration. Can be fed as
      kwargs to environment.Environment.
  """


  shared_factors = distribs.Product([