text stringlengths 3 1.18M |
|---|
package Observers;
import tadp.tp.domain.Persona;
import tadp.tp.domain.Reunion;
import tadp.tp.domain.excepciones.PocoPorcentajeDeAsistenciaException;
public class CanceladorPorPorcentaje implements Observador{
private Double porcentaje;
public CanceladorPorPorcentaje(Double unPorcentaje) {
this.setP... |
package Observers;
import tadp.tp.domain.Persona;
import tadp.tp.domain.Reunion;
import tadp.tp.domain.excepciones.RecursobligatorioDadoDeBajaException;
public class CancelarPorRecursoObligatorio implements Observador {
@Override
public void realizarAccion(Reunion reunion, Persona persona) {
if(person... |
package Observers;
import tadp.tp.domain.Fecha;
import tadp.tp.domain.Persona;
import tadp.tp.domain.Reunion;
public class Replanificador implements Observador {
private Fecha fecha;
@Override
public void realizarAccion(Reunion reunion, Persona persona) {
reunion.replanificar(this.getFecha());
}
... |
package Observers;
import tadp.tp.domain.HomePersonas;
import tadp.tp.domain.OrganizadorDeReuniones;
import tadp.tp.domain.Persona;
import tadp.tp.domain.Reunion;
import tadp.tp.domain.condiciones.QueryBuilder;
public class CriterioAsociadoDeSeleccion implements Observador {
private String otroCriterio;
... |
package tadp.tp.domain;
public interface Reservable {
public Agenda getAgenda();
public Boolean perteneceAlHorarioLaboral(String horarioInicial,String horarioFinal);
}
|
package tadp.tp.domain;
import java.util.ArrayList;
import java.util.List;
import cantidadReuniones.*;
import accionesPosteriores.AccionDeUsuario;
public final class HomePersonas {
private List<Persona> personas = new ArrayList<Persona>();
private static final HomePersonas INSTANCE = new HomePersonas();... |
package tadp.tp.domain;
public class Fecha {
private int dia;
private int mes;
public Fecha (int dia, int mes){
this.setDia(dia);
this.setMes(mes);
}
public boolean fechaPerteneceAlLimite(Fecha fechaR, int limite){
int distanciaMeses = fechaR.getMes() - this.getMes();
int distanciaEnDias ... |
package tadp.tp.domain;
public class Sala implements Reservable {
private Agenda agenda;
private Edificio edificio;
public Sala(Edificio edificio){
this.setEdificio(edificio);
this.agenda = new Agenda(this);
}
@Override... |
package tadp.tp.domain;
import java.util.List;
import accionesPosteriores.AccionDeUsuario;
import cantidadReuniones.*;
import tadp.tp.domain.condiciones.Condicion;
public class Persona implements Reservable {
private Agenda agenda;
private Edificio edificio;
private String nombre;
private Proyecto p... |
package tadp.tp.domain;
public class HorarioDeReuniones {
private String horaComienzo;
private String horaFin;
private Fecha fecha;
public HorarioDeReuniones(String horarioInicial, String horarioFinal, Fecha fecha) {// constructor :D
this.setHoraComienzo(horarioInicial);
this.setHor... |
package tadp.tp.domain;
import java.util.ArrayList;
import java.util.List;
import comparadores.PorEstado;
import Observers.Observador;
import accionesPosteriores.AccionPosterior;
import limites.Limite;
import tadp.tp.domain.condiciones.Condicion;
public class OrganizadorDeReuniones {
private HomePersonas ... |
package tadp.tp.domain;
public class Herramienta implements Reservable {
private Agenda agenda;
private String Herramienta;
private Double costo;
private Edificio edificio;
public Herramienta(String nombreherramienta, Double costo, Edificio edificio) {
this.setHerramienta(nombreherramienta);
this.... |
package tadp.tp.domain.condiciones;
import tadp.tp.domain.Persona;
public class CumpleRol implements Condicion {
private String rol;
public CumpleRol(String unString) {
this.rol = unString;
}
@Override
public boolean seCumplePor(Persona persona) {
return persona.getRol().equals(rol);
}
p... |
package tadp.tp.domain.condiciones;
import tadp.tp.domain.Persona;
public interface Condicion {
boolean seCumplePor(Persona persona);
}
|
package tadp.tp.domain.condiciones;
import java.util.ArrayList;
import java.util.List;
import tadp.tp.domain.Proyecto;
public class QueryBuilder {
private List<Condicion> condiciones = new ArrayList<Condicion>();
public QueryBuilder name(String string) {
this.condiciones.add(new CumpleNombre(s... |
package tadp.tp.domain.condiciones;
import tadp.tp.domain.Persona;
import tadp.tp.domain.Proyecto;
public class CumpleProyecto implements Condicion {
private Proyecto proyecto;
public CumpleProyecto(Proyecto x) {
this.proyecto = x;
}
public boolean seCumplePor(Persona persona) {
return person... |
package tadp.tp.domain;
import java.util.ArrayList;
public class Proyecto {
private ArrayList<Persona> personas = new ArrayList<Persona>();
private Double costos = 0.0;
public void agregarCostos(Double costoNuevo) {// hay que armar una excepcion
this.costos += costoNuevo; // para... |
package tadp.tp.domain;
import java.util.ArrayList;
import java.util.Collection;
public class Agenda {
private Reservable duenio;
private Collection<HorarioDeReuniones> reuniones = new ArrayList<HorarioDeReuniones>();
public Agenda (Reservable duenio){
this.duenio = duenio;
}
public Double h... |
package tadp.tp.domain;
import java.util.ArrayList;
import java.util.List;
public class Edificio {
private List<Sala> salas = new ArrayList<Sala>();
public void setSala(Sala sala) {
salas.add(sala);
}
public List<Sala> getSalas() {
return salas;
}
public Sala salaDisponible(String horar... |
package tadp.tp.domain.excepciones;
public class PocoPorcentajeDeAsistenciaException extends RuntimeException {
@Override
public String getMessage() {
return "Reunion cancela porque tiene poco porcentaje de asistencia";
}
}
|
package tadp.tp.domain.excepciones;
public class RecursobligatorioDadoDeBajaException extends RuntimeException {
@Override
public String getMessage() {
return "Se dio De baja un Recurso Obligatorio";
}
}
|
package tadp.tp.domain;
import java.util.ArrayList;
import java.util.List;
import Observers.Observador;
public class Reunion {
private List<Reservable> RecursosObligatorios=new ArrayList<Reservable>();
private List<Reservable> RecursosOpcionales=new ArrayList<Reservable>();
private Edificio edificio;
... |
package cantidadReuniones;
import java.util.ArrayList;
import java.util.List;
public class CargaPoca extends CargaReuniones{
public List<CargaReuniones> sucesores = new ArrayList<CargaReuniones>();
private static CargaPoca instancia;
private CargaPoca(){
sucesores.add(CargaNormal.getInstance());
... |
package cantidadReuniones;
import java.util.List;
public abstract class CargaReuniones {
public abstract List<CargaReuniones> getSucesores();
}
|
package cantidadReuniones;
import java.util.ArrayList;
import java.util.List;
public class CargaExcesiva extends CargaReuniones{
public List<CargaReuniones> sucesores = new ArrayList<CargaReuniones>();
private static CargaExcesiva instancia;
private CargaExcesiva()
{}
public static CargaExcesiv... |
package cantidadReuniones;
import java.util.ArrayList;
import java.util.List;
public class CargaNormal extends CargaReuniones {
public List<CargaReuniones> sucesores = new ArrayList<CargaReuniones>();
private static CargaReuniones instancia;
private CargaNormal(){
sucesores.add(CargaExcesiva.get... |
package comparadores;
import java.util.Comparator;
import cantidadReuniones.CargaReuniones;
import tadp.tp.domain.*;
public class PorEstado extends Orden implements Comparator<Persona>{
private Orden sucesor;
public PorEstado(Edificio edificioReunion,Fecha fechaReunion){
this.sucesor = new PorHor... |
package comparadores;
import java.util.Comparator;
import cantidadReuniones.CargaPoca;
import tadp.tp.domain.*;
public class PorUbicacion extends Orden implements Comparator<Persona>{
private Orden sucesor;
private Edificio edificioReunion;
private Fecha fechaReunion;
public PorUbicacion(Edificio ed... |
package comparadores;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import tadp.tp.domain.Persona;
public abstract class Orden implements Comparator<Persona>{
public void ordenar(List<Persona> personas){
Collections.sort(personas, this);
try {
getSucesor().o... |
package comparadores;
import java.util.Comparator;
import cantidadReuniones.CargaPoca;
import tadp.tp.domain.*;
public class PorCosto extends Orden implements Comparator<Persona>{
private Orden sucesor;
public PorCosto(Edificio edificioReunion, Fecha fechaReunion) {
this.sucesor = new PorUbicacion(edif... |
package comparadores;
import java.util.Comparator;
import cantidadReuniones.*;
import tadp.tp.domain.*;
public class PorHoras extends Orden implements Comparator<Persona>{
private Orden sucesor;
private Fecha fechaReunion;
public PorHoras(Edificio edificioReunion,Fecha fechaReunion){
this.fechaReuni... |
package limites;
import tadp.tp.domain.*;
public class LimiteRol implements Limite {
private String rol;
private int cantidad;
public LimiteRol(String rol,int cantidad){
this.setRol(rol);
this.setCantidad(cantidad);
}
public boolean tieneLimite(Persona unaPersona){
return unaPersona.g... |
package limites;
import tadp.tp.domain.*;
public class LimiteProyecto implements Limite{
private Proyecto proyecto;
private int cantidad;
public LimiteProyecto (Proyecto proyecto ,int cantidad){
this.setProyecto(proyecto);
this.setCantidad(cantidad);
}
public boolean tieneLimite(Persona unaP... |
package limites;
import tadp.tp.domain.*;
public class LimiteSector implements Limite{
private String sector;
private int cantidad;
public LimiteSector(String sector,int cantidad){
this.setSector(sector);
this.setCantidad(cantidad);
}
public boolean tieneLimite(Persona unaPersona){
retur... |
package limites;
import tadp.tp.domain.Persona;
public interface Limite {
boolean tieneLimite(Persona unaPersona);
int getCantidad();
}
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
*
* @author User
*/
public class SonarDriver {
public static void main()
{
String x = "Inches"... |
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... |
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Ultrasonic;
public class MainClass
{
public static int pingchan;
public static int echochan;
public static Ultrasonic sonar;
public MainClass( int a, int b )
{
pingchan = a;
echochan = b;
}
pub... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Ultrasonic;
/**
*
* @author Eric
*/
public class SonarSensor {
static int distancetrack=0;
stat... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.DigitalOutput;
/**
*
* @author Dean Fitzpatrick
*/
public class RobotLED {
DigitalOutput imput1;
static int digitalchan;
public RobotLED(int... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test_cv;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.lo... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test_cv;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
/**
*
* @author acappon
*/
public class CTargetInfo
{
CTarget m_currentTar... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test_cv;
import java.io.*;
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author acappon
*/
public class Main
{
/**
* @param args the command line argu... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test_cv;
/**
*
* @author acappon
*/
public class CTarget
{
int m_value; // Relative importance -- a 5 point goal is better than a 3 point goal
double m_range;
double m_azimuth;
double m_eleva... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.implementation.repository;
import fatecpg.sextociclo.domain.entities.Client;
import fatecpg.sextociclo.domain.repository.IClientRepository;
import java.lang.reflect.Method;
import java.util.Co... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.controllers;
import fatecpg.sextociclo.domain.entities.Address;
import fatecpg.sextociclo.domain.entities.Client;
import fatecpg.sextociclo.implementation.repository.ClientRepository;
import j... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.domain.entities;
import java.io.Serializable;
import javax.persistence.Embeddable;
/**
*
* @author amorimjj
*/
@Embeddable
public class Address implements Serializable {
private i... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.domain.entities;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
/**
*
* @author amorimjj
*/
@Entity
@DiscriminatorValue("PJ"... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.domain.entities;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
/**
*
* @author amorimjj
*/
@Entity
@Table(name="tbClient")
@Inheritance(strategy=Inh... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fatecpg.sextociclo.domain.repository;
import fatecpg.sextociclo.domain.entities.Client;
import java.util.Collection;
/**
*
* @author amorimjj
*/
public interface IClientRepository {
public abstract ... |
/**
*
*/
package steven.graph;
/**
* @author Steven
*
*/
public interface INode<T extends INode<T>>{
public int getHeuristic(T to);
public Node<T> getNode();
}
|
/**
*
*/
package steven.graph;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author Steven
*
*/
public class Node<T extends INode<T>> implements Comparable<Node<T>>{
private final T content;
private final List<Edge<T>> edges = new ArrayList<Edge<T>>();
@Sup... |
/**
*
*/
package steven.graph;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Set;
/**
* @author Steven
*
*/
public class Graph<T extends INode<T>>{
priv... |
/**
*
*/
package steven.graph;
/**
* @author Steven
*
*/
public class Edge<T extends INode<T>> implements Comparable<Edge<T>>{
private final Node<T> node;
private final int distance;
public Edge(final Node<T> node, final int distance){
this.node = node;
this.distance = distance;
}
@Over... |
/**
*
*/
package steven.location.service;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import steven.fusion.R;
import steven.graph.Edge;
import steven.ingre... |
/**
*
*/
package steven.location;
import android.content.Context;
import android.location.Location;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com... |
/**
*
*/
package steven.location.activity;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import steven.common.android.AndroidUtils;
import steven.fusion.R;
import steven.location.LocationPlugin;
import steven... |
/**
*
*/
package steven.runtime.android;
import android.os.Bundle;
/**
* @author Steven
*
*/
public interface ActivityPlugin{
public void onload();
public void onunload();
public void onCreate(Bundle savedInstanceState);
public void onDestory();
}
|
/**
*
*/
package steven.runtime.android;
import java.net.URL;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
/**
* @author Steven
*
*/
public class DynamicActivity extends Activity{
@Override
protected void onCreate(final Bundle savedInstanceState){
sup... |
/**
*
*/
package steven.ingress;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entr... |
/**
*
*/
package steven.ingress;
import steven.graph.INode;
import steven.graph.Node;
import android.location.Location;
/**
* @author Steven
*
*/
public class LocationNode implements INode<LocationNode>{
private final String area;
private final String name;
private final double latitude;
pri... |
/**
*
*/
package steven.common;
/**
* @author Steven
*
*/
public class ExtendedRunnable implements Runnable{
private Runnable task;
private long interval;
private boolean stopped;
private boolean paused;
public ExtendedRunnable(final long interval){
this(null, interval);
}
public Exten... |
/**
*
*/
package steven.common.android;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.provider.Settings;
/**
* Get methods are available to all apps. Set Methods are available only to system apps.<br />
* <br />
* Required permission: android.permission.WRI... |
/**
*
*/
package steven.common.android;
import android.content.Context;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
/**
* @author Steven
*
*/
public class UserInt... |
/**
*
*/
package steven.common.android;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.app.Service;
import android.content.Context;
/**
* @author steven.lam.t.f
*
*/
public class AndroidUtils{
protected AndroidUtils(){
}
public static... |
package GA;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
public class Demo {
public static void main(String[] args) throws Exception{
Class[] parameterTypes = new Class[1];
parameterTypes[0] = String.class;
Method method1 = Demo.class.getMethod("method1", par... |
package GA;
public class ChromosomePair
{
/**
* The Y-Chromosome is the "male" gene, which is the "action"-gene, because boys always plays action-like games.
*/
// public int[] YChromosome;
public Binary[] YChromosome;
/**
* The X-Chromosome is the "female" gene, which is the "wiseness"-gene, becau... |
package GA.tournaments;
import java.util.Random;
import LUDOSimulator.LUDOPlayer;
/**
* Example of automatic LUDO player
* @author David Johan Christensen
*
* @version 0.9
*
*/
public class SemiSmartLUDOPlayer implements LUDOPlayer {
LUDOBoard board;
Random rand;
public SemiSmartLUDOPlayer(L... |
package GA.tournaments;
public class APlayer
{
protected int[] actionsweight;
protected int[] choices;
public APlayer()
{
ExtendedTournament.signMeUp(this);
}
public APlayer(Object o)
{
}
}
|
package GA.tournaments;
import LUDOSimulator.LUDOPlayer;
import LUDOSimulator.PlayerResult;
public class ExtendedPlayerResult extends PlayerResult implements Comparable<ExtendedPlayerResult>
{
protected int losses = 0;
protected int secondWorst = 0;
protected int secondBest = 0;
protected int maxPointVa... |
package GA.tournaments;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import GA.Binary;
impo... |
package GA.tournaments;
import java.util.Random;
import LUDOSimulator.LUDOPlayer;
public class Ga3LUDOPlayer implements LUDOPlayer {
LUDOBoard board;
Random rand;
int[][] current_board;
int[][] new_board;
int[][] new_board2;
float max;
int bestIndex;
int[] w;
int[] actionList = {1, 2, 3, 4,... |
package GA.tournaments;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import LUDOSimulator.LUDOPlayer;
/**
* Example of automatic LUDO player
* @author David Johan Christensen
*
* @version 0.9
*
*/
public class ManualLUDOPlayer implements LUDOPlayer, MouseListener{
LUDOB... |
package GA.tournaments;
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;
import javax.imageio.ImageIO;
import LUDOSimulator.GameEndedListener;
import LUDOSimulator.LU... |
package GA.tournaments;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.R... |
package GA;
public class test
{
public static void main(String[] args)
{
int amount = 80;
int parents = 20;
int[] arr = new int[10];
int[] temparr = new int[10];
int j = 0;
int temp = amount;
double x = 0.62;
for(int i=0; i < parents; i = i + 2 )
{
temp = ((int)(temp - 2 - (i*x)))... |
package GA;
public interface IPlayer
{
int[] weights();
}
|
package GA;
import GA.tournaments.APlayer;
import LUDOSimulator.LUDOBoard;
import LUDOSimulator.LUDOPlayer;
public class GAPlayer extends APlayer implements LUDOPlayer, IPlayer
{
public enum ACTIONS { HIT_OPPONENT, HIT_MY_SELF_HOME, IS_STAR };
LUDOBoard board;
public GA brain;
public GAPlayer(LUDOBo... |
package GA;
//File: EA.java
//Author: John Hallam, based on integer EA by Peter Ross,
// built upon NU's basic skeleton
//
//This file contains a simple real vector GA.
//
//It deliberately does *not* make use of GUI components; it is intended
//to be run from a command-line prompt. For example, to compile... |
package GA;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public abstract class AGA
{
Map<String, Method> map;
ArrayList<AGA.Action> actions;
static int[][] current_board;
sta... |
package GA;
public class Binary
{
int[] binary = new int[size];
int integer;
public static final int size = 4;
public static final int intValue = 15;
public Binary(int value)
{
if(value >= Math.pow((double)2, (double)size))
return;
int temp = value;
for(int i = size-1; i >= 0 && i ... |
package GA;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import GA.tournaments.ExtendedPlayerResult;
import GA.tournaments.ExtendedTournament;
import LUDOSimulator.LUDO;
import LUDOSimulato... |
/** Node class used by linked structures.
* This class and its data members are
* visible only within the package dataStructures. */
package lists;
class ChainNode
{
// package visible data members
Object element;
ChainNode next;
// package visible constructors
ChainNode() {}
... |
/** interface for linear lists */
package lists;
public interface LinearList
{
public boolean isEmpty();
public int size();
public Object get(int index);
public int indexOf(Object theElement);
public Object remove(int index);
public void add(int index, Object theElement);
public Str... |
/** linked implementation of LinearList */
package lists;
import java.util.*;
public class Chain implements LinearList
{
// data members
protected ChainNode firstNode;
protected int size;
// constructors
/** create a list that is empty */
public Chain(int initialCapacity)
{
... |
/** interface for extended linear lists */
package lists;
public interface ExtendedLinearList extends LinearList
{
public void clear();
public void add(Object theElement);
}
|
/** singly linked circular list with header node */
package lists;
public class CircularWithHeader
{
// data member
protected ChainNode headerNode;
// constructor
/** create a circular list that is empty */
public CircularWithHeader()
{
headerNode = new ChainNode();
... |
/** circular linked list extended to include an arbirary remove method */
package lists;
public class CircularListWithRemove extends CircularList
{
/** remove the element in the node x
* @return removed element */
public Object remove(ChainNode x)
{
if (size == 1)
// list is ... |
/** circular linked list implementation of ExtendedLinearList */
package lists;
import java.util.*;
public class CircularList implements ExtendedLinearList
{
// data members
protected ChainNode lastNode;
protected int size;
// constructors
/** create a list that is empty */
public Ci... |
package perceptrons;
public class Perceptron
{
private class ErrorClass
{
int errorResult;
TrainingSet set;
}
private TrainingSet[] trainingsets;
private int[] weights;
private int bias;
public Perceptron(int bias, int[] weights, TrainingSet... sets)
{
assert weights.length-1 == sets... |
package perceptrons;
public class TrainingSet
{
int[] inputs;
int output;
public TrainingSet(int[] inputs, int output)
{
this.inputs = inputs;
this.output = output;
}
}
|
package LUDOSimulator;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.Bu... |
package LUDOSimulator;
public class PlayerResult
{
private LUDOPlayer player;
protected int number, result, wins, games;
public PlayerResult(LUDOPlayer l, int w, int g)
{
this.player = l;
this.number = 0;
this.result = 0;
this.wins = w;
this.games = g;
}
public PlayerResult(LUDOPlay... |
package LUDOSimulator;
import java.util.ArrayList;
import java.util.List;
public class Tournament
{
public static List<PlayerResult> playEvaluationRound(List<LUDOPlayer> players, ArrayList<LUDOPlayer> evaluationPlayers)
{
System.out.println("Round started");
long time = System.currentTimeMillis();
... |
package LUDOSimulator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Helper
{
public static boolean isUnique(int[] toCheck, int a)
{
for (int i = 0; i < toCheck.length; i++)
{
if (toCheck[i] == a)
return false;
}
return true;
}
publ... |
package LUDOSimulator;
public class DbjLUDOPlayer implements LUDOPlayer
{
LUDOBoard board;
private int[] weights;
private int weight1, weight2, weight3, weight4, weight5, weight6, weight7, weight8, weight9, weight10;
public DbjLUDOPlayer(LUDOBoard board)
{
this.board = board;
weight1 = 78;
wei... |
package LUDOSimulator;
/**
* Made by -
* ISHAN GANESHAN,Roberto Edmundo Ponce Reyes ,Cristian Florian Mitu
*
*
**/
public class IshanLUDOPlayer implements LUDOPlayer {
double TwH1_I1=-0.06260063588460131,TwH1_I2=-4.652088218934489,TwH1_I3=0.32824642122850806,TwH1_I4=-0.7642359947865884,
TwH1_I... |
class CalcLib {
int x;
int y;
int z;
public CalcLib (int num1, int num2){
x = num1;
y = num2;
}
public int addNumbers(){
z = x+y;
return z;
}
public int subtractNumbers(){
z = x-y;
return z;
}
public int multiplyNumbers(){
z = x*y;
return z;
}
public int ... |
import javax.swing.*;
public class UserInput {
public static void main(String[] args) {
String num = "";
num = JOptionPane.showInputDialog(
null, "Please enter number: ");
double val = Double.parseDouble(num);
if(val%2 == 0){
JOptionPane.showMessageDialog(null, "The value entered i... |
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.