code
stringlengths
3
1.18M
language
stringclasses
1 value
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
/* Copyright 2010 Cesar Valiente Gordo This file is part of QuiteSleep. QuiteSleep is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
Java
package controller; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.HashMap; import java.util...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.math.BigDecimal; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persi...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.p...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persis...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Enti...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.p...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.p...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.jpa_query.nbp.core; import java.io.Serializable; import java.math.BigDecimal; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persi...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.chl.tdaniel.ria; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; i...
Java
package com.example.ayelet; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import com.example.ayelet.Imagelabels.ImageAndLabel; import com.example.ayelet.Imagelabel...
Java
package com.example.ayelet; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.Toast; import com.example.ayelet.Imagelabels.ImageAndLabels; import com.google.protobuf.InvalidProt...
Java
package com.ayelet.learnenglish; import android.net.Uri; public class ImageAndLabel { private Uri ImageUri; private String Label; public Uri getImageUri() { return ImageUri; } public void setImageUri(Uri imageUri) { ImageUri = imageUri; } public String getLabel() { return Label; } public void set...
Java
package com.ayelet.learnenglish; import java.util.ArrayList; import android.support.v7.app.ActionBarActivity; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; public class LearnEnglish extends ActionB...
Java
package com.example.testtts; import java.util.Locale; import android.content.Context; import android.speech.tts.TextToSpeech; import android.util.Log; public class Text2Speech implements TextToSpeech.OnInitListener { private TextToSpeech tts; public Text2Speech(Context context) { tts = new TextToS...
Java
package com.example.testtts; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; public class MainActivity extends Activity { Text2Speech tts; @Override protected void onCreate(Bundle savedInstanceState) { super.on...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package haxemultiplayer; /** * * @author carlos */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application log...
Java
package finder; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.HashMap; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * InventProducts.java * * Created on 2009-12-18, 15:54:32 */ /** * * @author Stan */ public class InventProducts extends javax.swing.JFrame { /** Creates new form InventProducts */ public InventProdu...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * NewJFrame.java * * Created on 2009-12-17, 16:20:22 */ /** * * @author Stan */ public class NewJFrame extends javax.swing.JFrame { /** Creates new form NewJFrame */ public NewJFrame() { init...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Inventories.java * * Created on 2009-12-18, 15:45:12 */ /** * * @author Stan */ public class Inventories extends javax.swing.JFrame { /** Creates new form Inventories */ public Inventories() { ...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Products.java * * Created on 2009-12-18, 15:29:09 */ /** * * @author Stan */ public class Products extends javax.swing.JFrame { /** Creates new form Products */ public Products() { initComp...
Java
package lobster.games.studios; import levels.Level1; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Main extends Activity { /** Call...
Java
package lobster.games.studios; import lobster.games.studios.ImageAdapter; import android.app.Activity; import android.content.res.Resources; import android.os.Bundle; import android.widget.GridView; public class LevelSelect extends Activity{ GridView gridView; static int[] levels; @Override public...
Java
package lobster.games.studios; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import ...
Java
package lobster.games.studios; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.MotionEvent; public class Splash extends Activity { //how long until we go to the next activity ...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level7 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset_y...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level10 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset_...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level8 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset_y...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level9 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset_y...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.WindowManager.LayoutParams; public class Level4 extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.le...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level6 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset_y...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level3 extends Activity{ private View selected_item = null; private int offset_x = 0; private int offset...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.view....
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager.LayoutParams; import android.widget.Button; import android.widget.ImageVi...
Java
package lobster.games.studios; import levels.Level1; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Main extends Activity { /** Called ...
Java
package lobster.games.studios; import lobster.games.studios.ImageAdapter; import android.app.Activity; import android.content.res.Resources; import android.os.Bundle; import android.widget.GridView; public class LevelSelect extends Activity { GridView gridView; static int[] levels; @Override publi...
Java
package lobster.games.studios; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import ...
Java
package lobster.games.studios; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.MotionEvent; public class Splash extends Activity { // how long until we go to the next activity...
Java
package levels; import java.util.ArrayList; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; import android.widget.Button; import android.widget.ImageView; public class Level7 extends Activity ...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level10 extends Activity { private View selected_item = null; private int offset_x = 0; private int offset_y = 0...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level8 extends Activity { private View selected_item = null; private int offset_x = 0; private int offset_y = 0;...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level9 extends Activity { private View selected_item = null; private int offset_x = 0; private int offset_y = 0;...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.WindowManager.LayoutParams; public class Level4 extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.l...
Java
package levels; import java.util.ArrayList; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParam...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager.LayoutParams; public class Level3 extends Activity { private View selected_item = null; private int offset_x = 0; private int offset_y = 0;...
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.view....
Java
package levels; import lobster.games.studios.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager.LayoutParams; import android.widget.Button; import android.widget.ImageVi...
Java
package som.util; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.cfg.Configuration; /** * fdfg * Configures and provides access to Hibernate sessions, tied to the * current thread of execution. Follows the Thread Local Session * pattern, see {@link http://hibernate.or...
Java
package com.jboa.model; import java.util.HashSet; import java.util.Set; /** * Department entity. @author MyEclipse Persistence Tools */ public class Department implements java.io.Serializable { // Fields private String id; private String name; private Set profiles = new HashSet(0); private Set tusers = new ...
Java
package com.jboa.model; import java.util.HashSet; import java.util.Set; /** * Job entity. @author MyEclipse Persistence Tools */ public class Job implements java.io.Serializable { // Fields private String id; private String name; private String tdesc; private Set profiles = new HashSet(0); private Set tuse...
Java
package com.jboa.model; /** * Authority entity. @author MyEclipse Persistence Tools */ public class Authority implements java.io.Serializable { // Fields private String id; private Tmenu tmenu; private Trole trole; // Constructors /** default constructor */ public Authority() { } /** minimal construct...
Java
package com.jboa.model; import java.util.HashSet; import java.util.Set; /** * Tmenu entity. @author MyEclipse Persistence Tools */ public class Tmenu implements java.io.Serializable { // Fields private String id; private Tmenu tmenu; private String text; private String url; private String icon; private Se...
Java
package com.jboa.model; import java.util.HashSet; import java.util.Set; /** * Trole entity. @author MyEclipse Persistence Tools */ public class Trole implements java.io.Serializable { // Fields private String id; private String name; private String tdesc; private Set tusers = new HashSet(0); private Set au...
Java
package com.jboa.model; import java.util.HashSet; import java.util.Set; /** * Tuser entity. @author MyEclipse Persistence Tools */ public class Tuser implements java.io.Serializable { // Fields private String id; private Trole trole; private Department department; private Job job; private String username; ...
Java
package com.jboa.model; import java.math.BigDecimal; import java.util.Date; /** * Profile entity. @author MyEclipse Persistence Tools */ public class Profile implements java.io.Serializable { // Fields private String profileid; private Department department; private Tuser tuser; private Job job; private St...
Java
package constants; import client.Command; public class Constants { public static enum Color{ blue, red, green, cyan, magenta, orange, pink, yellow } // Order of enum important for determining opposites public static enum dir { N, W, E, S }; public static dir oppositeDir(dir d){ if(d== d...
Java
package client; import java.util.LinkedList; import constants.Constants.*; public class Command { static { LinkedList< Command > cmds = new LinkedList< Command >(); for ( dir d : dir.values() ) { cmds.add( new Command( d ) ); } for ( dir d1 : dir.values() ) { for ( dir d2 : dir.values() ) { if (...
Java
package client; public enum Action { MoveEast, MoveWest, MoveNorth, MoveSouth, PushNW, PushW, PushSW, PushS, PushSE, PushE, PushNE, PushN, PullNW, PullW, PullSW, PullS, PullSE, PullE, PullNE, PullN, NoOp }
Java
package client.planners; import java.util.ArrayList; import java.util.Collection; import java.util.Random; import agent.objectives.DockABox; import agent.objectives.GoalABox; import agent.objectives.Objective; import agent.planners.AgentPlanner; import agent.planners.AgentProgressionPlanner; import utils...
Java
package client.planners; public interface Planner { public String getName(); public void makePlan(); }
Java
package client; import LevelObjects.Agent; import LevelObjects.Box; import LevelObjects.Goal; public class Desire { public Agent agent; public Box box; public Goal goal; boolean completed; public Desire(Agent a, Box b) { this.agent = a; this.box = b; } public Desire(Agent a, Box b, Goal g) { this.a...
Java
package client; import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReade...
Java
package client; import java.util.Arrays; import java.util.Scanner; public class Output { private static Scanner scan = new Scanner(System.in); /*public Output() { scan = new Scanner(System.in); }*/ public static boolean[] Send(Command[] commands) { // System.err.println("Sending: [" + Arr...
Java
package client; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Map; import constants.Constants.Color; import constants.Constants.dir; import ...
Java
package client.clients; import java.io.IOException; import constants.Constants; import constants.Constants.dir; import utils.Communication; import utils.Timer; import LevelObjects.Agent; import LevelObjects.Box; import LevelObjects.Field; import LevelObjects.Level; import client.Command; import clien...
Java
package client.clients; import java.io.*; import java.util.*; import client.Command; public class RandomWalkClient { private static Random rand = new Random(); public class Agent { // We don't actually use these for Randomly Walking Around private char id; private String color; Agent( char id, String col...
Java
package datastructures; import java.util.ArrayList; import java.util.List; import client.Command; import LevelObjects.Box; import LevelObjects.Field; public class MoveActionSequence extends ActionSequence { private Field startField; private Field endField; public List<Box> boxesInTheWay; ...
Java
package datastructures; import LevelObjects.Field; public class MoveBoxActionSequence extends ActionSequence { private Field agentLocation; private Field boxLocation; private Field targetLocation; public Field getAgentLocation() { return agentLocation; } public void setAgentLocation(Field agen...
Java
package datastructures; import LevelObjects.Field; public class GoalActionSequence extends ActionSequence { private Field agentStartLocation; private Field agentEndField; private Field boxStartLocation; private Field boxEndLocation; public Field getBoxStartLocation() { return boxStartLocatio...
Java
package datastructures; public class FieldBlockedChange { public int time; public boolean changeToBlocked; public FieldBlockedChange(int time, boolean c){ this.time = time; this.changeToBlocked = c; } }
Java
package datastructures; import java.util.ArrayList; import LevelObjects.Field; public class FieldInState extends ObjectInState { public ArrayList<FieldBlockedChange> blockedTimeChangeIndexes; public FieldInState(Field f) { super(); this.f = f; blockedTimeChangeIndexes = new ArrayList<FieldBlockedChange>();...
Java
package datastructures; import java.util.ArrayList; import LevelObjects.Field; import client.Command; public abstract class ActionSequence { private ActionSequence parent; public ArrayList<Field> fields; public ActionSequence getParent() { return parent; } public void setParent(ActionSequ...
Java
package datastructures; import LevelObjects.Agent; import LevelObjects.Field; public class AgentInState extends ObjectInState { public Agent a; public AgentInState(Agent a, Field f) { super(); this.a = a; this.f = f; } }
Java
package datastructures; import java.util.ArrayList; import client.Command; public class State implements Comparable<State> { public int g; public int f; public ArrayList<AgentInState> agents; public ArrayList<BoxInState> boxes; public ArrayList<FieldInState> fields; public State parent; public ArrayList<C...
Java
package datastructures; import LevelObjects.Box; import LevelObjects.Field; public class BoxInState extends ObjectInState { public Box b; public BoxInState(Box b, Field f) { super(); this.b = b; this.f = f; } }
Java
package datastructures; import LevelObjects.Field; public abstract class ObjectInState implements Comparable<ObjectInState> { public Field f; @Override public int compareTo(ObjectInState o) { if (this.f.x != o.f.y) { return this.f.x-o.f.x; } else{ return this.f.y-o.f.y; } } }
Java
package datastructures; import java.util.ArrayList; import LevelObjects.*; public class BoxCost { public Box box; public int cost; public ArrayList<GoalCost> goalCosts; public BoxCost() { goalCosts = new ArrayList<GoalCost>(); } }
Java
package datastructures; import LevelObjects.Field; public class StateGoal { public Field agentToPos; public Field boxToPos; public BoxInState box; public AgentInState agent; public boolean isMoveToBoxGoal; public boolean isClearPathGoal; public int nextGoalIndex; }
Java
package datastructures; import LevelObjects.Field; import client.Command; public class GoalSequenceNode implements Comparable<GoalSequenceNode> { public GoalSequenceNode parent; public Field boxLocation; public Field agentLocation; public Command action; public int timeStep; public int f; public int g; pub...
Java
package datastructures; import LevelObjects.*; public class GoalCost { public GoalCost(Goal goal, int cost) { this.cost = cost; this.goal = goal; } public Goal goal; public int cost; }
Java
package utils; public class Timer { private long _time; public volatile long time; public Timer() { time = 0; _time = System.currentTimeMillis(); } public void takeTime() { time = 0; _time = System.currentTimeMillis(); } public long stop() { time = System.currentTimeMillis()...
Java
package utils; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Queue; import LevelObjects.Field; public class BFS { public enum NodeColour { WHITE, GRAY, BLACK } private static class Node ...
Java
package utils; import java.util.ArrayList; import java.util.List; import LevelObjects.Agent; import LevelObjects.Box; import LevelObjects.Field; import LevelObjects.Goal; import LevelObjects.Level; public class GoalPriority { /** * Goal prioritization. Checks to see for every goal, how many boxes ...
Java
package utils; import constants.Constants.dir; import LevelObjects.Field; import client.Command; public class AStarField implements Comparable<AStarField> { public Field field; public int g; public int f; public int h; public Command c; public int timeStep; public AStarField(Field field...
Java
package utils; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.PriorityQueue; import java.util.Set; import constants.C...
Java
package utils; import java.util.ArrayList; import LevelObjects.Agent; import LevelObjects.Box; import LevelObjects.Field; import LevelObjects.Level; public class Communication { /** * find agent to move a given box that might be in the way for another agent * @param box * @param level * @retur...
Java
package utils; import java.util.ArrayList; import java.util.Collection; import java.util.List; import constants.Constants.dir; import LevelObjects.Agent; import LevelObjects.Box; import LevelObjects.Field; import LevelObjects.Level; import client.Command; import datastructures.ActionSequence; import da...
Java
package LevelObjects; import constants.Constants.Color; public class Box implements Comparable<Box> { private char id; // stored as lowercase so we can easily compare with goals private Color color; private Field atField; public Box(char id, Color color, Field atField) { this.id = Character.toLowerCase(id...
Java
package LevelObjects; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.Queue; import java.util.Random; import agent.objectives.*; import agent.planners.AgentPlanner; import utils.Communication; import utils.Moves; import utils.Utils; im...
Java
package LevelObjects; import java.util.ArrayList; public class Level { public ArrayList<Agent> agents = new ArrayList<Agent>(); public ArrayList<Box> boxes = new ArrayList<Box>(); public ArrayList<Field> fields = new ArrayList<Field>(); public ArrayList<Goal> goals = new ArrayList<Goal>(); public Field[][] fiel...
Java
package LevelObjects; import java.util.Comparator; import constants.Constants.dir; public class Field implements Comparator<Field> { // Order of directions. /*public static enum dir { N, W, E, S };*/ // Example: neighbours[Constants.Constants.dir.N] public Field[] neighbours = new Field[4]; public int...
Java
package LevelObjects; import java.util.ArrayList; public class Conflict { private Agent helpAgent; private Object obstacle; private Box moveaBox; private int priority; public ArrayList<Field> avoidFields = new ArrayList<Field>(); public Conflict(Agent helpAgent, ArrayList<Field> avoidFields, Object...
Java
package LevelObjects; public class Goal extends Field implements Comparable<Goal> { private char id; public int priority; public char getId() { return id; } public int getPriority() { return priority; } public void setPriority(int priority){ this.priority = priority; } public Goal(char id, i...
Java