query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
2. Create dynamic method that allows us to add eventListeners from application runtime | public void addEventListener(Object listener) {
API.addEventListener(listener);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void addListener(EventListener eventListener, String componentName);",
"public abstract void registerListeners();",
"protected void installListeners() {\n\n\t}",
"public native void addEventListener(String name, EventCall f);",
"void registerListeners();",
"protected void installListeners() {\n }",
"protected void installListeners() {\n }",
"public interface EventListener {\n\t/**\n\t * Add an EventHandler to handle events for processing.\n\t * @param handler the EventHandler to add\n\t */\n\tpublic void addHandler(EventHandler handler);\n}",
"public interface ApplicationListener extends EventListener {\n\n /**\n * Handle an application event\n *\n * @param e event to respond to\n */\n void onApplicationEvent(ApplicationEvent e);\n\n}",
"protected void installListeners() {\n\t}",
"void addEventRegistrationCallback(EventRegistrationCallback eventRegistrationCallback);",
"public void addEventHandlers() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,\n\tInvocationTargetException, InstantiationException {\n\t\tClass<?> applicationClass = Class.forName(\"com.apple.eawt.Application\");\n\t\tClass<?> quitHandlerClass = Class.forName(\"com.apple.eawt.QuitHandler\");\n\t\tClass<?> aboutHandlerClass = Class.forName(\"com.apple.eawt.AboutHandler\");\n\t\tClass<?> openFilesHandlerClass = Class.forName(\"com.apple.eawt.OpenFilesHandler\");\n\t\tClass<?> preferencesHandlerClass = Class.forName(\"com.apple.eawt.PreferencesHandler\");\n\n\t\tObject application = applicationClass.getConstructor((Class[]) null).newInstance((Object[]) null);\n\t\tObject proxy = Proxy.newProxyInstance(MacOsIntegration.class.getClassLoader(), new Class<?>[]{\n\t\t\tquitHandlerClass, aboutHandlerClass, openFilesHandlerClass, preferencesHandlerClass}, this);\n\n\t\tapplicationClass.getDeclaredMethod(\"setQuitHandler\", quitHandlerClass).invoke(application, proxy);\n\t\tapplicationClass.getDeclaredMethod(\"setAboutHandler\", aboutHandlerClass).invoke(application, proxy);\n\t\tapplicationClass.getDeclaredMethod(\"setOpenFileHandler\", openFilesHandlerClass).invoke(application, proxy);\n\t\tapplicationClass.getDeclaredMethod(\"setPreferencesHandler\", preferencesHandlerClass).invoke(application,\n\t\t\t\tproxy);\n\t}",
"private void addListeners(){\n Conservable[] listenerFromProductTypeRelation = this.productRelation.getListener();\n this.listener[0] = listenerFromProductTypeRelation[0];\n this.listener[1] = listenerFromProductTypeRelation[1];\n this.listener[2] = this.post;\n this.listener[3] = this.productRelation;\n this.listener[4] = this;\n }",
"private void createEvents() {\n\t}",
"public void addEvPEC(Event ev);",
"public void addListeners()\n {\n view.addListeners(new FileButtonClick(view, this), new ViewButtonClick(view, this), new ClassClick(view, this), new RelationshipClick(view, this), new RightClickListenerFactory(view, this));\n\t}",
"@Override\n\tpublic void getListener(){\n\t}",
"public interface RehaTPEventListener extends EventListener {\npublic void rehaTPEventOccurred(RehaTPEvent evt );\n/*public void RehaTPEventOccurred(TerminFenster evt );\npublic void RehaTPEventOccurred(Container evt );\npublic void RehaTPEventOccurred(Object evt );\npublic void RehaTPEventOccurred(SystemLookAndFeel evt );\n*/\n}",
"public interface WFEventListener extends ActivityInsEventListener, ProcessInsEventListener {\r\n\r\n /**\r\n * called when a timer event is fired;\r\n */\r\n public void onTimerEvent();\r\n\r\n public void addECAList(ECAList list);\r\n\r\n}",
"@ReactMethod\n public void addListener(String eventName) {\n }",
"@ReactMethod\n public void addListener(String eventName) {\n }",
"@Override\n public <T extends EventListener> void addListener(T t) {\n\n }",
"private void setListeners() {\n\n }",
"public void addHandler(EventHandler handler);",
"@ReactMethod\n public void addListener(String eventName) {\n }",
"protected void attachListeners() {\n\t\t\n\t}",
"public interface ClickGenerator {\r\n /**\r\n * adds listeners that listens for clickEvents\r\n * @param listener \r\n */\r\n public void addListener(ClickListener listener);\r\n}",
"ListenerMethod getListenerMethod();",
"@Override\n\tpublic void addListener() {\n\t\t\n\t}",
"public void createListeners() {\n\n addRow.addActionListener(e -> gui.addRow());\n deleteRow.addActionListener(e -> gui.deleteRow());\n }",
"private void addListeners() {\n \t\tfHistoryListener= new HistoryListener();\n \t\tfHistory.addOperationHistoryListener(fHistoryListener);\n \t\tlistenToTextChanges(true);\n \t}",
"public interface ComponentSystem {\n /**\n * AddListener's common function, according event type to add certain listener\n * \n * @param listener listener to be add\n */\n public void addListener(EventListener listener);\n\n /**\n * @return listener type\n */\n public ListenerType getListenerType();\n\n /**\n * Set the component name\n * \n * @param name name of component\n */\n public void setComponentName(ComponentName name);\n\n /**\n * @return component name\n */\n public ComponentName getComponentName();\n}",
"private static void registerEventListener() {\r\n\r\n log.info(\"Registering event listener for Listeners\"); //$NON-NLS-1$\r\n\r\n try {\r\n ObservationManager observationManager = ContentRepository\r\n .getHierarchyManager(ContentRepository.CONFIG)\r\n .getWorkspace()\r\n .getObservationManager();\r\n\r\n observationManager.addEventListener(new EventListener() {\r\n\r\n public void onEvent(EventIterator iterator) {\r\n // reload everything\r\n reload();\r\n }\r\n }, Event.NODE_ADDED\r\n | Event.NODE_REMOVED\r\n | Event.PROPERTY_ADDED\r\n | Event.PROPERTY_CHANGED\r\n | Event.PROPERTY_REMOVED, \"/\" + CONFIG_PAGE + \"/\" + \"IPConfig\", true, null, null, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r\n }\r\n catch (RepositoryException e) {\r\n log.error(\"Unable to add event listeners for Listeners\", e); //$NON-NLS-1$\r\n }\r\n }",
"@FunctionalInterface\npublic interface EventHook<T> {\n\n /**\n * Invokes this Listener with the event\n *\n * @param event The Event being Invoked\n */\n void invoke(T event);\n}",
"@Override\n public void addListener(Class<? extends EventListener> listenerClass) {\n\n }",
"void subscribeToEvents(Listener listener);",
"@Override\r\n\tprotected void attachListeners() {\n\t\t\r\n\t}",
"abstract public void addListener(Listener listener);",
"BasicEvents createBasicEvents();",
"private void addListeners() {\r\n updateMethod.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n enableFieldBasedOnUpdateMethod();\r\n }\r\n });\r\n cbUseLeakyLearning.addActionListener(this);\r\n cbUseLeakyLearning.setActionCommand(\"useLeakyLearning\");\r\n }",
"@Override\r\n\tnative long createListenerProxy(EventSink eventSink);",
"@Override\n public void addListener(String className) {\n\n }",
"private void registerEvents() {\n MouseEventHandler handler = new MouseEventHandler();\n setOnMousePressed(handler);\n setOnMouseReleased(handler);\n setOnMouseMoved(handler);\n setOnMouseEntered(handler);\n setOnMouseExited(handler);\n\n }",
"public interface ButtonListener {\n void add();\n}",
"@EventName(\"targetCreated\")\n EventListener onTargetCreated(EventHandler<TargetCreated> eventListener);",
"private void addListeners()\r\n {\r\n Actions act = new Actions();\r\n btnCountA.addActionListener(act);\r\n btnSearch.addActionListener(act);\r\n btnFindL.addActionListener(act);\r\n }",
"public interface Listener {}",
"private void notifyListeners (String aMauiApplicationName, RendererEvent aRendererEvent)\n\t{\n\t\tVector theListeners = (Vector) rendererListeners.get (aMauiApplicationName);\n\t\t\n\t\tif (theListeners != null)\n\t\t{\n\t\t\tObject [] theListenerArray = theListeners.toArray ();\n\t\t\n\t\t\tfor (int i = 0; i < theListenerArray.length; i++)\n\t\t\t{\n\t\t\t\t((I_RendererListener) theListenerArray [i]).rendererCreated (aRendererEvent);\n\t\t\t}\n\t\t}\n\t}",
"public interface ListenerSupport<T> {\n\n /**\n * register new listener\n */\n public void addListener(T listener);\n\n /**\n * removed already added listener\n */\n public void removeListener(T listener);\n\n}",
"private void addListeners() {\n\n\t\tfinal ComponentsController serviceController = (ComponentsController) componentsService;\n\t\t/*\n\t\t * service controller listener:\n\t\t */\n\t\tfinal ChangeListener changeListener = new ChangeListener() {\n\t\t\tpublic void modelChanged(ChangeEvent ce) {\n\t\t\t\tPmsChangeEvent event = (PmsChangeEvent) ce;\n\t\t\t\tswitch (event.getType()) {\n\t\t\t\t\tcase PmsChangeEvent.UPDATE:\n\t\t\t\t\t\tonComponentUpdate((InheritedComponentInstanceSelDTO) event.getEventInfo());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PmsChangeEvent.IMPORT:\n\t\t\t\t\t\ttryGetComponents();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: // event not expected: nothing to do here.\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tserviceController.addChangeListener(changeListener);\n\t\t\n\t\t// remove listener from components controller when this panel is detached\n\t\taddListener(Events.Detach, new Listener<BaseEvent>() {\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tserviceController.removeChangeListener(changeListener);\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * Grid RowClick listener\n\t\t */\n\t\tgrid.addListener(Events.RowClick, new Listener<GridEvent<InheritedComponentInstanceSelModelData>>() {\n\t\t\tpublic void handleEvent(GridEvent<InheritedComponentInstanceSelModelData> ge) {\n\t\t\t\tInheritedComponentInstanceSelModelData model = grid.getSelectionModel().getSelectedItem();\n\t\t\t\tif (model != null) {\n\t\t\t\t\tenableDisableButtons(model);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"protected void installListeners() {\n Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();\n if (topLevelWindows != null) {\n for (int i = 0; i < topLevelWindows.length; i++) {\n if (topLevelWindows[i] instanceof Accessible) {\n installListeners((Accessible) topLevelWindows[i]);\n }\n }\n }\n }",
"public interface OnEventControlListener {\r\n\tvoid onEvent(int eventType, View control, Object data);\r\n}",
"@Override\n\tprotected void initListeners() {\n\t\t\n\t}",
"@Test\n public void testAddEventListener() {\n List<SimulatorEventListener> eventListeners = eventDispatcher.getSimulatorEventListeners();\n assertTrue(eventListeners.size() == 0);\n SimulatorEventListener listener = new SimulatorEventListener() {\n\n\n public void onNewMessage(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onMatchingScenario(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseBuilt(Exchange exchange, Conversation conversation) {\n\n }\n\n public void onResponseSent(Exchange exchange, Conversation conversation) {\n\n }\n };\n eventDispatcher.addSimulatorEventListener(listener);\n assertTrue(eventListeners.size() == 1);\n }",
"public interface ISemanticEventListener {\n\n\t/**\n\t * Notifies this listener that a semantic event has happened.\n\t * @param event - the semantic event\n\t */\n\tvoid notify(IUISemanticEvent event);\n \n\t////////////////////////////////////////////////////////////////////////////\n\t//\n\t// Meta events\n\t//\n\t////////////////////////////////////////////////////////////////////////////\n\n\t//TODO: maybe these meta-notifications should not have there own methods?\n\t\n /**\n * Notifies this listener that event recording has started.\n */\n void notifyStart();\n \n /**\n * Notifies this listener that event recording has stopped.\n */\n void notifyStop();\n\n /**\n * Notifies this listener that the event stream is to be written.\n */\n void notifyWrite();\n \n /**\n * Notifies this listener that root display has been disposed (effectively, recording is terminated).\n */ \n void notifyDispose();\n\n\t/**\n\t * Notifies this listener that the event stream is to be flushed and restarted.\n\t */\n\tvoid notifyRestart();\n\n\t/**\n\t * Notifies this listener that the event stream is to be paused.\n\t */\n\tvoid notifyPause();\n\t\n\t/**\n\t * Notifies this listener that an error occured during recording.\n\t * @param event - the error event\n\t */\n\tvoid notifyError(RecorderErrorEvent event);\n\n\t/**\n\t * Notifies this listener that a trace event was sent during recording.\n\t * @param event - the trace event\n\t */\n\tvoid notifyTrace(RecorderTraceEvent event);\n\n\t/**\n\t * Notifies this listener that a hook added vent was sent during recording.\n\t * @param hookName \n\t */\n\tvoid notifyAssertionHookAdded(String hookName);\n\t\n\t/**\n\t * Notifies that Recorder Controller was started and listens on specific port \n\t * @param port the port number that this controller started listen on\n\t */\n\tpublic void notifyControllerStart(int port);\n\t\n\t/**\n\t * Notifies this listener that Display instance was not found in the application process\n\t */\n\tpublic void notifyDisplayNotFound();\n\n\t/**\n\t * Notifies the listener that spy mode has been toggled.\n\t */\n\tvoid notifySpyModeToggle();\n}",
"private void registerEventListeners() {\n addDisposeListener(new DisposeListener() {\n @Override\n public void widgetDisposed(DisposeEvent de) {\n Display display = getDisplay();\n display.removeFilter(SWT.Move, moveFilter);\n OldFXCanvas.this.widgetDisposed(de);\n }\n });\n\n addPaintListener(pe -> {\n OldFXCanvas.this.paintControl(pe);\n });\n\n addMouseListener(new MouseListener() {\n @Override\n public void mouseDoubleClick(MouseEvent me) {\n // Clicks and double-clicks are handled in FX\n }\n @Override\n public void mouseDown(MouseEvent me) {\n // FX only supports 3 buttons so don't send the event for other buttons\n if (me.button > 3) {\n return;\n }\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_PRESSED);\n }\n @Override\n public void mouseUp(MouseEvent me) {\n // FX only supports 3 buttons so don't send the event for other buttons\n if (me.button > 3) {\n return;\n }\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_RELEASED);\n }\n });\n\n addMouseMoveListener(me -> {\n if ((me.stateMask & SWT.BUTTON_MASK) != 0) {\n // FX only supports 3 buttons so don't send the event for other buttons\n if ((me.stateMask & (SWT.BUTTON1 | SWT.BUTTON2 | SWT.BUTTON3)) != 0) {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_DRAGGED);\n } else {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_MOVED);\n }\n } else {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_MOVED);\n }\n });\n\n addMouseWheelListener(me -> {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_WHEEL);\n });\n\n addMouseTrackListener(new MouseTrackListener() {\n @Override\n public void mouseEnter(MouseEvent me) {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_ENTERED);\n }\n @Override\n public void mouseExit(MouseEvent me) {\n OldFXCanvas.this.sendMouseEventToFX(me, AbstractEvents.MOUSEEVENT_EXITED);\n }\n @Override\n public void mouseHover(MouseEvent me) {\n // No mouse hovering in FX\n }\n });\n\n addControlListener(new ControlListener() {\n @Override\n public void controlMoved(ControlEvent ce) {\n OldFXCanvas.this.sendMoveEventToFX();\n }\n @Override\n public void controlResized(ControlEvent ce) {\n OldFXCanvas.this.sendResizeEventToFX();\n }\n });\n\n addFocusListener(new FocusListener() {\n @Override\n public void focusGained(FocusEvent fe) {\n OldFXCanvas.this.sendFocusEventToFX(fe, true);\n }\n @Override\n public void focusLost(FocusEvent fe) {\n OldFXCanvas.this.sendFocusEventToFX(fe, false);\n }\n });\n\n addKeyListener(new KeyListener() {\n @Override\n public void keyPressed(KeyEvent e) {\n OldFXCanvas.this.sendKeyEventToFX(e, SWT.KeyDown);\n \n }\n @Override\n public void keyReleased(KeyEvent e) {\n OldFXCanvas.this.sendKeyEventToFX(e, SWT.KeyUp);\n }\n });\n \n addMenuDetectListener(e -> {\n Runnable r = () -> {\n if (isDisposed()) {\n return;\n }\n OldFXCanvas.this.sendMenuEventToFX(e);\n };\n // In SWT, MenuDetect comes before the equivalent mouse event\n // On Mac, the order is MenuDetect, MouseDown, MouseUp. FX\n // does not expect this order and when it gets the MouseDown,\n // it closes the menu. The fix is to defer the MenuDetect\n // notification until after the MouseDown is sent to FX.\n if (\"cocoa\".equals(SWT.getPlatform())) {\n getDisplay().asyncExec(r);\n } else {\n r.run();\n }\n });\n }",
"EventBinding createEventBinding();",
"public void testCustomEventListener() throws Exception\n {\n checkEventTypeRegistration(CUSTOM_EVENT_BUILDER, \"\");\n }",
"static private CustomListener eventCustListener() {\n return new CustomListener() {\n\t @Override\n\t public void customEventReceived(CustomEvent e) {\n\t\tSystem.out.println(e.getMessage());\n\t }\n }\n}",
"public interface AttachmentsListener {\n\n /**\n * Fires when user presses 'add' button.\n */\n void onAddAttachments();\n}",
"public interface a\n{\n\n public abstract void addEventListener(String s, VPAIDEventListener vpaideventlistener);\n\n public abstract void dispatchEvent(VPAIDEvent vpaidevent);\n\n public abstract boolean hasEventListener(String s, VPAIDEventListener vpaideventlistener);\n\n public abstract void removeEventListener(String s, VPAIDEventListener vpaideventlistener);\n}",
"<T extends EventDetector> void addEventDetector(T detector);",
"private void registerEvents(){\n\t\tPluginManager pm = getServer().getPluginManager();\r\n\t\t//PlayerListener stuff\r\n\t pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Event.Priority.Normal, this);\r\n\t pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\r\n\t pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Normal, this);\r\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\r\n\t //BlockListener stuff\r\n pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Event.Priority.Normal, this);\r\n pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Event.Priority.Normal, this);\r\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\r\n //EntityListener stuff\r\n pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Event.Priority.Normal, this);\r\n pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Event.Priority.Normal, this);\r\n //ServerListener stuff\r\n pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Event.Priority.Normal, this);\r\n pm.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, this);\r\n }",
"public void addListener(EventListener listener);",
"protected void addEventListeners()\n {\n // Add them to the contents.\n InteractionFigure interactionLayer =\n view.getEditor().getInteractionFigure();\n\n // let mouseState handle delete key events\n interactionLayer.addKeyListener(mouseState);\n getShell().addShellListener(new ShellAdapter() {\n @Override\n public void shellDeactivated(ShellEvent e)\n {\n mouseState.cancelDynamicOperation();\n }\n });\n }",
"public void addEvent(Event e) {\n\t\t\n\t}",
"public void addEvent(Event e) {\n\t\t\n\t}",
"@Override\r\n\tprotected void bindEvents() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void bindEvents() {\n\t\t\r\n\t}",
"public void addGameEventListener(GameEventListener gameEventListener);",
"public void createEventListeners() {\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(ComponentEvent e) {\n super.componentResized(e);\n //canvas.setSize(J2DNiftyView.this.getSize());\n }\n });\n }",
"void onNewEvent(Event event);",
"public interface Listener {\n}",
"public interface Listener {\n}",
"@Override\r\n protected void createListeners(\r\n ) {\r\n \tsuper.createListeners();\r\n \t\r\n inputManager.addMapping( \"nextScene\"\r\n , new KeyTrigger( KeyInput.KEY_RETURN ) );\r\n inputManager.addMapping( \"priorScene\"\r\n , new KeyTrigger( KeyInput.KEY_BACKSLASH ) );\r\n inputManager.addMapping( \"abortLoad\"\r\n , new KeyTrigger( KeyInput.KEY_DELETE ) );\r\n \r\n ActionListener aListener = new CSGTestActionListener(); \r\n inputManager.addListener( aListener, \"nextScene\" );\r\n inputManager.addListener( aListener, \"priorScene\" );\r\n inputManager.addListener( aListener, \"abortLoad\" );\r\n }",
"protected abstract void collectFires(Collection<Object> evAndListeners);",
"private void addEventListener(ListenerWrapper lsnr, int[] types) {\n if (!enterBusy())\n return;\n\n try {\n for (int t : types)\n registerListener(lsnr, t);\n }\n finally {\n leaveBusy();\n }\n }",
"private void registrarListeners() {\n ventanaAgregarOperador.agregarListenerBotonGuardarNuevoOperador(new VentanaAgregarOperadorBotonGuardarAL());\n ventanaEditarOperador.agregarListenerBotonGuardarDatosModificados(new VentanaEditarOperadorBotonGuardarAL());\n\n }",
"ISubscription addEventHandler(EventType type, IEventHandler<DetectionEvent> handler);",
"private void registerListeners() {\r\n View.OnClickListener clickListener = new ButtonListener();\r\n btnStart.setOnClickListener(clickListener);\r\n btnStop.setOnClickListener(clickListener);\r\n }",
"@Override\r\n\tpublic void initListeners() {\n\t\t\r\n\t}",
"public void addNPTListener(NPTListener l){}",
"private void createEvents() {\n\t\taddBtn.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbuildOutput();\n\t\t\t}\n\t\t});\n\t}",
"public interface OnEventAvailableListener {\n\tpublic void OnEventAvailable(Message msg);\n}",
"public interface DesignerListener extends EventListener {\r\n\t\r\n\t/**\r\n\t * Method to notify that a designer has joined the application.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void designerAdded(DesignerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a designer input vector has been modified.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void designerInputModified(DesignerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a designer has left the application.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void designerRemoved(DesignerEvent e);\r\n\t\r\n\t/**\r\n\t * Method to notify that a designer state (e.g. ready status) \r\n\t * has been modified.\r\n\t *\r\n\t * @param e the event\r\n\t */\r\n\tpublic void designerStateModified(DesignerEvent e);\r\n}",
"public interface OnBaseUIListener {\n}",
"private void registerEvents(){\n Bukkit.getPluginManager().registerEvents(new RegionListener(), this);\n Bukkit.getPluginManager().registerEvents(new SignListener(), this);\n Bukkit.getPluginManager().registerEvents(new PrisonerListener(), this);\n Bukkit.getPluginManager().registerEvents(new PrisonBlockListener(), this);\n Bukkit.getPluginManager().registerEvents(new MonitorListener(), this);\n Bukkit.getPluginManager().registerEvents(new PortalListener(), this);\n }",
"@Override\r\n\tpublic void onEvent(Object e) {\n\t}",
"private void setupListeners() {\n\t\tfor (int i = 0; i < _controlPoints.length; i++) {\n\t\t\taddControlPointListener(_controlPoints[i][0], i);\n\t\t\taddControlPointListener(_controlPoints[i][1], i);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < _selectionButtons.length; i++) {\n\t\t\taddPointSelectionButtonListener(i);\n\t\t}\n\t}",
"private void hook(View view) {\n try {\n Class classview = Class.forName(\"android.view.View\");\n Method method = classview.getDeclaredMethod(\"getListenerInfo\");\n method.setAccessible(true);\n Object listenerInfo = method.invoke(view);\n Class classInfo = Class.forName(\"android.view.View$ListenerInfo\");\n Field field = classInfo.getDeclaredField(\"mOnClickListener\");\n field.set(listenerInfo, new HookListener((View.OnClickListener) field.get(listenerInfo)));\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }",
"public interface MonitoringEventListener {\n\n /**\n * Callback for received STDOUT lines.\n * \n * @param line stdout line\n */\n void appendStdout(String line);\n\n /**\n * Callback for received STDERR lines.\n * \n * @param line stderr line\n */\n void appendStderr(String line);\n\n /**\n * Callback for additional user information lines (validation, progress, ...).\n * \n * @param line information line\n */\n void appendUserInformation(String line);\n}",
"private void registerListeners() {\n\n\t\tline.addActionListener(new LineButtonListener());\n\t\trect.addActionListener(new RectButtonListener());\n\t\toval.addActionListener(new OvalButtonListener());\n\t\timage.addActionListener(new ImageButtonListener());\n\n\t\tMouseListener listener = new ListenToMouse();\n\t\tMouseMotionListener motionListener = new ListenToMouse();\n\n\t\tcanvas.addMouseMotionListener(motionListener);\n\t\tcanvas.addMouseListener(listener);\n\n\t}",
"private void addEventListener(IEventListener<T> listener) {\n\t\t\tevent.addEventListener(listener);\n\t\t}",
"void add(SpaceInstanceAddedEventListener eventListener, boolean includeExisting);",
"private void adicionaListeners() {\r\n\t\t\taddFocusListener(this);\r\n\t\t\taddKeyListener(this);\r\n\t\t\taddMouseListener(this);\r\n\t\t}",
"public interface DispatchListener {\n void onDispatchClickListener(Dispatch dispatch);\n}",
"@Override\n protected void hookUpActionListeners() {\n }",
"public abstract void addServiceListener(PhiDiscoverListener listener);",
"public interface IEvenListener {\n}",
"public void enableMultiTouchElementListeners() {\r\n\t\tif (itemListeners == null) {\r\n\t\t\titemListeners = new ArrayList<ItemListener>();\r\n\t\t}\r\n\t\tif (screenCursorListeners == null) {\r\n\t\t\tscreenCursorListeners = new ArrayList<ScreenCursorListener>();\r\n\t\t}\r\n\t\tif (orthoControlPointRotateTranslateScaleListeners == null) {\r\n\t\t\torthoControlPointRotateTranslateScaleListeners = new ArrayList<OrthoControlPointRotateTranslateScaleListener>();\r\n\t\t}\r\n\t\tif (bringToTopListeners == null) {\r\n\t\t\tbringToTopListeners = new ArrayList<BringToTopListener>();\r\n\t\t}\r\n\t\tif (orthoSnapListeners == null) {\r\n\t\t\torthoSnapListeners = new ArrayList<OrthoSnapListener>();\r\n\t\t}\r\n\t\tif (flickListeners == null) {\r\n\t\t\tflickListeners = new ArrayList<OrthoFlickListener>();\r\n\t\t}\r\n\t\t\r\n\t\t((IOrthoContentItemImplementation) this.contentItemImplementation)\r\n\t\t\t\t.addBringToTopListener(this);\r\n\t\t((IOrthoContentItemImplementation) this.contentItemImplementation)\r\n\t\t\t\t.addItemListener(this);\r\n\t\t((IOrthoContentItemImplementation) this.contentItemImplementation)\r\n\t\t\t\t.addOrthoControlPointRotateTranslateScaleListener(this);\r\n\t\t((IOrthoContentItemImplementation) this.contentItemImplementation)\r\n\t\t\t\t.addSnapListener(this);\r\n\t\t((IOrthoContentItemImplementation) this.contentItemImplementation)\r\n\t\t\t\t.addFlickListener(this);\r\n\t}",
"protected void installListeners(Accessible a) {\n installListeners(a.getAccessibleContext());\n }"
] | [
"0.71080256",
"0.6987245",
"0.6595612",
"0.65897065",
"0.6589348",
"0.6512561",
"0.6512561",
"0.6484477",
"0.64476544",
"0.6441497",
"0.6357958",
"0.6326576",
"0.63260216",
"0.63153934",
"0.6281913",
"0.627334",
"0.626812",
"0.62431484",
"0.62401986",
"0.623618",
"0.623618",
"0.623097",
"0.61678153",
"0.6162361",
"0.6156144",
"0.6139784",
"0.6104783",
"0.60896546",
"0.6074164",
"0.6072059",
"0.6067341",
"0.60615134",
"0.60604674",
"0.6045338",
"0.604296",
"0.6042054",
"0.60370344",
"0.6027077",
"0.6021035",
"0.60121286",
"0.6007453",
"0.59978557",
"0.59716076",
"0.5961441",
"0.59612584",
"0.59430486",
"0.59318954",
"0.5930698",
"0.59228396",
"0.5922385",
"0.59174234",
"0.5915884",
"0.59141475",
"0.58832484",
"0.5879301",
"0.58790356",
"0.58773655",
"0.58675504",
"0.58673817",
"0.58635926",
"0.5862353",
"0.5857972",
"0.58578664",
"0.5855416",
"0.5846434",
"0.5844695",
"0.5844695",
"0.5843145",
"0.5843145",
"0.58402026",
"0.5814534",
"0.5812565",
"0.58094597",
"0.58094597",
"0.5802088",
"0.57935935",
"0.5791569",
"0.57899916",
"0.57874864",
"0.5787183",
"0.57859606",
"0.57825786",
"0.57758933",
"0.5766409",
"0.57645404",
"0.5757991",
"0.57546437",
"0.57527274",
"0.575103",
"0.5749254",
"0.574855",
"0.574375",
"0.5736303",
"0.57240266",
"0.5712452",
"0.57063496",
"0.5703799",
"0.5701301",
"0.56957155",
"0.5694789",
"0.5694079"
] | 0.0 | -1 |
Created by Administrator on 2018/4/18. | public interface AddDeviceActivityView extends BaseView {
void showAddDeviceResult(MdlBaseHttpResp resp);
void showDeviceListResult(MdlBaseHttpResp<List<MdlDevice>> resp);
void showDelDeviceResult(MdlBaseHttpResp resp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void create () {\n\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"private TMCourse() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"Petunia() {\r\n\t\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n\tpublic void create() {\n\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"public contrustor(){\r\n\t}",
"public void create() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"private UsineJoueur() {}",
"@Override\n protected void initialize() \n {\n \n }",
"public void mo4359a() {\n }",
"@Override\r\n\tpublic void create() {\n\t\t\r\n\t}",
"private Singletion3() {}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void create() {\n\r\n\t}",
"public void autoDetails() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"public Pitonyak_09_02() {\r\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"protected Doodler() {\n\t}",
"@Override\n public void init() {\n\n }",
"@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }",
"@Override\n public int describeContents() { return 0; }",
"private static void oneUserExample()\t{\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private ReportGenerationUtil() {\n\t\t\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}",
"@Override\n public Date getCreated()\n {\n return null;\n }",
"@Override\n public String toString() {\n return \"\";\n }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n void init() {\n }",
"public static void created() {\n\t\t// TODO\n\t}",
"Consumable() {\n\t}",
"@Override\n public void init() {\n }",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"private MetallicityUtils() {\n\t\t\n\t}",
"@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }",
"protected void onFirstUse() {}",
"private DittaAutonoleggio(){\n \n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void initialize() {\n \n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"private SingleTon() {\n\t}",
"@Override\n public String getName() {\n return null;\n }",
"public void verarbeite() {\n\t\t\r\n\t}",
"@Override\n public int getSize() {\n return 1;\n }",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n protected void execute() {\n \n }",
"private MApi() {}",
"@Override\n public void init() {}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n public String getName() {\n return null;\n }",
"public void mo55254a() {\n }",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n public String getType() {\n return \"\";\n }",
"CreationData creationData();"
] | [
"0.62136674",
"0.6090949",
"0.5769723",
"0.5736592",
"0.5733917",
"0.5729521",
"0.5672822",
"0.56677485",
"0.5667281",
"0.56564254",
"0.5636243",
"0.56159574",
"0.5613901",
"0.56043166",
"0.5604009",
"0.55797285",
"0.5576577",
"0.55761015",
"0.55689985",
"0.55689985",
"0.55606806",
"0.5558293",
"0.5558293",
"0.5557483",
"0.5542873",
"0.552463",
"0.5512308",
"0.55028075",
"0.55028075",
"0.55028075",
"0.55028075",
"0.55028075",
"0.55028075",
"0.5501156",
"0.5498297",
"0.5495748",
"0.54939085",
"0.54922825",
"0.54877216",
"0.5470028",
"0.5469768",
"0.54671866",
"0.5457914",
"0.5456575",
"0.54563344",
"0.5449287",
"0.54423136",
"0.544052",
"0.54313815",
"0.5425337",
"0.54135513",
"0.54116577",
"0.5402909",
"0.53974134",
"0.5374598",
"0.5374598",
"0.5374598",
"0.5374598",
"0.5374598",
"0.5374598",
"0.5374598",
"0.5364775",
"0.5361691",
"0.5360128",
"0.53510857",
"0.53501016",
"0.535003",
"0.5329501",
"0.5328137",
"0.53159434",
"0.53095114",
"0.53048",
"0.53044206",
"0.53007346",
"0.52984107",
"0.5294885",
"0.5294861",
"0.5292567",
"0.52871066",
"0.5276897",
"0.5276897",
"0.52714366",
"0.5266451",
"0.5265439",
"0.5264826",
"0.5263351",
"0.5255839",
"0.5255839",
"0.5255839",
"0.52545494",
"0.5253791",
"0.5246713",
"0.524502",
"0.52404284",
"0.5240221",
"0.5237601",
"0.52314115",
"0.5229191",
"0.5227892",
"0.5226221",
"0.5225568"
] | 0.0 | -1 |
Startar (eller omstartar) timern. | public void start(){
started = true;
lastTime = System.nanoTime();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sendeSpielStarten();",
"public static void start() { \r\n\t\ttempo_inicial = System.nanoTime(); \r\n\t\ttempo_final = 0; \r\n\t\tdiftempo = 0; \r\n\t}",
"private void startTime()\n {\n timer.start();\n }",
"@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}",
"Start createStart();",
"private void startTiming() {\n m_startTime = Calendar.getInstance().getTimeInMillis();\n }",
"public void start() {\n startTime = System.currentTimeMillis();\n }",
"protected void setupTime() {\n this.start = System.currentTimeMillis();\n }",
"public void startRideTime(){\r\n\t\trideTime.start();\r\n\t}",
"public void start() {\n startTime = System.currentTimeMillis();\n }",
"Instant getStart();",
"public void startTeleopTimer() {\n t.reset();\n t.start();\n }",
"public void startTimer() {\n startTime = System.currentTimeMillis();\n }",
"public void tickerNeuStarten( int ms ) \n {\n anzeige.tickerAbmelden( this );\n anzeige.tickerAnmelden( this , ms );\n }",
"public synchronized void start() {\r\n\t\tif(type == TYPE_DELAY) {\r\n\t\t\tdate = new Date(System.currentTimeMillis() + delay);\r\n\t\t}\r\n\t\tif(started) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tstarted = true;\r\n\t\ttm.addStartedTimers(this);\t\t\r\n//\t\ttm.getHandler().post(new Runnable() {\r\n//\t\t\tpublic void run() {\r\n//\t\t\t\tdoCancel();\r\n//\t\t\t\tdoStart();\r\n//\t\t\t}\r\n//\t\t});\r\n\t}",
"public void startTime() {\n\t\tthis.clock.start();\n\t}",
"void setStart(Instant instant);",
"public void setStartTime() {\r\n startTime = System.currentTimeMillis();\r\n }",
"@Override\n public synchronized void start() {\n m_startTime = getMsClock();\n m_running = true;\n }",
"public void start() {timer.start();}",
"public void Start(long startTime){\n // Your code here\n this.startTime = startTime;\n Thread t = new Thread(this);\n t.start();\n //run();\n }",
"public void setStart(long start) { this.start = start; }",
"public void startTime() {\n if (!isRunning) {\n timer = new Timer();\n clock = new Clock();\n timer.scheduleAtFixedRate(clock,0,1000);\n isRunning = true;\n }\n }",
"@Override\n\tpublic int getStartTime() {\n\t\treturn 0;\n\t}",
"int getStartTime();",
"int getStartTime();",
"int getStartTime();",
"public void start(){\n\t\ttimer = new Timer();\n\t\ttimer.schedule(this, 0, (long)66.6);\n\t}",
"public void startCount() {\n //meetodi k�ivitamisel nullime tunnid, minutid, sekundid:\n secondsPassed = 0;\n minutePassed = 0;\n hoursPassed = 0;\n if (task != null)\n return;\n task = new TimerTask() {\n @Override\n public void run() {//aeg l�ks!\n secondsPassed++; //loeme sekundid\n if (secondsPassed == 60) {//kui on l�binud 60 sek, nullime muutujat\n secondsPassed = 0;\n minutePassed++;//kui on l�binud 60 sek, suurendame minutid 1 v�rra\n }\n if (minutePassed == 60) {//kui on l�binud 60 min, nullime muutujat\n minutePassed = 0;\n hoursPassed++;//kui on l�binud 60 min, suurendame tunnid 1 v�rra\n }\n //kirjutame aeg �les\n String seconds = Integer.toString(secondsPassed);\n String minutes = Integer.toString(minutePassed);\n String hours = Integer.toString(hoursPassed);\n\n if (secondsPassed <= 9) {\n //kuni 10 kirjutame 0 ette\n seconds = \"0\" + Integer.toString(secondsPassed);\n }\n if (minutePassed <= 9) {\n //kuni 10 kirjutame 0 ette\n minutes = \"0\" + Integer.toString(minutePassed);\n }\n if (hoursPassed <= 9) {\n //kuni 10 kirjutame null ettte\n hours = \"0\" + Integer.toString(hoursPassed);\n }\n\n\n time = (hours + \":\" + minutes + \":\" + seconds);//aeg formaadis 00:00:00\n getTime();//edastame aeg meetodile getTime\n\n }\n\n };\n myTimer.scheduleAtFixedRate(task, 0, 1000);//timer k�ivitub kohe ja t��tab sekundite t�psusega\n\n }",
"public void setStart_time(long start_time) {\n this.start_time = start_time;\n }",
"public void start() {\n thread = new Thread(this);\n thread.start();\n System.out.println(\"---\\t Ober \" + naam + \" is gestart.\");\n }",
"public void setTimeStart(int timeStart) {\r\n this.timeStart = timeStart;\r\n }",
"public void startTimer(){\n timerStarted = System.currentTimeMillis();\n }",
"long getStartTime();",
"void start() \r\n {\r\n while (controller.clock <= controller.totalBurstTime) {\r\n this.clock();\r\n }\r\n }",
"public void start(){\n\t\t//System.out.println(\"SimulationTime.start\");\n\t\tthis.running\t\t\t= true;\n\t\tthis.pause\t\t\t\t= false;\n\t}",
"void doManualStart();",
"public void startTimer() {\n\t\t\n\t\ttimerStart = System.currentTimeMillis();\n\t\ttimerStarted = true;\n\t}",
"public void startAgentTime() {\n Timer timer = new Timer(SIBAConst.TIME_AGENT_CHANGE_FOR_HOUR, new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n \t\n \tCalendar c = Calendar.getInstance();\n int minutos = c.get(Calendar.MINUTE);\n int hora = c.get( (Calendar.HOUR_OF_DAY)); \n hora = hora * 60;\n if (minutos >= 30 && minutos <= 59)\n {hora +=30;\t\n }\n if (hora > ctrlHours)\n {ctrlHours = hora;\n //activada bandera de modificacion de programacion\n activatedScheduleChange = true;\n }\n else\n { if (hora < ctrlHours)\n \t ctrlHours = 0;\n }\n \t\n \t\n \n }\n });\n timer.start();\n }",
"public void changeStartTimeTo(long t) {\n\t\tm_startTime = t;\n\t\tif( m_privateNotification != null ) {\n\t\t\tString content = \"changeStartOfSignals:\"+Long.toString(t)+\";\";\n\t\t\tm_privateNotification.sendMessage(m_parentName+\"TSCanvasMenu\", m_parentName+\"TSCanvas\", content);\n\t\t}\n\t}",
"public void startTiming() {\n elapsedTime = 0;\n startTime = System.currentTimeMillis();\n }",
"@Override\n\tpublic void setStartTime(float t) \n\t{\n\t\t_tbeg = t;\n\t}",
"public void startAlarm(){\r\n\t\tAlarm alarm = new Alarm(\"magAanvallen\", 1 / aanvallenPerSeconden);\r\n\t\talarm.addTarget(this);\r\n\t\talarm.start();\r\n\t}",
"long start();",
"public void start() {\n\t\tthis.startTime = System.nanoTime();\n\t\tthis.running = true;\n\t}",
"public long getStartTime();",
"public long getStartTime();",
"public void start()\r\n\t{\r\n\t\tcurrentstate = TIMER_START;\r\n\t\tstarttime = Calendar.getInstance();\r\n\t\tamountOfPause = 0;\r\n\t\trunningTime = 0;\r\n\t\tlastRunningTime = 0;\r\n\t\tpassedTicks = 0;\r\n\t}",
"public static long startTimer() {\n return System.currentTimeMillis();\n }",
"@Override\n\t\tpublic long getStartMillis() {\n\t\t\treturn 0;\n\t\t}",
"public void start(long millisToRestart) throws Exception;",
"void setZeroStart();",
"public void setStart(){\n\t\tthis.isStart=true;\n\t}",
"public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }",
"public long startTime();",
"private AppTimer() {\n\t\tstart();\n\t}",
"public abstract long startTimestamp();",
"int getStart();",
"public void start() {\n\n System.out.println(\"Esto no debe salir por consola al sobreescribirlo\");\n\n }",
"public void setTimeStart(long ts)\n {\n this.timeStart = (ts > 0L)? ts : -1L;\n }",
"long getStartTimestamp();",
"public int getTimeStart() {\r\n return timeStart;\r\n }",
"public static void startTimer() {\n elapsedTime = 0;\r\n timerIsWorking = true;\r\n startTime = System.nanoTime() / 1000000; // ms\r\n }",
"private void IniciarCronometro() {\n ActionListener action = new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n currentSegundo++;\n\n if (currentSegundo == 60) {\n currentMinuto++;\n currentSegundo = 0;\n }\n\n if (currentMinuto == 60) {\n currentHora++;\n currentMinuto = 0;\n }\n\n String hr = currentHora <= 9 ? \"0\" + currentHora : currentHora + \"\";\n String min = currentMinuto <= 9 ? \"0\" + currentMinuto : currentMinuto + \"\";\n String seg = currentSegundo <= 9 ? \"0\" + currentSegundo : currentSegundo + \"\";\n\n lbcronometro.setText(hr + \":\" + min + \":\" + seg);\n tempo = hr + \":\" + min + \":\" + seg;\n }\n };\n this.timer = new Timer(velocidade, action);\n this.timer.start();\n }",
"@Override\n public void start() {\n runTime.reset();\n telemetry.addData(\"Run Time\", \"reset\");\n }",
"public void startTimer(final int min) throws InterruptedException {\n\t\tSystem.err.println(\"Inizio startTimer per = \" + min);\n\t\tfinal int sec = min * 60;\n\n\t\tses.scheduleWithFixedDelay(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (!runFlag) {\n\t\t\t\t\tinvertFlag();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(new Date());\n\t\t\t\t\ttry {\n\t\t\t\t\t\tNotification.getIstance();\n\t\t\t\t\t} catch (final IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tses.shutdown();\n\t\t\t\t\tSystem.out.println(\"TIMER SHUTDOWN\");\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0, sec, TimeUnit.SECONDS);\n\t}",
"private void startTime() {\n Task<Void> task = new Task<Void>() {\n @Override\n protected Void call() throws Exception {\n while (player.getCurrentTime().lessThanOrEqualTo(player.getStopTime()) && player.getStatus() != Status.PAUSED) {\n if (player.getStatus() == Status.STOPPED) {\n eventBus.emit(new CurrentTimeEvent(0, Duration.ZERO));\n cancel();\n }\n // Convert the current time to a percentage\n double timePercentage = player.getCurrentTime().toSeconds() / player.getStopTime().toSeconds();\n // Get the current time as a Duration\n Duration timeDuration = player.getCurrentTime();\n eventBus.emit(new CurrentTimeEvent(timePercentage, timeDuration));\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n cancel();\n }\n }\n return null;\n }\n };\n\n timeThread = new Thread(task);\n timeThread.setDaemon(true);\n timeThread.start();\n }",
"public void startTimer() {\n\t\ttimer.start();\n\t}",
"void moveToStart();",
"public static void ComienzaTimer(){\n timer = System.nanoTime();\n }",
"public void setStart(int start) {\n this.start=start;\n }",
"@Override\r\n\tpublic void preExcute(long arg0) {\n\t\tstartTime = arg0;\r\n\r\n\t}",
"public void setStart(int start) {\r\n this.start = start;\r\n }",
"private String makeEventStart(LocalDateTime date) {\n String name = \"DTSTART\";\n return formatTimeProperty(date, name) + \"\\n\";\n }",
"public void start() {\n ActionListener listener = new TimePrinter();\n Timer t = new Timer(interval, listener);\n t.start();\n }",
"SyncStart createSyncStart();",
"public void setStarttime(Date starttime) {\n this.starttime = starttime;\n }",
"public void setStarttime(Date starttime) {\n this.starttime = starttime;\n }",
"private void startTimer() {\n Timer.addTimeout(endTime, this);\n }",
"public void start() {\r\n\t\ttimeKeyB = timeAmount + System.nanoTime();\r\n\t}",
"public void setStartTime(long ts) {\n\t\tthis.startTime = ts;\t\t\n\t}",
"public void starteStartCountdown() {\r\n\r\n if (spielerSet.size() >= plugin.getConfig().getInt(\"Mindest-Spieler\")) {\r\n plugin.broadcastMessage(\"SnowSpleef startet jetzt\");\r\n final ItemStack[] items = new ItemStack[2];\r\n items[0] = new ItemStack(Material.IRON_SPADE, 1, (short) -32768);\r\n items[1] = new ItemStack(Material.SNOW_BALL, plugin.getConfig().getInt(\"Schneeball-Anzahl\"));\r\n\r\n startCountdown = true;\r\n BukkitRunnable startCountdownTask;\r\n startCountdownTask = new BukkitRunnable() {\r\n int counter = plugin.getConfig().getInt(\"StartCountdown-Zeit\") * 20;\r\n Iterator<String> it = spielerSet.iterator();\r\n Player spieler;\r\n\r\n @Override\r\n public void run() {\r\n counter--;\r\n if (counter == 0) {\r\n plugin.broadcastMessage(ChatColor.GOLD + \"GO!\");\r\n startCountdown = false;\r\n plugin.getSpiel().starteSpiel();\r\n this.cancel();\r\n } else {\r\n if (counter % 20 == 0) {\r\n for (String spieler : spielerSet) {\r\n plugin.sendMessage(plugin.getServer().getPlayer(spieler), ChatColor.GOLD + \"\" + (counter / 20) + \"...\");\r\n }\r\n }\r\n }\r\n if (it.hasNext()) {\r\n spieler = plugin.getServer().getPlayer(it.next());\r\n spieler.setGameMode(GameMode.SURVIVAL);\r\n spieler.getInventory().clear();\r\n spieler.getInventory().setContents(items);\r\n spieler.teleport(plugin.getSpiel().getSpielfeld().zufaelligerSpawn());\r\n }\r\n }\r\n };\r\n startCountdownTask.runTaskTimer(plugin, 0L, 1L);\r\n } else {\r\n plugin.broadcastMessage(\"Zu wenige Spieler haben SnowSpleef betreten\");\r\n this.stoppeSpiel();\r\n }\r\n }",
"public void setStartTime(long milliseconds) {\r\n\t\tthis.startTime = milliseconds;\r\n\t}",
"@Override\n\tpublic float getStartTime()\n\t{\n\t\treturn _tbeg;\n\t}",
"private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}",
"public double getStartTime();",
"public void start() {}",
"public void start() {}",
"public void start()\n {\n clock = new java.util.Timer();\n clock.schedule(\n new TimerTask() //This is really a new anonymous class, extending TimerTask.\n {\t\t\t\t\t //Since it has only one method, it seemed easiest to create it in line here.\n public void run() //Called by the Timer when scheduled.\n {\n timeElapsed++;\n if (timeElapsed > 999) //999 is the highest 3 digit integer, the highest number that can\n {\t\t\t\t\t\t\t //be shown on the displays. Beyond that, the player automatically loses.\n endGame(false);\n return;\n }\n repaint();\n }\n }\n \t\t\t, 1000, 1000); //1000 milliseconds, so a repeated 1 second delay.\n }",
"public void start( )\n {\n // Implemented by student.\n }",
"public int start() { return _start; }",
"public abstract void startInitTimer();",
"public void start() {\n\t\t\n\t}",
"public void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"TESLA has been started\");\n\t}",
"@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}",
"public void startTimer() {\n timer = new Timer();\n //initialize the TimerTask's job\n initializeTimerTask();\n //schedule the timer, to wake up every 1 second\n timer.schedule(timerTask, 1000, 1000); //\n }",
"public void setStartTime(long value) {\r\n this.startTime = value;\r\n }",
"@Override\n public LocalTime getStart() {\n return start;\n }",
"private void start() {\n\n\t}"
] | [
"0.7367199",
"0.7090825",
"0.694091",
"0.6852565",
"0.6846965",
"0.6839265",
"0.679624",
"0.6790877",
"0.6789209",
"0.6786371",
"0.6778228",
"0.6756558",
"0.6744871",
"0.67304695",
"0.672325",
"0.66510177",
"0.6645139",
"0.65803456",
"0.6575579",
"0.6569303",
"0.6560236",
"0.65237",
"0.64793605",
"0.64711666",
"0.64489853",
"0.64489853",
"0.64489853",
"0.6441273",
"0.644011",
"0.64118314",
"0.6396213",
"0.6387349",
"0.63681775",
"0.6320535",
"0.6308193",
"0.6286173",
"0.62756544",
"0.6272325",
"0.62642986",
"0.62630236",
"0.6248304",
"0.6216549",
"0.6212837",
"0.6209576",
"0.6205061",
"0.6204592",
"0.6204592",
"0.62021315",
"0.61872464",
"0.6179168",
"0.6175662",
"0.61445194",
"0.6139568",
"0.613785",
"0.61341786",
"0.6132497",
"0.61318237",
"0.6119166",
"0.61100394",
"0.6099533",
"0.6099183",
"0.6068838",
"0.6061536",
"0.6050455",
"0.6046659",
"0.60427564",
"0.6041072",
"0.60377634",
"0.60342073",
"0.6031137",
"0.60298294",
"0.6028543",
"0.60153264",
"0.60017073",
"0.60002434",
"0.5994193",
"0.59804296",
"0.59804296",
"0.5972113",
"0.59689355",
"0.5968624",
"0.59674054",
"0.5963726",
"0.5955856",
"0.5948797",
"0.59483296",
"0.5947708",
"0.5947708",
"0.5940933",
"0.5936258",
"0.59354126",
"0.59308034",
"0.59247047",
"0.59247047",
"0.59189165",
"0.5912172",
"0.5905239",
"0.5901469",
"0.5900086",
"0.5898483"
] | 0.64683926 | 24 |
TODO Autogenerated method stub | @Override
public void dispose() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void pause() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void resize(int width, int height) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void resume() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
0 checkbox disable, 1 checkbox enable | public ListViewItem(String name, int value) {
this.name = name;
this.value = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void enableCheckBoxes(){\n fallSemCheckBox.setDisable(false);\n springSemCheckBox.setDisable(false);\n summerSemCheckBox.setDisable(false);\n allQtrCheckBox.setDisable(false);\n allMbaCheckBox.setDisable(false);\n allHalfCheckBox.setDisable(false);\n allCampusCheckBox.setDisable(false);\n allHolidayCheckBox.setDisable(false);\n fallSemCheckBox.setDisable(false);\n// allTraTrbCheckBox.setDisable(false);\n selectAllCheckBox.setDisable(false);\n //Set selection for select all check box to true\n selectAllCheckBox.setSelected(true);\n }",
"private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {\n if(price.isEnabled()){\n price.setEnabled(false);\n \n }else{\n price.setEnabled(true);\n }\n \n ;\n // if(price.enabled(true))\n // {}\n \n \n }",
"private void enableControls(boolean b) {\n\n\t}",
"public void toggleEnable();",
"public void DisableCheckBox(ActionEvent event) throws Exception {\n\n if (!SavingRB.isSelected()) {//if savings is not selected than disable specials acc check box\n SpecialSavingAccCB.setSelected(false);\n SpecialSavingAccCB.setDisable(true);\n } else SpecialSavingAccCB.setDisable(false);\n\n if (!CheckingRB.isSelected()) {//if checkings is not selected than disable direct deposit check boc\n DirectDepositCheckingsCB.setSelected(false);\n DirectDepositCheckingsCB.setDisable(true);\n } else DirectDepositCheckingsCB.setDisable(false);\n\n if (CloseAccRB.isSelected()) {//if and else if to disable textfields based on bank options\n AmountInput.setDisable(true);\n DateInput.setDisable(true);\n } else if (DepositRB.isSelected() || WithdrawAccRB.isSelected()) {\n AmountInput.setDisable(false);\n DateInput.setDisable(true);\n } else {\n AmountInput.setDisable(false);\n DateInput.setDisable(false);\n }\n\n\n }",
"private void checkEnabled() {\n }",
"@FXML\n protected void onCheckBoxSelect(){\n damping.setDisable(schwingungstyp.isSelected());\n dampingFunc.setDisable(schwingungstyp.isSelected());\n }",
"private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}",
"boolean updateEnabling();",
"private void configureEnableButtons() {\r\n\t\ttglbtnBirthdays.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (e.getSource() == tglbtnBirthdays) {\r\n\t\t\t\t\tif (tglbtnBirthdays.isSelected()) {\r\n\t\t\t\t\t\ttglbtnBirthdays.setText(\"Disable\");\r\n\t\t\t\t\t\ttheSender.setBirthdayTemplate(emailStorage.getTemplate(templateBirthday));\r\n\t\t\t\t\t\ttheSender.runBirthdaySetUp();\r\n\t\t\t\t\t\ttheSender.resumeSendingBirthdays();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!tglbtnBirthdays.isSelected()) {\r\n\t\t\t\t\t\ttglbtnBirthdays.setText(\"Enable\");\r\n\t\t\t\t\t\ttheSender.stopSendingBirthdays();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\ttglbtnAnniv.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (e.getSource() == tglbtnAnniv) {\r\n\t\t\t\t\tif (tglbtnAnniv.isSelected()) {\r\n\t\t\t\t\t\ttglbtnAnniv.setText(\"Disable\");\r\n\t\t\t\t\t\ttheSender.setAnnivTemplate(emailStorage.getTemplate(templateAnniv));\r\n\t\t\t\t\t\ttheSender.runAnnivSetUp();\r\n\t\t\t\t\t\ttheSender.resumeSendingAnniv();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!tglbtnAnniv.isSelected()) {\r\n\t\t\t\t\t\ttglbtnAnniv.setText(\"Enable\");\r\n\t\t\t\t\t\ttheSender.stopSendingAnniv();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t}",
"private void enableSet(){\n addSubmit.setDisable(true);\n removeSubmit.setDisable(true);\n setSubmit.setDisable(false);\n addCS.setDisable(true);\n removeCS.setDisable(true);\n setCS.setDisable(false);\n addIT.setDisable(true);\n removeIT.setDisable(true);\n setIT.setDisable(false);\n addECE.setDisable(true);\n removeECE.setDisable(true);\n setECE.setDisable(false);\n partTime.setDisable(true);\n fullTime.setDisable(true);\n management.setDisable(true);\n dateAddText.setDisable(true);\n dateRemoveText.setDisable(true);\n dateSetText.setDisable(false);\n nameAddText.setDisable(true);\n nameRemoveText.setDisable(true);\n nameSetText.setDisable(false);\n hourlyAddText.setDisable(true);\n annualAddText.setDisable(true);\n managerRadio.setDisable(true);\n dHeadRadio.setDisable(true);\n directorRadio.setDisable(true);\n //codeAddText.setDisable(true);\n hoursSetText.setDisable(false);\n }",
"private void enableRadioButtons(){\n\n this.acOffRadioButton.setEnabled(true);\n\n this.heatOffRadioButton.setEnabled(true);\n\n this.lightsOnRadioButton.setEnabled(true);\n this.lightsOffRadioButton.setEnabled(true);\n\n this.leftDoorsOpenRadioButton.setEnabled(true);\n this.leftDoorsCloseRadioButton.setEnabled(true);\n\n this.rightDoorsOpenRadioButton.setEnabled(true);\n this.rightDoorsCloseRadioButton.setEnabled(true);\n }",
"@Override\n public void setEnabled(boolean b)\n {\n btnDeselectAll.setEnabled(b);\n btnExport.setEnabled(b);\n btnSelectAll.setEnabled(b);\n checkBoxList1.setEnabled(b);\n\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(checkBoxActualizar.isSelected()){\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\ttextnodo.setEnabled(true);\n\t\t\t\t\tcheckBoxEliminar.setEnabled(false);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\ttextnodo.setEnabled(false);\n\t\t\t\t\tcheckBoxEliminar.setEnabled(true);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"private void setButtonsEnable(boolean b){\n addButton.setEnabled(b);\n clearButton.setEnabled(b);\n peelOffButton.setEnabled(b);\n buttonControlPanel.setEnabled(b);\n progressCheckBox.setEnabled(b);\n }",
"public boolean setEnabled(boolean enable);",
"public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }",
"private void checkEnableDisable() {\n\t\tif (_trainingSet.getCount() > 0) {\n\t\t\t_saveSetMenuItem.setEnabled(true);\n\t\t\t_saveSetAsMenuItem.setEnabled(true);\n\t\t\t_trainMenuItem.setEnabled(true);\n\t\t} else {\n\t\t\t_saveSetMenuItem.setEnabled(false);\n\t\t\t_saveSetAsMenuItem.setEnabled(false);\n\t\t\t_trainMenuItem.setEnabled(false);\n\t\t}\n\n\t\tif (_currentTrainGrid == null) {\n\t\t\t_deleteGridMenuItem.setEnabled(true);\n\t\t} else {\n\t\t\t_deleteGridMenuItem.setEnabled(true);\n\t\t}\n\n\t\tif (_index > 0) {\n\t\t\t_leftGridMenuItem.setEnabled(true);\n\t\t\t_leftBtn.setEnabled(true);\n\t\t\t_firstGridMenuItem.setEnabled(true);\n\t\t\t_firstBtn.setEnabled(true);\n\t\t} else {\n\t\t\t_leftGridMenuItem.setEnabled(false);\n\t\t\t_leftBtn.setEnabled(false);\n\t\t\t_firstGridMenuItem.setEnabled(false);\n\t\t\t_firstBtn.setEnabled(false);\n\t\t}\n\n\t\tif (_index < _trainingSet.getCount() - 1) {\n\t\t\t_rightGridMenuItem.setEnabled(true);\n\t\t\t_rightBtn.setEnabled(true);\n\t\t\t_lastGridMenuItem.setEnabled(true);\n\t\t\t_lastBtn.setEnabled(true);\n\t\t} else {\n\t\t\t_rightGridMenuItem.setEnabled(false);\n\t\t\t_rightBtn.setEnabled(false);\n\t\t\t_lastGridMenuItem.setEnabled(false);\n\t\t\t_lastBtn.setEnabled(false);\n\t\t}\n\n\t\tif (_index >= _trainingSet.getCount()) {\n\t\t\t_indexLabel.setText(String.format(NEW_INDEX_LABEL, _trainingSet.getCount()));\n\t\t} else {\n\t\t\t_indexLabel.setText(String.format(INDEX_LABEL, _index + 1, _trainingSet.getCount()));\n\t\t}\n\n\t\t_resultLabel.setText(EMPTY_RESULT_LABEL);\n\t}",
"private void setControlsEnabled(boolean value){\r\n txtRolodexId.setEditable(value);\r\n txtLastUpdate.setEditable(value);\r\n txtUpdateUser.setEditable(value);\r\n txtLastName.setEditable(value);\r\n txtFirstName.setEditable(value);\r\n txtMiddleName.setEditable(value);\r\n txtSuffix.setEditable(value);\r\n txtPrefix.setEditable(value);\r\n txtTitle.setEditable(value);\r\n txtSponsorCode.setEditable(value);\r\n txtOrganization.setEditable(value);\r\n txtAddress1.setEditable(value);\r\n txtAddress2.setEditable(value);\r\n txtAddress3.setEditable(value);\r\n txtCity.setEditable(value);\r\n txtCounty.setEditable(value);\r\n //Modified for case#3278 - State Combobox is made non editable\r\n cmbState.setEditable(false);\r\n cmbState.setEnabled(value);\r\n cmbState.setForeground(Color.black);\r\n cmbCountry.setEnabled(value);\r\n txtPostalCode.setEditable(value);\r\n txtPhone.setEditable(value);\r\n txtEMail.setEditable(value);\r\n txtFax.setEditable(value);\r\n txtComments.setEditable(value);\r\n }",
"public void setEnabled(boolean aFlag) { _enabled = aFlag; }",
"public void enable(){\r\n\t\tthis.activ = true;\r\n\t}",
"private void enableComponents(boolean input){\n jButton11.setEnabled(input);\n jButton12.setEnabled(input);\n jButton13.setEnabled(input);\n jButton21.setEnabled(input);\n jButton22.setEnabled(input);\n jButton23.setEnabled(input);\n jButton31.setEnabled(input);\n jButton32.setEnabled(input);\n jButton33.setEnabled(input);\n jButton2.setEnabled(!input);\n jTextNome.setEditable(!input);\n }",
"private void changeControlState(boolean enabled)\n\t{\n\t\tbtnSubmit.setEnabled(enabled);\n\t\ttaDSIXML.setEnabled(enabled);\n\t\tcmbWebMethod.setEnabled(enabled);\n\t}",
"@Override\n\tpublic void setEnabled(boolean flag) {\n\t\t\n\t}",
"private void buttonEnable(){\n\t\t\taddC1.setEnabled(true);\n\t\t\taddC2.setEnabled(true);\n\t\t\taddC3.setEnabled(true);\n\t\t\taddC4.setEnabled(true);\n\t\t\taddC5.setEnabled(true);\n\t\t\taddC6.setEnabled(true);\n\t\t\taddC7.setEnabled(true);\n\t\t}",
"public void setEnabled(boolean enabled) {\n \t\tthis.enabled = enabled;\n \n \t\tcheckboxCell.setEnabled(enabled);\n \t}",
"private void habilitar() {\n\n if (i <= 0) {\n jButton4.setEnabled(false);\n } else {\n jButton4.setEnabled(true);\n }\n }",
"public boolean CheckBox() {\n if (AseguradoCulpable.isSelected()) {\n return true;\n } else {\n return false;\n }\n }",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"boolean isEnabled();",
"private void moikhoacontrol(boolean b) {\n\t\tbtnSua.setEnabled(b);\n\t\tbtnluu.setEnabled(b);\n\t\tbtnxoa.setEnabled(b);\n\t\tbtnThoat.setEnabled(b);\n\t\tbtnTim.setEnabled(b);\n\t\t\n\t}",
"private void setMultipleChecks() {\r\n\r\n checkNemenyi.setEnabled(true);\r\n checkShaffer.setEnabled(true);\r\n checkBergman.setEnabled(true);\r\n\r\n checkIman.setEnabled(true);\r\n checkHolm.setEnabled(true);\r\n }",
"boolean hasEnabled();",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"private void setEnableComponents(){\r\n awardAddDocumentForm.cmbDocumentType.setEnabled(true);\r\n awardAddDocumentForm.txtDescription.setEditable(true);\r\n awardAddDocumentForm.txtFileName.setEditable(false);\r\n awardAddDocumentForm.btnUpload.setEnabled(true);\r\n awardAddDocumentForm.btnOk.setEnabled(true);\r\n awardAddDocumentForm.btnCancel.setEnabled(true);\r\n awardAddDocumentForm.btnView.setEnabled(false);\r\n }",
"@Override\n public void toggle() {\n checkBox.toggle();\n }",
"@Override\n public void onClick(View v) {\n if(custActiveInactive.isChecked()){\n custHardwareReturned.setChecked(false);\n custHardwareReturned.setEnabled(false);\n custHardwareInstalled.setEnabled(true);\n cust.custActiveInActive = 1;\n }else{\n custHardwareInstalled.setChecked(false);\n custHardwareInstalled.setEnabled(false);\n custHardwareReturned.setEnabled(true);\n cust.custActiveInActive = 0;\n }\n }",
"boolean getEnabled();",
"boolean getEnabled();",
"boolean getEnabled();",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(checkBoxEliminar.isSelected()){\t\t\t\t\t\n\t\t\t\t\ttextnodo.setEnabled(true);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tcheckBoxActualizar.setEnabled(false);\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\ttextnodo.setEnabled(false);\n\t\t\t\t\t\n\t\t\t\t\tcheckBoxActualizar.setEnabled(true);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"private void enableRadioOptions() {\n\t\tradioButtonA.setEnabled(true);\n\t\tradioButtonB.setEnabled(true);\n\t\tradioButtonC.setEnabled(true);\n\t\tradioButtonD.setEnabled(true);\n\t\tradioButtonA.setChecked(false);\n\t\tradioButtonB.setChecked(false);\n\t\tradioButtonC.setChecked(false);\n\t\tradioButtonD.setChecked(false);\n\t}",
"@Override\n\t\t\tpublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t\t\tcsb_switchbutton1.setEnabled(isChecked);\n\t\t\t}",
"public void checkEnabled()\n {\n if(graph == null || graph.vertices.size() < 1)\n {\n removeJButton.setEnabled(false);\n removeJMenuItem.setEnabled(false);\n printJMenuItem.setEnabled(false);\n calculateJButton.setEnabled(false);\n findPathJMenuItem.setEnabled(false);\n bruteForceJRadioButton.setEnabled(true);\n bruteForceJRadioButtonMenuItem.setEnabled(true);\n }\n else if(graph.vertices.size() < 3)\n {\n removeJButton.setEnabled(true);\n removeJMenuItem.setEnabled(true);\n printJMenuItem.setEnabled(false);\n calculateJButton.setEnabled(false);\n findPathJMenuItem.setEnabled(false);\n bruteForceJRadioButton.setEnabled(true);\n bruteForceJRadioButtonMenuItem.setEnabled(true);\n }\n else if(graph.vertices.size() <= 5)\n {\n removeJButton.setEnabled(true);\n removeJMenuItem.setEnabled(true);\n printJMenuItem.setEnabled(true);\n calculateJButton.setEnabled(true);\n findPathJMenuItem.setEnabled(true);\n bruteForceJRadioButton.setEnabled(true);\n bruteForceJRadioButtonMenuItem.setEnabled(true);\n }\n else\n {\n if(bruteForceJRadioButton.isSelected())\n {\n nearestJRadioButton.setSelected(true);\n nearestNeighborJRadioButtonMenuItem.setSelected(true);\n methodJLabel.setText(\"Nearest Neighbor\");\n }\n printJMenuItem.setEnabled(true);\n removeJButton.setEnabled(true);\n removeJMenuItem.setEnabled(true);\n calculateJButton.setEnabled(true);\n findPathJMenuItem.setEnabled(true);\n bruteForceJRadioButton.setEnabled(false);\n bruteForceJRadioButtonMenuItem.setEnabled(false);\n }\n }",
"public void enablePanel(boolean b);",
"private void enableAdd(){\n addSubmit.setDisable(false);\n removeSubmit.setDisable(true);\n setSubmit.setDisable(true);\n addCS.setDisable(false);\n removeCS.setDisable(true);\n setCS.setDisable(true);\n addIT.setDisable(false);\n removeIT.setDisable(true);\n setIT.setDisable(true);\n addECE.setDisable(false);\n removeECE.setDisable(true);\n setECE.setDisable(true);\n partTime.setDisable(false);\n fullTime.setDisable(false);\n management.setDisable(false);\n dateAddText.setDisable(false);\n dateRemoveText.setDisable(true);\n dateSetText.setDisable(true);\n nameAddText.setDisable(false);\n nameRemoveText.setDisable(true);\n nameSetText.setDisable(true);\n hourlyAddText.setDisable(false);\n annualAddText.setDisable(false);\n managerRadio.setDisable(false);\n dHeadRadio.setDisable(false);\n directorRadio.setDisable(false);\n //codeAddText.setDisable(false);\n hoursSetText.setDisable(true);\n }",
"@FXML\n void checkboxManualAutomatic(ActionEvent event) {\n \tif (autoModeAlgo == null) {\n \t\tthrow new NullPointerException(\"MainGuiController.checkboxManualAutomatic() autoModeAlgo == null\");\n \t}\n \t\n \t//check checkbox state, if checked enable button, otherwise disable. The elevator can only be sent to a floor if in manual mode. \n \tif(checkbox_manual_mode.isSelected()) {\n \t\t//disable the automatic mode -> enable manual mode\n \t\tautoModeAlgo.disable(selectedElevator);\n \t\tbutton_send_to_floor.setDisable(false);\n \t}\n \telse {\n \t\tautoModeAlgo.enable(selectedElevator);\n \t\tbutton_send_to_floor.setDisable(true);\n \t}\n }",
"public static void setEnabled(JPanel jpanel, boolean boo) {\n for (int i = 0; i < jpanel.getComponentCount(); i++) {\n if (jpanel.getComponent(i).getClass().equals(txtTexto.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtCodigo.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtNumeros.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtFecha.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtCelular.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtTelefono.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtNumerosFormato.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(combo.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JComboBox.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JRadioButton.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JCheckBox.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtHoraHMS.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(txtPassword.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n\n if (jpanel.getComponent(i).getClass().equals(JButton.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JTextField.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JPasswordField.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n continue;\n }\n if (jpanel.getComponent(i).getClass().equals(JFormattedTextField.class)) {\n jpanel.getComponent(i).setEnabled(boo);\n }\n }\n }",
"public void setCheckBoxes() {\n\t\tdeliveredCheckBox.setSelected(order.isDelivered());\n\t\tif (deliveredCheckBox.isSelected() || (!order.isPrepared())) {\n\t\t\tdeliveredCheckBox.setDisable(true);\n\t\t}\n\t}",
"final void habilitarcampos(boolean valor){\n TXT_CodCliente.setEnabled(valor);\n TXT_Aparelho.setEnabled(valor);\n TXT_Valor.setEnabled(valor);\n TXT_Informacao.setEnabled(valor); \n TXT_CodServico.setEnabled(valor); \n TXT_Clientes.setEnabled(valor); \n TXT_Serial.setEnabled(valor);\n TXT_Data.setEnabled(valor);\n}",
"public void enableDisableAutoRepeatCheckBox() {\r\n autoRepeatCheckBox.setEnabled(topModel.isAutoRepeatEnabled());\r\n }",
"public boolean isEnabled() { return _enabled; }",
"void setEnable(boolean b) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"private void activateButtons(){\n limiteBoton.setEnabled(true);\n derivadaBoton.setEnabled(true);\n integralBoton.setEnabled(true);\n}",
"private void CheckEnable()\n {\n btn_prev.setEnabled(true);\n btn_next.setEnabled(true);\n\n if(increment+1 == pageCount)\n {\n btn_next.setEnabled(false);\n }\n if(increment == 0)\n {\n btn_prev.setEnabled(false);\n }\n }",
"private void setClockID(boolean a) {\n//Khoa hoac mo khoa cho Cac JTextField\n this.txtExamDate.setEnabled(!a);\n }",
"public void editEnabled(boolean enabled){\n }",
"public void setEnabled(boolean enabled);",
"public void setEnabled(boolean enabled);",
"public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}",
"@FXML\n void selectChecking(ActionEvent event) {\n \tdirectDep.setSelected(false);\n \tisLoyal.setSelected(false);\n \tdirectDep.setDisable(false);\n \tisLoyal.setDisable(true);\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJToggleButton x = (JToggleButton) e.getSource();\n\t\t\t\tif(x.isSelected()){\n\t\t\t\t\tif(host_txtfield.getText().trim().isEmpty()){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please provide a hostname\", \"Lock Settings\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(port_txtfield.getText().trim().isEmpty()){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please provide a port\", \"Lock Settings\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(dbname_txtfield.getText().trim().isEmpty()){\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please provide a database name\", \"Lock Settings\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\thost_txtfield.setEnabled(false);\n\t\t\t\t\tport_txtfield.setEnabled(false);\n\t\t\t\t\tdbname_txtfield.setEnabled(false);\n\t\t\t\t\tuseLocalSettings_checkBox.setEnabled(false);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(!useLocalSettings_checkBox.isSelected()){\n\t\t\t\t\t\thost_txtfield.setEnabled(true);\n\t\t\t\t\t\tport_txtfield.setEnabled(true);\n\t\t\t\t\t}\n\t\t\t\t\tdbname_txtfield.setEnabled(true);\n\t\t\t\t\tuseLocalSettings_checkBox.setEnabled(true);\n\t\t\t\t}\n\t\t\t}",
"private void unlockButton() {\n\t\tconversionPdf_Txt.setEnabled(true);\n\t\tavisJury.setEnabled(true);\n\t\tstatistique.setEnabled(true);\n bData.setEnabled(true);\n\t}",
"public void enable() {\n \t\t\tsetEnabled(true);\n \t\t}",
"void setEnabled(boolean enabled);",
"void setEnabled(boolean enabled);",
"void setEnabled(boolean enabled);",
"void setEnabled(boolean enabled);",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"public void setEnable(Boolean enable) {\n this.enable = enable;\n }",
"public void setEnabled(boolean bEnabled) {\n txtReferredBy.setEnabled(false);\n cbxProfession.setEnabled(bEnabled);\n cbxEducation.setEnabled(bEnabled);\n txtNotes1.setEnabled(bEnabled);\n txtNotes2.setEnabled(bEnabled);\n txtPartFamName.setEnabled(bEnabled);\n txtPartName.setEnabled(bEnabled);\n txtBirthPlc.setEnabled(bEnabled);\n cbxSpcEvt.setEnabled(bEnabled);\n txtSpclDate.setEnabled(bEnabled);\n txtChildNames.setEnabled(bEnabled);\n txtNumChildren.setEnabled(bEnabled);\n btnLookup.setEnabled(bEnabled);\n }",
"public void setEnable(boolean enable) {\n this.enable = enable;\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\t\n\t\t\t\tif(cb_VN.isChecked()) {\n\t\t\t\t\tcb_VN.setChecked(true);\n\t\t\t\t\tcb_VN.setClickable(false);\n\t\t\t\t\t\n\t\t\t\t\tcb_EN.setChecked(false);\n\t\t\t\t\tcb_EN.setClickable(true);\n\t\t\t\t} else {\n\t\t\t\t\tcb_VN.setChecked(true);\n\t\t\t\t\tcb_VN.setClickable(false);\n\t\t\t\t\t\n\t\t\t\t\tcb_EN.setChecked(false);\n\t\t\t\t\tcb_EN.setClickable(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"public void enableChoice() {\n\t\t// Enable the buttons, lighting them up\n\t\trock.setEnabled(true);\n\t\tpaper.setEnabled(true);\n\t\tscissors.setEnabled(true);\n\t}",
"private void enableAutosaveCheckboxItemStateChanged(java.awt.event.ItemEvent evt)\n {\n if (!autosave.isLoadingDialog())\n {\n enableDisableComponents();\n }\n }",
"@Override\n public void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n if (arg1 == true) {\n }\n { //Do something\n kc.setChecked(false);\n }\n //do something else\n lbButton = true;\n\n }",
"public void setEnabled(boolean value) {\n m_Enabled = value;\n }",
"protected void disableButtons() {\n if (mFalseButton.isPressed() || mTrueButton.isPressed())\n mFalseButton.setEnabled(false);\n mTrueButton.setEnabled(false);\n }",
"private void setDishBtnUsability(boolean enable){\n dishBtn1.setEnabled(enable);\n dishBtn2.setEnabled(enable);\n dishBtn3.setEnabled(enable);\n dishBtn4.setEnabled(enable);\n dishBtn5.setEnabled(enable);\n }",
"public void setEnabled(boolean enabled) {\r\n\t}",
"private void disableRadioButtons(){\n\n this.acOnRadioButton.setEnabled(false);\n this.acOffRadioButton.setEnabled(false);\n\n this.heatOffRadioButton.setEnabled(false);\n this.heatOnRadioButton.setEnabled(false);\n\n this.lightsOnRadioButton.setEnabled(false);\n this.lightsOffRadioButton.setEnabled(false);\n\n this.leftDoorsOpenRadioButton.setEnabled(false);\n this.leftDoorsCloseRadioButton.setEnabled(false);\n\n this.rightDoorsOpenRadioButton.setEnabled(false);\n this.rightDoorsCloseRadioButton.setEnabled(false);\n }",
"public boolean isEnabled() { return this.myEnabled; }",
"public void enable() {\r\n m_enabled = true;\r\n }",
"private void setButton(boolean a) {\n//Vo hieu hoac co hieu luc cho cac JButton\n this.btnCourseAdd.setEnabled(a);\n this.btnCourseDelete.setEnabled(a);\n this.btnCourseEdit.setEnabled(a);\n this.btnCourseSave.setEnabled(!a);\n this.btnCourseReport.setEnabled(!a);\n this.btnCourseReset.setEnabled(!a);\n this.btnCourseClose.setEnabled(a);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(cb_EN.isChecked()) {\n\t\t\t\t\tcb_EN.setChecked(true);\n\t\t\t\t\tcb_EN.setClickable(false);\n\t\t\t\t\t\n\t\t\t\t\tcb_VN.setChecked(false);\n\t\t\t\t\tcb_VN.setClickable(true);\n\t\t\t\t} else {\n\t\t\t\t\tcb_EN.setChecked(true);\n\t\t\t\t\tcb_EN.setClickable(false);\n\t\t\t\t\t\n\t\t\t\t\tcb_VN.setChecked(false);\n\t\t\t\t\tcb_VN.setClickable(true);\n\t\t\t\t}\n\t\t\t}",
"public static void ToggleEnabled()\n {\n \t\tEnabled = !Enabled;\n \t\tConfigHandler.configFile.save();\n \t \t\n }",
"protected void updateEnabled() {\n\t\tFieldGroup control = getUIControl();\n\t\tif (control != null) {\n\t\t\tCollection<? extends IRidget> ridgets = getRidgets();\n\t\t\tfor (IRidget ridget : ridgets) {\n\t\t\t\tridget.setEnabled(isEnabled());\n\t\t\t}\n\t\t\tcontrol.setEnabled(isEnabled());\n\t\t}\n\t}",
"public Boolean getbEnable() {\n return bEnable;\n }",
"public void lockCheckboxes(ArrayList<CheckBox> boxes){\n for(CheckBox box: this.boxes){\n box.disableProperty().set(true);\n }\n }",
"private void setDepressionControlsEnabled(boolean enabled) {\n depressionCheckbox\n .setSelection(enabled && depressionCheckbox.getSelection());\n depressionCheckbox.setEnabled(enabled);\n depressionNumberLabel\n .setEnabled(enabled && depressionCheckbox.getSelection());\n depressionNumberCombo\n .setEnabled(enabled && depressionCheckbox.getSelection());\n }",
"public void setEnable(String name,boolean value) {\n\t\tgetButtonPanel().getButton(name).setEnabled(value);\n\t\tgetGameMenuBar().getItem(name).setEnabled(value);\n\t}",
"private void setOneAllChecks() {\r\n\r\n checkIman.setEnabled(true);\r\n checkBonferroni.setEnabled(true);\r\n checkHolm.setEnabled(true);\r\n checkHochberg.setEnabled(true);\r\n checkHommel.setEnabled(true);\r\n checkHolland.setEnabled(true);\r\n checkRom.setEnabled(true);\r\n checkFinner.setEnabled(true);\r\n checkLi.setEnabled(true);\r\n\r\n }",
"public void setEnabledGeneral(boolean estado) {\r\n\t\tthis.partidasList.setEnabled(estado);\r\n\t\tthis.btnCambiarNick.setEnabled(estado);\r\n\t\tthis.btnCambiarPassword.setEnabled(estado);\r\n\t\tthis.btnCerrarSesion.setEnabled(estado);\r\n\t\tthis.btnUnirse.setEnabled(estado);\r\n\t}",
"public void enableInputs();",
"private void setModeUI(){\n\n if (this.inManualMode == true){ this.enableRadioButtons(); } // manual mode\n else if (this.inManualMode == false){ this.disableRadioButtons(); } // automatic mode\n }"
] | [
"0.7385569",
"0.73807687",
"0.68622535",
"0.68596196",
"0.68354255",
"0.67732465",
"0.67655593",
"0.6662677",
"0.66157734",
"0.6614002",
"0.66001266",
"0.65639514",
"0.65529335",
"0.65124226",
"0.6496841",
"0.6491491",
"0.64885217",
"0.6458055",
"0.64459455",
"0.643391",
"0.6427337",
"0.6423015",
"0.6413982",
"0.64079595",
"0.6385668",
"0.63814986",
"0.6381028",
"0.6326922",
"0.6325938",
"0.6325938",
"0.6325938",
"0.6325938",
"0.6325938",
"0.6325938",
"0.6325938",
"0.6325938",
"0.63205165",
"0.63157976",
"0.6314204",
"0.6301491",
"0.62853587",
"0.62762445",
"0.62761426",
"0.6243838",
"0.6243838",
"0.6243838",
"0.6243516",
"0.62415236",
"0.62211597",
"0.6198161",
"0.6197507",
"0.61951894",
"0.6193892",
"0.6191606",
"0.61845815",
"0.61737514",
"0.6171803",
"0.6169205",
"0.616626",
"0.6150724",
"0.6150001",
"0.61495024",
"0.61457306",
"0.6136743",
"0.6136743",
"0.6126063",
"0.61254466",
"0.6125015",
"0.61172414",
"0.6115865",
"0.6113465",
"0.6113465",
"0.6113465",
"0.6113465",
"0.61015534",
"0.60895926",
"0.60877705",
"0.60863173",
"0.6084519",
"0.6078781",
"0.6077757",
"0.60729706",
"0.6071611",
"0.60585517",
"0.6058051",
"0.60567427",
"0.6056038",
"0.60512125",
"0.6044758",
"0.6042039",
"0.6041158",
"0.6040978",
"0.60364586",
"0.6028011",
"0.60262334",
"0.60223246",
"0.60190797",
"0.6017074",
"0.6012872",
"0.60121685",
"0.60116625"
] | 0.0 | -1 |
Convert the ByteBuffer's contents to a hex string using upper case by default. | public ToHexString() {
this(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }",
"public\n static\n CharSequence\n asHexString( ByteBuffer bb )\n {\n inputs.notNull( bb, \"bb\" );\n ByteBuffer slice = bb.slice();\n\n CharBuffer res = CharBuffer.allocate( slice.remaining() * 2 );\n\n while ( slice.hasRemaining() )\n {\n byte b = slice.get();\n \n res.put( HEX_CHARS[ ( b >> 4 ) & 0x0f ] );\n res.put( HEX_CHARS[ b & 0x0f ] );\n }\n\n res.flip();\n return res.asReadOnlyBuffer();\n }",
"public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}",
"public static String asHex(byte[] buf) {\n \t char[] HEX_CHARS = \"0123456789abcdef\".toCharArray();\n \t char[] chars = new char[2 * buf.length];\n \t for (int i = 0; i < buf.length; ++i) {\n \t chars[2 * i] = HEX_CHARS[(buf[i] & 0xF0) >>> 4];\n \t chars[2 * i + 1] = HEX_CHARS[buf[i] & 0x0F];\n \t }\n \t return new String(chars);\n \t}",
"private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',\n\t\t\t\t'B', 'C', 'D', 'E', 'F' };\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'\n\t\t};\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"@NotNull\n public static String convertBytesToHex(@NotNull byte[] value) {\n checkNotNull(value);\n int len = value.length;\n char[] buff = new char[len + len];\n char[] hex = HEX;\n for (int i = 0; i < len; i++) {\n int c = value[i] & 0xff;\n buff[i + i] = hex[c >> 4];\n buff[i + i + 1] = hex[c & 0xf];\n }\n return new String(buff);\n }",
"private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }",
"public static String bytesToHex(byte[] txtInByte) {\n\t\t StringBuilder sb = new StringBuilder(txtInByte.length * 2);\n\t\t for(byte b: txtInByte)\n\t\t sb.append(String.format(\"%02x\", b & 0xff));\n\t\t return sb.toString();\n\t\t}",
"public static String byteToHex(final byte[] hash) {\n if (Objects.isNull(hash)) {\n return null;\n }\n\n Formatter formatter = new Formatter();\n for (byte b : hash) {\n formatter.format(\"%02x\", b);\n }\n String result = formatter.toString();\n formatter.close();\n return result;\n }",
"private static String toHex(byte buffer[]) {\n\t\tStringBuffer sb = new StringBuffer(buffer.length * 2);\n\t\tfor (int i = 0; i < buffer.length; i++) {\n\t\t\tsb.append(Character.forDigit((buffer[i] & 0xf0) >> 4, 16));\n\t\t\tsb.append(Character.forDigit(buffer[i] & 0x0f, 16));\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }",
"public String toString() {\n return Util.bytesToHex(getByteArray());\n }",
"private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }",
"public static String byteToHex(byte b) {\n return new String(new char[] {HEX_CHARS[(b & 0xFF) >>> 4], HEX_CHARS[b & 0xF]});\n }",
"public static String toHexStringUpperCase(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsUpperCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsUpperCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }",
"public ToHexString(boolean useUpperCase) {\n this.useUpperCase = useUpperCase;\n }",
"private String m34491a(byte[] bArr) {\n StringBuilder sb = new StringBuilder(bArr.length);\n for (byte b : bArr) {\n String hexString = Integer.toHexString(((char) b) & 255);\n if (hexString.length() < 2) {\n sb.append(0);\n }\n sb.append(hexString.toUpperCase());\n }\n return sb.toString();\n }",
"public static String bytesToHex(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for (byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }",
"public static String bytesToHex_UpperCase(byte[] txtInByte) {\n\t\treturn bytesToHex(txtInByte).toUpperCase();\n }",
"public static String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n\n for (int n = 0; n < b.length; n++) {\n stmp = Integer.toHexString(b[n] & 0xFF);\n if (stmp.length() == 1)\n hs += (\"0\" + stmp);\n else\n hs += stmp;\n }\n return hs.toUpperCase();\n }",
"public static String prettyHex(final byte value) {\n return prettyHex(new byte[] {value});\n }",
"public String toHex(String arg) throws UnsupportedEncodingException {\n\t return String.format(\"%064x\", new BigInteger(1, arg.getBytes(\"UTF8\")));\n\t}",
"private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }",
"private String blobToHex (Blob blobData) throws SQLException {\n\n String returnData = \"\";\n\n if (blobData != null) {\n try {\n byte[] bytes = blobData.getBytes(1, (int) blobData.length());\n returnData = Hex.encodeHexString(bytes).toUpperCase();\n } finally {\n // The most important thing here is free the BLOB to avoid memory Leaks\n blobData.free();\n }\n }\n return returnData;\n }",
"private static String bytesToHex(byte[] bytes) {\n StringBuilder result = new StringBuilder();\n\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n\n return result.toString();\n }",
"public static String bytesToHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(Character.forDigit((b & 0xF0) >> 4, 16))\n .append(Character.forDigit((b & 0x0F), 16));\n }\n return hex.toString();\n }",
"private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}",
"static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }",
"public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}",
"protected byte[] binaryToHex(byte[] digest) throws UnsupportedEncodingException {\n StringBuffer digestString = new StringBuffer();\n for (int i = 0; i < digest.length; i++) {\n if ((digest[i] & 0x000000ff) < 0x10) {\n digestString.append(\"0\" + Integer.toHexString(digest[i] & 0x000000ff));\n } else {\n digestString.append(Integer.toHexString(digest[i] & 0x000000ff));\n }\n }\n return digestString.toString().getBytes(encoding);\n }",
"public String bytesToHex(byte[] bytes) {\n\t StringBuilder sbuf = new StringBuilder();\n\t for(int idx=0; idx < bytes.length; idx++) {\n\t int intVal = bytes[idx] & 0xff;\n\t if (intVal < 0x10) sbuf.append(\"0\");\n\t sbuf.append(Integer.toHexString(intVal).toUpperCase());\n\t }\n\t return sbuf.toString();\n\t }",
"public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }",
"public static String bytetohex(byte[] byteArray) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\tsb.append(String.format(\"%02x\", 0xFF & (int) byteArray[i]));\n\t\t}\n\t\treturn sb.toString().toLowerCase();\n\t}",
"public static void byte2hex(byte b, StringBuffer buf) {\n char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int high = ((b & 0xf0) >> 4);\n int low = (b & 0x0f);\n buf.append(hexChars[high]);\n buf.append(hexChars[low]);\n }",
"public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }",
"public static String bytesToHex(byte[] bytes){\n if(bytes == null)\n throw new NullPointerException();\n String result = \"\";\n for(byte b: bytes){\n String tmp = Integer.toHexString(b & 0xFF);\n if(tmp.length() == 1)\n result += \"0\";\n result += tmp;\n }\n return result;\n }",
"private static String bytesToHex(byte[] bytes) {\n final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }",
"public static String bytesToHex(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n return result.toString();\n }",
"public static String convertBech32AddressToHexAddress(String bech32Address) {\n return Util.start0x(Hex.toHexString(Bech32Util.decodeAddress(bech32Address, null)));\n }",
"private String convertToHex(byte[] raw) {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < raw.length; i++) {\n sb.append(Integer.toString((raw[i] & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }",
"private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String hex(final byte[] data) {\n return hex(data, 0, data.length);\n }",
"public static String toHexString(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"public static String hex(final byte value) {\n char[] buf = new char[2];\n System.arraycopy(Hexs.HEXDUMP_TABLE, (value & 0xFF) << 1, buf, 0, 2);\n return new String(buf);\n }",
"public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }",
"public static String bytesToHex(byte[] bytes) {\n Formatter f = new Formatter();\n for (byte b : bytes) {\n f.format(\"%02x\", b);\n }\n return f.toString();\n }",
"public static String byteToHex(byte[] bytes) {\n\t\tchar[] hexChars = new char[bytes.length * 2];\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tint j = bytes[i] & 0xFF;\n\t\t\thexChars[i * 2] = hexLookup[j >>> 4];\n\t\t\thexChars[i * 2 + 1] = hexLookup[j & 0x0F];\n\t\t}\n\t\treturn new String(hexChars);\n\t}",
"public static String asciiToHex(String asciiValue)\n \t{\n \t char[] chars = asciiValue.toCharArray();\n \t StringBuffer hex = new StringBuffer();\n \t for (int i = 0; i < chars.length; i++)\n \t {\n \t hex.append(Integer.toHexString((int) chars[i]));\n \t }\n \t return hex.toString();\n \t}",
"public String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n for (int n = 0; n < b.length; n++) {\n stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));\n if (stmp.length() == 1) {\n hs = hs + \"0\" + stmp;\n } else {\n hs = hs + stmp;\n }\n\n if (n < b.length - 1) {\n hs = hs + \"\";\n }\n }\n\n return hs;\n }",
"private String toHex(byte[] bytes) {\n StringBuilder s = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n s.append(String.format(\"%02x\", b));\n }\n return s.toString();\n }",
"private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}",
"@NonNull\n public static String sha256BytesToHex(@NonNull byte[] bytes) {\n synchronized (SHA_256_CHARS) {\n return bytesToHex(bytes, SHA_256_CHARS);\n }\n }",
"private static String byteToHexString(final byte hash) {\n\t\tint n = hash;\n\t\tif (n < 0) {\n\t\t\tn = 256 + n;\n\t\t}\n\t\tint d1 = n / 16;\n\t\tint d2 = n % 16;\n\t\treturn FileHashingUtils.hexDigits[d1] + FileHashingUtils.hexDigits[d2];\n\t}",
"public static String toHex(byte[] bytes){\r\n\t\treturn hexEncode(bytes);\r\n\t}",
"public static String byteArrayToHexString(byte[] in) {\n\t\tint ch = 0x00;\n\t\tString pseudo[] = {\"0\", \"1\", \"2\",\n\t\t\t\t\"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n\t\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"};\n\n\t\tStringBuffer out = new StringBuffer(in.length*2);\n\t\tfor (int i = 0; i < in.length; i++) {\n\t\t\tch = ((in[i] & 0xF0) >> 4);\n\t\t\tch = (ch & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t\tch = (in[i] & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t}\n\t\treturn new String(out);\n\t}",
"public static final String toHexString(byte[] b) {\n return toHexString(b, 0, b.length);\n }",
"public static final String toHexString(byte b) {\n return Integer.toString((b & 0xff) + 0x100, 16).substring(1);\n }",
"private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\n }",
"public static String getHexString (byte[] bytes) {\r\n\t \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\r\n\t for (int i = 0; i < bytes.length; i++) {\r\n\t sb.append(String.format(\"%02x\", bytes[i]).toUpperCase());\r\n\t if (i < (bytes.length - 1))\r\n\t \tsb.append(\"-\");\r\n\t }\r\n\r\n\t return sb.toString();\r\n\t}",
"public static String formatByteAsHex(byte a)\n {\n char guarismos[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n int i = signedByte2unsignedInteger(a);\n byte nibbleH = (byte)(i >> 4), nibbleL = (byte)(i & 0x0F);\n\n return \"\" + guarismos[nibbleH] + guarismos[nibbleL];\n }",
"public static String toHexString(byte b) {\n return Integer.toHexString(toInt(b));\n }",
"public static String toHexString(byte... vals) {\n StringBuilder sb = new StringBuilder();\n for (byte v : vals)\n sb.append(toHexString(v));\n return sb.toString();\n }",
"public static final String bytesToHexString(byte[] bArray, int begin, int end) {\n StringBuffer sb = new StringBuffer(bArray.length);\n String sTemp;\n for (int i = begin; i < end; i++) {\n sTemp = Integer.toHexString(0xFF & bArray[i]);\n if (sTemp.length() < 2)\n sb.append(0);\n sb.append(sTemp.toUpperCase());\n sb.append(\" \");\n }\n return sb.toString();\n }",
"public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }",
"public static String convertBytesAddressToBech32Address(byte[] address) {\n return Bech32Util.encodeAddress(address, null);\n }",
"public static String bytesToHexStringNo0xChar(byte[] src) {\n StringBuilder stringBuilder = new StringBuilder(\"\");\n if (src == null || src.length <= 0) {\n return null;\n }\n for (int i = 0; i < src.length; i++) {\n int v = src[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n stringBuilder.append(0);\n }\n stringBuilder.append(hv);\n }\n return stringBuilder.toString();\n }",
"public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }",
"public static String asciiToHex(String ascii) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tfor (int i = 0; i < ascii.length(); ++i) {\n\t\t\tbuffer.append(Integer.toHexString((int) ascii.charAt(i)));\n\t\t}\n\t\treturn buffer.toString();\n\t}",
"public static String formatHexBytes(byte[] raw) {\n StringBuffer buffer;\n final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int i;\n int value;\n buffer = new StringBuffer(raw.length * 2);\n for (i = 0; i < raw.length; i++) {\n value = raw[i];\n buffer.append(hexDigits[(value >> 4) & 0x0F]);\n buffer.append(hexDigits[value & 0x0F]);\n }\n return (buffer.toString());\n }",
"private static String getHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(\n HEXES.charAt((b & 0x0F)));\n }\n return hex.toString();\n }",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (byte b : bytearray) {\n\t\t\tString x = Integer.toHexString((int) (b & 0xFF));\n\t\t\tif (x.length() == 1) {\n\t\t\t\tsb.append(String.valueOf(0));\n\t\t\t}\n\t\t\tsb.append(x);\n\t\t}\n\t\tif (sb.length() % 2 != 0) {\n\t\t\tsb.insert(0, 0);\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String bytesToHex(byte[] array) {\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < array.length; i++) {\n String hex = Integer.toHexString(0xff & array[i]);\n if(hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n return hexString.toString();\n }",
"public static String prettyHex(final byte[] data) {\n return prettyHex(data, 0, data.length);\n }",
"public void binToHex(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toHex();\n\t\t\tthis.outHex();\n\t\t}\n\t}",
"public static String byteArrayToHex(final byte[] arr) {\n final StringBuilder sb = new StringBuilder();\n if (arr != null) {\n for (final byte b : arr) {\n sb.append(byteToHex(b));\n sb.append(\" \");\n }\n }\n return sb.toString().replaceAll(\" $\", \"\");\n }",
"public static String toString(final ByteBuffer bb) {\n Objects.requireNonNull(bb);\n return (BytesUtils.toString(bb, BytesUtils.DEFAULT_CHARSET));\n }",
"@Override\n public String toString() {\n\treturn ByteUtils.toHexString(toByteArray(), true);\n }",
"public static String toHexString(byte[] byteArray) {\n final StringBuilder hexString = new StringBuilder(\"\");\n if (byteArray == null || byteArray.length <= 0)\n return null;\n for (int i = 0; i < byteArray.length; i++) {\n int v = byteArray[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n hexString.append(0);\n }\n hexString.append(hv);\n }\n return hexString.toString().toLowerCase();\n }",
"byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }",
"public static String hexToString(String txtInHex) {\n \tint groupLength = 2;\n StringBuilder sb = new StringBuilder(txtInHex.length() / groupLength);\n \n for (int i = 0; i < txtInHex.length() - groupLength + 1; i += groupLength) {\n String hex = txtInHex.substring(i, i + groupLength);\n sb.append((char) Integer.parseInt(hex, 16));\n }\n \n return sb.toString();\n }",
"private String ByteArrayToHexString(byte [] inarray) {\n int i, j, in;\n String [] hex = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"};\n String out= \"\";\n\n for(j = 0 ; j < inarray.length ; ++j)\n {\n in = (int) inarray[j] & 0xff;\n i = (in >> 4) & 0x0f;\n out += hex[i];\n i = in & 0x0f;\n out += hex[i];\n }\n return out;\n }",
"public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }",
"static String hexEncode(byte[] b, int off, int len, int max) {\n char[] r;\n int v;\n int i;\n int j;\n \n if ((b == null) || (len == 0)) {\n return \"\";\n }\n\n if ((off < 0) || (len < 0)) {\n throw new ArrayIndexOutOfBoundsException();\n }\n\n r = new char[len * 3];\n\n for (i = 0, j = 0; ; ) {\n v = b[off + i] & 0xff;\n r[j++] = hc[v >>> 4];\n r[j++] = hc[v & 0x0f];\n\n i++;\n if (i >= len) {\n break;\n }\n\n if (i == max) {\n r[j++] = ' ';\n r[j++] = '+';\n break;\n }\n \n r[j++] = ':';\n }\n\n return (new String(r, 0, j));\n }",
"public String binToHex(String input) {\r\n int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn Integer.toString(decimal,16);\t\r\n\t}",
"public static String byteArrayToHexString(byte[] bytes) {\n // Solution copied from https://stackoverflow.com/questions/9655181\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = Normal.DIGITS_16_UPPER[v >>> 4];\n hexChars[j * 2 + 1] = Normal.DIGITS_16_UPPER[v & 0x0F];\n }\n return new String(hexChars);\n }",
"private static String byteArrayToHexString(byte[] b) {\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (byte element : b) {\n int v = element & 0xff;\n if(v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"public static String asciiToHex(String asciiValue) {\n char[] chars = asciiValue.toCharArray();\n StringBuffer hex = new StringBuffer();\n for (int i = 0; i < chars.length; i++) {\n hex.append(Integer.toHexString((int) chars[i]));\n }\n\n return hex.toString() + \"\".join(\"\", Collections.nCopies(32 - (hex.length() / 2), \"00\"));\n }",
"public static String toHex(byte[] bytes)\n {\n\n if (bytes == null)\n {\n return null;\n }\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < bytes.length; i++)\n {\n int value = (int) bytes[i];\n\n builder.append(HEX_CHARS.charAt((value >> 4) & 0x0F));\n builder.append(HEX_CHARS.charAt(value & 0x0F));\n }\n\n return builder.toString();\n }",
"public String toASCIIString() {\n return Utilities.convertHexToASCII(this.toHexString());\n }",
"private static String byteToHexString(byte b) {\n int n = b;\n if (n < 0) {\n n += 256;\n }\n int d1 = n >> 4;\n int d2 = n % 16;\n return hexDigits[d1] + hexDigits[d2];\n }",
"public static String bytesToHexString(byte[] b) {\n\t\treturn bytesToHexString(b,b.length);\n\t}",
"private static char toHex(int nibble) {\n\t\treturn hexDigit[(nibble & 0xF)];\n\t}",
"private static String convertToByteHexValue(String hexValue, int bufferSize, boolean paddingAtBottom){\n\t\t\n\t\tStringBuffer sbTemp = new StringBuffer();\n\t\t\n\t\tint hexValSize = hexValue.length();\n\t\t\n\t\t// This will append the hexValue data at the beginning of the output String. e.g.: 0b 00 00 00\n\t\tif (paddingAtBottom) {\n\t\t\tsbTemp.append(hexValue);\n\t\t}\n\t\t\n\t\twhile (bufferSize*2 > hexValSize){\n\t\t\t\tsbTemp.append(\"0\");\n\t\t\t\thexValSize++;\n\t\t}\n\t\t\n\t\t// This will append the hexValue data at the end of the output String. e.g.: 00 00 00 0b\n\t\tif (!paddingAtBottom) {\n\t\t\tsbTemp.append(hexValue);\n\t\t}\n\t\t\n\t\treturn sbTemp.toString();\n\t}",
"private static char toHex(int nibble)\n\t{\n\t\treturn hexDigit[(nibble & 0xF)];\n\t}",
"public static String unHex(String arg) { \r\n\t String str = \"\";\r\n\t for(int i=0;i<arg.length();i+=2)\r\n\t {\r\n\t String s = arg.substring(i, (i + 2));\r\n\t int decimal = Integer.parseInt(s, 16);\r\n\t str = str + (char) decimal;\r\n\t } \r\n\t return str;\r\n\t}",
"public static String sha256BytesToHex(byte[] bytes) {\n synchronized (SHA_256_CHARS) {\n return bytesToHex(bytes, SHA_256_CHARS);\n }\n }",
"private void outHex(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}"
] | [
"0.70229465",
"0.6293478",
"0.6246971",
"0.62111294",
"0.6157863",
"0.6042064",
"0.60324013",
"0.60104185",
"0.59482956",
"0.5897985",
"0.5866289",
"0.58586836",
"0.5847956",
"0.5846013",
"0.5816047",
"0.5810747",
"0.58062553",
"0.5803883",
"0.5751252",
"0.5727208",
"0.5721273",
"0.5708893",
"0.5702288",
"0.5693749",
"0.56827384",
"0.56771827",
"0.566766",
"0.5666455",
"0.56320196",
"0.5629511",
"0.5603833",
"0.5601627",
"0.5582619",
"0.557527",
"0.55571556",
"0.5545497",
"0.5516293",
"0.5493937",
"0.5479374",
"0.54789084",
"0.54418755",
"0.5434306",
"0.54293233",
"0.5425359",
"0.5424141",
"0.54213625",
"0.54210526",
"0.54037994",
"0.5388699",
"0.53862053",
"0.5381035",
"0.5368376",
"0.5365729",
"0.53630304",
"0.5355408",
"0.5349639",
"0.5347117",
"0.53256327",
"0.53220195",
"0.5321539",
"0.53070885",
"0.53055394",
"0.53021806",
"0.529993",
"0.52868867",
"0.5285657",
"0.5282267",
"0.52806354",
"0.52659005",
"0.52489257",
"0.5248785",
"0.5239135",
"0.5234035",
"0.5225474",
"0.5212232",
"0.52120763",
"0.5204309",
"0.52029413",
"0.5200966",
"0.5200865",
"0.51900566",
"0.5183462",
"0.5173005",
"0.51650345",
"0.5157814",
"0.51553845",
"0.5151247",
"0.51475537",
"0.5142909",
"0.51339674",
"0.5131682",
"0.512478",
"0.5120477",
"0.51062113",
"0.5102",
"0.5093991",
"0.5085601",
"0.50855064",
"0.508413",
"0.50814706",
"0.507931"
] | 0.0 | -1 |
Convert the ByteBuffer's contents to a hex string upper or lower case. | public ToHexString(boolean useUpperCase) {
this.useUpperCase = useUpperCase;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String _bytesToHex( ByteBuffer buf )\n {\n final int offset = buf.position();\n final int size = buf.remaining();\n final char[] hexChars = new char[size * 2];\n\n for (int j = 0; j < size; j++) {\n int v = buf.get(j + offset) & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n\n return new String(hexChars);\n }",
"public static String asHex(byte[] buf) {\n \t char[] HEX_CHARS = \"0123456789abcdef\".toCharArray();\n \t char[] chars = new char[2 * buf.length];\n \t for (int i = 0; i < buf.length; ++i) {\n \t chars[2 * i] = HEX_CHARS[(buf[i] & 0xF0) >>> 4];\n \t chars[2 * i + 1] = HEX_CHARS[buf[i] & 0x0F];\n \t }\n \t return new String(chars);\n \t}",
"public\n static\n CharSequence\n asHexString( ByteBuffer bb )\n {\n inputs.notNull( bb, \"bb\" );\n ByteBuffer slice = bb.slice();\n\n CharBuffer res = CharBuffer.allocate( slice.remaining() * 2 );\n\n while ( slice.hasRemaining() )\n {\n byte b = slice.get();\n \n res.put( HEX_CHARS[ ( b >> 4 ) & 0x0f ] );\n res.put( HEX_CHARS[ b & 0x0f ] );\n }\n\n res.flip();\n return res.asReadOnlyBuffer();\n }",
"private static String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'\n\t\t};\n\t\tchar[] array = {hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f]};\n\t\treturn new String(array);\n\t}",
"private static String toHex(byte buffer[]) {\n\t\tStringBuffer sb = new StringBuffer(buffer.length * 2);\n\t\tfor (int i = 0; i < buffer.length; i++) {\n\t\t\tsb.append(Character.forDigit((buffer[i] & 0xf0) >> 4, 16));\n\t\t\tsb.append(Character.forDigit(buffer[i] & 0x0f, 16));\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public String toHexString()\n\t{\n\t\t// holds the string builder object to return\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tint intCurrent = bytes[i] & 0xFF;\n\t\t\t\n\t\t\t// check to see if a leading 0 is needed\n\t\t\tif (intCurrent < 0x10)\n\t\t\t{\n\t\t\t\t// append a 0\n\t\t\t\tsb.append(0);\n\t\t\t}\n\t\t\t\n\t\t\tString s = Integer.toHexString(intCurrent).toUpperCase();\n\t\t\t\n\t\t\t// append the character\n\t\t\tsb.append(s);\n\t\t}\n\t\t\n\t\t// return the string\n\t\treturn sb.toString();\n\t}",
"private String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n\n return buf.toString();\n }",
"private String makeHex(byte[] buffer) {\n byte current;\n int length = buffer.length;\n String blank = \"\"; // it's easier to change\n StringBuffer ret = new StringBuffer(2*length);\n\n // do for each half byte\n for(int i=0;i<(2*length);i++)\n {\n\t// mask half byte and move it to the right\n\tcurrent = i%2==1 ? (byte) (buffer[(i/2)] & 0x0F)\n\t : (byte) ((buffer[(i/2)] >> 4) & 0x0F);\n\t\n\t// convert half byte to ASCII char\t\t \n\tret.append((char) (current < 0x0A ? current+0x30 : current+0x37) + (i%2==1 ? blank : \"\"));\n }\n return ret.toString();\n }",
"private static String hexify(byte bytes[]) {\n\n char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};\n\n StringBuilder buf = new StringBuilder(bytes.length * 2);\n for (byte aByte : bytes) {\n buf.append(hexDigits[(aByte & 0xf0) >> 4]);\n buf.append(hexDigits[aByte & 0x0f]);\n }\n return buf.toString();\n }",
"@NotNull\n public static String convertBytesToHex(@NotNull byte[] value) {\n checkNotNull(value);\n int len = value.length;\n char[] buff = new char[len + len];\n char[] hex = HEX;\n for (int i = 0; i < len; i++) {\n int c = value[i] & 0xff;\n buff[i + i] = hex[c >> 4];\n buff[i + i + 1] = hex[c & 0xf];\n }\n return new String(buff);\n }",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',\n\t\t\t\t'B', 'C', 'D', 'E', 'F' };\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"static public String byteToHex(byte b) {\n\t\tchar hexDigit[] = {\n\t\t\t\t'0', '1', '2', '3', '4', '5', '6', '7',\n\t\t\t\t'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'\n\t\t};\n\t\tchar[] array = { hexDigit[(b >> 4) & 0x0f], hexDigit[b & 0x0f] };\n\t\treturn new String(array);\n\t}",
"private String toHexString(byte[] bytes) {\n StringBuilder hexString = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n String hex = Integer.toHexString(0xFF & bytes[i]);\n if (hex.length() == 1) {\n hexString.append('0');\n }\n hexString.append(hex);\n }\n\n return hexString.toString().toUpperCase();\n }",
"public static String bytesToHex(byte[] txtInByte) {\n\t\t StringBuilder sb = new StringBuilder(txtInByte.length * 2);\n\t\t for(byte b: txtInByte)\n\t\t sb.append(String.format(\"%02x\", b & 0xff));\n\t\t return sb.toString();\n\t\t}",
"private String toHex(byte[] data) {\r\n char[] chars = new char[data.length * 2];\r\n for (int i = 0; i < data.length; i++) {\r\n chars[i * 2] = HEX_DIGITS[(data[i] >> 4) & 0xf];\r\n chars[i * 2 + 1] = HEX_DIGITS[data[i] & 0xf];\r\n }\r\n return new String(chars);\r\n}",
"private String m34491a(byte[] bArr) {\n StringBuilder sb = new StringBuilder(bArr.length);\n for (byte b : bArr) {\n String hexString = Integer.toHexString(((char) b) & 255);\n if (hexString.length() < 2) {\n sb.append(0);\n }\n sb.append(hexString.toUpperCase());\n }\n return sb.toString();\n }",
"public String toString() {\n return Util.bytesToHex(getByteArray());\n }",
"public static String convertBech32AddressToHexAddress(String bech32Address) {\n return Util.start0x(Hex.toHexString(Bech32Util.decodeAddress(bech32Address, null)));\n }",
"private String blobToHex (Blob blobData) throws SQLException {\n\n String returnData = \"\";\n\n if (blobData != null) {\n try {\n byte[] bytes = blobData.getBytes(1, (int) blobData.length());\n returnData = Hex.encodeHexString(bytes).toUpperCase();\n } finally {\n // The most important thing here is free the BLOB to avoid memory Leaks\n blobData.free();\n }\n }\n return returnData;\n }",
"public static String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n\n for (int n = 0; n < b.length; n++) {\n stmp = Integer.toHexString(b[n] & 0xFF);\n if (stmp.length() == 1)\n hs += (\"0\" + stmp);\n else\n hs += stmp;\n }\n return hs.toUpperCase();\n }",
"private static String bytesToHex(byte[] bytes) {\n StringBuilder result = new StringBuilder();\n\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n\n return result.toString();\n }",
"public static String bytetohex(byte[] byteArray) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\tsb.append(String.format(\"%02x\", 0xFF & (int) byteArray[i]));\n\t\t}\n\t\treturn sb.toString().toLowerCase();\n\t}",
"private static String toHex(byte[] hash) {\n StringBuilder hashedInput = new StringBuilder(\"\");\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(0xff & hash[i]);\n if (hex.length() == 1) {\n hashedInput.append('0');\n }\n hashedInput.append(hex);\n }\n return hashedInput.toString();\n }",
"public static String byteToHex(byte b) {\n return new String(new char[] {HEX_CHARS[(b & 0xFF) >>> 4], HEX_CHARS[b & 0xF]});\n }",
"public static String bytesToString(byte[] txtInByte){\n \treturn hexToString(bytesToHex(txtInByte));\n }",
"static String createString(byte b[]) {\n\treturn StringConverter.byteToHex(b);\n }",
"public static String bytesToHex(byte[] in) {\n final StringBuilder builder = new StringBuilder();\n for (byte b : in) {\n builder.append(String.format(\"%02x\", b));\n }\n return builder.toString();\n }",
"public String toHex(String arg) throws UnsupportedEncodingException {\n\t return String.format(\"%064x\", new BigInteger(1, arg.getBytes(\"UTF8\")));\n\t}",
"public static String byteToHex(final byte[] hash) {\n if (Objects.isNull(hash)) {\n return null;\n }\n\n Formatter formatter = new Formatter();\n for (byte b : hash) {\n formatter.format(\"%02x\", b);\n }\n String result = formatter.toString();\n formatter.close();\n return result;\n }",
"public static void byte2hex(byte b, StringBuffer buf) {\n char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int high = ((b & 0xf0) >> 4);\n int low = (b & 0x0f);\n buf.append(hexChars[high]);\n buf.append(hexChars[low]);\n }",
"private String convertToHex(byte[] raw) {\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < raw.length; i++) {\n sb.append(Integer.toString((raw[i] & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }",
"public static String bytesToHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(Character.forDigit((b & 0xF0) >> 4, 16))\n .append(Character.forDigit((b & 0x0F), 16));\n }\n return hex.toString();\n }",
"public static String toHexString(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsLowerCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"public static String toHexStringUpperCase(byte[] b) {\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor (int i = 0; i < b.length; i++) {\r\n\t\t\tsb.append(hexCharsUpperCase[ (int)(((int)b[i] >> 4) & 0x0f)]);\r\n\t\t\tsb.append(hexCharsUpperCase[ (int)(((int)b[i]) & 0x0f)]);\r\n\t\t}\r\n\t return sb.toString(); \r\n\t}",
"public static String prettyHex(final byte value) {\n return prettyHex(new byte[] {value});\n }",
"private static String convertToHex(byte[] data) {\r\n StringBuffer buf = new StringBuffer();\r\n for (int i = 0; i < data.length; i++) {\r\n int halfbyte = (data[i] >>> 4) & 0x0F;\r\n int two_halfs = 0;\r\n do {\r\n if ((0 <= halfbyte) && (halfbyte <= 9)) {\r\n buf.append((char) ('0' + halfbyte));\r\n }\r\n else {\r\n buf.append((char) ('a' + (halfbyte - 10)));\r\n }\r\n halfbyte = data[i] & 0x0F;\r\n } while(two_halfs++ < 1);\r\n }\r\n return buf.toString();\r\n }",
"public String bytesToHex(byte[] bytes) {\n\t StringBuilder sbuf = new StringBuilder();\n\t for(int idx=0; idx < bytes.length; idx++) {\n\t int intVal = bytes[idx] & 0xff;\n\t if (intVal < 0x10) sbuf.append(\"0\");\n\t sbuf.append(Integer.toHexString(intVal).toUpperCase());\n\t }\n\t return sbuf.toString();\n\t }",
"public void binToHex(){\n\t\tthis.inputBin();\n\t\tif(checkValue()==true){\n\t\t\tthis.toHex();\n\t\t\tthis.outHex();\n\t\t}\n\t}",
"private static String bytesToHex(byte[] bytes) {\n final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',\n '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n char[] hexChars = new char[bytes.length * 2];\n int v;\n for (int j = 0; j < bytes.length; j++) {\n v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"private static String bytesToHex(byte[] bytes) {\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = hexArray[v >>> 4];\n hexChars[j * 2 + 1] = hexArray[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String rawHexDump(byte[] b)\r\n\t{\r\n\t\tif (b == null)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tint size = b.length;\r\n\t\tif (size == 0)\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tfor (int i=0; i < size; i++)\r\n\t\t{\r\n\t\t\t\tbuf.append(zeropad(Integer.toHexString(byteToUInt(b[i])).toUpperCase(),2));\r\n\t\t\t\tbuf.append(\" \");\r\n\t\t}\r\n\t\tbuf.delete(buf.length()-1,buf.length());\r\n\t\treturn buf.toString();\r\n\t}",
"private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }",
"public static String convertBytesAddressToBech32Address(byte[] address) {\n return Bech32Util.encodeAddress(address, null);\n }",
"private String toHex(byte[] bytes) {\n StringBuilder s = new StringBuilder(bytes.length * 2);\n for (byte b : bytes) {\n s.append(String.format(\"%02x\", b));\n }\n return s.toString();\n }",
"public static String toHex(byte[] bytes){\r\n\t\treturn hexEncode(bytes);\r\n\t}",
"public String byte2hex(byte[] b) {\n String hs = \"\";\n String stmp = \"\";\n for (int n = 0; n < b.length; n++) {\n stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));\n if (stmp.length() == 1) {\n hs = hs + \"0\" + stmp;\n } else {\n hs = hs + stmp;\n }\n\n if (n < b.length - 1) {\n hs = hs + \"\";\n }\n }\n\n return hs;\n }",
"public static String toHex(byte[] b) {\r\n\tStringBuffer buf;\r\n\tint i;\r\n\r\n\tbuf = new StringBuffer(b.length * 2);\r\n\r\n\tfor (i = 0; i < b.length; i++) {\r\n\t buf.append(HEX.charAt((b[i] >> 4) & 15));\r\n\t buf.append(HEX.charAt(b[i] & 15));\r\n\t}\r\n\treturn buf.toString();\r\n }",
"protected byte[] binaryToHex(byte[] digest) throws UnsupportedEncodingException {\n StringBuffer digestString = new StringBuffer();\n for (int i = 0; i < digest.length; i++) {\n if ((digest[i] & 0x000000ff) < 0x10) {\n digestString.append(\"0\" + Integer.toHexString(digest[i] & 0x000000ff));\n } else {\n digestString.append(Integer.toHexString(digest[i] & 0x000000ff));\n }\n }\n return digestString.toString().getBytes(encoding);\n }",
"public static String bytesToHex(byte[] bytes){\n if(bytes == null)\n throw new NullPointerException();\n String result = \"\";\n for(byte b: bytes){\n String tmp = Integer.toHexString(b & 0xFF);\n if(tmp.length() == 1)\n result += \"0\";\n result += tmp;\n }\n return result;\n }",
"public static String bytesToHex_UpperCase(byte[] txtInByte) {\n\t\treturn bytesToHex(txtInByte).toUpperCase();\n }",
"public static String bytesToHex(byte[] bytes) {\n StringBuffer result = new StringBuffer();\n for (byte byt : bytes) {\n result.append(Integer.toString((byt & 0xff) + 0x100, 16).substring(1));\n }\n return result.toString();\n }",
"public static String asciiToHex(String asciiValue)\n \t{\n \t char[] chars = asciiValue.toCharArray();\n \t StringBuffer hex = new StringBuffer();\n \t for (int i = 0; i < chars.length; i++)\n \t {\n \t hex.append(Integer.toHexString((int) chars[i]));\n \t }\n \t return hex.toString();\n \t}",
"public static String hex(final byte[] data) {\n return hex(data, 0, data.length);\n }",
"private static String getHex(byte[] raw) {\n if (raw == null) {\n return null;\n }\n final StringBuilder hex = new StringBuilder(2 * raw.length);\n for (final byte b : raw) {\n hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(\n HEXES.charAt((b & 0x0F)));\n }\n return hex.toString();\n }",
"public static final String toHex(byte hash[]) {\r\n StringBuffer buf = new StringBuffer(hash.length * 2);\r\n int i;\r\n\r\n for (i = 0; i < hash.length; i++) {\r\n if (((int) hash[i] & 0xff) < 0x10) {\r\n buf.append(\"0\");\r\n }\r\n buf.append(Long.toString((int) hash[i] & 0xff, 16));\r\n }\r\n return buf.toString();\r\n }",
"public static String convert(byte[] bytes) {\n/* 34 */ StringBuffer sb = new StringBuffer(bytes.length * 2);\n/* 35 */ for (int i = 0; i < bytes.length; i++) {\n/* 36 */ sb.append(hexs[bytes[i] >> 4 & 0xF]);\n/* 37 */ sb.append(hexs[bytes[i] & 0xF]);\n/* */ } \n/* 39 */ return sb.toString();\n/* */ }",
"private static String toHex(byte[] digest) {\n\t\tchar[] result = new char[digest.length * 2];\n\t\tint pos = 0;\n\t\tfor (int i = 0; i < digest.length; i++) {\n\t\t\tresult[pos++] = hexChar((digest[i] & 0xf0) >> 4);\n\t\t\tresult[pos++] = hexChar(digest[i] & 0x0f);\n\t\t}\n\t\treturn new String(result);\n\t}",
"public static String byteToHex(byte[] bytes) {\n\t\tchar[] hexChars = new char[bytes.length * 2];\n\t\tfor (int i = 0; i < bytes.length; i++) {\n\t\t\tint j = bytes[i] & 0xFF;\n\t\t\thexChars[i * 2] = hexLookup[j >>> 4];\n\t\t\thexChars[i * 2 + 1] = hexLookup[j & 0x0F];\n\t\t}\n\t\treturn new String(hexChars);\n\t}",
"public static String byteArrayToHexString(byte[] in) {\n\t\tint ch = 0x00;\n\t\tString pseudo[] = {\"0\", \"1\", \"2\",\n\t\t\t\t\"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n\t\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"};\n\n\t\tStringBuffer out = new StringBuffer(in.length*2);\n\t\tfor (int i = 0; i < in.length; i++) {\n\t\t\tch = ((in[i] & 0xF0) >> 4);\n\t\t\tch = (ch & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t\tch = (in[i] & 0x0F);\n\t\t\tout.append(pseudo[ch]);\n\t\t}\n\t\treturn new String(out);\n\t}",
"public static String toHex(byte[] bytes)\n {\n\n if (bytes == null)\n {\n return null;\n }\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < bytes.length; i++)\n {\n int value = (int) bytes[i];\n\n builder.append(HEX_CHARS.charAt((value >> 4) & 0x0F));\n builder.append(HEX_CHARS.charAt(value & 0x0F));\n }\n\n return builder.toString();\n }",
"public static String bytesToHex(byte[] bytes) {\n Formatter f = new Formatter();\n for (byte b : bytes) {\n f.format(\"%02x\", b);\n }\n return f.toString();\n }",
"public static String toHexString(byte[] byteArray) {\n final StringBuilder hexString = new StringBuilder(\"\");\n if (byteArray == null || byteArray.length <= 0)\n return null;\n for (int i = 0; i < byteArray.length; i++) {\n int v = byteArray[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n hexString.append(0);\n }\n hexString.append(hv);\n }\n return hexString.toString().toLowerCase();\n }",
"private String ByteArrayToHexString(byte [] inarray) {\n int i, j, in;\n String [] hex = {\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"};\n String out= \"\";\n\n for(j = 0 ; j < inarray.length ; ++j)\n {\n in = (int) inarray[j] & 0xff;\n i = (in >> 4) & 0x0f;\n out += hex[i];\n i = in & 0x0f;\n out += hex[i];\n }\n return out;\n }",
"public static String formatHexBytes(byte[] raw) {\n StringBuffer buffer;\n final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n int i;\n int value;\n buffer = new StringBuffer(raw.length * 2);\n for (i = 0; i < raw.length; i++) {\n value = raw[i];\n buffer.append(hexDigits[(value >> 4) & 0x0F]);\n buffer.append(hexDigits[value & 0x0F]);\n }\n return (buffer.toString());\n }",
"public static String hex(final byte value) {\n char[] buf = new char[2];\n System.arraycopy(Hexs.HEXDUMP_TABLE, (value & 0xFF) << 1, buf, 0, 2);\n return new String(buf);\n }",
"@NonNull\n public static String sha256BytesToHex(@NonNull byte[] bytes) {\n synchronized (SHA_256_CHARS) {\n return bytesToHex(bytes, SHA_256_CHARS);\n }\n }",
"public static String formatByteAsHex(byte a)\n {\n char guarismos[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};\n int i = signedByte2unsignedInteger(a);\n byte nibbleH = (byte)(i >> 4), nibbleL = (byte)(i & 0x0F);\n\n return \"\" + guarismos[nibbleH] + guarismos[nibbleL];\n }",
"public static final String toHexString(byte[] b) {\n return toHexString(b, 0, b.length);\n }",
"public static final String toHexString(byte b) {\n return Integer.toString((b & 0xff) + 0x100, 16).substring(1);\n }",
"public String toHexString() {\n\treturn ByteUtils.toHexString(toByteArray());\n }",
"private static char toHex(int nibble) {\n\t\treturn hexDigit[(nibble & 0xF)];\n\t}",
"public static String prettyHex(final byte[] data) {\n return prettyHex(data, 0, data.length);\n }",
"private static char toHex(int nibble)\n\t{\n\t\treturn hexDigit[(nibble & 0xF)];\n\t}",
"public static String toHexString(byte b) {\n return Integer.toHexString(toInt(b));\n }",
"public static String asciiToHex(String ascii) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tfor (int i = 0; i < ascii.length(); ++i) {\n\t\t\tbuffer.append(Integer.toHexString((int) ascii.charAt(i)));\n\t\t}\n\t\treturn buffer.toString();\n\t}",
"public static String getHexString (byte[] bytes) {\r\n\t \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\r\n\t for (int i = 0; i < bytes.length; i++) {\r\n\t sb.append(String.format(\"%02x\", bytes[i]).toUpperCase());\r\n\t if (i < (bytes.length - 1))\r\n\t \tsb.append(\"-\");\r\n\t }\r\n\r\n\t return sb.toString();\r\n\t}",
"private static String byteToHexString(final byte hash) {\n\t\tint n = hash;\n\t\tif (n < 0) {\n\t\t\tn = 256 + n;\n\t\t}\n\t\tint d1 = n / 16;\n\t\tint d2 = n % 16;\n\t\treturn FileHashingUtils.hexDigits[d1] + FileHashingUtils.hexDigits[d2];\n\t}",
"public static String bytesToHexStringNo0xChar(byte[] src) {\n StringBuilder stringBuilder = new StringBuilder(\"\");\n if (src == null || src.length <= 0) {\n return null;\n }\n for (int i = 0; i < src.length; i++) {\n int v = src[i] & 0xFF;\n String hv = Integer.toHexString(v);\n if (hv.length() < 2) {\n stringBuilder.append(0);\n }\n stringBuilder.append(hv);\n }\n return stringBuilder.toString();\n }",
"public static String hexToString(String txtInHex) {\n \tint groupLength = 2;\n StringBuilder sb = new StringBuilder(txtInHex.length() / groupLength);\n \n for (int i = 0; i < txtInHex.length() - groupLength + 1; i += groupLength) {\n String hex = txtInHex.substring(i, i + groupLength);\n sb.append((char) Integer.parseInt(hex, 16));\n }\n \n return sb.toString();\n }",
"public static String byteArrayToHexString(byte[] bytes) {\n // Solution copied from https://stackoverflow.com/questions/9655181\n char[] hexChars = new char[bytes.length * 2];\n for (int j = 0; j < bytes.length; j++) {\n int v = bytes[j] & 0xFF;\n hexChars[j * 2] = Normal.DIGITS_16_UPPER[v >>> 4];\n hexChars[j * 2 + 1] = Normal.DIGITS_16_UPPER[v & 0x0F];\n }\n return new String(hexChars);\n }",
"public static String toHexString(byte b[]) {\n int pos = 0;\n char[] c = new char[b.length * 2];\n for (int i = 0; i < b.length; i++) {\n c[pos++] = toHex[(b[i] >> 4) & 0x0F];\n c[pos++] = toHex[b[i] & 0x0f];\n }\n return new String(c);\n }",
"public static final String bytesToHexString(byte[] bArray, int begin, int end) {\n StringBuffer sb = new StringBuffer(bArray.length);\n String sTemp;\n for (int i = begin; i < end; i++) {\n sTemp = Integer.toHexString(0xFF & bArray[i]);\n if (sTemp.length() < 2)\n sb.append(0);\n sb.append(sTemp.toUpperCase());\n sb.append(\" \");\n }\n return sb.toString();\n }",
"private static String byteArrayToHexString(byte[] b) {\n StringBuffer sb = new StringBuffer(b.length * 2);\n for (byte element : b) {\n int v = element & 0xff;\n if(v < 16) {\n sb.append('0');\n }\n sb.append(Integer.toHexString(v));\n }\n return sb.toString().toUpperCase();\n }",
"public static String bytesToHex(byte[] array) {\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < array.length; i++) {\n String hex = Integer.toHexString(0xff & array[i]);\n if(hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n return hexString.toString();\n }",
"public static String toHexString(byte... vals) {\n StringBuilder sb = new StringBuilder();\n for (byte v : vals)\n sb.append(toHexString(v));\n return sb.toString();\n }",
"protected static String convertHex( String base )\r\n\t{\r\n\t\treturn \"H\" + HexConvertor.convertHex( base.getBytes() ); \r\n\t}",
"private static String byteArrayToHexString(byte[] byteArray) {\n\t\t\n\t\t//Initialize the string buffer\n\t\tStringBuffer stringBuffer = new StringBuffer(byteArray.length * 2);\n\t\t\n\t\t//Start constructing the byte array\n\t\tstringBuffer.append(\"[ \");\n\t\t\n\t\t//For all the bytes in the array\n\t\tfor (int i = 0; i < byteArray.length; i++) {\n\t\t\t\n\t\t\t//Convert the byte to an integer\n\t\t\tint v = byteArray[i] & 0xff;\n\t\t\t\n\t\t\t//Left shift\n\t\t\tif (v < 16) {\n\t\t\t\tstringBuffer.append('0');\n\t\t\t}\n\t\t\t\n\t\t\t//Add the hex string representation of the byte \n\t\t\tstringBuffer.append(\"0x\" + Integer.toHexString(v).toUpperCase() + \" \");\n\t\t}\n\t\t\n\t\t//Close the byte array string\n\t\tstringBuffer.append(\"]\");\n\t\t\n\t\t//Convert the string buffer to a string a return it\n\t\treturn stringBuffer.toString();\n\t}",
"private static String byteToHexString(byte b) {\n int n = b;\n if (n < 0) {\n n += 256;\n }\n int d1 = n >> 4;\n int d2 = n % 16;\n return hexDigits[d1] + hexDigits[d2];\n }",
"byte toStringValue() {\n return (byte) String.valueOf(value).charAt(0);\n }",
"public String toASCIIString() {\n return Utilities.convertHexToASCII(this.toHexString());\n }",
"public String binarioToHexa(String binario) {\n\t\tSystem.out.print(\"Convirtiendo binario (\" + binario + \") a hexadecimal >> \");\n\t\tInteger numero = 0;\n\t\ttry{\n\t\t\tnumero = Integer.valueOf(binario, 2);\n\t\t}catch (NumberFormatException e) {\n\t\t\tSystem.err.print(\"\\nERROR : El numero \" + binario + \" no es binario\");\n\t\t}\n\t\treturn Integer.toHexString(numero);\n\t}",
"public static String bytetohex(byte[] bytearray) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (byte b : bytearray) {\n\t\t\tString x = Integer.toHexString((int) (b & 0xFF));\n\t\t\tif (x.length() == 1) {\n\t\t\t\tsb.append(String.valueOf(0));\n\t\t\t}\n\t\t\tsb.append(x);\n\t\t}\n\t\tif (sb.length() % 2 != 0) {\n\t\t\tsb.insert(0, 0);\n\t\t}\n\t\treturn sb.toString();\n\t}",
"static String convert(String bits) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.append(String.valueOf(hexLookUp.charAt(Integer.parseInt(bits, 2))));\n\t\tString hex = stringBuilder.toString();\n\t\treturn hex;\n\t}",
"public static String toHex(byte[] data) {\n\t\tStringBuilder builder = new StringBuilder(data.length * 3);\n\t\tfor (byte b : data) {\n\t\t\tint v = b & 0xFF;\n\t\t\t// Get the first then second character\n\t\t\tbuilder.append(HEX_ARRAY[v >>> 4]);\n\t\t\tbuilder.append(HEX_ARRAY[v & 0x0F]);\n\t\t\tbuilder.append(' ');\n\t\t}\n\t\treturn builder.toString().trim();\n\t}",
"public static String toHexString(byte[] array) {\n return DatatypeConverter.printHexBinary(array).toUpperCase();\n }",
"public static String unHex(String arg) { \r\n\t String str = \"\";\r\n\t for(int i=0;i<arg.length();i+=2)\r\n\t {\r\n\t String s = arg.substring(i, (i + 2));\r\n\t int decimal = Integer.parseInt(s, 16);\r\n\t str = str + (char) decimal;\r\n\t } \r\n\t return str;\r\n\t}",
"public static String convertToHex(byte[] otp) {\n return ByteIterator.ofBytes(otp).hexEncode().drainToString();\n }",
"public static String asciiToHex(String asciiValue) {\n char[] chars = asciiValue.toCharArray();\n StringBuffer hex = new StringBuffer();\n for (int i = 0; i < chars.length; i++) {\n hex.append(Integer.toHexString((int) chars[i]));\n }\n\n return hex.toString() + \"\".join(\"\", Collections.nCopies(32 - (hex.length() / 2), \"00\"));\n }",
"private static String hex(String binStr) {\n\n\n\t\tString newStr = new String();\n\n\t\ttry {\n\t\t\tString hexStr = \"0123456789ABCDEF\";\n\t\t\tbyte[] p = binStr.getBytes();\n\t\t\tfor (int k = 0; k < p.length; k++) {\n\t\t\t\tint j = (p[k] >> 4) & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j);\n\t\t\t\tj = p[k] & 0xF;\n\t\t\t\tnewStr = newStr + hexStr.charAt(j) + \" \";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"Failed to convert into hex values: \" + e);\n\t\t}\n\t\treturn newStr;\n\t}",
"@Test\n public void testBytesToHexString() {\n String testHex = ByteUtils.bytesToHexString(testBytes); \n assertEquals(testHex.length(), testBytes.length * 2);\n }"
] | [
"0.70602334",
"0.6319885",
"0.6251581",
"0.61283875",
"0.6124285",
"0.60540986",
"0.5978235",
"0.5977075",
"0.59726137",
"0.59720534",
"0.5961901",
"0.5954431",
"0.5943408",
"0.5920737",
"0.5860175",
"0.578358",
"0.576934",
"0.575343",
"0.57422656",
"0.5732412",
"0.5730253",
"0.5700439",
"0.5694006",
"0.5688426",
"0.5677745",
"0.5660988",
"0.56567144",
"0.56539327",
"0.56490505",
"0.564141",
"0.5635028",
"0.5614727",
"0.5612438",
"0.5601506",
"0.5582834",
"0.5576222",
"0.5562749",
"0.5546101",
"0.5537145",
"0.5534298",
"0.55272114",
"0.55240446",
"0.5520818",
"0.551579",
"0.54956037",
"0.5474634",
"0.5472927",
"0.54725474",
"0.54611844",
"0.54605985",
"0.5447522",
"0.5436023",
"0.54320997",
"0.54196143",
"0.5416554",
"0.5406975",
"0.5386875",
"0.5381884",
"0.5376064",
"0.53541905",
"0.53485477",
"0.5337328",
"0.53308994",
"0.5325805",
"0.531656",
"0.5304572",
"0.52937555",
"0.527728",
"0.52731",
"0.52724344",
"0.52702653",
"0.5266694",
"0.5263759",
"0.52552545",
"0.5253063",
"0.5252947",
"0.5240909",
"0.5237582",
"0.5229419",
"0.5213469",
"0.5211822",
"0.5208924",
"0.5206715",
"0.52023405",
"0.5178978",
"0.5173896",
"0.5170745",
"0.51704496",
"0.5170054",
"0.51696885",
"0.5158319",
"0.5153551",
"0.5153465",
"0.514472",
"0.5139435",
"0.5139259",
"0.51383996",
"0.513757",
"0.51350784",
"0.51348436"
] | 0.5390713 | 56 |
/ Math Functions Absolute value Math.abs(int) > Returns an int Math.abs(double) > returns a double Trig Math.sin(double angle) > returns a double, measured in radians Math.cos(double angle) > returns a double Math.tan(double) > returns a double Math.asin(double) > returns a double Math.acos(double) > returns a double Math.atan(double) > returns a double Exponents Math.pow(double base, double exponent) > returns a double Math.exp(double power) > returns e raised to power, > returns a double Square root Math.sqrt(double) > returns a double Floor/Ceiling Math.ceil(double) > round up on every double. ex. 4.1 > 5, 4.7 > 5, > returns a double Math.floor(double) > rounds down on every value. ex. 4.1 > 4, 5.8 > 5, > returns a double | public static void main(String[] args) {
double a = Math.pow(234, 450);
System.out.println(Math.abs(-4));
System.out.println(a);
/*
* Random Numbers
* 1) import java.util.Random;
* Object Random() - lets us create a new object Random that will generate random numbers
* Random name = new Random(); <-- creates the random number generator
* Methods - name.nextInt() --> random int between 0 - 1
* name.nextDouble --> random double between 0.0 (inclusive) and 1.0 (exclusive)
*/
Random gen = new Random();
int random1 = gen.nextInt(10); // <-- 10 is the range of values I can receive, 0 - 9
int random2 = gen.nextInt(24); // <-- range of values: 0 - 23
int random3 = gen.nextInt(10)+1; // <-- 1 - 10?
// Generate random numbers between 34-49
int random4 = gen.nextInt(16)+34;
System.out.println(random1 + " " + random2 + " " + random3 + " " + random4);
int random5 = gen.nextInt(50)+101;
int random6 = (gen.nextInt(8)*2)+3;
System.out.println(random6);
String s = "4";
Integer.parseInt(s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static double getSinSquare(Double value){\r\n\t\treturn Math.pow(Math.sin(value/2), 2);\r\n\r\n }",
"public interface Math2 {\n\n /*\n * PI2 is a constant which is approximately equivalent to 2*PI\n */\n public static final double PI2 = 2 * Math.PI;\n\n /**\n * Method which computes the square of a given number\n * \n * @param x\n * is the number (double variable) whose square is computed\n * @return the square of the given double\n */\n public static double sq(double x) {\n return x * x;\n }\n\n /**\n * Method which returns the largest integer less than or equal to \"x mod y\"\n * \n * @param x\n * double variable\n * @param y\n * double variable\n * @return double variable which returns floor(x mod y)\n */\n public static double floorMod(double x, double y) {\n return x - y * (Math.floor(x / y));\n }\n\n /**\n * Method which computes the haversin of x, knowing that its formula is :\n * haversin(x) = [sin(x/2)]^2\n * \n * @param x\n * double variable whose haversin this method computes\n * @return the haversin of x\n */\n public static double haversin(double x) {\n return sq(Math.sin(x / 2));\n }\n\n /**\n * Mathod which computes the angular distance between two angles\n * \n * @param a1:\n * double variable indicating the value of the first angle (in\n * radians)\n * @param a2:\n * double variable indicating the value of the second angle (in\n * radians)\n * @return The angular distance, knowing that its formula is :\n * floor(a2-a1+pi, 2*pi) - pi\n */\n public static double angularDistance(double a1, double a2) {\n return floorMod((a2 - a1 + Math.PI), PI2) - Math.PI;\n }\n\n /**\n * Linear interpolation to estimate the value taken by a continuous function\n * between two given points.\n * \n * @param y0\n * double variable which corresponds to f(x0), where x0 = 0\n * @param y1\n * double variable which corresponds to f(x1), where x1 = 1\n * @param x\n * double variable which serves as input to compute the value the\n * the function (obtained by linear interpolation) will take\n * @return\n */\n public static double lerp(double y0, double y1, double x) {\n double m = y1 - y0;\n double b = y0;\n return m * x + b; // i.e, linear function\n }\n\n /**\n * Bilinear interpolation which allows to compute the value of a function at\n * a given point, from its two closest neighbours in each direction\n * \n * @param z00\n * double variable which represents f(x0,y0), where x0=0 and y0=0\n * @param z10\n * double variable which represents f(x1,y0), where x1=1 and y0=0\n * @param z01\n * double variable which represents f(x0,y1), where x0=0 and y1=1\n * @param z11\n * double variable which represents f(x1,y1), where x1=1 and y1=1\n * @param x\n * double variable which is the first input of our two variable\n * function\n * @param y\n * double variable which is the second input of our two variable\n * function\n * @return f(x,y)\n */\n public static double bilerp(double z00, double z10, double z01, double z11,\n double x, double y) {\n double a = lerp(z00, z10, x);\n double b = lerp(z01, z11, x);\n return lerp(a, b, y);\n\n }\n\n /**\n * Method which finds out the inferior boundary of a subinterval of size dX\n * which contains a zero\n * \n * @param f\n * is the function\n * @param minX\n * double variable, left boundary of the interval\n * @param maxX\n * double variable, right boundary of the interval\n * @param dX\n * size of the subintervals\n * @return the inferior boundary of a subinterval of size dX which contains\n * a zero (a double variable)\n */\n public static double firstIntervalContainingRoot(DoubleUnaryOperator f,\n double minX, double maxX, double dX) {\n Preconditions.checkArgument(maxX >= minX && dX > 0);\n double infSub = minX;\n double nextSub = minX + dX;\n while (f.applyAsDouble(infSub) * f.applyAsDouble(nextSub) > 0\n && nextSub <= maxX - dX) {\n infSub += dX;\n nextSub += dX;\n }\n return f.applyAsDouble(infSub) * f.applyAsDouble(nextSub) > 0\n ? Double.POSITIVE_INFINITY : infSub;\n }\n\n /**\n * Method which finds the lowest boundary of a subinterval of size equal or\n * inferior to epsilon and between x1 and x2\n * \n * @param f\n * function\n * @param x1\n * first boundary of the interval\n * @param x2\n * second boundary of the interval\n * @param epsilon\n * error\n * @return lowest boundary of a subinterval of size equal or inferior to\n * epsilon and between x1 and x2\n * @throws IllegalArgumentException\n * if x1 and x2 have the same sign\n */\n public static double improveRoot(DoubleUnaryOperator f, double x1,\n double x2, double epsilon) {\n double a = x1;\n double b = x2;\n double c;\n \n if (f.applyAsDouble(a) == 0) {\n return a;\n } else if (f.applyAsDouble(b) == 0) {\n return b;\n }\n \n Preconditions.checkArgument(\n f.applyAsDouble(a) * f.applyAsDouble(b) < 0 && epsilon > 0);\n while (Math.abs(b - a) > epsilon) {\n c = (a + b) / 2;\n if (f.applyAsDouble(c) == 0) {\n return c;\n } else if (f.applyAsDouble(c) * f.applyAsDouble(a) > 0) {\n a = c;\n } else if (f.applyAsDouble(c) * f.applyAsDouble(b) > 0) {\n b = c;\n }\n }\n return a < b ? a : b;\n }\n}",
"@Test\n public void test04() throws Throwable {\n Complex complex0 = new Complex((-15.276), Double.POSITIVE_INFINITY);\n int int0 = complex0.hashCode();\n Complex complex1 = complex0.sqrt1z();\n Complex complex2 = complex0.sin();\n Complex complex3 = complex2.sqrt();\n String string0 = complex0.toString();\n Complex complex4 = complex2.atan();\n String string1 = complex0.toString();\n Complex complex5 = complex0.log();\n Complex complex6 = complex0.asin();\n List<Complex> list0 = complex2.nthRoot(27);\n double double0 = complex2.abs();\n Complex complex7 = (Complex)complex0.readResolve();\n }",
"@Test\n public void test25() throws Throwable {\n Complex complex0 = new Complex((-4594.967), 2587.341);\n Complex complex1 = complex0.tan();\n Complex complex2 = complex0.pow(complex1);\n Complex complex3 = complex0.sqrt();\n Complex complex4 = complex3.atan();\n double double0 = complex3.abs();\n Complex complex5 = complex0.exp();\n Complex complex6 = complex4.sqrt();\n Complex complex7 = complex4.conjugate();\n Complex complex8 = complex0.sin();\n }",
"public double abs() {\n\t\treturn Math.sqrt(real * real + imag * imag);\n\t}",
"@Test\n public void test37() throws Throwable {\n Complex complex0 = new Complex(2444.619, 1026.8487);\n Complex complex1 = complex0.cos();\n Complex complex2 = complex1.log();\n Complex complex3 = complex0.atan();\n double double0 = complex2.abs();\n Complex complex4 = complex1.multiply(2444.619);\n double double1 = complex2.abs();\n Complex complex5 = new Complex(2444.619, Double.POSITIVE_INFINITY);\n Complex complex6 = complex2.divide(complex0);\n List<Complex> list0 = complex2.nthRoot(1155);\n String string0 = complex2.toString();\n ComplexField complexField0 = complex0.getField();\n double double2 = complex0.abs();\n Complex complex7 = complex0.multiply(complex1);\n Complex complex8 = complex5.sin();\n Complex complex9 = complex1.sin();\n Complex complex10 = complex5.sinh();\n Complex complex11 = complex1.sinh();\n Complex complex12 = complex1.atan();\n }",
"static double calculate(String func, double arg) {\n double result = 0.0;\n\n if (func.equals(\"sin\")) {\n result = Math.sin(arg);\n }\n if (func.equals(\"ln\")) {\n result = Math.log(arg);\n }\n if (func.equals(\"sqrt\")) {\n result = Math.sqrt(arg);\n }\n if (func.equals(\"abs\")) {\n result = Math.abs(arg);\n }\n return result;\n }",
"public double utility();",
"public double evaluate() throws Exception {\n if (super.getExpression().evaluate() % 180 == 90) {\n return 0;\n }\n if (super.getExpression().evaluate() % 360 == 180) {\n return -1;\n }\n if (super.getExpression().evaluate() % 360 == 0) {\n return 1;\n }\n return Math.cos(Math.toRadians(super.getExpression().evaluate()));\n }",
"@Test\n public void test13() throws Throwable {\n Complex complex0 = new Complex(2444.619, 1026.8487);\n Complex complex1 = complex0.acos();\n Complex complex2 = complex0.cos();\n Complex complex3 = complex2.log();\n Complex complex4 = complex0.atan();\n double double0 = complex3.abs();\n Complex complex5 = complex2.multiply(2444.619);\n double double1 = complex3.abs();\n Complex complex6 = new Complex(2444.619, Double.POSITIVE_INFINITY);\n Complex complex7 = complex3.divide(complex0);\n List<Complex> list0 = complex3.nthRoot(1155);\n String string0 = complex3.toString();\n ComplexField complexField0 = complex0.getField();\n double double2 = complex0.abs();\n Complex complex8 = complex0.multiply(complex2);\n Complex complex9 = complex6.sin();\n Complex complex10 = complex2.sin();\n Complex complex11 = complex6.sinh();\n Complex complex12 = complex2.sinh();\n Complex complex13 = complex2.atan();\n Complex complex14 = complex12.acos();\n Complex complex15 = complex14.divide(complex0);\n }",
"public double abs(double value){return value < 0? value*-1: value;}",
"@Test\n public void test19() throws Throwable {\n Complex complex0 = new Complex((-138.659), 0.0);\n Complex complex1 = complex0.exp();\n String string0 = complex0.toString();\n Complex complex2 = complex1.subtract(complex0);\n Complex complex3 = complex0.multiply(complex1);\n Complex complex4 = complex0.cos();\n double double0 = complex4.getImaginary();\n }",
"@Test\n public void test16() throws Throwable {\n Complex complex0 = new Complex(0.0, 236.4);\n Complex complex1 = complex0.asin();\n Complex complex2 = complex1.atan();\n Complex complex3 = complex0.sin();\n Complex complex4 = (Complex)complex0.readResolve();\n double double0 = complex0.abs();\n Complex complex5 = complex0.log();\n Complex complex6 = complex1.sin();\n Complex complex7 = complex0.cos();\n String string0 = complex3.toString();\n Complex complex8 = complex1.multiply(complex2);\n try { \n complex3.nthRoot((-1));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -1\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}",
"@Test\n\tvoid sinTestWithConvertingToRadians() throws CustomException {\n\t\tdouble input = 90;\n\t\tdouble actual = 1.0000000000000002;\n\t\tdouble result1 = TrigLib.toRadians(input);\n\t\tdouble result = TrigLib.sine(result1);\n\t\tassertEquals(result, actual, \"Output is as expected as input is converted to radians\");\n\t}",
"static double sqrt(double number) {\n\t\tdouble answer = number / 2;\r\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative square roots\"); \r\n=======\n\tpublic static double sqrt(int number) { //gonna be honest here: idk??\r\n\t\tint div = number*number;\r\n\t\tif(number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no square roots of negative numbers\");\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\t}\r\n\t\twhile (((answer * answer) - number) >= .005 || ((answer * answer) - number) <= -.005) {\r\n\t\t\tanswer = 0.5 * (number / answer + answer);\r\n\t\t}\r\n\t\treturn round2(answer);\r\n\t}\r\n\t\r\n\tpublic static String quadForm(int a, int b, int c) { //need round2 so uhhhhh\r\n\t\tif(b == 0) {\r\n\t\t\tSystem.out.println(round2(c));\r\n\t\t}\r\n\r\n\t\tif(discriminant(a, b, c) == 0) {\r\n\t\t\treturn(\"Roots: \" + round2((b * -1) / (2 *a)));\t\r\n\t\t}\r\n\t\t\r\n\t\tif(discriminant(a, b, c) > 0) {\r\n\t\t\treturn(\"Roots: \" + round2(b * -1) + (sqrt(b * b - (4 * a * c))));\r\n\t\t}\r\n\t\t\r\n\t\treturn(\"no real roots\");\r\n\t}\r\n}",
"protected Object evaluate( ) throws Exception {\n return new Double(Math.atan(getDouble(0)));\n }",
"public double trigonometric(double value, Operator trigType) {\n switch (trigType) {\n case SIN -> { return Math.sin(StrictMath.toRadians(value)); }\n case COS -> { return Math.cos(StrictMath.toRadians(value)); }\n case TAN -> { return Math.tan(StrictMath.toRadians(value)); }\n default -> { return Double.NaN; }\n }\n }",
"@Test\n\tpublic void testAbsVal() {\n\t\tdouble tmpRndVal = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = Math.abs(doubleRandomNegativeNumbers());\n\t\t\tassertTrue( (tmpRndVal == ac.absoluteValue(tmpRndVal))\n\t\t\t\t\t|| (0.0 == ac.absoluteValue(tmpRndVal)) \n\t\t\t\t\t|| (-0.123456789 == ac.absoluteValue(tmpRndVal)) );\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = Math.abs(doubleRandomPositiveNumbers());\n\t\t\tassertTrue((tmpRndVal == ac.absoluteValue(tmpRndVal)));\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tdouble inpResult = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tinpResult = Math.abs(zero);\n\t\t\tassertTrue( (inpResult == ac.absoluteValue(zero)) );\n\t\t}\n\t\t\n\t}",
"static double f(double x){\n \treturn Math.sin(x);\r\n }",
"public static double function(double x) {\n double val = (Math.sin(x * 1) * 0.4 + (Math.sin(x * 2) * 0.4)) + (Math.sin(x * 5) * 0.2);\n //return (Math.cos(x)*0.5)+0.5;\n //return (Math.cos(x*5)*0.5)+0.5;\n //if (val<0) val=-0.5;\n //if (val>0) val=0.5;\n return val;\n }",
"public static double asin_safe(double x) {\n return Math.asin(Util.max(-1.0,Util.min(x,1.0)));\n\n //\tdouble z = Util.max(-1.0,Util.min(x,1.0));\n //\t//return Math.atan2(z,Math.sqrt(1-z*z));\n //\t \n //\treturn z+(z*z*z)/6.0+(3.0*z*z*z*z*z)/40.0+(15.0*z*z*z*z*z*z*z)/336.0;\n }",
"@Test\n public void test15() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n Complex complex1 = complex0.negate();\n Complex complex2 = complex0.cosh();\n Complex complex3 = complex0.acos();\n double double0 = complex0.getArgument();\n Complex complex4 = complex1.cosh();\n }",
"@Test\n public void test20() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n Complex complex1 = complex0.tan();\n Complex complex2 = complex0.log();\n Complex complex3 = complex2.atan();\n Complex complex4 = (Complex)complex2.readResolve();\n Complex complex5 = complex1.tan();\n Complex complex6 = complex0.atan();\n Complex complex7 = complex3.sin();\n Complex complex8 = complex0.negate();\n Complex complex9 = complex6.createComplex(2846.5, 0.0);\n Complex complex10 = complex0.add(complex1);\n Complex complex11 = complex1.sqrt1z();\n boolean boolean0 = complex6.equals(complex10);\n Complex complex12 = complex3.sqrt();\n double double0 = complex2.getArgument();\n Complex complex13 = complex1.sinh();\n try { \n complex9.nthRoot((-4646));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -4,646\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"@Test\n public void test36() throws Throwable {\n Complex complex0 = new Complex((-699.847402808), (-699.847402808));\n Complex complex1 = complex0.tanh();\n Complex complex2 = complex1.sqrt1z();\n Complex complex3 = complex0.tanh();\n Complex complex4 = complex0.sin();\n int int0 = complex0.hashCode();\n Complex complex5 = complex1.exp();\n boolean boolean0 = complex1.equals(complex1);\n Complex complex6 = complex1.log();\n Complex complex7 = complex6.add(complex0);\n double double0 = complex7.getArgument();\n Complex complex8 = complex1.atan();\n Complex complex9 = complex0.cosh();\n Complex complex10 = complex7.subtract(complex1);\n Complex complex11 = complex8.conjugate();\n Complex complex12 = complex7.add(complex0);\n double double1 = complex0.abs();\n Complex complex13 = complex7.multiply(0.0);\n Complex complex14 = complex11.multiply(complex13);\n Complex complex15 = complex11.sqrt1z();\n Complex complex16 = complex8.tan();\n double double2 = complex12.getArgument();\n Complex complex17 = complex0.divide(complex12);\n try { \n complex12.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public double calculate(double val) {\n double cosinus = Math.toRadians(val);\n return Math.cos(cosinus);\n }",
"double getSquareNumber();",
"@Test\n public void test21() throws Throwable {\n Complex complex0 = new Complex((-1392.0), (-1392.0));\n Complex complex1 = complex0.sinh();\n Complex complex2 = complex0.exp();\n Complex complex3 = complex0.conjugate();\n Complex complex4 = complex0.tan();\n Complex complex5 = complex1.divide(complex3);\n double double0 = complex4.abs();\n double double1 = complex4.getArgument();\n boolean boolean0 = complex4.equals(complex2);\n }",
"private static int Sqrt(double d) {\n\t\treturn 0;\n\t}",
"@Test\n public void test32() throws Throwable {\n Complex complex0 = new Complex((-1553.4164931494101), 1.125);\n double double0 = complex0.abs();\n Complex complex1 = complex0.cosh();\n Complex complex2 = complex1.asin();\n Complex complex3 = complex1.acos();\n Complex complex4 = complex1.atan();\n Complex complex5 = complex1.add(complex0);\n Complex complex6 = complex3.pow(complex2);\n Complex complex7 = complex1.log();\n Complex complex8 = complex3.cos();\n Complex complex9 = complex1.cosh();\n Complex complex10 = complex0.sin();\n String string0 = complex0.toString();\n Complex complex11 = (Complex)complex3.readResolve();\n double double1 = complex1.getArgument();\n Complex complex12 = complex0.createComplex((-1553.4164931494101), (-0.7853981633974483));\n Complex complex13 = complex12.acos();\n boolean boolean0 = complex5.isInfinite();\n Complex complex14 = complex9.tanh();\n List<Complex> list0 = complex2.nthRoot(1281);\n Complex complex15 = complex3.createComplex((-804.89327), 0.0);\n Complex complex16 = complex12.cos();\n Complex complex17 = complex9.asin();\n Complex complex18 = complex9.subtract(complex0);\n Complex complex19 = complex5.exp();\n Complex complex20 = complex17.tanh();\n Complex complex21 = complex6.cosh();\n }",
"public double absbearing(double x1, double y1, double x2, double y2) {\r\n\t\tdouble xo = x2 - x1;\r\n\t\tdouble yo = y2 - y1;\r\n\t\tdouble h = getRange(x1, y1, x2, y2);\r\n\t\tif (xo > 0 && yo > 0) {\r\n\t\t\treturn Math.asin(xo / h);\r\n\t\t}\r\n\t\tif (xo > 0 && yo < 0) {\r\n\t\t\treturn Math.PI - Math.asin(xo / h);\r\n\t\t}\r\n\t\tif (xo < 0 && yo < 0) {\r\n\t\t\treturn Math.PI + Math.asin(-xo / h);\r\n\t\t}\r\n\t\tif (xo < 0 && yo > 0) {\r\n\t\t\treturn 2.0 * Math.PI - Math.asin(-xo / h);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"private static double calculateSin(double dy, double distance) {\n if (distance > 0)\n return (dy) / distance;\n else\n return 0.0;\n }",
"@Test\n public void test33() throws Throwable {\n Complex complex0 = new Complex((-0.49999999999999994), (-0.49999999999999994));\n Complex complex1 = complex0.acos();\n Complex complex2 = complex0.sin();\n ComplexField complexField0 = complex0.getField();\n Complex complex3 = complex0.tanh();\n Complex complex4 = complex2.log();\n Complex complex5 = complex0.divide(complex2);\n Complex complex6 = complex2.sqrt();\n Complex complex7 = complex6.divide(complex4);\n Complex complex8 = complex4.pow(complex0);\n double double0 = complex6.getArgument();\n Complex complex9 = complex0.sinh();\n Complex complex10 = complex6.tanh();\n Complex complex11 = complex2.sqrt();\n Complex complex12 = complex0.negate();\n Complex complex13 = complex2.negate();\n Complex complex14 = complex3.conjugate();\n boolean boolean0 = complex2.isInfinite();\n boolean boolean1 = complex3.isInfinite();\n Complex complex15 = complex4.sinh();\n Complex complex16 = complex2.atan();\n boolean boolean2 = complex0.equals(\"}0\");\n Complex complex17 = complex2.subtract(complex3);\n ComplexField complexField1 = complex11.getField();\n boolean boolean3 = complex2.isNaN();\n Complex complex18 = complex11.pow(complex4);\n Complex complex19 = complex16.conjugate();\n Complex complex20 = complex16.cos();\n Complex complex21 = complex19.cosh();\n Complex complex22 = complex1.pow(complex6);\n Complex complex23 = (Complex)complex20.readResolve();\n }",
"public static double abs(double a) {\n\t\treturn ((a<0)?-a:a);\n\t}",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"@Test\n\tvoid tanTestWithConvertingToRadians() throws CustomException {\n\t\tdouble input = 30;\n\t\tdouble actual = 0.5773502691896257;\n\t\tdouble result1 = TrigLib.toRadians(input);\n\t\tdouble result = TrigLib.tan(result1);\n\t\tassertEquals(result, actual, \"Output is as expected as input is converted to radians\");\n\t}",
"private double calc_E(KeplerElements a) {\n\t\tdouble sqrome2 = Math.sqrt(1.0 - a.e * a.e);\r\n\t\tdouble cta = Math.cos(a.ta);\r\n\t\tdouble sta = Math.sin(a.ta);\r\n\t\tdouble sine0 = (sqrome2 * sta) / (1.0 + a.e * cta);\r\n\t\tdouble cose0 = (a.e + cta) / (1.0 + a.e * cta);\r\n\t\tdouble e0 = Math.atan2(sine0, cose0);\r\n\t\treturn e0;\r\n\r\n\t}",
"public double speed() {\n /* dx = sin(angle) * speed\n dy = cos(angle-180) * speed = -cos(angle)\n sqrt((dx)^2 + (-dy)^2 = sin(angle)^2*speed^2 + cos(angle)^2*speed^2)=\n sqrt(speed^2 *(cos(angle)^2+sin(angle)^2) = sqrt(speed^2*1)=speed\n */\n //distance math functions\n //to calculate the square root of the sum of squares of numbers passed to it as arguments.\n return Math.hypot(this.dx, this.dy);\n }",
"public double calculateSine(double angle);",
"public static double function(double x, double y)\r\n\t{\r\n\t\treturn (1-cos(PI * x)) * pow((1.23456 + cos(1.06512 * y)), 2) * \r\n\t\t\t\texp(-(pow(x, 2)) - (pow(y, 2)));\r\n\t}",
"public static void main(String[] args) {\n// System.out.println(Math.floor(12.34));/\n// System.out.println(Math.(12.34));/\n// System.out.println(Math.ceil(12.34));/\n// System.out.println(Math.ceil(12.34));/\n int start=5;\n int end=66;\n int i=start+(int)(Math.round(Math.random()*(end-start)) );\n System.out.println(i);\n }",
"@Test\n public void test09() throws Throwable {\n Complex complex0 = new Complex(0.0, (-1.5707963267948966));\n Complex complex1 = new Complex((-1.5707963267948966), 0.0);\n Complex complex2 = complex0.subtract(complex1);\n Complex complex3 = complex1.sinh();\n Complex complex4 = complex2.cosh();\n Complex complex5 = complex4.divide(complex0);\n int int0 = complex1.hashCode();\n Complex complex6 = complex4.exp();\n int int1 = complex4.hashCode();\n Complex complex7 = complex4.sqrt();\n double double0 = complex4.abs();\n Complex complex8 = complex1.acos();\n Complex complex9 = complex6.sin();\n int int2 = complex4.hashCode();\n boolean boolean0 = complex1.isNaN();\n double double1 = complex0.getReal();\n Complex complex10 = complex6.log();\n Complex complex11 = complex0.pow(complex4);\n Complex complex12 = complex2.multiply(complex10);\n Complex complex13 = complex6.sqrt1z();\n Complex complex14 = complex8.log();\n }",
"private static double sq (double x) {\n return Math.pow(x, 2);\n }",
"static double angle(PointDouble a, PointDouble o, PointDouble b) {\n Vec oa = vector(o, a), ob = vector(o, b);\n return Math.acos(dot(oa, ob) / (norm(oa) * norm(ob)));\n }",
"private double eculidean(double x, double x1, double y, double y1) {\n\t\treturn Math.sqrt(Math.pow((x - x1), 2) + Math.pow((y - y1), 2));\n\t}",
"@Test\n\tvoid sinTestWithRadiansInput() throws CustomException {\n\t\tdouble input = 1.5707963267948966;\n\t\tdouble actual = 1.0000000000000002;\n\t\tdouble result = TrigLib.sine(input);\n\t\tassertEquals(result, actual, \"Output is as expected as input is in radians\");\n\t}",
"@Test\n\tvoid cosTestWithConvertingToRadians() throws CustomException {\n\t\tdouble input = 60;\n\t\tdouble actual = 0.5000000000000001;\n\t\tdouble result1 = TrigLib.toRadians(input);\n\t\tdouble result = TrigLib.cosine(result1);\n\t\tassertEquals(result, actual, \"Output is as expected as input is converted to radians\");\n\t}",
"public static double normalizeAngle(double a, double center)\r\n/* 25: */ {\r\n/* 26: 91 */ return a - 6.283185307179586D * FastMath.floor((a + 3.141592653589793D - center) / 6.283185307179586D);\r\n/* 27: */ }",
"@Test\n\tpublic void testSquare() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble expResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers(); \n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\texpResult = Math.sqrt(zero);\n\t\t\tassertEquals(ac.square(zero), expResult, 0);\n\t\t}\n\t\t\n\t}",
"private static void badApproach() {\n\t\t\n\t\tList<Double> result = new ArrayList<>();\n\t\t\n\t\tThreadLocalRandom.current()\n\t\t\t.doubles(10_000).boxed()\n\t\t\t.forEach(\n\t\t\t\t\td -> NewMath.inv(d)\n\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\tinv -> NewMath.sqrt(inv)\n\t\t\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\t\t\t\tsqrt -> result.add(sqrt)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\n\t\tSystem.out.println(\"# result = \"+result.size());\n\t\t\n\t}",
"private double d(Point a, Point b){\n\t\treturn Math.sqrt(Math.pow(b.getX()-a.getX(),2) + Math.pow(a.getY() - b.getY(), 2));\r\n\t}",
"public double calculateHyperbolicSine(double angle);",
"public double getMagnitud(){\n return Math.sqrt(x*x+y*y);\n }",
"private double sqrt(double d) {\n\t\t\treturn 0;\n\t\t}",
"@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public static void main(String[] args) {\n Math myMath = new Math();\r\n System.out.println(\"Minimum no. : \" + myMath.min(4,2));\r\n System.out.println(\"Maximum no. : \" + myMath.max(6,3));\r\n System.out.println(\"Absolute : \" + myMath.abs(-3.4));\r\n System.out.println(\"Ceil : \" + myMath.ceil(4.3));\r\n }",
"double getSquareDistance();",
"@Test\n public void test35() throws Throwable {\n Complex complex0 = new Complex(1.633123935319537E16, 1069.2875);\n String string0 = complex0.toString();\n double double0 = complex0.getArgument();\n Complex complex1 = complex0.log();\n Complex complex2 = complex1.conjugate();\n Complex complex3 = complex2.cosh();\n Complex complex4 = complex0.exp();\n Complex complex5 = complex2.cosh();\n Complex complex6 = complex2.subtract(complex1);\n Complex complex7 = complex1.sqrt();\n double double1 = complex2.getArgument();\n Complex complex8 = complex2.exp();\n Complex complex9 = complex0.add(complex1);\n int int0 = complex1.hashCode();\n boolean boolean0 = complex0.isNaN();\n Complex complex10 = complex8.atan();\n String string1 = complex0.toString();\n String string2 = complex2.toString();\n int int1 = complex0.hashCode();\n Complex complex11 = complex8.asin();\n Complex complex12 = complex8.sqrt1z();\n double double2 = complex1.getReal();\n Complex complex13 = complex8.acos();\n Complex complex14 = complex13.pow(complex1);\n Complex complex15 = complex6.atan();\n }",
"public double r() { return Math.sqrt(x*x + y*y); }",
"public static void main(String[] args) {\n double x0=Math.PI/2;\n double dx=0.01;\n double f1;\n double f2;\n double m;\n\n double dr;\n f1=Math.cos(x0+dx);\n f2=Math.cos(x0-dx);\n m= Math.cos(x0)*2;\n dr=((f1)-(m)+(f2))/(dx*dx);\n\n System.out.println(dr);\n\n\n }",
"float determinante (){\r\n //lo de adentro de la raiz\r\n float det= (float)(Math.pow(b, 2)-4*a*c);\r\n //(float) por que pow tiene valores por defecto de double\r\n //entonces, hacemos casting: poniendole el (float) antes de\r\n //toda la funcion.\r\n return det; \r\n }",
"public static double signedSqrt(double value) {\n return Math.copySign(value * value, value);\n }",
"protected static final double acos(double c) {\n\t\t// case where c is a bit more than 1\n\t\tif (DoubleUtil.isEqual(c, 1) && c > 1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// case where c is a bit less than -1\n\t\tif (DoubleUtil.isEqual(c, -1) && c < -1) {\n\t\t\treturn Math.PI;\n\t\t}\n\n\t\treturn Math.acos(c);\n\t}",
"private static double g(double x, double y) {\n double eps = 1e-6;\n if (Math.abs(x + 1) < eps)\n return -y;\n if (Math.abs(x - 1) < eps)\n return y;\n if (Math.abs(y + 1) < eps)\n return -x;\n if (Math.abs(y - 1) < eps)\n return x;\n return 0;\n }",
"@Test\n public void test07() throws Throwable {\n Complex complex0 = new Complex(2479.28439673, Double.NaN);\n boolean boolean0 = complex0.isNaN();\n String string0 = complex0.toString();\n Complex complex1 = complex0.acos();\n Complex complex2 = complex1.exp();\n }",
"double getSalario();",
"protected static float toRadians(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_DEG:\n \t\t\treturn (value * 5 / 9);\n \t\tcase CSSPrimitiveValue.CSS_RAD:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_GRAD:\n \t\t\treturn (float) (value * 100 / Math.PI);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}",
"public double sin(double number);",
"@Override\n\tdouble evaluate() {\n\t\treturn Math.abs(operand.getVal());\n\t}",
"public double absolute() {\r\n return Math.hypot(real_part, imaginary_part);\r\n }",
"public double getAbsPosition() {\n double distCM = ToFSerial.get() - startDist;\n //System.out.println(\"Dist in CM \" + distCM);\n\n double distIn = distCM * Constants.k_CMtoIn;\n //System.out.println(\"Dist in In \" + distIn);\n\n return (int) (1000 * distIn); \n\n }",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public static double absValue(double number) {\n\t\tif(number >= 0) {\r\n\t\t\treturn(number);\r\n\t\t} else {\r\n\t\t\treturn(number / -1);\r\n\t\t}\r\n\t\t\r\n\t}",
"public static double abs(double x) {\n\t\treturn x>=0 ? x : -x;\n\t}",
"@Test\n public void test14() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n double double0 = complex0.getReal();\n Complex complex1 = complex0.cosh();\n Complex complex2 = complex0.cos();\n }",
"private static double hypot(double aa, double bb){\r\n \tdouble cc = 0.0D, ratio = 0.0D;\r\n \tdouble amod=Math.abs(aa);\r\n \tdouble bmod=Math.abs(bb);\r\n\r\n \tif(amod==0.0D){\r\n \t \tcc=bmod;\r\n \t}\r\n \telse{\r\n \t\tif(bmod==0.0D){\r\n \t\tcc=amod;\r\n \t\t}\r\n \t\telse{\r\n \t\tif(amod<=bmod){\r\n \t\t\tratio=amod/bmod;\r\n \t\t\tcc=bmod*Math.sqrt(1.0D+ratio*ratio);\r\n \t\t}\r\n \t\telse{\r\n \t\t\tratio=bmod/amod;\r\n \t\t\tcc=amod*Math.sqrt(1.0D+ratio*ratio);\r\n \t\t}\r\n \t\t}\r\n \t}\r\n \treturn cc;\r\n \t}",
"public double compute(double v)\r\n {\n return Math.toDegrees(Float11.atan(v));\r\n }",
"static double arg(PointDouble p) {\n PointDouble origin = new PointDouble(0, 0);\n PointDouble ox = new PointDouble(1, 0);\n if (p.y == 0) {\n return p.x >= 0 ? 0.0 : Math.PI;\n } else if (p.y <= 0) {\n return 2 * Math.PI - angle(ox, origin, p);\n } else {\n return angle(ox, origin, p);\n }\n }",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n double x = s.nextDouble();\n double y = s.nextDouble();\n double a = s.nextDouble();\n double b = s.nextDouble();\n \n DecimalFormat df = new DecimalFormat(\"#.000000000000\");\n double dp = x*a + y*b;\n double el =Math.sqrt(a*a + b*b);\n //double mel = dp/Double.valueOf(df.format(el*el));\n double mel = dp/(el*el);\n double as = mel*a;\n double bs = mel*b;\n double n = (x-mel*a)/(-1*b);\n //System.out.println(dp + \" \" + el + \" \" + mel + \" \" + as + \" \" + bs + \" \" + n);\n System.out.println(mel);\n System.out.println(n);\n }",
"public static double calc (int x, int y) {\r\n\t\ttry {\r\n\t\t\treturn Math.pow((Math.PI*(Math.pow(y, 2))), 0.5) / (2*x);\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"Unable to calculate\");\r\n\t\t}\r\n\t\treturn 0.0;\r\n\t}",
"@Test\n public void test03() throws Throwable {\n Complex complex0 = new Complex((-542.432682351), 0.0);\n double double0 = complex0.getImaginary();\n Complex complex1 = complex0.sinh();\n Complex complex2 = complex0.sinh();\n Complex complex3 = complex0.exp();\n Complex complex4 = complex1.sqrt();\n Complex complex5 = complex4.sqrt();\n Complex complex6 = complex1.createComplex((-151.5), Double.NaN);\n Complex complex7 = complex4.asin();\n Complex complex8 = complex7.exp();\n Complex complex9 = complex0.multiply(complex1);\n Complex complex10 = complex7.atan();\n Complex complex11 = complex2.cos();\n Complex complex12 = complex7.sinh();\n Complex complex13 = complex2.conjugate();\n Complex complex14 = complex6.cosh();\n int int0 = complex2.hashCode();\n Complex complex15 = complex4.multiply(Double.NaN);\n Complex complex16 = complex0.sin();\n Complex complex17 = complex11.multiply(0.0);\n Complex complex18 = complex8.cos();\n Complex complex19 = complex1.negate();\n Complex complex20 = complex6.exp();\n Complex complex21 = complex8.atan();\n }",
"private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }",
"public double evaluate(Map<String, Double> assignment) throws Exception {\n if (super.getExpression().evaluate(assignment) % 180 == 90) {\n return 0;\n }\n if (super.getExpression().evaluate(assignment) % 360 == 180) {\n return -1;\n }\n if (super.getExpression().evaluate(assignment) % 360 == 0) {\n return 1;\n }\n return Math.cos(Math.toRadians(super.getExpression().evaluate(assignment)));\n }",
"public abstract double mo9740e();",
"private static double acosh(double x){\n\t\treturn Math.log(x + Math.sqrt(x*x-1.0));\n\t}",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public static void main(String[] args) {\n\t\tdouble d1 = floor(3.1415926);\n\t\tSystem.out.println(d1);\n\t\t//double d2 = Math.ceil(3.1415926);\n\t\tdouble d2 = ceil(3.1415926);\n\t\tSystem.out.println(d2);\n\t}",
"public double convertToRadians(final double value) {\n return value * Math.PI / 180;\n }",
"private double function1(double x) {\n return Math.sin(x)*10;\n }",
"public double std(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += Math.pow((x.get(i) - average(x)), 2) / x.size();\n }\n round = Math.sqrt(sum) * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n\n\n }",
"@Test\n public void test02() throws Throwable {\n Complex complex0 = new Complex(77.38859, 77.38859);\n Complex complex1 = complex0.negate();\n Complex complex2 = complex1.sqrt();\n Complex complex3 = complex0.sqrt1z();\n double double0 = complex1.getReal();\n Complex complex4 = complex0.tan();\n Complex complex5 = complex2.negate();\n }",
"public static double hypot(double a, double b) {\n\t\tdouble r;\n\t\tif(Math.abs(a) > Math.abs(b)) {\n\t\t\tr = b / a;\n\t\t\tr = Math.abs(a) * Math.sqrt(1 + r * r);\n\t\t} else if(b != 0) {\n\t\t\tr = a / b;\n\t\t\tr = Math.abs(b) * Math.sqrt(1 + r * r);\n\t\t} else {\n\t\t\tr = 0.0;\n\t\t}\n\t\treturn r;\n\t}",
"double getMinTimerTrig();",
"private double getSin(int rot) {\r\n\t\treturn Math.sin(Math.toRadians(rot));\r\n\t}",
"public interface MathConstants {\n\t// ===========================================================\n\t// Final Fields\n\t// ===========================================================\n\n\tpublic static final float PI = (float) Math.PI;\n\n\tpublic static float PI_TWICE = PI * 2.0f;\n\tpublic static float PI_HALF = PI * 0.5f;\n\n\tpublic static final float DEG_TO_RAD = PI / 180.0f;\n\tpublic static final float RAD_TO_DEG = 180.0f / PI;\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n}",
"interface Formula {\n\t double calculate(int a);\n\t \n\t default double sqrt(int a) {\n\t return Math.sqrt(a);\n\t }\n\t}",
"public static void main(String[] args) throws Exception {\r\n\r\n float t = -4.234f;\r\n float sas = -0.8f;\r\n float ewr = 3.4f;\r\n\r\n System.out.println(Math.abs(t)- ((int)Math.abs(t)) );\r\n System.out.println(Math.abs(sas)- ((int)Math.abs(sas)) );\r\n System.out.println(Math.abs(ewr)- ((int)Math.abs(ewr)) );\r\n }",
"E atan(final E n);",
"public static double getAngle(double startAngle, double endAngle) {\n startAngle = normaliseAngle(startAngle);\n endAngle = normaliseAngle(endAngle);\n return Math.abs(Math.min(getAngle(startAngle, endAngle, true), getAngle(startAngle, endAngle, false)));\n }",
"private float getRadian(float x, float y) {\n float alpha = (float) Math.atan((x - mCx) / (mCy - y));\n // Quadrant\n if (x > mCx && y > mCy) {\n // 2\n alpha += Math.PI;\n } else if (x < mCx && y > mCy) {\n // 3\n alpha += Math.PI;\n } else if (x < mCx && y < mCy) {\n // 4\n alpha = (float) (2 * Math.PI + alpha);\n }\n return alpha;\n }",
"@Test\r\n\tpublic void testAbs(){\n\t\twhen(calculator.abs(-5)).thenReturn(5);\r\n\t\t\r\n\t\tint expected = 5;\r\n\t\tint actual =calculator.abs(-5);\r\n\t\tassertEquals(expected,actual);\r\n\t}"
] | [
"0.6551263",
"0.626165",
"0.6098524",
"0.6095192",
"0.59997797",
"0.59817255",
"0.58908343",
"0.5867659",
"0.5846758",
"0.5821505",
"0.58092105",
"0.577087",
"0.57695746",
"0.57200944",
"0.57072574",
"0.5662612",
"0.5646581",
"0.5628823",
"0.561742",
"0.56070477",
"0.5596954",
"0.5546267",
"0.5519159",
"0.55168",
"0.55115867",
"0.54998153",
"0.5484334",
"0.5453167",
"0.5432128",
"0.5406171",
"0.53941476",
"0.53917617",
"0.5384548",
"0.5373879",
"0.5370644",
"0.5369886",
"0.5367497",
"0.5359979",
"0.5352176",
"0.5342664",
"0.53375417",
"0.53300047",
"0.53283334",
"0.53260136",
"0.532279",
"0.53223926",
"0.53219247",
"0.5320308",
"0.53194976",
"0.5312649",
"0.5311206",
"0.530713",
"0.5306076",
"0.5301908",
"0.5300961",
"0.5292158",
"0.5290293",
"0.52875745",
"0.5284846",
"0.52845687",
"0.5279459",
"0.527356",
"0.5253723",
"0.5240429",
"0.52403224",
"0.52242714",
"0.5215619",
"0.5214626",
"0.52073836",
"0.52071077",
"0.52070665",
"0.52026516",
"0.5194054",
"0.5193002",
"0.5183829",
"0.51830167",
"0.51816416",
"0.51763684",
"0.51752776",
"0.5175133",
"0.51698387",
"0.516977",
"0.5164758",
"0.516456",
"0.51567036",
"0.5156288",
"0.5153108",
"0.51530033",
"0.5151555",
"0.5146973",
"0.5146848",
"0.5146247",
"0.5146059",
"0.5144018",
"0.51436347",
"0.51426226",
"0.5140263",
"0.51393694",
"0.5138884",
"0.51359516",
"0.5127236"
] | 0.0 | -1 |
d (n) = (n 1) [d (n 1) + d (n 2)] | public int findDerangement(int n) {
long a = 0, b = 1, i = 3, c;
for (; i <= n + 1; i ++) {
c = (i - 1) * (a + b) % 1000000007;
a = b;
b = c;
}
return (int) a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }",
"static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}",
"public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }",
"public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }",
"public int recursive(int n) {\r\n //base case: return n if <= 1\r\n if (n <= 1) {\r\n return n;\r\n }\r\n //else return result of of two previous #s being added to each other\r\n return recursive(n - 1) + recursive(n - 2);\r\n }",
"public double alternatingSequence(int n)\r\n {\r\n double sum = 0;\r\n\r\n for (int i = 1; i <= n; i++)\r\n sum += Math.pow(-1, i - 1)/i;\r\n\r\n return sum;\r\n }",
"static int recursiva2(int n)\n\t\t{\n\t\t\tif (n==0)\n\t\t\treturn 10; \n\t\t\tif (n==1)\n\t\t\treturn 20;\n\t\t\tif (n==2)\n\t\t\treturn 30;\n\t\t\t\n\t\t\treturn recursiva2(n-1) + recursiva2 (n-2) * recursiva2 (n-3); \n\t\t}",
"public static String linearCombinationOf(int n, int d){\n int q = n / d;\n int r = n - (d * q);\n return n+\" = \"+d+\"(\"+q+\") + \"+r;\n }",
"@Override\n public int generateNumber(int n) {\n if (n == 0) {\n return 0;\n } else if (n == 1) {\n return 1;\n } else {\n // We need the following nums to do the calculation by themselves\n int num1 = 0;\n int num2 = 1;\n int num3 = 0;\n // Starting from i = 1 is because we have done the first two in num1 and num2\n for (int i = 1; i < n; i++) {\n num3 = num1 + num2;\n num1 = num2;\n num2 = num3;\n }\n return num3;\n }\n }",
"public static int sumDownBy2(int n) {\n\t\tif (n == 0) {\n\t\t\treturn 0;\n\t\t} else if (n == 1) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn n + sumDownBy2(n - 2);\n\t\t}\n\t}",
"public static int sum1(int[] a, int n) // summen av de n første\n {\n if (n == 1) return a[0]; // summen er verdien selv\n return sum1(a,n-1) + a[n-1]; // summen av de n-1 første + a[n-1]\n }",
"public static double sum(double n) {\n\t\tdouble sum = 0;\t// Sum of the series\n\t\tfor (double i = 1; i <= n; i++) {\n\t\t\tsum += i / (i + 1);\n\t\t}\n\t\treturn sum;\n\t}",
"private static int path1(int n) {\n int[] path = new int[n+1];\n path[0] = 0;\n path[1] = 1;\n path[2] = 2;\n for (int i=3;i<=n;i++) {\n path[i] = path[i-1] + path[i-2];\n }\n return path[n];\n }",
"private Proof sumDistr(int n, int m) {\n if (m == 0) {\n return faxm6Gen(intToLit(n));\n }\n m = m - 1;\n Proof sucResp1 = faxm1Convert(sumDistr(n, m));\n return equalityRightConvert(equalitySymConvert(faxm5Gen(intToLit(n), intToLit(m))), sucResp1);\n }",
"int catalanDP(int n) {\n int[] catalan = new int[n+1]; \n \n // Initialize first two values in table \n catalan[0] = catalan[1] = 1; \n\n // Fill entries in catalan[] using recursive formula \n for (int i=2; i<=n; i++) { \n catalan[i] = 0; \n for (int j=0; j<i; j++) \n catalan[i] += catalan[j] * catalan[i-j-1]; \n } \n \n // Return last entry \n return catalan[n]; \n }",
"public static Node twoSumRegulate(Node n) {\n int len = n.getlength();\n for (int i = 0; i < len; i++) {\n int curpos = len - i - 1;\n int curvalue = n.get(curpos);\n\n if (curvalue > 9) {\n if (curpos == 0) {\n n.set(curpos, curvalue - 10);\n n = n.add(1, 0);\n } else {\n n.set(curpos, curvalue - 10);\n n.set(curpos - 1, n.get(curpos - 1) + 1);\n }\n }\n }\n return n;\n }",
"public static int iterativeFactDP(int n){\n int[] table = new int[n+1];\n table[0] = 0;\n table[1] = 1;\n for (int i = 2; i <=n ; i++) {\n table[i] = table[i-2]+table[i-1];\n }\n return table[n];\n }",
"public static int recursionSum(int[] num, int n) {\n if (n <= 2)\n System.out.println(num[n]);\n if (n <= 0)\n return 0;\n return recursionSum(num, n - 1) + num[n - 1];\n }",
"public static int linearSum(int[] data, int n) {\n if (n == 0)\n return 0;\n else\n return linearSum(data, n - 1) + data[n - 1];\n }",
"static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}",
"static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}",
"public static int[] sumOfTwoDice(int n) {\n int[] dice = new int[11];\n for(int b = n; b > 0; b--) {\n\t\tint d = ThreadLocalRandom.current().nextInt(1, 7);\n int d1 = ThreadLocalRandom.current().nextInt(1, 7);\n int i = d+d1-2;\n dice[i]+=1; \n\t}\n return dice;\n }",
"@Override\r\n\tpublic double calculate() {\n\r\n\t\treturn n1 + n2;\r\n\t}",
"public static double[] nSumTo1(int n) {\n Random r = new Random();\n double[] nums = new double[n];\n int sum = 100;\n\n for (int i = 0; i < nums.length-1; i++) {\n int randInt = r.nextInt(200);\n int num = randInt % (sum + 1);\n sum -= num;\n nums[i] = num / 100.0;\n }\n nums[nums.length-1] = sum / 100.0;\n\n return nums;\n }",
"public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }",
"protected void updateArrayBySumOfElements(int arr[], int n) { \n\n\t\tif (n <= 1) { \n\t\t return; \n\t\t} \n\t\tint prev = arr[0]; \n\t\tarr[0] = arr[0] + arr[1]; \n \n\n \tfor (int i = 1; i < n - 1; i++) { \n \t\tint curr = arr[i]; \n \t\tarr[i] = prev + arr[i + 1]; \n \t\tprev = curr; \n \t} \n \tarr[n - 1] = prev + arr[n - 1]; \n\t}",
"public static int[] twoNumbersAddToN(int[] arr, int n){\n\n int[] result = new int[2];\n int pointerA = 0, pointerB = 0;\n\n while(pointerB < arr.length && pointerA < arr.length){\n if(arr[pointerA] + arr[pointerB] == n && pointerA != pointerB){\n break;\n }\n if(pointerB == arr.length-1){\n pointerA++;\n pointerB = pointerA;\n }else {\n pointerB++;\n }\n }\n\n if(arr[pointerA] + arr[pointerB] != n){\n return result;\n }\n\n result[0] = arr[pointerA];\n result[1] = arr[pointerB];\n\n return result;\n }",
"void sumProd(int n) {\n\t\tdouble sum = 0.0;//C1\n\t\tdouble prod = 1.0;\n\t\tfor (int i = 1; i <= n; i++)\n\t\t\t{ if (i%2 == 0) sum += i;\n\t\t\tprod = prod * i;\n\t\t\tUtil.foo(sum, prod); }}",
"public static void main(String[] args) throws Exception {\n \n Scanner scn = new Scanner(System.in);\n int n = scn.nextInt();\n \n long[] sp = new long[n+1];\n long[] bl = new long[n+1];\n \n sp[1] = 1;\n bl[1] =1;\n \n \n for(int i = 2; i < n+1; i++){\n sp[i] = sp[i-1] + bl[i-1];\n bl[i] = sp[i-1];\n }\n \n long way = sp[n] + bl[n];\n long bothWay = way*way;\n \n System.out.println(bothWay);\n \n }",
"public static void fibonacciDp(int n,int [] array){\n array[0] =0;\n array[1] =1;\n\n for (int i=2;i<=n;i++)\n array[i] = array[i-1]+array[i-2];\n\n }",
"public static long sequentialSum(long n) {\n return Stream.iterate(1L, num -> num + 1)\n .limit(n)\n .reduce(0L, Long::sum);\n }",
"int main()\n{\n int n,p=0,n2=2;\n cin>>n;\n if(n>0)\n cout<<p<<\" \";\n for(int i=1;i<n;i++)\n {\n p=p+n2;\n cout<<p<<\" \";\n if(i%2==1)\n \tn2=n2+4;\n }\n \n}",
"public int iterative(int n) {\r\n //base cases\r\n if (n <= 1) {\r\n return n;\r\n }\r\n if (n == 2) {\r\n return 1;\r\n }\r\n //initialize current and previous two values\r\n int current = 0;\r\n int prev1 = 1;\r\n int prev2 = 1;\r\n\r\n //iterate starting at 3\r\n for (int i = 3; i <= n; i++) {\r\n //set current to value being computed\r\n current = prev1 + prev2;\r\n //set prev2 to n - 1\r\n prev2 = prev1;\r\n //set prev1 to current, reaching n + 1 exits loop and returns current\r\n prev1 = current;\r\n }\r\n return current;\r\n }",
"private int d(final int n) {\r\n Set<Long> set = new Factors(n).getProperDivisors();\r\n long sum = 0;\r\n for (long i : set) {\r\n sum += i;\r\n }\r\n return (int) sum;\r\n }",
"private static String subProcess(int[] n1, int[] n2) {\n\n\t\t// if n1.length is smaller than n2.length, we are going to be too small.\n\t\tif (n1.length < n2.length) {\n\t\t\treturn \"+\" + toString (n1);\n\t\t}\n\t\t\n\t\t// we have to extend, and reduce length. Note that this WILL terminate because\n\t\t// we would have left earlier if n2 were greater than n1.\n\t\tint off = 0;\n\t\tint length = n2.length;\n\t\twhile (compareTo(n2,0,length,n1,off) > 0) {\n\t\t\tn2 = expand(n2);\n\t\t\tlength = n2.length;\n\t\t\t\n\t\t\tif (length > n1.length) {\n\t\t\t\t// gone too far! We at last have our remainder! Return as \"+remainder\".\n\t\t\t\treturn \"+\" + toString(n1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint []innerSum = new int[n1.length+1]; // add 1 just in case we get too high\n\t\tint []result = new int[length]; \n\t\tint start;\n\t\t\n\t\t// initial set.\n\t\tif (n2[0] == 0) { start = 9; } else { start = n1[0]/n2[0]; }\n\t\t\n\t\tmultiply(n2, start, innerSum);\n\t\tinnerSum = reduce(innerSum);\n\t\t\n\t\tif (innerSum.length < n2.length) {\n\t\t\t// perfect fit. Expand back out to work with subtractDown. REALLY UGLY CODE\n\t\t\tinnerSum = expand(innerSum);\n\t\t} else {\n\t\t\t// must reduce and continue....\n\t\t\twhile (n2.length < innerSum.length) {\n\t\t\t\tstart--; // had gone too far! Back down.\n\t\t\t\tinnerSum = new int[n1.length+1];\n\t\t\t\tmultiply (n2, start, innerSum);\n\t\t\t\tinnerSum = reduce(innerSum);\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean subtractDown = compareTo(innerSum, n1, innerSum.length) > 0; // if false, we have to add up\n\t\twhile (true) {\n\t\t\tif (subtractDown) {\n\t\t\t\tstart--;\n\t\t\t\tsubtract(innerSum, n2, result, subProcessSign);\n\t\t\t\tassign(innerSum, result);\n\t\t\t\t\n\t\t\t\tsubtractDown = compareTo(innerSum, n1, innerSum.length) > 0;\n\t\t\t} else {\n\t\t\t\t// found. Note that 'start' is the digit in the quotient. Subtract from and replace.\n\t\t\t\tint []newTop = new int[innerSum.length];\n\t\t\t\textract(newTop,0,n1,0,innerSum.length);\n\t\t\t\t\n\t\t\t\tresult = new int[innerSum.length];\n\t\t\t\tsubtract(newTop, innerSum, result, subProcessSign); \n\t\t\t\textract(n1,0,result,0,result.length); // copy back in\n\t\t\t\t\n\t\t\t\tint[]normalized_n1 = reduce(n1);\n\t\t\t\tint[]normalized_n2 = reduce(n2);\n\t\t\t\tString s = start + subProcess(normalized_n1, normalized_n2);\n\t\t\t\treturn s;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static int getSum(int arr[], int n)\n{\n\tint total = 0;\n\tfor (int i = 0; i < n; i++)\n\t\ttotal += arr[i];\n\treturn total;\n}",
"public static int fibonacciDP(int n,int[] array){\n if (array[n] == -1 ){\n int res = 0;\n if (n==0 || n == 1)\n res = n;\n else\n res = fibonacciDP(n - 1, array) + fibonacciDP(n - 2, array);\n\n array[n] = res;\n }\n return array[n];\n }",
"public long fibonacci_with_dp(int n){\n global_dp_count++;\n if(lookup[n] ==0) {\n if (n <= 1) {\n lookup[n] = n;\n } else {\n lookup[n] = fibonacci_with_dp(n - 1) + fibonacci_with_dp(n - 2);\n }\n }\n return lookup[n];\n }",
"public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}",
"static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }",
"public static int fibboDP(int n){\n int[] mem = new int[n+1];\n if(n==0 || n==1){\n return mem[n]=n;\n }\n if(mem[n]!=0){\n return mem[n];\n }\n int fib1 = fibboDP(n-1);\n int fib2 = fibboDP(n-2);\n return mem[n] = fib1+fib2;\n }",
"public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }",
"public double wrapper(double n) {\n return -1 + (n + 1) % 2;\n }",
"public static void multiply(int[] n1, int d, int[] result) {\n\t\tint[]n2 = new int[n1.length];\n\t\tn2[n2.length-1] = d;\n\t\tmultiply (n2, n1, result);\n\t}",
"public static int sum(int n1, int n2){\n return n1 + n2;\n }",
"public int divisorSum(int n) {\n\t\tint sum = 0;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tint z = n % i;\n\t\t\tif (z == 0) {\n\t\t\t\tsum = sum + i;\n\t\t\t}\n\t\t}\n\t\treturn sum;\n\t}",
"static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }",
"static double harmonicSum(int n) {\n\t\tif (n==1) \n\t\t\treturn 1.0; \n\t\telse\n\t\t{\n\t\t\treturn 1/n + harmonicSum(n-1);\n\t\t}\n\t}",
"public int[] seriesUp(int n) {\n int[] arr = new int[n * (n+1) / 2];\n int num = n, counter = 1;\n \n \n for (int i = arr.length - 1; i >= 0; i--) {\n if (num == 0) {\n num = n - counter;\n counter++;\n }\n arr[i] = num;\n num--;\n }\n \n return arr;\n }",
"public int numTrees(int n) {\n if(n<=1)\n return 1;\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n dp[2] = 2;\n \n for(int i=3;i<=n;i++){\n int sum = 0;\n for(int a=0;a<i;a++){\n sum+=dp[0+a]*dp[i-1-a];\n }\n dp[i] = sum;\n //if i is odd then add the i/2 dp after you multiply by 2\n }\n return dp[n];\n }",
"static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}",
"@Override\n public int divisor_sum(int n) {\n int x;\n int sum = 0;\n for (int i = 1; i <= n; i++) {\n if(n%i == 0){\n x = i;\n sum += x;\n }\n }\n return sum;\n }",
"int main()\n{\n int i,j,n,a=0,b=1,c;\n cin>>n;\n for(i=3;i<=n;i++)\n {\n c=a+b;\n a=b;\n b=c;\n }\n cout<<c;\n}",
"public static Seq plus(Delta d1, Delta d2) {\n return new Delta((d1.num < d2 .num)?d1.num:d2.num, (d1.initial + d2.initial),\n (d1.delta + d2.delta));\n \n }",
"public int arraySum(int[] array, int n) {\n\t\tif (n == 0) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn arraySum(array, n - 1) + array[n - 1];\n\t\t}\n\t}",
"private static int getNumberOfWays(int n, int[] dp) {\n\t\t\r\n\t\tif(n==0) {\r\n\t\t\tdp[n] = 0; \r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(n == 1) {\r\n\t\t\tdp[1] = 1;\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\t\r\n\t\tif(n == 2) {\r\n\t\t\tdp[2] = 2;\r\n\t\t\treturn 2;\r\n\t\t}\r\n\t\t\r\n\t\tif(dp[n] == 0){\r\n\t\t\tdp[n] = getNumberOfWays(n-1, dp) + getNumberOfWays(n-2, dp);\r\n\t\t}\r\n\t\treturn dp[n];\r\n\t}",
"public static long D(long n) {\n\t\tlong count = 0;\n\t\n\t\tlong m = 9;\n\t\t// F(7) = 138, F(8) = 362\n\t\tlong recPrev=138;\n\t\tlong recCurrent=362;\n\n\t\twhile (n >= m) {\t\n\t\t\tif (m %6 == 0) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 38L;\n\t\t\t\trecPrev = current;\n\t\t\t} else if (m%6== 1) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 36L;\n\t\t\t\trecPrev = current;\n\t\t\t} else if (m%6==2 || m%6==3 || m%6==5) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 32L;\n\t\t\t\trecPrev = current;\n\t\t\t} else /*(m%6==4)*/{\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 30L;\n\t\t\t\trecPrev = current;\n\t\t\t}\n\t\t\trecPrev = recPrev % 87654321;\n\t\t\trecCurrent = recCurrent % 87654321;\t\n\t\t\tif (recCurrent == 0) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tm +=1;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn count;\n\n\t}",
"static int[] stones(int n, int a, int b) {\n List<Integer> arr = new ArrayList<>();\n if(a == b){\n arr.add(a*(n-1));\n } else {\n if(a>b){\n int temp = a;\n a = b;\n b = temp;\n } \n for(int i=0; i<n; i++)\n arr.add(i*b+(n-1-i)*a);\n } \n int ar[] = new int[arr.size()];\n for(int i=0; i<arr.size(); i++)\n ar[i] = arr.get(i);\n return ar;\n }",
"private static Gate[] mergeRec(Gate[] gates, int n) {\n int k = n/2;\n if(k == 1) {\n return merge(gates, gates);\n } else {\n return merge(mergeRec(gates, k), mergeRec(gates, k));\n }\n }",
"void add(int n);",
"private Node add(Word d, Node n) {\n if (n == null) {\n return new Node(d);\n } else {\n //d < n.data\n if (d.compareTo(n.data) == -1) {\n n.left = add(d, n.left);\n //d > n.data\n } else if(d.compareTo(n.data) == 1) {\n n.right = add(d, n.right);\n } else{\n //d == n.data, so increment frequency\n n.data.incFrequency();\n }\n return n;\n }\n }",
"private static int path(int n) {\n if (n == 0 || n == 1 || n == 2) {\n return n;\n }\n return path(n-1) + path(n-2);\n }",
"public long parallelSum(long n) {\n //better use long int double rangeclosed instead of iterate\n return Stream.iterate(1L, i -> i + 1)\n .limit(n)\n .parallel()\n .reduce(0L, Long::sum);\n }",
"public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }",
"public static int fibSum(int n) {\n int sum = 0;\n int fib1 = 1;\n int fib2 = 1;\n for (int i = 3; fib2 < n; i++) {\n int x = fib1 + fib2;\n fib1 = fib2;\n fib2 = x;\n if (fib2 % 2 == 0) sum += fib2;\n }\n return sum;\n }",
"private static double fact(int n) {\n\t\tdouble sum = 1;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tsum *= i;\n\t\t}\n\t\treturn sum;\n\t}",
"public static int uniquePathsDP(int m, int n) {\n int [][] total = new int[m][n];\n for(int i=0;i<m;i++){\n for(int j=0;j<n;j++){\n if(i==0 || j==0)\n total[i][j]=1;\n else\n total[i][j]=total[i-1][j]+total[i][j-1];\n\n }\n }\n return total[m-1][n-1];\n }",
"protected double getCost(double[] n) throws Exception {\n\t\tdouble[] da = this.outputDifferences(n);\n\t\tdouble o = 0;\n\t\tfor (double d : da) o += d*d;\n\t\treturn o;\n\t}",
"public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}",
"static int padovan(int n){\n if(n>=0 && n<=2)\n return 1;\n return padovan(n-2) + padovan(n-3);\n }",
"public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}",
"public int tripleStep(int n) {\n int result = compute(n);\n return result;\n }",
"static long arrayManipulation(int n, int[][] queries) {\n int len = queries.length;\n long[] arr = new long[n + 2];\n\n for (int i = 0; i < arr.length; i++) {\n arr[i] = 0;\n }\n\n\n for (int i = 0; i < len; i++) {\n int[] query = queries[i];\n int a = query[0];\n int b = query[1];\n int k = query[2];\n arr[a] = arr[a] + k;\n if (b + 1 <= arr.length) {\n arr[b + 1] = arr[b + 1] - k;\n }\n }\n\n long max = arr[0];\n long x = 0;\n\n for (int i = 0; i < arr.length; i++) {\n x = x + arr[i];\n max = Math.max(x, max);\n }\n\n return max;\n }",
"static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }",
"public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }",
"void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }",
"public static int calculateSum(int n)\n {\n int sum =0 ;\n for(int i = 3;i <= n; i++ )\n {\n if(i%3 == 0 || i%5 == 0)\n {\n sum += i;\n }\n }\n return sum;\n }",
"static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }",
"public static double[] dicesSum(int n) {\n if (n <= 0) return new double[0];\n\n final int nums = n * FACES;\n int[][] dp = new int[n + 1][nums + 1];\n\n // Arrays.fill(dp[1], 1, FACES, 1);\n for (int i = 1; i <= FACES; i++) {\n dp[1][i] = 1;\n }\n\n for (int i = 2; i <= n; i++) {\n // Using i indices, get [i, i * FACES] results\n for (int j = i; j <= i * FACES; j++) {\n // f(n) = f(n - 1) + f(n - 2) + ... + f(n - 6)\n for (int k = 1; k <= FACES && k < j; k++) {\n dp[i][j] += dp[i - 1][j - k];\n }\n }\n }\n\n final double total = Math.pow(FACES, n);\n final double[] res = new double[nums];\n // Using n indices, get [n, n * FACES] results\n for (int i = n; i <= nums; i++) {\n res[i - n] = dp[n][i] / total;\n }\n return res;\n }",
"public static int sumAll(int n1,int n2) {\n int sum=0;\n for(int i=0;i<12;sum+=weights[n1][n2][i],i++);\n return sum;\n }",
"public static int dynamicProgramming(int n) {\n for (int i=0; i<=n; i++) {\n table[0][i] = 1;\n }\n\n for (int j=1; j<4; j++) { //this loops the different denominations.\n for (int i=0; i<=n; i++) { //this loops through the amount we have to make change for\n\n //hard to explain, create a table and look at it. For j=1 (nickel), for anything less than\n //5 cents, we just copy the value down from j=0 (penny). The nickel has no effect for anything less than 5 cents.\n if (i < denominations[j]) {\n table[j][i] = table[j-1][i];\n continue;\n }\n\n //For example, j=1 (nickel), i = 11 cents. the number of ways to make 11 cents is equal to\n //the number of ways to make 11 cents without using nickel (table[j-1][i]) plus the number\n //of ways to 6 cents (table[j][i-denomination[j]).\n table[j][i] = table[j-1][i] + table[j][i-denominations[j]];\n }\n }\n return table[3][n];\n }",
"private static int[] computePermutations(int n) {\n final int[] indexes = new int[n];\n for (int i = 0; i < n; i++) {\n indexes[i] = i;\n //indexes[i] = i + 1;\n }\n\n final int total = computePermutations(indexes, 0, n);\n System.out.println(\"# \" + np + \"; total = \" + total);\n\n return indexes;\n }",
"public static int[] answer(int[] data, int n) {\n\t\tHashMap <Integer, Integer> h = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i=0; i<data.length; i++){\r\n\t\t\tif (!h.containsKey(data[i])){\r\n\t\t\t\th.put(data[i], 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\th.put(data[i], h.get(data[i])+1);\r\n\t\t\t//h[data[i]]++;\r\n\t\r\n\t\t\tif (h.get(data[i]) > n){\r\n\t\t\t\th.put(data[i], Integer.MIN_VALUE);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<Integer> r = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor(int i=0; i<data.length; i++){\r\n\t\t\t\r\n\t\t\tif (h.get(data[i])>0){\r\n\t\t\t\tr.add(data[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//pp(h);\r\n\t\t//System.out.println(h);\r\n\t\t\r\n\t\tint [] rr = new int [r.size()];\r\n\r\n\t\tfor(int k=0; k<r.size(); k++){\r\n\t\t\trr[k] = r.get(k);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn rr;\r\n }",
"long getRsum(int n, int i, int k){\r\n return n-i>=k ? (n-i-k)+ssum(k-1): ssum(k-1) - ssum(k-n+i);\r\n }",
"private int getSumD2(int[][] a) {\n int sum = 0;\n\n int jd1 = 0;\n int jd2 = a.length - 1;\n while (jd1 < a.length) {\n sum += a[jd1][jd2];\n jd2--;\n jd1++;\n }\n return sum;\n }",
"private static long combination(int n, int r) {\n if (r > n || n <= 0 || r <= 0) {\n throw new IllegalArgumentException(\"r must be smaller than n and both n and r must be positive ints\");\n }\n long result = 1;\n for (int i = r + 1; i <= n; i++) {\n result = result * i;\n }\n long nMinusRFactorial = factorial(n - r);\n result = result / nMinusRFactorial;\n// System.out.println(\"C(\" + n + \", \" + r + \") = \" + result);\n return result;\n }",
"public static int next(int n)\n { \n int x = 0;\n if(n%2 == 0)\n {\n return n/2;\n }\n else\n {\n return (3*n)+1;\n }\n }",
"public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}",
"int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }",
"public int fib(int n) {\n if (n < 2) {\n return n;\n }\n\n int n1 = 1;\n int n2 = 0;\n\n for (int i = 2; i < n; i++) {\n int current = n1 + n2;\n n2 = n1;\n n1 = current;\n }\n return n1 + n2;\n }",
"public int fibo2(int n){\r\n int[] f = new int[n];\r\n f[0] = 1;\r\n f[1] = 1;\r\n for(int i=2; i<n; i++){\r\n f[i] = f[i-1] + f[i-2];\r\n }\r\n return f[n-1];\r\n }",
"private static int fibonacci(int n) {\n if (n == 1 || n == 2)\n return 1;\n else\n return fibonacci(n - 1) + fibonacci(n - 2);\n }",
"public int[][] subSum(int[] list){\n\tint n=list.length;\n\tS=new int[n][n];\n\t//initialize S from list values\n\tfor (int i = 0; i < n; i++) {\n\t\tS[i][i]=list[i];\n\t}\n\t//calculate the values by bottom up fashion\n\tfor (int k = 1; k < n; k++) {\n\t\tint i=0;\n\t\tint j=i+k;\n\t\twhile(j<n && i<j){\n\t\t if(i!=j)\n\t\t\tS[i][j]=S[i][i]+S[i+1][j];\n\t\t i=i+1;\n\t\t j=i+k;\n\t\t}\n\t}\n\treturn S;\n}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\t\n\t\tint arr[] = new int[n+1];\n\t\t\n\t\tint dp[] =new int[n+1];\n\t\t\n\t\t\n\t\tfor(int i =1; i<=n; i++){\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\t\n\t\tdp[1]=arr[1];\n\t\t\n\t\tif(n>=2) {\n\t\tdp[2]=dp[1]+arr[2];\n\t\t}\n\t\t\n\t\tfor(int i=3; i<=n; i++){\n\t\t\t\n\t\t\tdp[i] = Math.max(dp[i-2]+arr[i], dp[i-3]+arr[i-1]+arr[i]);\n\t\t}\n\t\t\n\t\tSystem.out.println(dp[n]);\n\t\t\n\t}",
"public int climbStairs4(int n){\n if(n==1)\n return 1;\n int first=1;\n int second=2;\n for(int i=3;i<=n;i++){\n int third=first+second;\n first=second;\n second=third;\n }\n return second;\n }",
"public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nint n=sc.nextInt();\r\n\r\nList<Integer> l=new ArrayList<Integer>();\r\nfor(int i=1;i<=n;i++){\r\n\tif(i%2!=0)\r\n\t{\r\n\t\tl.add(i);\r\n\t}\r\n}\r\n\tSystem.out.println(l);\r\n\tint n1=l.get(0);\r\n\tfor(int i=0;i<l.size();i++){\r\n\tif(i%2==0)\r\n\t\r\n\t\tn1=n1-l.get(i);\r\n\t//System.out.println(s);\r\n\telse\r\n\t\tn1=n1+l.get(i);\r\n\t}\r\n\tSystem.out.println(n1+1);\r\n\t}",
"public int[] permutate(int n) {\n int[] x = new int[n];\n for (int i = 0; i < n; i++) {\n x[i] = i;\n }\n\n permutate(x);\n\n return x;\n }",
"@Override\n public Z computeNext() {\n int n = size();\n if (n <= 2) {\n return Z.valueOf(mInits[n]);\n }\n final int pow2 = Integer.highestOneBit(n);\n final int j = n - pow2;\n Z result = a(j).multiply(mFaj0).add(a(j + 1).multiply(mFaj1));\n if (j == pow2 - 1) {\n result = result.add(1);\n }\n return result;\n \n }",
"public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }",
"@Override\r\n\tpublic double calculate() {\n\t\treturn n1 - n2;\r\n\t}"
] | [
"0.684193",
"0.6806797",
"0.66968256",
"0.6473691",
"0.6394831",
"0.6391781",
"0.6275162",
"0.62662596",
"0.6245117",
"0.6241995",
"0.62259585",
"0.62165546",
"0.6202924",
"0.619046",
"0.61739594",
"0.61534685",
"0.6105153",
"0.6059905",
"0.6055286",
"0.60492647",
"0.60375917",
"0.6020156",
"0.6018952",
"0.6006762",
"0.599498",
"0.5992794",
"0.5946358",
"0.5929626",
"0.5913975",
"0.58988184",
"0.5880266",
"0.587513",
"0.5863957",
"0.5830179",
"0.5811368",
"0.58025223",
"0.57771933",
"0.5769827",
"0.57566154",
"0.573747",
"0.5722712",
"0.57145476",
"0.57137877",
"0.57067806",
"0.56874394",
"0.56865597",
"0.56830263",
"0.5678508",
"0.56681144",
"0.56638587",
"0.5656874",
"0.56092453",
"0.5602516",
"0.5571983",
"0.55719364",
"0.55677676",
"0.5558022",
"0.55454946",
"0.55420893",
"0.55327946",
"0.55294436",
"0.5527228",
"0.5519564",
"0.5518233",
"0.55108786",
"0.55087227",
"0.55086243",
"0.5507025",
"0.55034673",
"0.5499541",
"0.5490908",
"0.54879504",
"0.5481006",
"0.54749393",
"0.5460501",
"0.5459594",
"0.5458032",
"0.5456863",
"0.5453947",
"0.5444549",
"0.54425544",
"0.54400724",
"0.5433101",
"0.5424404",
"0.54239917",
"0.54235256",
"0.54215676",
"0.53946656",
"0.5393672",
"0.5392987",
"0.5388796",
"0.53856623",
"0.5384081",
"0.5377119",
"0.53731835",
"0.5372521",
"0.5366785",
"0.5356685",
"0.5350219",
"0.53460157"
] | 0.55690515 | 55 |
Better alternative solution and easier to understand is To understand below check | public void permutationOfString(String s, int start, int end){
if(start == end && !hs.contains(s)){
hs.add(s);
System.out.println(s);
return;
}
for(int i=start;i<=end;i++){
s=swap(s,i,start);
permutationOfString(s,start+1, end);
s=swap(s,i,start);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\n }",
"public static void main(String[] args) {\n\t int[] array= {1, 2, 3, 5, 465, 2, 8, 6, 8};\n System.out.println(hasDuplicates(array));\n System.out.println(hasDuplicates2(array));\n System.out.println(hasDuplicates3(array));\n\n String s1 = \"Hello World\";\n StringBuilder sb= new StringBuilder(s1);\n String reversed = sb.reverse().toString();\n System.out.println(reversed);\n\n Student jhony = new Student(\"John\", LocalDate.of(2000, Month.MAY,17), 85);\n Student paul = new Student(\"Paul\", LocalDate.of(1999, Month.JULY,1), 90);\n Student kolya = new Student(\"Kolya\", LocalDate.of(2002, Month.APRIL,6), 70);\n Student sasha = new Student(\"Sasha\", LocalDate.of(2005, Month.NOVEMBER,24), 29);\n Student tom = new Student(\"Tom\", LocalDate.of(2001, Month.JANUARY,2), 10);\n\n List<Student> students= new ArrayList<>();\n students.add(jhony);\n students.add(paul);\n students.add(kolya);\n students.add(sasha);\n students.add(tom);\n// for (Student student:students) {\n// //if(student.getMarkJava()<50) System.out.println(student.getName());\n// if(student.getBirthday().getYear()>2000) System.out.println(student.getName());\n// }\n students.stream().filter(student -> student.getMarkJava()>50)\n .forEach(System.out::println);\n System.out.println(students.stream().filter(el -> el.getMarkJava() > 80).count());\n System.out.println(students.stream().max(Comparator.comparing(student -> student.getMarkJava())));\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).max().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).min().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).sum());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).average().getAsDouble());\n System.out.println(students.stream().count());\n\n PartTimeEmployee ivan = new PartTimeEmployee(\"Ivan\",15,80);\n FullTimeEmployee vasya = new FullTimeEmployee(\"Vasya\",2,15,\"coder\");\n List<IAccounting> workers = new ArrayList<>();\n workers.add(ivan);\n workers.add(vasya);\n System.out.println(workers);\n\n }",
"protected boolean func_70814_o() { return true; }",
"public void VerifyCurrencySymbol(){\r\n\t\tString countriess1 = \"Germany,France,Netherland,Italy,Spain,BernardFrance,BernardBelgium,PresselAustria,PresselGermany\";\r\n\t\tString countriess2 = \"Sweden,Denmark,Norway\";\r\n\t\tString countriess3 = \"PresselSwitzerland\";\r\n\t\tString countriess4 = \"UK\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Currency symbol should be present in Cartincheckout and Order Summary as per the country\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getText(locator_split(\"txtQuantityCartinCheckout\")).contains(\"€\") & getText(locator_split(\"txtOrderSummaryTotal\")).contains(\"€\")){\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -€ is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -€ is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getText(locator_split(\"txtQuantityCartinCheckout\")).contains(\"Kr\") & getText(locator_split(\"txtOrderSummaryTotal\")).contains(\"Kr\")){\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -Kr is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -Kr is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getText(locator_split(\"txtQuantityCartinCheckout\")).contains(\"CHF\") & getText(locator_split(\"txtOrderSummaryTotal\")).contains(\"CHF\")){\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -CHF is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -CHF is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess4.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getText(locator_split(\"txtQuantityCartinCheckout\")).contains(\"£\") & getText(locator_split(\"txtOrderSummaryTotal\")).contains(\"£\")){\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -£ is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"The currency symbole -£ is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The Currency symbole is not matching for country -\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"The Currency symbole is not matching for country -\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}",
"@Test\n public final void testGetLong() {\n String msg2 = \"get(long) illegal arguments check failed.\";\n\n boolean[] a1_a = new boolean[1023];\n boolean[] a1_1_a = new boolean[320];\n boolean[] a1_2_a = new boolean[621];\n boolean[] a1_3_a = new boolean[82];\n boolean[] a2_a = new boolean[2048];\n boolean[] a2_1_a = new boolean[641];\n boolean[] a2_2_a = new boolean[490];\n boolean[] a2_3_a = new boolean[690];\n boolean[] a2_4_a = new boolean[317];\n for (int i = 0; i < a1_a.length; i++) {\n a1_a[i] = (i % 17 == 0);\n }\n {\n int c = 17, i = 0, s;\n for (s = i; (i - s) < a1_1_a.length; i++) {\n a1_1_a[i - s] = (i % c == 0);\n }\n for (s = i; (i - s) < a1_2_a.length; i++) {\n a1_2_a[i - s] = (i % c == 0);\n }\n for (s = i; (i - s) < a1_3_a.length; i++) {\n a1_3_a[i - s] = (i % c == 0);\n }\n }\n for (int i = 0; i < a2_a.length; i++) {\n a2_a[i] = (i % 19 == 0);\n }\n {\n int c = 19, i = 0, s;\n for (s = i; (i - s) < a2_1_a.length; i++) {\n a2_1_a[i - s] = (i % c == 0);\n }\n for (s = i; (i - s) < a2_2_a.length; i++) {\n a2_2_a[i - s] = (i % c == 0);\n }\n for (s = i; (i - s) < a2_3_a.length; i++) {\n a2_3_a[i - s] = (i % c == 0);\n }\n for (s = i; (i - s) < a2_4_a.length; i++) {\n a2_4_a[i - s] = (i % c == 0);\n }\n }\n\n MemoryBitList a1_1 = new MemoryBitList(a1_1_a);\n MemoryBitList a1_2 = new MemoryBitList(a1_2_a);\n MemoryBitList a1_3 = new MemoryBitList(a1_3_a);\n SequenceBitList a1 = new SequenceBitList();\n a1.add(new SimpleRange(a1_1, 0, a1_1.length()));\n a1.add(new SimpleRange(a1_2, 0, a1_2.length()));\n a1.add(new SimpleRange(a1_3, 0, a1_3.length()));\n\n MemoryBitList a2_1 = new MemoryBitList(a2_1_a);\n MemoryBitList a2_2 = new MemoryBitList(a2_2_a);\n MemoryBitList a2_3 = new MemoryBitList(a2_3_a);\n MemoryBitList a2_4 = new MemoryBitList(a2_4_a);\n SequenceBitList a2 = new SequenceBitList();\n a2.add(new SimpleRange(a2_1, 0, a2_1.length()));\n a2.add(new SimpleRange(a2_2, 0, a2_2.length()));\n a2.add(new SimpleRange(a2_3, 0, a2_3.length()));\n a2.add(new SimpleRange(a2_4, 0, a2_4.length()));\n\n LargeBitListTest.testGetLongInner(a1, 0, a1_a);\n LargeBitListTest.testGetLongInner(a2, 0, a2_a);\n\n try {\n a1.get(a1_a.length);\n fail(msg2);\n } catch (IndexOutOfBoundsException ex) {\n //OK\n }\n\n try {\n a1.get(-1);\n fail(msg2);\n } catch (IndexOutOfBoundsException ex) {\n //OK\n }\n }",
"@Test\n public void isAnagram() {\n\n Assert.assertEquals(true,Computation.isAnagram(\"read\",\"dear\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"deard\"));\n Assert.assertEquals(false,Computation.isAnagram(\"read\",\"reaaad\"));\n Assert.assertEquals(false,Computation.isAnagram(\"readd\",\"reaad\"));\n }",
"private boolean solutionChecker() {\n\t\t// TODO\n\t\treturn false;\n\n\t}",
"public void test17() throws Exception {\n helper1(new String[] {\"b\", \"i\"}\r\n , new String[] {\"I\", \"Z\"}\r\n , false, 0);\r\n }",
"public void test19() throws Exception {\n helper1(new String[] {\"b\", \"i\"}\r\n , new String[] {\"I\", \"Z\"}\r\n , false, 0);\r\n }",
"@Test\n public void isSameBeneficiary() {\n assertTrue(ANIMAL_SHELTER.isSameBeneficiary(ANIMAL_SHELTER));\n\n // null -> returns false\n assertFalse(ANIMAL_SHELTER.isSameBeneficiary(null));\n\n // same name, different attribute -> return true\n assertTrue(ANIMAL_SHELTER.isSameBeneficiary(\n new BeneficiaryBuilder(BABES).withName(VALID_NAME_ANIMAL_SHELTER).build()));\n\n // different name and different phone or email -> returns false\n Beneficiary differentPhone = new BeneficiaryBuilder(BABES).withPhone(VALID_PHONE_BABES)\n .withEmail(VALID_EMAIL_ANIMAL_SHELTER).build();\n assertFalse(ANIMAL_SHELTER.isSameBeneficiary(differentPhone));\n\n Beneficiary differentEmail = new BeneficiaryBuilder(BABES).withPhone(VALID_PHONE_ANIMAL_SHELTER)\n .withEmail(VALID_EMAIL_BABES).build();\n assertFalse(ANIMAL_SHELTER.isSameBeneficiary(differentEmail));\n\n //different name, (same phone and email) different attributes -> returns true\n Beneficiary editedAnimalShelter = new BeneficiaryBuilder(ANIMAL_SHELTER)\n .withName(VALID_NAME_BABES)\n .withAddress(VALID_ADDRESS_BABES).build();\n assertTrue(ANIMAL_SHELTER.isSameBeneficiary(editedAnimalShelter));\n\n // same name, same email, different attributes -> returns true\n editedAnimalShelter = new BeneficiaryBuilder(ANIMAL_SHELTER).withPhone(VALID_PHONE_BABES)\n .withAddress(VALID_ADDRESS_BABES).build();\n assertTrue(ANIMAL_SHELTER.isSameBeneficiary(editedAnimalShelter));\n\n // same name, same phone, same email, different attributes -> returns true\n editedAnimalShelter = new BeneficiaryBuilder(ANIMAL_SHELTER).withAddress(VALID_ADDRESS_BABES).build();\n assertTrue(ANIMAL_SHELTER.isSameBeneficiary(editedAnimalShelter));\n }",
"public void test18() throws Exception {\n helper1(new String[] {\"b\", \"i\"}\r\n , new String[] {\"I\", \"Z\"}\r\n , false, 0);\r\n }",
"public static void main(String[] args) {\n\n\n List<Integer> a = range(3, 19).mapToObj(Integer::valueOf).collect(toList());\n a.sort((x, y) -> (x - y));\n// System.out.println(a);\n\n List<List<String>> QUICK_THREE_OPTIONS = new ArrayList<>();\n //空 0\n QUICK_THREE_OPTIONS.add(new ArrayList<>());\n //和值 1\n final List<String> sumOptions = range(3, 19).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(sumOptions);\n //三同号 2\n final List<String> threeSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 3)).collect(toList());\n threeSameOptions.add(\"3A\");\n QUICK_THREE_OPTIONS.add(threeSameOptions);\n //二同号 3\n final List<String> twoSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 2)).collect(toList());\n twoSameOptions.addAll(range(1, 7).mapToObj(String::valueOf).collect(toList()));\n twoSameOptions.addAll(range(1, 7).mapToObj(i -> nTimes(i, 2) + \"*\").collect(toList()));\n QUICK_THREE_OPTIONS.add(twoSameOptions);\n //三不同 4\n final List<String> threeDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n threeDifferent.add(\"3B\");\n QUICK_THREE_OPTIONS.add(threeDifferent);\n //二不同 5\n final List<String> twoDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(twoDifferent);\n\n// System.out.println(QUICK_THREE_OPTIONS);\n\n List<List<String>> ELEVEN_C_FIVE_OPTIONS = new ArrayList<>();\n\n //组合选项\n ELEVEN_C_FIVE_OPTIONS.add(IntStream.range(1, 12).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //前二直选\n final List<String> frontTwoDirect = new ArrayList<>();\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontTwoDirect);\n //前三直选\n final List<String> frontThreeDirect = new ArrayList<>();\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontThreeDirect);\n\n final int TWENTY_C_FIVE_SAN_GUO_SHI_LI = 1;\n final int TWENTY_C_FIVE_SAN_GUO_FIVE = 2;\n final int TWENTY_C_FIVE_SAN_GUO_EIGHT = 3;\n final int TWENTY_C_FIVE_SAN_GUO_FRONT_THREE_DIRECT = 4;\n final List<List<String>> TWENTY_C_FIVE_SAN_GUO_OPTIONS = new ArrayList<>();\n\n //势力选择\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(IntStream.range(1, 4).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //组合选项\n final List<String> group = new ArrayList<>();\n group.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n group.addAll(IntStream.range(1, 4).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(group);\n //前三直选\n final List<String> frontThreeDirect1 = new ArrayList<>();\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 4).mapToObj(i -> \"d\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(frontThreeDirect1);\n\n// System.out.println(ELEVEN_C_FIVE_OPTIONS);\n\n List<String> s = new ArrayList<>();\n s.add(\"3\");\n s.add(\"5\");\n s.add(\"6\");\n s.add(\"7\");\n s.add(\"9\");\n// s.add(\"11\");\n// System.out.println(c);\n List<List<String>> s1 = new ArrayList<>();\n s1.add(s);\n List<String> targetNumbers = s1.stream().map(l -> join(l, \",\")).collect(toList());\n\n// System.out.println(getPermutationXSrcLists(s, 2, true));\n\n long tl = computeElevenCFiveGroup(targetNumbers.get(0));\n// System.out.println(tl);\n System.out.println(TWENTY_C_FIVE_SAN_GUO_OPTIONS);\n\n }",
"private static boolean special_optimization(String a)\n {\n int sum = 0;\n for(int x = 0; x < a.length(); x++)\n {\n sum += (find_value(\"\"+a.charAt(x)));\n }\n if(sum <= library.return_uppervalue() && sum >= library.return_lowervalue())\n return false;\n return true;\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Test\n public void intermediateOperations() {\n Stream<Book> books = TestData.getBooks().stream();\n // filter\n Stream<Book> booksWithMultipleAuthors = books.filter(book -> book.hasMultipleAuthors());\n // map\n Stream<String> namesStream = booksWithMultipleAuthors.map(book -> book.getName());\n \n Set<String> expected = \n Sets.newHashSet(\"Design Patterns: Elements of Reusable Object-Oriented Software\",\n \"Structure and Interpretation of Computer Programs\");\n assertEquals(expected, namesStream.collect(Collectors.toSet()));\n }",
"public static void main(String[] args) {\n\t\t\n\t\t// 10 Tests: \n\t\tList<Integer> a1 = new List<>();\n\t\tList<Integer> b1 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a2 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b2 = new List<>();\n\t\t\n\t\tList<Integer> a3 = new List<>();\n\t\tList<Integer> b3 = new List<>();\n\t\t\n\t\tList<Integer> a4 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b4 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\t\n\t\tList<Integer> a5 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\tList<Integer> b5 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a6 = new List<>(1, new List<>(4, new List<>(6, new List<>()))); \n\t\tList<Integer> b6 = new List<>(5, new List<>(6, new List<>(9, new List<>())));\n\t\t\n\t\tList<Integer> a7 = new List<>(-6, new List<>(-5, new List<>(-4, new List<>())));\n\t\tList<Integer> b7 = new List<>(-3, new List<>(-2, new List<>(-1, new List<>())));\n\t\t\n\t\tList<Integer> a8 = new List<>(-2, new List<>(-1, new List<>(0, new List<>())));\n\t\tList<Integer> b8 = new List<>(-1, new List<>(0, new List<>(1, new List<>(2, new List<>()))));\n\t\t\n\t\tList<Integer> a9 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b9 = new List<>(3, new List<>(4, new List<>(5, new List<>())));\n\t\t\n\t\tList<Integer> a10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\t\n\t\tSystem.out.println(unique(a1, b1));\n\t\tSystem.out.println(unique(a2, b2));\n\t\tSystem.out.println(unique(a3, b3));\n\t\tSystem.out.println(unique(a4, b4));\n\t\tSystem.out.println(unique(a5, b5));\n\t\tSystem.out.println(unique(a6, b6));\n\t\tSystem.out.println(unique(a7, b7));\n\t\tSystem.out.println(unique(a8, b8));\n\t\tSystem.out.println(unique(a9, b9));\n\t\tSystem.out.println(unique(a10, b10));\n\t\t\n\t}",
"public static void main(String[] args) throws Exception {\n int arr[]= {7,9,88,-33,2,12,6,1};\n Arrays.sort(arr);\n /*for(int i=0; i<arr.length; i++)\n \t System.out.print(arr[i]+\", \");\n System.out.println(\"\\n DESC\");\n System.out.print(\"{ \");\n for(int i=arr.length-1; i>=0; i--) {\n \t if(arr[i]==arr[0])\n \t System.out.print(arr[i]);\n \t else \n \t\t System.out.print(arr[i]+\", \");\n }*/\n // System.out.print(\" }\");\n \n int[] ar= {6,2,2,5,2,2,1};\n int startIndex=0;\n int lastIndex=ar.length-1;\n //a is sumRight,b = sumLeft\n int a=0,b=0;\n /* while(true) {\n \t \n \t if(b>a) \n \t\t //1+2+2=+5\n \t\t a+=ar[lastIndex--];\n \t else \n \t\t //6+2+2\n \t\t\t b+=ar[startIndex++];\n \t\tif(startIndex>lastIndex) {\n \t\t\tSystem.out.println(startIndex);\n \t\t\tif(a==b)\n \t\t\t\tbreak;\n \t\t\t else\n \t\t\t throw new Exception(\"not a valid array\");\n \t\t\t\n \t\t}\n \t\t\t \n \t\t\n }\n System.out.println(lastIndex);\n */\n \n \n while(true) {\n \t \n \t if(b>a)\n \t\t a+= ar[lastIndex--];\n \t else\n b+=ar[startIndex++];\n \t if(startIndex>lastIndex) {\n \t\t if(a==b)\n \t\t\t break;\n \t }\n }\n System.out.println(lastIndex);\n\t}",
"int a(java.lang.String r8, com.google.ho r9, java.lang.StringBuilder r10, boolean r11, com.google.ae r12) {\n /*\n r7 = this;\n r1 = 0;\n r0 = r8.length();\t Catch:{ RuntimeException -> 0x0009 }\n if (r0 != 0) goto L_0x000b;\n L_0x0007:\n r0 = r1;\n L_0x0008:\n return r0;\n L_0x0009:\n r0 = move-exception;\n throw r0;\n L_0x000b:\n r2 = new java.lang.StringBuilder;\n r2.<init>(r8);\n r0 = J;\n r3 = 25;\n r0 = r0[r3];\n if (r9 == 0) goto L_0x001c;\n L_0x0018:\n r0 = r9.a();\n L_0x001c:\n r0 = r7.a(r2, r0);\n if (r11 == 0) goto L_0x0025;\n L_0x0022:\n r12.a(r0);\t Catch:{ RuntimeException -> 0x0040 }\n L_0x0025:\n r3 = com.google.aw.FROM_DEFAULT_COUNTRY;\t Catch:{ RuntimeException -> 0x0042 }\n if (r0 == r3) goto L_0x005e;\n L_0x0029:\n r0 = r2.length();\t Catch:{ RuntimeException -> 0x003e }\n r1 = 2;\n if (r0 > r1) goto L_0x0044;\n L_0x0030:\n r0 = new com.google.ao;\t Catch:{ RuntimeException -> 0x003e }\n r1 = com.google.dk.TOO_SHORT_AFTER_IDD;\t Catch:{ RuntimeException -> 0x003e }\n r2 = J;\t Catch:{ RuntimeException -> 0x003e }\n r3 = 26;\n r2 = r2[r3];\t Catch:{ RuntimeException -> 0x003e }\n r0.<init>(r1, r2);\t Catch:{ RuntimeException -> 0x003e }\n throw r0;\t Catch:{ RuntimeException -> 0x003e }\n L_0x003e:\n r0 = move-exception;\n throw r0;\n L_0x0040:\n r0 = move-exception;\n throw r0;\n L_0x0042:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x003e }\n L_0x0044:\n r0 = r7.a(r2, r10);\n if (r0 == 0) goto L_0x0050;\n L_0x004a:\n r12.a(r0);\t Catch:{ RuntimeException -> 0x004e }\n goto L_0x0008;\n L_0x004e:\n r0 = move-exception;\n throw r0;\n L_0x0050:\n r0 = new com.google.ao;\n r1 = com.google.dk.INVALID_COUNTRY_CODE;\n r2 = J;\n r3 = 24;\n r2 = r2[r3];\n r0.<init>(r1, r2);\n throw r0;\n L_0x005e:\n if (r9 == 0) goto L_0x00d2;\n L_0x0060:\n r0 = r9.L();\n r3 = java.lang.String.valueOf(r0);\n r4 = r2.toString();\n r5 = r4.startsWith(r3);\n if (r5 == 0) goto L_0x00d2;\n L_0x0072:\n r5 = new java.lang.StringBuilder;\n r3 = r3.length();\n r3 = r4.substring(r3);\n r5.<init>(r3);\n r3 = r9.X();\n r4 = r7.o;\n r6 = r3.g();\n r4 = r4.a(r6);\n r6 = 0;\n r7.a(r5, r9, r6);\n r6 = r7.o;\n r3 = r3.f();\n r3 = r6.a(r3);\n r6 = r4.matcher(r2);\t Catch:{ RuntimeException -> 0x00ca }\n r6 = r6.matches();\t Catch:{ RuntimeException -> 0x00ca }\n if (r6 != 0) goto L_0x00af;\n L_0x00a5:\n r4 = r4.matcher(r5);\t Catch:{ RuntimeException -> 0x00cc }\n r4 = r4.matches();\t Catch:{ RuntimeException -> 0x00cc }\n if (r4 != 0) goto L_0x00bb;\n L_0x00af:\n r2 = r2.toString();\t Catch:{ RuntimeException -> 0x00ce }\n r2 = r7.a(r3, r2);\t Catch:{ RuntimeException -> 0x00ce }\n r3 = com.google.dz.TOO_LONG;\t Catch:{ RuntimeException -> 0x00ce }\n if (r2 != r3) goto L_0x00d2;\n L_0x00bb:\n r10.append(r5);\t Catch:{ RuntimeException -> 0x00d0 }\n if (r11 == 0) goto L_0x00c5;\n L_0x00c0:\n r1 = com.google.aw.FROM_NUMBER_WITHOUT_PLUS_SIGN;\t Catch:{ RuntimeException -> 0x00d0 }\n r12.a(r1);\t Catch:{ RuntimeException -> 0x00d0 }\n L_0x00c5:\n r12.a(r0);\n goto L_0x0008;\n L_0x00ca:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x00cc }\n L_0x00cc:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x00ce }\n L_0x00ce:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x00d0 }\n L_0x00d0:\n r0 = move-exception;\n throw r0;\n L_0x00d2:\n r12.a(r1);\n r0 = r1;\n goto L_0x0008;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.a(java.lang.String, com.google.ho, java.lang.StringBuilder, boolean, com.google.ae):int\");\n }",
"public boolean func_145773_az() { return true; }",
"public static void main(String args[]) {\n boolean hasSATscore = true;\n boolean hasHighSchoolTranscript = true;\n boolean isInternational=false;\n boolean hasTOFELscore=false;\n\n /*\n * logical_step2: Check if the applicant is eligible to apply to the university\n * logical_step_details: the applicant must have a SAT score, a high school transcript and must have TOEFL score\n * if is an international student.\n * question_1: What does the following block of code do?\n * answer 1: Check if the applicant is eligible to apply to the university\n * question_2: What is the data type of the variable isElig?\n * answer 2: isElig is a Boolean data type\n * question_3: What is the value of: !isInternational. (value assigned above)\n * answer_3: the value of !isInternational is true\n * question_4: What is the output the following block of code?\n * answer_4: the code displays the following statement \"You eligibility requirement has been evaluated to :true\"\n */\n\n /*\n * stm_comment: isElig contains result of logical operation between the variables. logical and (&&), logical or(||) and not operator is used \n * question_1: Please explain how the value of isElig evaluated.\n * answer_1: isElig contains result of logical operation between the variables\n * question_2: Please state the operators used in the code block below.\n * answer_2: logical and (&&), logical or(||) and not operator is used .\n *\n */\n\n boolean isElig = hasSATscore && hasHighSchoolTranscript && (!isInternational || (isInternational && hasTOFELscore));\n System.out.println(\" Your eligibility requirement has been evaluated to :\" +isElig );\n\n\n }",
"public void smell() {\n\t\t\n\t}",
"private void method_4318() {\r\n String[] var1;\r\n int var11;\r\n label68: {\r\n var1 = class_752.method_4253();\r\n class_758 var10000 = this;\r\n if(var1 != null) {\r\n if(this.field_3417 != null) {\r\n label71: {\r\n var11 = this.field_3417.field_3012;\r\n if(var1 != null) {\r\n if(this.field_3417.field_3012) {\r\n var10000 = this;\r\n if(var1 != null) {\r\n if(!this.field_2990.field_1832) {\r\n this.method_409(this.field_3404, class_1691.method_9334((class_1036)null), 10.0F);\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var10000.field_3417 = null;\r\n if(var1 != null) {\r\n break label71;\r\n }\r\n }\r\n\r\n var11 = this.field_3029 % 10;\r\n }\r\n\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 == 0) {\r\n float var13;\r\n var11 = (var13 = this.method_406() - this.method_405()) == 0.0F?0:(var13 < 0.0F?-1:1);\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 < 0) {\r\n this.method_4188(this.method_406() + 1.0F);\r\n }\r\n }\r\n }\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var11 = var10000.field_3028.nextInt(10);\r\n }\r\n\r\n if(var11 == 0) {\r\n float var2 = 32.0F;\r\n List var3 = this.field_2990.method_2157(class_705.class, this.field_3004.method_7097((double)var2, (double)var2, (double)var2));\r\n class_705 var4 = null;\r\n double var5 = Double.MAX_VALUE;\r\n Iterator var7 = var3.iterator();\r\n\r\n while(true) {\r\n if(var7.hasNext()) {\r\n class_705 var8 = (class_705)var7.next();\r\n double var9 = var8.method_3891(this);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n label43: {\r\n double var12 = var9;\r\n if(var1 != null) {\r\n if(var9 >= var5) {\r\n break label43;\r\n }\r\n\r\n var12 = var9;\r\n }\r\n\r\n var5 = var12;\r\n var4 = var8;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.field_3417 = var4;\r\n break;\r\n }\r\n }\r\n\r\n }",
"public static void main (String[] args)\r\n {\n \r\n System.out.println(withoutX(\"xHix\"));//Hi\r\n System.out.println(withoutX(\"xHi\"));//Hi\r\n System.out.println(withoutX(\"Hxix\"));//Hxi\r\n System.out.println(withoutX(\"xxHi\"));//xHi\r\n System.out.println(withoutX(\"Hix\"));//Hi\r\n System.out.println(withoutX(\"xaxbx\"));//axb\r\n System.out.println(withoutX(\"Hello\"));//Hello\r\n System.out.println(withoutX(\"Hexllo\"));//Hexllo\r\n \r\n \r\n ////****hasBad METHOD CALLS****/////\r\n /*\r\n System.out.println(hasBad(\"badxx\"));//true \r\n System.out.println(hasBad(\"xbadxx\"));//true \r\n System.out.println(hasBad(\"xxbadxx\"));//false\r\n System.out.println(hasBad(\"code\"));//false \r\n System.out.println(hasBad(\"bad\"));//true\r\n System.out.println(hasBad(\"ba\"));//false\r\n System.out.println(hasBad(\"xba\"));//false\r\n System.out.println(hasBad(\"xbad\"));//true\r\n System.out.println(hasBad(\"\"));//false\r\n System.out.println(hasBad(\"badyy\"));//true\r\n */\r\n \r\n ////****minCat METHOD CALLS****/////\r\n /*\r\n System.out.println(minCat(\"Hello\", \"Hi\"));//loHi\r\n System.out.println(minCat(\"Hello\", \"java\"));//ellojava\r\n System.out.println(minCat(\"java\", \"Hello\"));//javaello\r\n System.out.println(minCat(\"abc\", \"x\"));//cx\r\n System.out.println(minCat(\"abc\", \"\"));//*empty String*\r\n */\r\n \r\n ////****countHi METHOD CALLS****/////\r\n /*\r\n System.out.println(countHi(\"abc hi ho\"));//1\r\n System.out.println(countHi(\"ABChi hi\"));//2\r\n System.out.println(countHi(\"hihi\"));//2\r\n System.out.println(countHi(\"hiHIhi\"));//2\r\n System.out.println(countHi(\"hi\"));//1\r\n System.out.println(countHi(\"Hi si no HI on ahI\"));//0\r\n System.out.println(countHi(\"hiho not HOHIhi\"));//2\r\n */\r\n\r\n ////****repeatFront METHOD CALLS****/////\r\n /*\r\n System.out.println(repeatFront(\"Chocolate\", 4));//ChocChoChC\r\n System.out.println(repeatFront(\"Chocolate\", 3));//ChoChC\r\n System.out.println(repeatFront(\"Ice Cream\", 2));//IcI\r\n System.out.println(repeatFront(\"Ice Cream\", 1));//I\r\n System.out.println(repeatFront(\"Ice Cream\", 0));//*empty String*\r\n */ \r\n\r\n }",
"public static void main(String[] args) {\n\t\tString s1 =\"Yashodhar\";//String by java string literal\r\n\t\tchar ch[] ={'y','a','s','h','o','d','h','a','r','.','s'};\r\n\t\tString s3 = new String(ch);//Creating java to string\r\n\t\tString s2= new String(\"Yash\");//creating java string by new keyword \r\n\t\tSystem.out.println(s1);\r\n\t\tSystem.out.println(s2);\r\n\t\tSystem.out.println(s3);\r\n\t\t\r\n\t\t//Immutable String in Java(Can not changed)\r\n\t\tString s4= \"YASHODSHR\";\r\n\t\ts4 =s4.concat( \"Suvarna\");\r\n\t\tSystem.out.println(\"Immutable Strin=== \"+s4);\r\n\t\t\r\n\t\t//Compare two Strings using equals\r\n\t\tString s5= \"Yash\";\t\t\r\n\t\tString s6= \"YASH\";\r\n\t\tSystem.out.println(\"Campare equal \"+s5.equals(s6));\r\n\t\tSystem.out.println(s5.equalsIgnoreCase(s6));\r\n\t\t\r\n\t\t\t\r\n\t\t String s7=\"Sachin\"; \r\n\t\t String s8=\"Sachin\"; \r\n\t\t String s9=new String(\"Sachin\"); \r\n\t\t System.out.println(s7==s8); \r\n\t\t System.out.println(s7==s9);\r\n\t\t \r\n\t\t String s10 = \"YAsh\";\r\n\t\t String s11 = \"Yash\";\r\n\t\t String s12 = new String(\"yash\");\r\n\t\t System.out.println(s10.compareTo(s11));\r\n\t\t System.out.println(s11.compareTo(s12));\r\n\t\t \r\n\t\t //SubStrings\t\t \r\n\t\t String s13=\"SachinTendulkar\"; \r\n\t\t System.out.println(s13.substring(6));\r\n\t\t System.out.println(s13.substring(0,3));\r\n\t\t \r\n\t\t System.out.println(s10.toLowerCase());\r\n\t\t System.out.println(s10.toUpperCase());\r\n\t\t System.out.println(s10.trim());//remove white space\r\n\t\t System.out.println(s7.startsWith(\"Sa\"));\r\n\t\t System.out.println(s7.endsWith(\"n\"));\r\n\t\t System.out.println(s7.charAt(4));\r\n\t\t System.out.println(s7.length());\r\n\r\n\r\n\t\t String Sreplace = s10.replace(\"Y\",\"A\");\r\n\t\t System.out.println(Sreplace);\r\n\t\t \r\n\t\t System.out.print(\"String Buffer\");\r\n\t\t StringBuffer sb = new StringBuffer(\"Hello\");\r\n\t\t sb.append(\"JavaTpoint\");\r\n\t\t sb.insert(1,\"JavaTpoint\");\r\n\t\t sb.replace(1, 5, \"JavaTpoint\");\r\n\t\t sb.delete(1, 3);\r\n\t\t sb.reverse();\r\n\t\t System.out.println(\" \"+sb);\r\n\t\t \r\n\t\t String t1 = \"Wexos Informatica Bangalore\";\r\n\t\t System.out.println(t1.contains(\"Informatica\"));\r\n\t\t System.out.println(t1.contains(\"Wexos\"));\r\n\t\t System.out.println(t1.contains(\"wexos\"));\r\n\t\t \r\n\t\t \r\n\t\t String name = \"Yashodhar\";\r\n\t\t String sf1 = String.format(name);\r\n\t\t String sf2= String .format(\"Value of %f\", 334.4);\r\n\t\t String sf3 = String.format(\"Value of % 43.6f\", 333.33);\r\n\t\t \t\t\t \r\n\t\t \r\n\t\t System.out.println(sf1);\r\n\t\t System.out.println(sf2);\r\n\t\t System.out.println(sf3);\r\n\t\t \r\n\t\t String m1 = \"ABCDEF\";\r\n\t\t byte[] brr = m1.getBytes();\r\n\t\t for(int i=1;i<brr.length;i++)\r\n\t\t {\r\n\t\t System.out.println(brr[i]);\r\n\t\t }\r\n\t\t \r\n\t\t String s16 = \"\";\r\n\t\t System.out.println(s16.isEmpty());\r\n\t\t System.out.println(m1.isEmpty());\r\n\t\t \r\n\t\t String s17 =String.join(\"Welcome \", \"To\",\"Wexos Infomatica\");\r\n\t\tSystem.out.println(s17);\r\n\t\t \r\n \r\n\t}",
"@Test\r\n public void testUsingHascode()\r\n {\n \r\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n \r\n /******** Get HashCode *****************/ \r\n //return hascode as a string the is an easy way of doing this\r\n // all u have to do is state the object preceeded with a dot hashcode \r\n //*** E.g object.hashcode() ***\r\n String num1 = Integer.toHexString(System.identityHashCode(try_scorers)) ; \r\n String num2 = Integer.toHexString(System.identityHashCode(try_scorers.updateTries(5)));\r\n \r\n //Different hashcodes mean that it isnt the same object\r\n Assert.assertNotEquals(num1,num2,\"Objects are same\");\r\n \r\n }",
"public void solution() {\n\t\t\n\t}",
"public int a(int r12, androidx.recyclerview.widget.RecyclerView.u r13) {\n /*\n r11 = this;\n e.m.a.g r0 = r11.A\n int r0 = r0.a()\n r1 = 0\n if (r0 != 0) goto L_0x000a\n return r1\n L_0x000a:\n e.m.a.b r0 = e.m.a.b.c(r12)\n int r2 = r11.f8992j\n r3 = 1\n if (r2 == 0) goto L_0x0019\n int r2 = java.lang.Math.abs(r2)\n goto L_0x0088\n L_0x0019:\n int r2 = r11.f8991i\n int r2 = r0.a(r2)\n if (r2 <= 0) goto L_0x0023\n r2 = r3\n goto L_0x0024\n L_0x0023:\n r2 = r1\n L_0x0024:\n e.m.a.b r4 = e.m.a.b.START\n if (r0 != r4) goto L_0x003d\n int r4 = r11.k\n if (r4 != 0) goto L_0x003d\n int r2 = r11.f8991i\n if (r2 != 0) goto L_0x0032\n r2 = r3\n goto L_0x0033\n L_0x0032:\n r2 = r1\n L_0x0033:\n if (r2 == 0) goto L_0x0036\n goto L_0x0055\n L_0x0036:\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n goto L_0x0075\n L_0x003d:\n e.m.a.b r4 = e.m.a.b.END\n if (r0 != r4) goto L_0x005e\n int r4 = r11.k\n e.m.a.g r5 = r11.A\n int r5 = r5.c()\n int r5 = r5 - r3\n if (r4 != r5) goto L_0x005e\n int r2 = r11.f8991i\n if (r2 != 0) goto L_0x0052\n r2 = r3\n goto L_0x0053\n L_0x0052:\n r2 = r1\n L_0x0053:\n if (r2 == 0) goto L_0x0057\n L_0x0055:\n r4 = r1\n goto L_0x0075\n L_0x0057:\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n goto L_0x0075\n L_0x005e:\n if (r2 == 0) goto L_0x006a\n int r2 = r11.f8989g\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n int r2 = r2 - r4\n goto L_0x0073\n L_0x006a:\n int r2 = r11.f8989g\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n int r2 = r2 + r4\n L_0x0073:\n r4 = r2\n r2 = r1\n L_0x0075:\n e.m.a.c$c r5 = r11.y\n com.yarolegovich.discretescrollview.DiscreteScrollView$d r5 = (com.yarolegovich.discretescrollview.DiscreteScrollView.d) r5\n com.yarolegovich.discretescrollview.DiscreteScrollView r5 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n boolean r6 = r5.f3982d\n if (r6 == 0) goto L_0x0087\n if (r2 == 0) goto L_0x0083\n r2 = r1\n goto L_0x0084\n L_0x0083:\n r2 = 2\n L_0x0084:\n r5.setOverScrollMode(r2)\n L_0x0087:\n r2 = r4\n L_0x0088:\n if (r2 > 0) goto L_0x008b\n return r1\n L_0x008b:\n int r12 = java.lang.Math.abs(r12)\n int r12 = java.lang.Math.min(r2, r12)\n int r12 = r0.a(r12)\n int r0 = r11.f8991i\n int r0 = r0 + r12\n r11.f8991i = r0\n int r0 = r11.f8992j\n if (r0 == 0) goto L_0x00a3\n int r0 = r0 - r12\n r11.f8992j = r0\n L_0x00a3:\n e.m.a.a$c r0 = r11.n\n int r1 = -r12\n e.m.a.g r2 = r11.A\n r0.a(r1, r2)\n e.m.a.a$c r0 = r11.n\n boolean r0 = r0.a(r11)\n if (r0 == 0) goto L_0x00b6\n r11.a(r13)\n L_0x00b6:\n int r13 = r11.l\n r0 = -1\n if (r13 == r0) goto L_0x00c5\n int r13 = r11.f8991i\n int r1 = r11.f8992j\n int r13 = r13 + r1\n int r13 = java.lang.Math.abs(r13)\n goto L_0x00c7\n L_0x00c5:\n int r13 = r11.f8989g\n L_0x00c7:\n float r13 = (float) r13\n r1 = -1082130432(0xffffffffbf800000, float:-1.0)\n int r2 = r11.f8991i\n float r2 = (float) r2\n float r2 = r2 / r13\n float r13 = java.lang.Math.max(r1, r2)\n r1 = 1065353216(0x3f800000, float:1.0)\n float r13 = java.lang.Math.min(r13, r1)\n float r13 = -r13\n e.m.a.c$c r1 = r11.y\n com.yarolegovich.discretescrollview.DiscreteScrollView$d r1 = (com.yarolegovich.discretescrollview.DiscreteScrollView.d) r1\n com.yarolegovich.discretescrollview.DiscreteScrollView r2 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n java.util.List<com.yarolegovich.discretescrollview.DiscreteScrollView$c> r2 = r2.f3980b\n boolean r2 = r2.isEmpty()\n if (r2 == 0) goto L_0x00e8\n goto L_0x0133\n L_0x00e8:\n com.yarolegovich.discretescrollview.DiscreteScrollView r2 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n int r2 = r2.getCurrentItem()\n com.yarolegovich.discretescrollview.DiscreteScrollView r4 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n e.m.a.c r4 = r4.f3979a\n int r5 = r4.f8991i\n if (r5 != 0) goto L_0x00f9\n int r0 = r4.k\n goto L_0x010a\n L_0x00f9:\n int r6 = r4.l\n if (r6 == r0) goto L_0x00ff\n r0 = r6\n goto L_0x010a\n L_0x00ff:\n int r0 = r4.k\n e.m.a.b r4 = e.m.a.b.c(r5)\n int r3 = r4.a(r3)\n int r0 = r0 + r3\n L_0x010a:\n if (r2 == r0) goto L_0x0133\n com.yarolegovich.discretescrollview.DiscreteScrollView r3 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n androidx.recyclerview.widget.RecyclerView$d0 r10 = r3.a(r2)\n com.yarolegovich.discretescrollview.DiscreteScrollView r1 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n androidx.recyclerview.widget.RecyclerView$d0 r1 = r1.a(r0)\n java.util.List<com.yarolegovich.discretescrollview.DiscreteScrollView$c> r3 = r3.f3980b\n java.util.Iterator r3 = r3.iterator()\n L_0x011e:\n boolean r4 = r3.hasNext()\n if (r4 == 0) goto L_0x0133\n java.lang.Object r4 = r3.next()\n com.yarolegovich.discretescrollview.DiscreteScrollView$c r4 = (com.yarolegovich.discretescrollview.DiscreteScrollView.c) r4\n r5 = r13\n r6 = r2\n r7 = r0\n r8 = r10\n r9 = r1\n r4.a(r5, r6, r7, r8, r9)\n goto L_0x011e\n L_0x0133:\n r11.a()\n return r12\n */\n throw new UnsupportedOperationException(\"Method not decompiled: e.m.a.c.a(int, androidx.recyclerview.widget.RecyclerView$u):int\");\n }",
"@RepeatedTest(20)\n void subTest(){\n assertEquals(f.sub(f), new Float(decimal-decimal));\n assertEquals(f.sub(g), new Float(decimal-random));\n assertEquals(f.sub(i), new Float(decimal-seed));\n assertEquals(f.sub(bi), new Float(decimal-bi.toInt(bi.getBinary())));\n assertEquals(i.sub(f), new Float(seed-decimal));\n assertEquals(i.sub(i), new Int(seed-seed));\n assertEquals(i.sub(bi), new Int(seed-bi.toInt(bi.getBinary())));\n\n //nulls\n //Bool - ITypes\n assertEquals(bot.sub(st),Null);\n assertEquals(bof.sub(st),Null);\n assertEquals(bot.sub(bot),Null);\n assertEquals(bof.sub(bot), Null);\n assertEquals(bot.sub(f), Null);\n assertEquals(bof.sub(i), Null);\n assertEquals(bot.sub(bi), Null);\n //Float - ITypes \\ {Numbers}\n assertEquals(f.sub(st), Null);\n assertEquals(f.sub(bot), Null);\n assertEquals(f.sub(bof), Null);\n //Int - ITypes \\ {Numbers}\n assertEquals(i.sub(st), Null);\n assertEquals(i.sub(bot),Null);\n assertEquals(i.sub(bof), Null);\n //Binary - ITypes \\ {Int, Binary}\n assertEquals(bi.sub(st), Null);\n assertEquals(bi.sub(bot), Null);\n assertEquals(bi.sub(f), Null);\n //NullType subtractions\n assertEquals(Null.sub(st), Null);\n assertEquals(Null.sub(bof), Null);\n assertEquals(Null.sub(f), Null);\n assertEquals(Null.sub(i), Null);\n assertEquals(Null.sub(bi), Null);\n assertEquals(Null.sub(Null), Null);\n assertEquals(st.sub(Null), Null);\n assertEquals(bot.sub(Null), Null);\n assertEquals(f.sub(Null), Null);\n assertEquals(i.sub(Null), Null);\n assertEquals(bi.sub(Null), Null);\n }",
"private static boolean checkForMethod1() {\n\n \t\tif( easyTag1.size() < 3 || mediumTag2.size() < 3 || hardTag3.size() < 3 || easyTag4.size() < 3 || mediumTag5.size() < 3 || hardTag6.size() < 3 ) {\n \t\t\treturn true;\n \t\t}else {\n \t\t\treturn false;\n \t\t}\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println((0+15)/2);\r\n\t\tSystem.out.println(2.0e-6*10000000000.1);\r\n\t\tSystem.out.println(true&&false||true&&true);\r\n\t\t\r\n\t\t//1.1.2\r\n\t\tSystem.out.println((1+2.236)/2);\r\n\t\tSystem.out.println(1+2+3+4.0);\r\n\t\tSystem.out.println(4.1>=4);\r\n\t\tSystem.out.println(1+2+\"3\");\r\n\t\t\r\n\t\t//1.1.3\r\n//\t\tSystem.out.println(\"Please enter three nums\");\r\n\t\tScanner scanner=new Scanner(System.in);\r\n//\t\tint num=scanner.nextInt();\r\n//\t\tint num2=scanner.nextInt();\r\n//\t\tint num3=scanner.nextInt();\r\n//\t\r\n//\t\tif(num==num2&&num==num3) {\r\n//\t\t\tSystem.out.println(\"Eqaul:\");\r\n//\t\t}else {\r\n//\t\t\tSystem.out.println(\"Not equal:\");\r\n//\t\t}\r\n//\r\n//\t\t\t\r\n//\t\t//1.1.4\r\n//\t\t//a. then 语法错误\r\n//\t\t//b. ok\r\n//\t\t//c. ok\r\n//\t\t//d. ok\r\n//\r\n//\t\t\r\n//\t\t//1.1.5\r\n//\t\tint x=scanner.nextInt();\r\n//\t\tint y=scanner.nextInt();\r\n//\t\tif(x<1.0 && y<1.0 && x>0 && y>0) {\r\n//\t\t\tSystem.out.println(\"true\");\r\n//\t\t}\r\n//\t\telse {\r\n//\t\t\tSystem.out.println(\"false\");\r\n//\t\t}\r\n//\t\t\r\n\t\t\r\n\t\t//1.1.6\r\n//\t\tint f=0;\r\n//\t\tint g=1;\r\n//\t\tfor(int i=0;i<=15;i++) {\r\n//\t\t\tSystem.out.print(f+\"\\t\");\r\n//\t\t\tf=f+g;\r\n//\t\t\tg=f-g;\r\n//\t\t}\r\n\t\t\r\n\t\t//1.1.7\r\n//\t\tdouble t=9.0;\r\n//\t\twhile(Math.abs(t-9.0/t)> .001) {\r\n//\t\t\tt=(9.0/t+t)/2.0;\r\n//\t\t}\r\n//\t\tSystem.out.printf(\"%.5f\\n\", t);\r\n//\t\t\r\n//\t\t\r\n//\t\tint sum=0;\r\n//\t\tfor(int i=1;i<1000;i++)\r\n//\t\t\tfor(int j=0;j<i;j++)\r\n//\t\t\t\tsum++;\r\n//\t\tSystem.out.println(sum);\r\n//\t\r\n//\t\t\r\n//\t\tint sum2=0;\r\n//\t\tfor(int i=1;i<1000;i*=2)\r\n//\t\t\tfor(int j=0;j<1000;j++)\r\n//\t\t\t\tsum2++;\r\n//\t\tSystem.out.println(sum2);\r\n\t\r\n\t\t//1.1.8\r\n//\t\tSystem.out.println('b');\r\n//\t\tSystem.out.println('b'+'c');\r\n//\t\tSystem.out.println((char)('a'+4));\r\n\t\t\r\n\t\t//1.1.9\r\n//\t\tSystem.out.println(\"Please enter one num and return with a binary code\");\r\n//\t\tint N=scanner.nextInt();\r\n//\t\tString string=\"\";\r\n//\t\tfor(int n=N;n>0;n/=2) {\r\n//\t\t\tstring=(n%2)+string;\r\n//\t\t}\r\n//\t\tSystem.out.println(string);\r\n\t\t\r\n\t\t//1.1.10\r\n\t\t//int[] a=new int[10];\r\n\t\t\r\n\t\t//1.1.11\r\n//\t\tboolean[][] arrays= {{true,true,true},\r\n//\t\t\t\t{false,false,false},\r\n//\t\t\t\t{true,false,true},\r\n//\t\t};\r\n//\t\t\r\n//\t\tfor(int i=0;i<arrays.length;i++)\r\n//\t\t\tfor(int j=0;j<arrays.length;j++) {\r\n//\t\t\t\tif(arrays[i][j]) {\r\n//\t\t\t\t\tSystem.out.print(\"*\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\tSystem.out.print(\"^\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t//1.1.12\r\n//\t\tint[] a=new int[10];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=9-i;\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=a[a[i]];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\tSystem.out.println(i);\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Test\n public void test() {\n\t \n String obj1 = \"EMP201\"; \n String obj3 = \"Jackson\";\n String obj5 = \"Bond\";\n String obj7 = \"01/21/1989\";\n String obj9 = \"Male\";\n String obj11= \"[email protected]\";\n String obj13 = \"Male\";\n String obj16= \"0172345658\";\n String obj17= \"H.N0 34,Jack Street,Malaysia\";\n String obj19= \"Developer\";\n String obj21= \"ICT\";\n String obj23= \"6000\";\n String obj25=\"02/21/2004\";\n\n /* Error When User enter some other form of value or \n * submit page without any parameter*/\n\n String obj2 = \"EMP201\";\n String obj4 = \"Jackson\";\n String obj6 = \"Bond\";\n String obj8 = \"01/21/1989\";\n String obj10 = \"Male\";\n String obj12= \"[email protected]\";\n /*String obj12= \"jackso.com\";*/\n String obj14 = \"Male\";\n String obj15= \"0172345658\";\n /* String obj15= \"\";*/\n String obj18 = \"H.N0 34,Jack Street,Malaysia\";\n String obj20= \"Developer\";\n String obj22 = \"ICT\";\n /*int obj22 = 22;*/\n String obj24= \"6000\";\n String obj26=\"02/21/2004\";\n \n /*Testing paramter when entering values are in correct form*/\n /*assertEquals(obj1, obj2);*/\n assertEquals(obj3, obj4);\n assertEquals(obj5, obj6);\n assertEquals(obj7, obj8);\n assertEquals(obj9, obj10);\n assertEquals(obj11, obj12);\n assertEquals(obj13, obj14);\n assertEquals(obj15, obj16);\n assertEquals(obj17, obj18);\n assertEquals(obj19, obj20);\n assertEquals(obj21, obj22);\n assertEquals(obj23, obj24);\n assertEquals(obj25, obj26); \n \n /*assertNull(obj15);*/\n \n \n \n\n }",
"@Test\n\tprivate void checkPossibilityTest() {\n\t\tint[] input = new int[] {1,1,1};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {0,0,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {4,2,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {2,3,4,2,3};\n Assertions.assertThat(checkPossibility(input)).isFalse();\n\t}",
"private static int m6083a(Object obj) {\n if (obj == null) {\n return 1;\n }\n if (obj == Undefined.f6689a) {\n return 0;\n }\n if (obj instanceof CharSequence) {\n return 4;\n }\n if (obj instanceof Number) {\n return 3;\n }\n if (obj instanceof Boolean) {\n return 2;\n }\n if (obj instanceof Scriptable) {\n if (obj instanceof NativeJavaClass) {\n return 5;\n }\n if (obj instanceof NativeJavaArray) {\n return 7;\n }\n if (obj instanceof Wrapper) {\n return 6;\n }\n return 8;\n } else if (obj instanceof Class) {\n return 5;\n } else {\n if (obj.getClass().isArray()) {\n return 7;\n }\n return 6;\n }\n }",
"public static void main(String[] args) {\n\t\tString str_fail = \"abccs\";\n\t\tString str_pass = \"abcd\";\n\t\tSystem.out.println(isUnique.doubleLoop(str_fail));\n\t\tSystem.out.println(isUnique.doubleLoop(str_pass));\n\t\t\n\t\tSystem.out.println(isUnique.hashing(str_fail));\n\t\tSystem.out.println(isUnique.hashing(str_pass));\n\n\t}",
"public static void main(String[] args) {\n String s1 = \"tweety\";\n String s2 = \"weetty\";\n System.out.println(checkPermutationCountingHashMap(s1, s2));\n System.out.println(checkPermutationSorting(s1, s2));\n System.out.println(checkPermutationCountingArray(s1, s2));\n }",
"public static void main( String args[] ) {\n String blah = new String( \"Blah blah blah\" );\n String woof = new String( \"BCDBCDBCDBCDBCD\" );\n String pal1 = new String( \"a\" );\n String pal2 = new String( \"ab\" );\n String pal3 = new String( \"aba\" );\n String pal4 = new String( \"amanaplanacanalpanama\" );\n String pal5 = new String( \"abba\" );\n System.out.println( containsVowel( blah ) );\n System.out.println( containsVowel( woof ) );\n System.out.println( isPalindrome( pal1 ) );\n System.out.println( isPalindrome( pal2 ) );\n System.out.println( isPalindrome( pal3 ) );\n System.out.println( isPalindrome( pal4 ) );\n System.out.println( isPalindrome( pal5 ) );\n System.out.println( \"evensOnly() returns: \" + evensOnly( \"REHEARSALSZ\" ) );\n System.out.println( \"evensOnly() returns: \" + evensOnly( \"REhearSALsz\" ) );\n System.out.println( \"evensOnlyNoDupes() returns: \" + evensOnlyNoDupes( \"REhearSALsz\" ) );\n System.out.println( \"oddsOnly() returns: \" + oddsOnly( \"xylophones\" ) );\n System.out.println( \"oddsOnly() returns: \" + oddsOnly( \"XYloPHonES\" ) );\n System.out.println( \"oddsOnlyNoDupes() returns: \" + oddsOnlyNoDupes( \"XYloPHonES\" ) );\n System.out.println( \"reverse() returns: \" + reverse( \"REHEARSALSZ\" ) );\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString date=\"1990-02-02\";// yy-mm-dd\n\t\tLocalDate dat =LocalDate.parse(date,DateTimeFormatter.ISO_DATE);\n\t\tSystem.out.println(dat);\n\t\t\n//compare 2 strings\n\t\tString s1=\"The Boeing 747 \";\n\t\tString s2=\" this year's Australian rules\";\n\t\t\n\t\tif(s1==s2) {\n\t\t\tSystem.out.println(\"String equal\");\n\t\t}else {\n\t\t\tSystem.out.println(\"String not equal\");\n\t\t}\n//verify if a string is numeric\n\t\tString N=\"12345\";\n\t\tSystem.out.println(N.contains(\"1\"));\n\t\tboolean numeric=true;\n\t\ttry {\n\t\t\tDouble d=Double.parseDouble(N);\n\t\t\t\n\t\t}catch(NumberFormatException e) {\n\t\t\tnumeric=false;\n\n\t\t}\n\t\t\n\t\tif(numeric) {\n\t\t\tSystem.out.println(\"String is numeric \"+N);\n\t\t}else {\n\t\t\tSystem.out.println(\"String is not numeric\");\n\t\t}\n\t\t\n//verify if 2 strings are anagrams-\n\t\tString st1=\"DOG\";\n\t\tString st2=\"GOD\";\n\t \n\t\tif(st1.length()==st2.length()) {\n\t\t\t\n\t\t\tchar[] c1= st1.toCharArray();\n\t\t\tchar[] c2=st2.toCharArray();\n\t\t\t\n\t\t\tArrays.sort(c2);\n\t\t\tArrays.sort(c1);\n\n\t\t\tboolean result=Arrays.equals(c1, c2);\n\t\t\t\n\t\t\tif(result) {\n\t\t\t\tSystem.out.println(st1 +\" and \"+ st2 + \" are anagrams\");\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n//verify if a string contains a substring\n\t\tString str=\"Welcome to Maldives Enjoy your stay\";\n\t\tString mal=\"Maldives\";\n\t\tString sta=\"Stay\";\n\t\t\n boolean result=str.contains(mal);\n if(result) {\n\t System.out.println(\"contains substring \"+ mal);\n }else {\n\t System.out.println(\"does not contains substring\"+mal);\n }\n result=str.contains(sta);\n if(result) {\n\t System.out.println(\"contains substring \"+ sta);\n }else {\n\t System.out.println(\"does not contains substring \"+sta);\n }\n\n//iterate through each character of a string;\n\n String it=\"Testing Selenium\";\n char[] ch=it.toCharArray();\n for(char e:ch) {\n \t System.out.println(e);\n }\n\t\t\n //create random stringd\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"@Test\n public void isSamePerson() {\n assertTrue(ALICE.isSamePerson(ALICE));\n\n // null -> returns false\n assertFalse(ALICE.isSamePerson(null));\n\n // different phone and email -> returns false\n Person editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB).build();\n assertFalse(ALICE.isSamePerson(editedAlice));\n\n // different name -> returns false\n editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(ALICE.isSamePerson(editedAlice));\n\n // same name, same phone, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(ALICE.isSamePerson(editedAlice));\n\n // same name, same email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(ALICE.isSamePerson(editedAlice));\n\n // same name, same phone, same email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND)\n .withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(ALICE.isSamePerson(editedAlice));\n\n\n // null phone and email test cases start here\n Person aliceWithoutPhone = new PersonBuilder(ALICE).withoutPhone().build();\n Person aliceWithoutEmail = new PersonBuilder(ALICE).withoutEmail().build();\n Person aliceWithoutPhoneAndEmail = new PersonBuilder(ALICE).withoutPhone().withoutEmail().build();\n\n // same name, null phone, null email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withoutEmail().withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(aliceWithoutPhoneAndEmail.isSamePerson(editedAlice));\n\n // same name, null phone, null and non-null email -> returns false\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withoutEmail().build();\n assertFalse(aliceWithoutPhone.isSamePerson(editedAlice));\n\n // same name, null phone, same email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(aliceWithoutPhone.isSamePerson(editedAlice));\n\n // same name, null phone, different email -> returns false\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withEmail(VALID_EMAIL_BOB).build();\n assertFalse(aliceWithoutPhone.isSamePerson(editedAlice));\n\n // same name, null and non-null phone, null email -> returns false\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withoutEmail().build();\n assertFalse(aliceWithoutEmail.isSamePerson(editedAlice));\n\n // same name, null and non-null phone, null and non-null email -> returns false\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withoutEmail().build();\n assertFalse(ALICE.isSamePerson(editedAlice));\n\n // same name, null and non-null phone, same email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(ALICE.isSamePerson(editedAlice));\n\n // same name, null and non-null phone, different email -> returns false\n editedAlice = new PersonBuilder(ALICE).withoutPhone().withEmail(VALID_EMAIL_BOB).build();\n assertFalse(ALICE.isSamePerson(editedAlice));\n\n // same name, same phone, null email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withoutEmail().withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(aliceWithoutEmail.isSamePerson(editedAlice));\n\n // same name, same phone, null and non-null email, different attributes -> returns true\n editedAlice = new PersonBuilder(ALICE).withoutEmail().withAddress(VALID_ADDRESS_BOB)\n .withClientSources(VALID_CLIENTSOURCE_HUSBAND).withNote(VALID_NOTE_DOG).addToArchive().build();\n assertTrue(ALICE.isSamePerson(editedAlice));\n\n // same name, different phone, null email -> returns false\n editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withoutEmail().build();\n assertFalse(aliceWithoutEmail.isSamePerson(editedAlice));\n\n // same name, different phone, null and non-null email -> returns false\n editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withoutEmail().build();\n assertFalse(ALICE.isSamePerson(editedAlice));\n\n }",
"public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}",
"static void test_isPalindrome() {\n\n String pal1 = new String( \"a\" );\n String pal2 = new String( \"ab\" );\n String pal3 = new String( \"aba\" );\n String pal4 = new String( \"amanaplanacanalpanama\" );\n String pal5 = new String( \"abba\" );\n String pal6 = new String( \"Racecar\" );\n String pal7 = new String( \"RacecaR\" );\n\n\n System.out.println( \"\\nTESTS FOR isPalindrome() : \" );\n\n System.out.print( \"Test for string 'a' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal1 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'ab' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal2 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'aba' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal3 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'amanaplanacanalpanama' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal4 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'abba' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal5 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'Racecar' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal6 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n System.out.print( \"Test for string 'RacecaR' : \" );\n try { System.out.println( StringStuff.isPalindrome( pal7 ) ? \"true\" : \"false\" ); }\n catch( Exception e ) { System.out.println ( false ); }\n\n }",
"public static void main(String[] args )\r\n\t{\n\t\tlong t=322342432;\r\n\t\tString p=\"welcome\";\r\n\t\tString q=\"home\";\r\n\t\tint r=5;\r\n\t\tint s=9;\r\n\r\n\t\tSystem.out.println(p+q);\r\n\t\tSystem.out.println(r+s);\r\n\t\tSystem.out.println(p+q+r);\r\n\t\tSystem.out.println(p+q+r+s);//left to right\r\n\t\tSystem.out.println(p+q+(r+s));\r\n\r\n\t\tString a= \"javatrainingTesting \";\r\n\t\t//charAt(index), contains(char seq),concat(string),contentEquals(StringBuffer/StringBuilder),EqualsIgnoreCase(String),indexOf(),\r\n\t\t//lastIndexOf(), length(),startsWith(String),endswith(String), replace(),subString(),toUpperCAse(),toLowerAcse(),trim().\r\n\t\t//st.contentEquals(StringBuffer/StringBuilder)---> to compare String with StringBuilder or String buffer\r\n\t\t//st.equals(char seq..)---> to compare String with String or String Object\r\n\t\t// equals method is also present in Object class which compares references not content. Equals method in string class overrides this to compare content\r\n\r\n\t\tSystem.out.println(a.charAt(2));\r\n\t\tSystem.out.println(a.indexOf(\"a\"));\r\n\t\tSystem.out.println(a.substring(3, 6));\r\n\t\tSystem.out.println(a.substring(5));\r\n\t\tSystem.out.println(a.concat(\"rahul teaches\"));\r\n\t\tSystem.out.println(a.replace(\"in\", \"\"));//replace in with no character(delete)\r\n\t\t\r\n\t\tSystem.out.println(a.trim());\r\n\t\tSystem.out.println(a.toUpperCase());\r\n\t\tSystem.out.println(a.toLowerCase());\r\n\t\t//split\r\n\t\tString []arr =a.split(\"t\");\r\n\t\tSystem.out.println(arr[0]);\r\n\t\tSystem.out.println(arr[1]);\r\n\t\tSystem.out.println(arr[2]);\r\n\t\tSystem.out.println(a.replace(\"t\", \"s\"));\r\n\r\n\t\t//concept: final keyword---->is used to put restriction\r\n\t\t//final variable is constant.It can't be changed again\r\n\t\t//final class can't be inherited by child class(can't be extended)\r\n\t\t//final method can't be overriden by method in child class.\r\n\r\n\t\t//There are few inbuilt packages in java like--java, lang, awt, javax, swing, net, io, util, sql etc.\r\n\t\t//java.lang is inbuilt package ..thats why we can directly use commands like system.out.println, String class etc without any import.\r\n\t\t//java/Util package--all Collection classes and other classes come from this package but we need to import it.\r\n\r\n\t\t/*access modifiers:---for variables and methods\r\n\t public--access through out project in all packages, sub packages\r\n\t protected--access in same package and sub classes of different packages also.\r\n\t Default--access only in same package\r\n\t private--access only inside same class\r\n\t protected = default + subclass of other packages(using extends)\r\n\t public= protected + Other packages\r\n\r\n\t\t */\r\n\r\n\t}",
"private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }",
"public boolean method_1456() {\r\n return true;\r\n }",
"public static void main(String[] args) {\n String input_one = \"Fourscore and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war. We have come to dedicate a portion of that field as a final resting-place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. But, in a larger sense, we cannot dedicate — we cannot consecrate — we cannot hallow — this ground. The brave men, living and dead, who struggled here have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us — that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion — that we here highly resolve that these dead shall not have died in vain — that this nation shall have a new birth of freedom and that government of the people, by the people, for the people, shall not perish from the earth.\";\r\n String input_two = \"Oh, say can you see, by the dawn's early light,What so proudly we hailed at the twilight's last gleaming?Whose broad stripes and brightstars,through the perilous fight,O'er the ramparts we watched, were so gallantly streaming?And the rockets' red glare, the bombs bursting in air,Gave proof through the night that our flag was still there.O say, does that star-spangled banner yet waveO'er the land of the free and the home of the brave?On the shore, dimly seen through the mists of the deep,Wherethe foe's haughty host in dread silence reposes,What isthatwhichthe breeze, o'er the towering steep,As it fitfully blows, now conceals, now discloses?Now it catches the gleam of the morning's first beam,In full glory reflected now shines on the stream:'Tis the starspangled banner! O long may it waveO'er the land of the free and the home of the brave. And where is that band who so vauntingly swore That the havoc of war and the battle's confusionA home and a country should leaveus no more?Their blood has wiped out their foulfootstep'spollution.Norefuge could save the hireling and slaveFrom the terror of flight, or the gloom of the grave:And the star-spangled banner in triumph doth waveO'er theland of the free and the home of the brave.Oh! thus be it ever, when freemen shall stand Between their loved homes and the war's desolation!Blest with victory and peace, may the heaven-rescued land Praise the Power that hath made and preserved us a nation.Then conquer we must, for our cause it is just,And this be our motto: In God is our trust. And the star-spangled banner forever shall waveO'er the land of the free and the home of \";\r\n\r\n String input_upper = input_one.toUpperCase();\r\n String input_upper2 = input_two.toUpperCase();\r\n // System.out.println(input_upper);\r\n String[] pattern = { \"FREE\", \"BRAVE\", \"NATION\" };\r\n // Brute Force algorithm\r\n System.out.println();\r\n System.out.println(\"**************************** OUTPUT OF FIRST INPUT FILE: *****************************\");\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf = new BF_Search();\r\n long bf_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper, pattern[i]);\r\n }\r\n long bf_endTime = System.nanoTime();\r\n bf.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime - bf_startTime) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp = new KMP_Search();\r\n long kmp_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp.KMPSearch(pattern[i], input_upper);\r\n if (i == pattern.length - 1) {\r\n kmp.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime - kmp_startTime) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm = new BM_Search();\r\n char[] bm_input = input_upper.toCharArray();\r\n char[] bm_pattern = new char[] {};\r\n long bm_startTime = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern = i.toCharArray();\r\n bm.bm_search(bm_input, bm_pattern);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime - bm_startTime) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk = new RKA_Search();\r\n int q = 101;\r\n long rk_startTime = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk.rka_search(pattern[i], input_upper, q);\r\n if (i == pattern.length - 1) {\r\n rk.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime - rk_startTime) + \" nanoseconds\");\r\n System.out.println();\r\n System.out.println(\"************************* OUTPUT OF SECOND INPUT FILE: *******************************\");\r\n // Brute Force algorithm\r\n System.out.println();\r\n // System.out.println();\r\n System.out.println(\"\\t\\t\\t\\t\\tBRUTE FORCE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BF_Search bf2 = new BF_Search();\r\n long bf_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n bf.brute_force_search(input_upper2, pattern[i]);\r\n }\r\n long bf_endTime2 = System.nanoTime();\r\n bf2.printBF_Comparison();\r\n System.out.println(\"It took: \" + (bf_endTime2 - bf_startTime1) + \" nanoseconds\");\r\n\r\n // Knuth Moris Pratt algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tKNUTH MORIS PRATT ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n KMP_Search kmp2 = new KMP_Search();\r\n long kmp_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n kmp2.KMPSearch(pattern[i], input_upper2);\r\n if (i == pattern.length - 1) {\r\n kmp2.printKM_Comparisons();\r\n }\r\n }\r\n long kmp_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (kmp_endTime2 - kmp_startTime1) + \" nanoseconds\");\r\n\r\n // Boyer Moore algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tBOYER MOORE ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n BM_Search bm2 = new BM_Search();\r\n char[] bm_input2 = input_upper.toCharArray();\r\n char[] bm_pattern2 = new char[] {};\r\n long bm_startTime1 = System.nanoTime();\r\n for (String i : pattern) {\r\n bm_pattern2 = i.toCharArray();\r\n bm.bm_search(bm_input2, bm_pattern2);\r\n if (pattern[pattern.length - 1] == i) {\r\n bm2.printBM_Comparison();\r\n }\r\n }\r\n long bm_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (bm_endTime2 - bm_startTime1) + \" nanoseconds\");\r\n\r\n // Rabin Karp algorithm\r\n System.out.println(\"\\t\\t\\t\\t\\tRABIN KARP ALGORITHM:\");\r\n System.out.println(\"=====================================================================================\");\r\n RKA_Search rk2 = new RKA_Search();\r\n int q2 = 101;\r\n long rk_startTime1 = System.nanoTime();\r\n for (int i = 0; i < pattern.length; i++) {\r\n rk2.rka_search(pattern[i], input_upper2, q2);\r\n if (i == pattern.length - 1) {\r\n rk2.printRKA_Comparison();\r\n }\r\n }\r\n long rk_endTime2 = System.nanoTime();\r\n System.out.println(\"It took: \" + (rk_endTime2 - rk_startTime1) + \" nanoseconds\");\r\n }",
"@Test\n public void t1() {\n // manually verified\n RefactoringCommit instance1 = getRefactoringCommits().stream().filter(commit ->\n commit.getCommit().equals(\"5e7d64d6b2719afb1e5f4785d80d24ac5a19a782\") &&\n commit.getRefactoring().equals(\"Extract Method\") &&\n commit.getMethodMetrics().getFullMethodName().equals(\"isSameDay/2[Date,Date]\")\n ).collect(Collectors.toList()).get(0);\n\n Assert.assertNotNull(instance1);\n\n Assert.assertEquals(\"isSameDay/2[Date,Date]\", instance1.getMethodMetrics().getFullMethodName());\n Assert.assertEquals(2, instance1.getMethodMetrics().getMethodVariablesQty());\n Assert.assertEquals(1, instance1.getMethodMetrics().getMethodMaxNestedBlocks());\n Assert.assertEquals(1, instance1.getMethodMetrics().getMethodReturnQty());\n Assert.assertEquals(0, instance1.getMethodMetrics().getMethodTryCatchQty());\n }",
"public String a(String paramString, int paramInt, boolean paramBoolean)\r\n/* 517: */ {\r\n/* 518:516 */ StringBuilder localStringBuilder = new StringBuilder();\r\n/* 519:517 */ int i1 = 0;\r\n/* 520:518 */ int i2 = paramBoolean ? paramString.length() - 1 : 0;\r\n/* 521:519 */ int i3 = paramBoolean ? -1 : 1;\r\n/* 522:520 */ int i4 = 0;\r\n/* 523:521 */ int i5 = 0;\r\n/* 524:523 */ for (int i6 = i2; (i6 >= 0) && (i6 < paramString.length()) && (i1 < paramInt); i6 += i3)\r\n/* 525: */ {\r\n/* 526:524 */ char c1 = paramString.charAt(i6);\r\n/* 527:525 */ int i7 = a(c1);\r\n/* 528:527 */ if (i4 != 0)\r\n/* 529: */ {\r\n/* 530:528 */ i4 = 0;\r\n/* 531:530 */ if ((c1 == 'l') || (c1 == 'L')) {\r\n/* 532:531 */ i5 = 1;\r\n/* 533:532 */ } else if ((c1 == 'r') || (c1 == 'R')) {\r\n/* 534:533 */ i5 = 0;\r\n/* 535: */ }\r\n/* 536: */ }\r\n/* 537:535 */ else if (i7 < 0)\r\n/* 538: */ {\r\n/* 539:536 */ i4 = 1;\r\n/* 540: */ }\r\n/* 541: */ else\r\n/* 542: */ {\r\n/* 543:538 */ i1 += i7;\r\n/* 544:539 */ if (i5 != 0) {\r\n/* 545:540 */ i1++;\r\n/* 546: */ }\r\n/* 547: */ }\r\n/* 548:544 */ if (i1 > paramInt) {\r\n/* 549: */ break;\r\n/* 550: */ }\r\n/* 551:548 */ if (paramBoolean) {\r\n/* 552:549 */ localStringBuilder.insert(0, c1);\r\n/* 553: */ } else {\r\n/* 554:551 */ localStringBuilder.append(c1);\r\n/* 555: */ }\r\n/* 556: */ }\r\n/* 557:555 */ return localStringBuilder.toString();\r\n/* 558: */ }",
"private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test(timeout = 4000)\n public void test33() throws Throwable {\n JSTerm jSTerm0 = new JSTerm();\n JSSubstitution jSSubstitution0 = new JSSubstitution();\n jSTerm0.add((Object) \"\");\n JSPredicateForm jSPredicateForm0 = jSTerm0.applySubstitutionPF(jSSubstitution0);\n JSSubstitution jSSubstitution1 = new JSSubstitution();\n JSTerm jSTerm1 = new JSTerm();\n jSTerm1.add((Object) jSPredicateForm0);\n JSJshopVars.exclamation = (-3277);\n jSTerm0.add((Object) jSTerm1);\n JSPredicateForm jSPredicateForm1 = jSTerm0.clonePF();\n JSPredicateForm jSPredicateForm2 = jSPredicateForm0.applySubstitutionPF(jSSubstitution0);\n Object object0 = new Object();\n SystemInUtil.addInputLine(\"\");\n Predicate<Integer> predicate0 = Predicate.isEqual((Object) \"\");\n Predicate<Object> predicate1 = (Predicate<Object>) mock(Predicate.class, new ViolatedAssumptionAnswer());\n doReturn(false).when(predicate1).test(any());\n Predicate<Integer> predicate2 = predicate0.and(predicate1);\n Predicate<Integer> predicate3 = predicate2.or(predicate0);\n Predicate<Integer> predicate4 = predicate3.negate();\n jSPredicateForm0.removeIf(predicate4);\n Predicate<String> predicate5 = Predicate.isEqual((Object) \"\");\n Predicate<String> predicate6 = predicate5.negate();\n jSPredicateForm1.removeIf(predicate5);\n Predicate<String> predicate7 = predicate6.negate();\n Predicate<String> predicate8 = predicate6.and(predicate5);\n predicate7.or(predicate8);\n predicate5.negate();\n JSSubstitution jSSubstitution2 = new JSSubstitution();\n predicate6.or(predicate7);\n Predicate<Integer> predicate9 = Predicate.isEqual((Object) predicate6);\n jSSubstitution2.removeIf(predicate9);\n jSPredicateForm2.toStr();\n jSPredicateForm2.standarizerPredicateForm();\n jSPredicateForm0.trimToSize();\n // Undeclared exception!\n try { \n jSPredicateForm1.applySubstitutionPF(jSSubstitution1);\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // umd.cs.shop.JSTerm cannot be cast to java.lang.String\n //\n verifyException(\"umd.cs.shop.JSPredicateForm\", e);\n }\n }",
"public boolean method_2434() {\r\n return false;\r\n }",
"@Test\n\tpublic void testStartingIndicesRegression(){\n\t\tassertLeftmostStartingIndices(\"5,1,7,3,2|-..xxx$1..x...xxx$3....-xx........\", 0, 6, 8, 18, 22);\n\t\tassertRightmostStartingIndices(\"7,5|.......xxx$1....xxx$2..-\", 6, 14);\n\t\t\n\t}",
"public static void main(String[] args) {\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, true, null)));\n measureTime(()->checkInterruptSequential(4, 4, 3, false));\n measureTime(()->checkInterruptSequential(4, 4, 3, true));\n }",
"@Override\n public void computeSatisfaction() {\n\n }",
"public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }",
"boolean test() {\n return false; // REPLACE WITH SOLUTION\n }",
"@Test\n public void t2() {\n List<StableCommit> stableCommitList = getStableCommits().stream().filter(commit ->\n commit.getFilePath().equals(\"src/java/org/apache/commons/lang/builder/HashCodeBuilder.java\") && commit.getLevel() == 1).collect(Collectors.toList());\n // it has been through 9 different refactorings\n List<RefactoringCommit> refactoringCommitList = getRefactoringCommits().stream().filter(commit ->\n commit.getFilePath().equals(\"src/java/org/apache/commons/lang/builder/HashCodeBuilder.java\")).collect(Collectors.toList());\n\n Assert.assertEquals(4, stableCommitList.size());\n Assert.assertEquals(8, refactoringCommitList.size());\n\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", stableCommitList.get(0).getCommit());\n\n // then, it was refactored two times (in commit 5c40090fecdacd9366bba7e3e29d94f213cf2633)\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", refactoringCommitList.get(0).getCommit());\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", refactoringCommitList.get(1).getCommit());\n\n // It appears 3 times\n Assert.assertEquals(\"379d1bcac32d75e6c7f32661b2203f930f9989df\", stableCommitList.get(1).getCommit());\n Assert.assertEquals(\"d3c425d6f1281d9387f5b80836ce855bc168453d\", stableCommitList.get(2).getCommit());\n Assert.assertEquals(\"3ed99652c84339375f1e6b99bd9c7f71d565e023\", stableCommitList.get(3).getCommit());\n }",
"static String isValid(String s) {\n if(s.isEmpty())return \"YES\";\n int[] alphabet = new int[26];\n // char - 97 = arr location;\n for(int i = 0;i<s.length();i++){\n int location = (int)s.charAt(i) - 'a';\n alphabet[location] += 1;\n }\n for(Integer x: alphabet){\n System.out.println(x);\n }\n int i = 0;\n while(alphabet[i]==0){\n i++;\n }\n int standard = alphabet[i];\n boolean used = false;\n for(;i<26;i++){\n if(alphabet[i]!=0){\n if(Math.abs(alphabet[i]-standard)==1){\n if(used){\n System.out.println(\"equal 1\");\n return \"NO\";\n }else{\n used = true;\n }\n }else if(Math.abs(alphabet[i]-standard)>1){\n\n System.out.println(\"gtr then 1\");\n return \"NO\";\n }\n }\n }\n return \"YES\";\n\n\n\n }",
"private static boolean m14540d(C44919o c44919o, C8235ad c8235ad, C17313an c17313an) {\n boolean z;\n AppMethodBeat.m2504i(122757);\n if (c8235ad.eci() || !C25052j.m39373j(c8235ad.ejw(), c17313an)) {\n z = false;\n } else {\n z = true;\n }\n if (z) {\n AppMethodBeat.m2505o(122757);\n return true;\n }\n c44919o.initialize();\n ArrayDeque arrayDeque = c44919o.BKG;\n if (arrayDeque == null) {\n C25052j.dWJ();\n }\n Set set = c44919o.BKH;\n if (set == null) {\n C25052j.dWJ();\n }\n arrayDeque.push(c8235ad);\n while (true) {\n if (arrayDeque.isEmpty()) {\n z = false;\n } else {\n z = true;\n }\n if (!z) {\n c44919o.clear();\n AppMethodBeat.m2505o(122757);\n return false;\n } else if (set.size() > 1000) {\n Throwable illegalStateException = new IllegalStateException((\"Too many supertypes for type: \" + c8235ad + \". Supertypes = \" + C25035t.m39322a((Iterable) set, null, null, null, 0, null, null, 63)).toString());\n AppMethodBeat.m2505o(122757);\n throw illegalStateException;\n } else {\n C8235ad c8235ad2 = (C8235ad) arrayDeque.pop();\n C25052j.m39375o(c8235ad2, \"current\");\n if (set.add(c8235ad2)) {\n C37046c c37046c = c8235ad2.eci() ? C37049c.BKU : C37047a.BKT;\n if ((C25052j.m39373j(c37046c, C37049c.BKU) ^ 1) == 0) {\n c37046c = null;\n }\n if (c37046c != null) {\n for (C46867w c46867w : c8235ad2.ejw().eap()) {\n C25052j.m39375o(c46867w, \"supertype\");\n C8235ad aJ = c37046c.mo31381aJ(c46867w);\n if (aJ.eci() || !C25052j.m39373j(aJ.ejw(), c17313an)) {\n z = false;\n } else {\n z = true;\n }\n if (z) {\n c44919o.clear();\n AppMethodBeat.m2505o(122757);\n return true;\n }\n arrayDeque.add(aJ);\n }\n continue;\n } else {\n continue;\n }\n }\n }\n }\n }",
"private boolean method_2691(ahb var1, int var2, int var3, int var4, int var5) {\r\n int var7 = var2 + class_1707.field_8947[var5];\r\n String[] var10000 = class_752.method_4253();\r\n int var8 = var3 + class_1707.field_8948[var5];\r\n int var9 = var4 + class_1707.field_8949[var5];\r\n String[] var6 = var10000;\r\n int var10 = 0;\r\n\r\n int var10001;\r\n int var21;\r\n label171: {\r\n while(true) {\r\n if(var10 < 13) {\r\n label191: {\r\n var21 = var8;\r\n if(var6 == null) {\r\n break label171;\r\n }\r\n\r\n if(var6 != null) {\r\n if(var8 > 0) {\r\n var21 = var8;\r\n if(var6 == null) {\r\n return (boolean)var21;\r\n }\r\n\r\n if(var8 < 255) {\r\n aji var11 = var1.getBlock(var7, var8, var9);\r\n if(var6 == null) {\r\n break;\r\n }\r\n\r\n if(var11.method_2424() != awt.field_4170) {\r\n var21 = method_2689(var11, var1, var7, var8, var9, true);\r\n if(var6 != null) {\r\n if(var21 == 0) {\r\n return false;\r\n }\r\n\r\n var21 = var11.method_2514();\r\n }\r\n\r\n if(var6 != null) {\r\n if(var21 != 1) {\r\n var21 = var10;\r\n var10001 = 12;\r\n if(var6 != null) {\r\n if(var10 == 12) {\r\n return false;\r\n }\r\n\r\n var7 += class_1707.field_8947[var5];\r\n var8 += class_1707.field_8948[var5];\r\n var21 = var9;\r\n var10001 = class_1707.field_8949[var5];\r\n }\r\n\r\n var9 = var21 + var10001;\r\n ++var10;\r\n if(var6 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n var11.method_2466(var1, var7, var8, var9, var1.method_33(var7, var8, var9), 0);\r\n var1.method_2056(var7, var8, var9);\r\n }\r\n }\r\n break label191;\r\n }\r\n }\r\n\r\n var21 = 0;\r\n }\r\n\r\n return (boolean)var21;\r\n }\r\n }\r\n\r\n var10 = var7;\r\n break;\r\n }\r\n\r\n var21 = var8;\r\n }\r\n\r\n int var20 = var21;\r\n int var12 = var9;\r\n int var13 = 0;\r\n aji[] var14 = new aji[13];\r\n\r\n int var15;\r\n int var16;\r\n int var17;\r\n label140: {\r\n do {\r\n label137: {\r\n if(var7 == var2) {\r\n var21 = var8;\r\n var10001 = var3;\r\n if(var6 == null || var6 == null) {\r\n break label137;\r\n }\r\n\r\n if(var8 == var3) {\r\n var21 = var9;\r\n if(var6 == null) {\r\n break label140;\r\n }\r\n\r\n if(var9 == var4) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n var21 = var7;\r\n var10001 = class_1707.field_8947[var5];\r\n }\r\n\r\n aji var18;\r\n label125: {\r\n var15 = var21 - var10001;\r\n var16 = var8 - class_1707.field_8948[var5];\r\n var17 = var9 - class_1707.field_8949[var5];\r\n var18 = var1.getBlock(var15, var16, var17);\r\n int var19 = var1.method_33(var15, var16, var17);\r\n if(var6 != null) {\r\n label122: {\r\n if(var18 == this) {\r\n if(var6 == null) {\r\n break label122;\r\n }\r\n\r\n if(var15 == var2) {\r\n if(var6 == null) {\r\n break label122;\r\n }\r\n\r\n if(var16 == var3) {\r\n if(var6 == null) {\r\n break label122;\r\n }\r\n\r\n if(var17 == var4) {\r\n int var10006 = this.field_2143;\r\n if(var6 != null) {\r\n var10006 = this.field_2143?8:0;\r\n }\r\n\r\n var1.method_2054(var7, var8, var9, class_1192.field_6063, var5 | var10006, 4);\r\n var10006 = this.field_2143;\r\n if(var6 != null) {\r\n var10006 = this.field_2143?8:0;\r\n }\r\n\r\n var1.method_2131(var7, var8, var9, class_474.method_2823(class_1192.field_6061, var5 | var10006, var5, true, false));\r\n if(var6 != null) {\r\n break label125;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n var1.method_2054(var7, var8, var9, class_1192.field_6063, var19, 4);\r\n }\r\n }\r\n\r\n var1.method_2131(var7, var8, var9, class_474.method_2823(var18, var19, var5, true, false));\r\n }\r\n\r\n var14[var13++] = var18;\r\n var7 = var15;\r\n var8 = var16;\r\n var9 = var17;\r\n } while(var6 != null);\r\n\r\n var7 = var10;\r\n var8 = var20;\r\n var9 = var12;\r\n var21 = 0;\r\n }\r\n\r\n var13 = var21;\r\n\r\n do {\r\n label95: {\r\n if(var7 == var2) {\r\n var21 = var8;\r\n var10001 = var3;\r\n if(var6 == null || var6 == null) {\r\n break label95;\r\n }\r\n\r\n if(var8 == var3) {\r\n var21 = var9;\r\n if(var6 == null) {\r\n return (boolean)var21;\r\n }\r\n\r\n if(var9 == var4) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n var21 = var7;\r\n var10001 = class_1707.field_8947[var5];\r\n }\r\n\r\n var15 = var21 - var10001;\r\n var16 = var8 - class_1707.field_8948[var5];\r\n var17 = var9 - class_1707.field_8949[var5];\r\n var1.method_2063(var15, var16, var17, var14[var13++]);\r\n var7 = var15;\r\n var8 = var16;\r\n var9 = var17;\r\n } while(var6 != null);\r\n\r\n var21 = 1;\r\n return (boolean)var21;\r\n }",
"@Test(timeout = 4000)\n public void test17() throws Throwable {\n StringReader stringReader0 = new StringReader(\"0(Hu\");\n SystemInUtil.addInputLine(\"0(Hu\");\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer1 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer2 = new StreamTokenizer(stringReader0);\n JSTerm jSTerm0 = new JSTerm(streamTokenizer0);\n stringReader0.reset();\n StreamTokenizer streamTokenizer3 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer4 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer5 = new StreamTokenizer(stringReader0);\n streamTokenizer5.ordinaryChars((-4), (-1));\n streamTokenizer0.parseNumbers();\n streamTokenizer5.nextToken();\n StreamTokenizer streamTokenizer6 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer7 = new StreamTokenizer(stringReader0);\n streamTokenizer7.slashSlashComments(true);\n JSTerm jSTerm1 = new JSTerm(streamTokenizer4);\n streamTokenizer0.eolIsSignificant(true);\n jSTerm1.clear();\n streamTokenizer7.commentChar((-2));\n // Undeclared exception!\n try { \n jSTerm1.equals((JSPredicateForm) jSTerm0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 0 >= 0\n //\n verifyException(\"java.util.Vector\", e);\n }\n }",
"@Override\n\tprotected void logic() {\n\n\t}",
"private void method_2252() {\r\n String[] var1 = class_752.method_4253();\r\n\r\n do {\r\n boolean var10000 = this.field_1861[this.field_1862].isEmpty();\r\n\r\n int var2;\r\n label45:\r\n while(true) {\r\n if(var10000) {\r\n return;\r\n }\r\n\r\n var2 = this.field_1862;\r\n this.field_1862 ^= 1;\r\n Iterator var3 = this.field_1861[var2].iterator();\r\n\r\n while(true) {\r\n if(!var3.hasNext()) {\r\n break label45;\r\n }\r\n\r\n class_1033 var4 = (class_1033)var3.next();\r\n\r\n label40: {\r\n class_354 var6;\r\n label55: {\r\n try {\r\n var6 = this;\r\n if(var1 == null) {\r\n break label55;\r\n }\r\n\r\n var10000 = this.method_2253(var4);\r\n if(var1 == null) {\r\n break;\r\n }\r\n } catch (IllegalStateException var5) {\r\n throw method_2260(var5);\r\n }\r\n\r\n if(!var10000) {\r\n break label40;\r\n }\r\n\r\n var6 = this;\r\n }\r\n\r\n class_1627 var7 = var6.field_1850.method_2383();\r\n double var10001 = (double)var4.method_5847();\r\n double var10002 = (double)var4.method_5848();\r\n double var10003 = (double)var4.method_5849();\r\n int var10005 = this.field_1820.field_5738;\r\n class_297 var10006 = new class_297;\r\n var10006.method_1699(var4.method_5847(), var4.method_5848(), var4.method_5849(), var4.method_5852(), var4.method_5850(), var4.method_5851());\r\n var7.method_8903(var10001, var10002, var10003, 64.0D, var10005, var10006);\r\n }\r\n\r\n if(var1 == null) {\r\n break label45;\r\n }\r\n }\r\n }\r\n\r\n this.field_1861[var2].clear();\r\n } while(var1 != null);\r\n\r\n }",
"@Test(timeout = 4000)\n public void test02() throws Throwable {\n JSTerm jSTerm0 = new JSTerm();\n JSSubstitution jSSubstitution0 = new JSSubstitution();\n String string0 = \"\";\n jSTerm0.add((Object) \"\");\n JSSubstitution jSSubstitution1 = new JSSubstitution();\n JSTerm jSTerm1 = new JSTerm();\n jSTerm1.add((Object) jSTerm0);\n int int0 = (-3277);\n JSJshopVars.exclamation = (-3277);\n jSTerm0.add((Object) jSTerm1);\n JSPredicateForm jSPredicateForm0 = jSTerm0.applySubstitutionPF(jSSubstitution0);\n Object object0 = new Object();\n SystemInUtil.addInputLine(\"\");\n Predicate<String> predicate0 = Predicate.isEqual((Object) \"\");\n Predicate<String> predicate1 = predicate0.negate();\n jSTerm0.removeIf(predicate0);\n Predicate<String> predicate2 = predicate1.negate();\n Predicate<String> predicate3 = predicate1.and(predicate0);\n predicate2.or(predicate3);\n predicate0.negate();\n JSSubstitution jSSubstitution2 = new JSSubstitution();\n predicate1.or(predicate2);\n Predicate<Integer> predicate4 = Predicate.isEqual((Object) predicate1);\n jSSubstitution2.removeIf(predicate4);\n // Undeclared exception!\n try { \n jSPredicateForm0.toStr();\n fail(\"Expecting exception: StackOverflowError\");\n \n } catch(StackOverflowError e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test\n public void directJudgmentCase() {\n\n int num1 = 2;\n int num2 = 2;\n int expected1 = 4;\n int expected2 = 3;\n\n int actual = AssertionCalculator.add(num1, num2);\n\n //直接斷言該值是否為true\n Assertions.assertTrue(expected1 == actual, \"AssertionCalculator.add(\" + num1 + \",\" + num2 + \") == \" + expected1 + \"is false\");\n //直接斷言該值是否為false\n Assertions.assertFalse(expected2 == actual, \"AssertionCalculator.add(\" + num1 + \",\" + num2 + \") == \" + expected2 + \"is true\");\n\n }",
"private java.lang.String a(java.lang.String r6, com.google.b5 r7, com.google.e5 r8, java.lang.String r9) {\n /*\n r5 = this;\n r2 = F;\n r0 = r7.e();\n r1 = r5.o;\n r3 = r7.i();\n r1 = r1.a(r3);\n r3 = r1.matcher(r6);\n r1 = \"\";\n r1 = com.google.e5.NATIONAL;\t Catch:{ RuntimeException -> 0x0092 }\n if (r8 != r1) goto L_0x004b;\n L_0x001b:\n if (r9 == 0) goto L_0x004b;\n L_0x001d:\n r1 = r9.length();\t Catch:{ RuntimeException -> 0x0096 }\n if (r1 <= 0) goto L_0x004b;\n L_0x0023:\n r1 = r7.d();\t Catch:{ RuntimeException -> 0x0096 }\n r1 = r1.length();\t Catch:{ RuntimeException -> 0x0096 }\n if (r1 <= 0) goto L_0x004b;\n L_0x002d:\n r1 = r7.d();\n r4 = f;\n r1 = r4.matcher(r1);\n r1 = r1.replaceFirst(r9);\n r4 = z;\n r0 = r4.matcher(r0);\n r0 = r0.replaceFirst(r1);\n r1 = r3.replaceAll(r0);\n if (r2 == 0) goto L_0x009c;\n L_0x004b:\n r1 = r7.k();\n r4 = com.google.e5.NATIONAL;\t Catch:{ RuntimeException -> 0x0098 }\n if (r8 != r4) goto L_0x006b;\n L_0x0053:\n if (r1 == 0) goto L_0x006b;\n L_0x0055:\n r4 = r1.length();\t Catch:{ RuntimeException -> 0x009a }\n if (r4 <= 0) goto L_0x006b;\n L_0x005b:\n r4 = z;\n r4 = r4.matcher(r0);\n r1 = r4.replaceFirst(r1);\n r1 = r3.replaceAll(r1);\n if (r2 == 0) goto L_0x009c;\n L_0x006b:\n r0 = r3.replaceAll(r0);\n L_0x006f:\n r1 = com.google.e5.RFC3966;\n if (r8 != r1) goto L_0x0091;\n L_0x0073:\n r1 = p;\n r1 = r1.matcher(r0);\n r2 = r1.lookingAt();\n if (r2 == 0) goto L_0x0086;\n L_0x007f:\n r0 = \"\";\n r0 = r1.replaceFirst(r0);\n L_0x0086:\n r0 = r1.reset(r0);\n r1 = \"-\";\n r0 = r0.replaceAll(r1);\n L_0x0091:\n return r0;\n L_0x0092:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x0094 }\n L_0x0094:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x0096 }\n L_0x0096:\n r0 = move-exception;\n throw r0;\n L_0x0098:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x009a }\n L_0x009a:\n r0 = move-exception;\n throw r0;\n L_0x009c:\n r0 = r1;\n goto L_0x006f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.a(java.lang.String, com.google.b5, com.google.e5, java.lang.String):java.lang.String\");\n }",
"boolean hasS2();",
"private static java.lang.String a(java.lang.String r5, java.util.Map r6, boolean r7) {\n /*\n r2 = F;\n r3 = new java.lang.StringBuilder;\n r0 = r5.length();\n r3.<init>(r0);\n r0 = 0;\n r1 = r0;\n L_0x000d:\n r0 = r5.length();\n if (r1 >= r0) goto L_0x0035;\n L_0x0013:\n r4 = r5.charAt(r1);\n r0 = java.lang.Character.toUpperCase(r4);\n r0 = java.lang.Character.valueOf(r0);\n r0 = r6.get(r0);\n r0 = (java.lang.Character) r0;\n if (r0 == 0) goto L_0x002c;\n L_0x0027:\n r3.append(r0);\t Catch:{ RuntimeException -> 0x003a }\n if (r2 == 0) goto L_0x0031;\n L_0x002c:\n if (r7 != 0) goto L_0x0031;\n L_0x002e:\n r3.append(r4);\t Catch:{ RuntimeException -> 0x003c }\n L_0x0031:\n r0 = r1 + 1;\n if (r2 == 0) goto L_0x003e;\n L_0x0035:\n r0 = r3.toString();\n return r0;\n L_0x003a:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x003c }\n L_0x003c:\n r0 = move-exception;\n throw r0;\n L_0x003e:\n r1 = r0;\n goto L_0x000d;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.a(java.lang.String, java.util.Map, boolean):java.lang.String\");\n }",
"public static void main(String[] args) {\n String[] user0 = {\"/start\", \"/pink\", \"/register\", \"/orange\", \"/red\", \"a\"};\n String[] user1 = {\"/start\", \"/green\", \"/blue\", \"/pink\", \"/register\", \"/orange\", \"/one/two\"};\n String[] user2 = {\"a\", \"/one\", \"/two\"};\n String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n String[] user5 = {\"a\"};\n\n// out.println(rawr(user0, user1));\n// out.println(rawr(user1, user2));\n// out.println(rawr(user2, user0));\n// out.println(rawr(user5, user2));\n out.println(rawr(user3, user4));\n// out.println(rawr(user4, user3));\n\n P1 c=new P1();\n c.findContiguousHistory(user0, user1);\n c.findContiguousHistory(user1, user2);\n c.findContiguousHistory(user2, user0);\n c.findContiguousHistory(user5, user2);\n c.findContiguousHistory(user3, user4);\n\n // below scenaro is tricky because amber match later and user3 string. We have to come back again.\n // String[] user4 = {\"/red\", \"/orange\", \"/amber\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/lavender\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n // String[] user3 = {\"/red\", \"/orange\", \"/yellow\", \"/green\", \"/blue\", \"/purple\", \"/white\", \"/amber\", \"/HotRodPink\", \"/BritishRacingGreen\"};\n\n c.findContiguousHistory(user4, user3);\n }",
"public static void main(String[] args) {\n\t\tString str = \"66. All Valid Permutations Of Parentheses I\";\n//\t\tString str = \"Determine If One String Is Another's Substring\";\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t\tSystem.out.println(leet(str));\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n String str1 = Exercise1.getString(scanner);\n String str2 = Exercise1.getString(scanner);\n\n int[] rangeStr1 = getRange(scanner, str1);\n int[] rangeStr2 = getRange(scanner, str2);\n\n// Arrays.stream(range)\n// .forEach(System.out::println);\n\n boolean value = checkStringRangeEquality(str1, str2, rangeStr1, rangeStr2);\n System.out.println(\"Strings are equal: \" + value);\n\n\n }",
"@Test\n public void decompositionShape() {\n checkDecomposition(5, 5 ,false);\n checkDecomposition(10, 5,false);\n checkDecomposition(5, 10,false);\n checkDecomposition(5, 5 ,true);\n checkDecomposition(10, 5,true);\n checkDecomposition(5, 10,true);\n }",
"public static void main(String[] args) throws ArrayIndexOutOfBoundsException{\n\n A aB = new B();\n A aC = new C();\n B bB= new B();\n B bC= new C();\n C cC = new C();\n\n\n if ( aC.summ(1,1)==2) {\n System.out.println(\"true\");\n }\n if ( bC.diff(1,2) ==1) {\n System.out.println(\"true\");\n }\n\n System.out.println(bB.pp);\n System.out.println(bB.pr);\n\n System.out.println(cC.pp);\n System.out.println(cC.pr);\n\n\n int[] i = {};\n Class<?> cl = Integer.class;\n System.out.println(cl);\n\n System.out.println(2|1);\n System.out.println(3^1);\n\n\n int[] array = new int[] {1, 2, 3};\n\n for(int a: array) {\n System.out.print(a + \" \");\n }\n\n\n List<Integer> intList = new ArrayList<Integer>();\n for (int index = 0; index < array.length; index++)\n {\n intList.add(array[index]);\n }\n\n for(int a: intList) {\n System.out.print(a + \" \");\n }\n\n\n\n\n // int u = -1;\n // VM -ea\n //assert (u > 0): \"U < 0\";\n\n }",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"@Test\n\tvoid test() {\n\t\tassertEquals(0, solution1.solution(2147483647));\n\t\tassertEquals(1, solution1.solution(5));\n\t}",
"public static void main(String[] args) {\t\r\n\t\tList<Employee> empList = new ArrayList<>();\r\n\t\tempList.add(new Employee(\"Amit\", \"DSFSDF8989\", 67));\r\n\t\tempList.add(new Employee(\"Ranjit\", \"SDFSDF23423\", 63));\r\n\t\tempList.add(new Employee(\"Syamala\", \"SDFSDF23423\", 343));\r\n\t\r\n//\t\tusing ifPresent to avoid returning empty data.\r\n\t\tempList.stream()\r\n\t\t\t\t.filter(emp -> emp.getName().matches(\"Syamala\"))\r\n\t\t\t\t.findFirst()\r\n\t\t\t\t.ifPresent(System.out::println);\r\n\t\t\r\n//\t\t\r\n\t\tOptional<Employee> optionalEmployee = empList.stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t.filter(emp -> emp.getName().matches(\"dummy\"))\r\n\t\t\t\t\t\t\t\t\t\t\t\t.findFirst();\r\n\t\tSystem.out.println(\"optionalEmployee: \" + optionalEmployee.toString());\r\n\t\t\r\n\t\t\r\n//\t\tuse of Stream.findAny() method\r\n//\t\tunlike findFirst() the findAny() method select any element of the stream in parallel stream,\r\n//\t\tto increase the performance of the application,\r\n//\t\tThe cost of invoking multiple invocation on same source of data may not return same result!\r\n//\t\thence try to use the findFirst() instread.\r\n\t\tempList.stream()\r\n\t\t\t.filter(emp -> emp.getName().matches(\"Syamala\"))\r\n\t\t\t.findAny()\r\n\t\t\t.ifPresent(System.out::println);\r\n\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n String s=\"[()]{}{[()()]()}\";\n \n System.out.println(isBalanced(s));\n String s1=\"[(])\";\n System.out.println(isBalanced(s1));\n \n \n }",
"@Test\n public void test01() {\n EjercicioR755 ejercici1 = new EjercicioR755();\n\n\n ArrayList<Integer> origen = new ArrayList<>(Arrays.asList(5, 8, 2, 1, 9, 7, 4));\n String resultadoEsperado = \"9, 8, 7, 5, 4, 2, 1\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>(Arrays.asList(10, 4, 5, 4, 3, 9, 1));\n resultadoEsperado = \"10, 9, 5, 4, 4, 3, 1\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>(Arrays.asList(6, 4, 5, 4, 3, 9, 10));\n resultadoEsperado = \"10, 9, 6, 5, 4, 4, 3\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>();\n resultadoEsperado = \"\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n }",
"@Test\n void _correctIfCaseTest() {\n\n actionApply();\n\n for (ReceiverPair receiverPair : dependedReceiverPairs) {\n for (AssingablePair assingablePair : incompatibleAssignablePairs) {\n verify(model).arithm(receiverPair.getVariableReceiver(), \"=\", assingablePair.getIndexAssignable());\n }\n }\n }",
"public static void stringManipulations() {\n\t\tString str=\"hello naresh how are you\";\n\t\t// 012345678901234567890123 lengh=23\n\t\tString str2=\"hello naresh how are you\";\n\t\tString str3=\"Hello naresh how are you\";\n\t\t\n\t\tSystem.out.println(\"length of array :\"+str.length());\n\t\tSystem.out.println(\"char at 5th possition :\"+str.charAt(5));\n\t\tSystem.out.println(\"o char possition :\"+str.indexOf(\"o\"));//it si 1st occurance of O\n\t\t//here where the \"o\" possition is found that position will remains skips...\n\t\t//***in interviewer will ask i want 2nd \"o\" position at that time below statement\n\t\t//here directly we can give po\n\t\tSystem.out.println(\"2nd possition is :\"+str.indexOf(\"o\",str.indexOf(\"o\")+2));//2nd occurancy of o\n\t\t//2 nd 3rd occurancy search google\n\t\tSystem.out.println(str.indexOf(\"h\"));\n\t\tSystem.out.println(str.indexOf(\"how\"));\n\t\tSystem.out.println(str.indexOf(\"kjdsnfksd\"));//somany people think o/p is error or some exception but it will give \n\t\t//output is \"-1\"\n\t\t//string comparisum..\n\t\tSystem.out.println(str==str2);\n\t\tSystem.out.println(str==str3);\n\t\tSystem.out.println(str.equalsIgnoreCase(str3));//here cases (capt or small) ignored \n\t\t//substring\n\t\tSystem.out.println(str.substring(6, 12)); //it will give o/p char is in b/w\n\t\t//6 and 16\n\t\tSystem.out.println(str.trim());\n\t\t//it will trim the speaces befor anfter string bt it could not delete between speaces\n\t\tSystem.out.println(str2.replace(\" \", \"_\"));\n\t\tString[] strArray=str.split(\" \");\n\t\tfor (int i = 0; i < strArray.length; i++) {\n\t\t\tSystem.out.println(strArray[i]);\n\t\t}\n\t}",
"boolean hasS1();",
"Object findOperatorNeedCheck();",
"public static void main(String[] args) {\n\t\tStringBuilder sb=new StringBuilder();\n\t\tString str=\"xheixhixhi\";\n\t\tint x=0;\n\t\tfor(int i=0;i<str.length();i++)\n\t\t{\n\t\t\tif(str.charAt(i)=='x')\n\t\t\t\tx++;\n\t\t\n\t\t\telse\n\t\t\t\tsb.append(str.charAt(i));\n\t\t}\n\t\tfor(int i=0;i<x;i++)\n\t\t\tsb.append('x');\n\t\tSystem.out.println(sb);\n\t\t\n\t\tString str1=\"xxxyyy\";\n\t\tStringBuffer sb1=new StringBuffer(str1);\n\t\tSystem.out.println(sb1.toString());\n\t\tfor(int i=0;i<(str1.length());i++)\n\t\t{\n\t\t\tif(sb1.charAt(i)==sb1.charAt(i+1))\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb1.insert(++i,'*');\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb1.toString());\n\t\t\n\t\t//anagram\n\t\tString s1=\"niveda\";\n\t\tString s2=\"Nivedas\";\n\t\tString s4=s2.toLowerCase();\n\t\tchar[] s3=s1.toCharArray();\n\t\tchar[] s5=s4.toCharArray();\n\t\tArrays.sort(s3);\n\t\tArrays.sort(s5);\n\t\tboolean result=Arrays.equals(s3, s5);\n\t\tSystem.out.println(\"result is \"+result);\n\t\t\n\t\t//check all digits\n\t\tString s=\"09779\";\n\t\tif (s.isEmpty())\n\t\t\tSystem.out.println(\"empty\");;\n\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\tint temp = s.charAt(i) - (int)'0';\n\t\tSystem.out.println(temp);\n\t\tif (temp < 0 || temp > 9)\n\t\t\tSystem.out.println(\"false\");\n\t\t\n\t\t}\n\n\t\tSystem.out.println(\"true\");\n\n\t\t//reverse a string\n\t\tString s6=\"niveda is\";\n\t\tString sb4=new StringBuffer(s6).reverse().toString();\n\t\tSystem.out.println(sb4);\n\t\t\n\t\tStringBuilder s7=new StringBuilder();\n\t\tchar[] c1=s6.toCharArray();\n\t\tfor(int i=c1.length-1;i>=0;i--)\n\t\t{\n\t\t\ts7.append(c1[i]);\n\t\t}\n\t\tSystem.out.println(s7);\n\t\t\n\t\t//replace with space\n\t\tString str5=\"xxx yyy\";\n\t\tStringBuilder sb6=new StringBuilder(str5);\n\t\tSystem.out.println(sb6.toString());\n\t\tfor(int i=0;i<(str5.length());i++)\n\t\t{\n\t\t\tif(sb6.charAt(i)==32)\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tsb6.replace(i,i+1,\"%20\");\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(sb6.toString());\n\t\t\n\t\tString sentence=\"my name is niveda\";\n\t\tList< String> words = Arrays.asList(sentence.split(\"\\\\s\")); \n\t\tCollections.reverse(words); \n\t\t\n\t\tSystem.out.println(words);\n\t\tStringBuilder sb8 = new StringBuilder(sentence.length()); \n\t\t\n\t\tfor (int i = 0; i <=words.size() - 1; i++)\n\t\t{ \n\t\t\tsb8.append(words.get(i)); \n\t\t\t\n\t\tsb8.append(' ');\n\t\t}\n\t\tSystem.out.println(sb8.toString().trim());\n\t\t\n\t\tStringBuffer sb9=new StringBuffer(sentence);\n\t\tString sb10=sb9.reverse().toString();\n\t\tSystem.out.println(\"old \"+sb10.toString().trim());\n\t\t\n\t\tStringBuilder reverse = new StringBuilder(); \n\t\tString[] sa = sentence.trim().split(\"\\\\s\"); \n\t\tString newest=\"\";\n\t\tfor (int i = sa.length - 1; i >= 0; i--) \n\t\t{ \n\t\t\tString newword=sa[i]; \n\t\t\t//reverse.append(' '); \n\t\t\tString newstring=\"\";\n\t\t\tfor(int n=newword.length()-1;n>=0;n--)\n\t\t\t{\n\t\t\t\tnewstring=newstring+newword.charAt(n);\n\t\t\n\t\t\t}\n\t\t\tnewest=newest+newstring+\" \";\n\t\t} \n\t\tSystem.out.println( reverse.toString().trim());\n\t\tSystem.out.println(\"newest \"+newest);\n\t\tSystem.out.println(\"number of words in the string \"+sa.length);\n\n\t\t\n\t\t//reverse chars in the word in place\n\t\tString s11=\"my name is niveda\";\n\t\tString reversestring=\"\";\n\t\tString[] c11=s11.trim().split(\"\\\\s\");\n\t\tfor(int k=0;k<c11.length;k++)\n\t\t{\n\t\t\tString word=c11[k];\n\t\t\tString reverseword=\"\";\n\t\t\tfor(int m=word.length()-1;m>=0;m--)\n\t\t\t{\n\t\t\t\t\n\t\t\treverseword=reverseword+word.charAt(m);\n\t\t\t}\n\t\t\treversestring=reversestring+reverseword+\" \";\n\t\t}\n\t\t\n\t\tSystem.out.println( reversestring);\n\t}",
"public boolean a(amj paramamj)\r\n/* 268: */ {\r\n/* 269:293 */ if ((paramamj == null) || (paramamj.b == 0) || (paramamj.b() == null)) {\r\n/* 270:294 */ return false;\r\n/* 271: */ }\r\n/* 272: */ try\r\n/* 273: */ {\r\n/* 274:298 */ if (!paramamj.g())\r\n/* 275: */ {\r\n/* 276: */ do\r\n/* 277: */ {\r\n/* 278:301 */ i = paramamj.b;\r\n/* 279:302 */ paramamj.b = e(paramamj);\r\n/* 280:303 */ } while ((paramamj.b > 0) && (paramamj.b < i));\r\n/* 281:304 */ if ((paramamj.b == i) && (this.d.by.d))\r\n/* 282: */ {\r\n/* 283:306 */ paramamj.b = 0;\r\n/* 284:307 */ return true;\r\n/* 285: */ }\r\n/* 286:309 */ return paramamj.b < i;\r\n/* 287: */ }\r\n/* 288:312 */ int i = j();\r\n/* 289:313 */ if (i >= 0)\r\n/* 290: */ {\r\n/* 291:314 */ this.a[i] = amj.b(paramamj);\r\n/* 292:315 */ this.a[i].c = 5;\r\n/* 293:316 */ paramamj.b = 0;\r\n/* 294:317 */ return true;\r\n/* 295: */ }\r\n/* 296:318 */ if (this.d.by.d)\r\n/* 297: */ {\r\n/* 298:320 */ paramamj.b = 0;\r\n/* 299:321 */ return true;\r\n/* 300: */ }\r\n/* 301:323 */ return false;\r\n/* 302: */ }\r\n/* 303: */ catch (Throwable localThrowable)\r\n/* 304: */ {\r\n/* 305:325 */ b localb = b.a(localThrowable, \"Adding item to inventory\");\r\n/* 306:326 */ j localj = localb.a(\"Item being added\");\r\n/* 307: */ \r\n/* 308:328 */ localj.a(\"Item ID\", Integer.valueOf(alq.b(paramamj.b())));\r\n/* 309:329 */ localj.a(\"Item data\", Integer.valueOf(paramamj.i()));\r\n/* 310:330 */ localj.a(\"Item name\", new ahc(this, paramamj));\r\n/* 311: */ \r\n/* 312: */ \r\n/* 313: */ \r\n/* 314: */ \r\n/* 315: */ \r\n/* 316: */ \r\n/* 317:337 */ throw new u(localb);\r\n/* 318: */ }\r\n/* 319: */ }",
"@Test\n public void terminalOperations() {\n // count\n assertEquals(4, TestData.getBooks().stream().count());\n // findFirst\n Optional<Book> gangOfFour = TestData.getBooks().stream()\n .filter(book -> book.name.equals(\"Design Patterns: Elements of Reusable Object-Oriented Software\"))\n .findFirst();\n assertTrue(gangOfFour.isPresent());\n assertEquals(4, gangOfFour.get().authors.size());\n }",
"private boolean method_2685(ahb var1, int var2, int var3, int var4, int var5) {\r\n String[] var6 = class_752.method_4253();\r\n int var10000 = var5;\r\n boolean var7;\r\n if(var6 != null) {\r\n label148: {\r\n if(var5 != 0) {\r\n var10000 = var1.method_2170(var2, var3 - 1, var4, 0);\r\n if(var6 == null) {\r\n break label148;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n }\r\n\r\n byte var10001 = 1;\r\n if(var6 != null) {\r\n label138: {\r\n if(var10000 != 1) {\r\n var10000 = var1.method_2170(var2, var3 + 1, var4, 1);\r\n if(var6 == null) {\r\n break label138;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 2;\r\n }\r\n\r\n if(var6 != null) {\r\n label128: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2, var3, var4 - 1, 2);\r\n if(var6 == null) {\r\n break label128;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 3;\r\n }\r\n\r\n if(var6 != null) {\r\n label118: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2, var3, var4 + 1, 3);\r\n if(var6 == null) {\r\n break label118;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 5;\r\n }\r\n\r\n label153: {\r\n if(var6 != null) {\r\n label104: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2 + 1, var3, var4, 5);\r\n if(var6 == null) {\r\n break label104;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n if(var6 == null) {\r\n break label153;\r\n }\r\n\r\n var10001 = 4;\r\n }\r\n\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2 - 1, var3, var4, 4);\r\n if(var6 == null) {\r\n break label153;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3, var4, 0);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 2, var4, 1);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 1, var4 - 1, 2);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 1, var4 + 1, 3);\r\n }\r\n\r\n int var8;\r\n ahb var9;\r\n int var10002;\r\n int var10003;\r\n byte var10004;\r\n label155: {\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var9 = var1;\r\n var8 = var2 - 1;\r\n var10002 = var3 + 1;\r\n var10003 = var4;\r\n var10004 = 4;\r\n if(var6 == null) {\r\n break label155;\r\n }\r\n\r\n var10000 = var1.method_2170(var8, var10002, var4, 4);\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var9 = var1;\r\n var8 = var2 + 1;\r\n var10002 = var3 + 1;\r\n var10003 = var4;\r\n var10004 = 5;\r\n }\r\n\r\n var7 = var9.method_2170(var8, var10002, var10003, var10004);\r\n return var7;\r\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"public int logic1()\r\n\t{\r\n\t\tint changesMade = 0;\r\n\r\n\t\t\r\n\t\treturn changesMade;\r\n\t\t\t\t\t\r\n\t}",
"public static void main(String[] args) {\n System.out.println(\"QA factory\");\n int a;\n a=15+27;\n System.out.println(a);\n a=a + 3;\n System.out.println(a);\n int b;\n b=23*34;\n System.out.println(b);\n a= b+a*5 + 10;\n System.out.println(a);\n String s = \"Math class\";\n System.out.println(s);\n System.out.println(s + \" \" + a);\n System.out.println(\"a=\" + a);\n double h =10.5;\n h= h/9;\n System.out.println(h);\n boolean o;\n o = true;\n o = false;\n o= true && false;\n System.out.println(o);\n o= true && true;\n System.out.println(o);\n o= true || false;\n System.out.println(o);\n System.out.println(a == 123);\n System.out.println(10 > 8);\n System.out.println(15 < 45);\n System.out.println(12 != 45);\n int[] m = {1, 10, 100};\n System.out.println(m[1]);\n int p;\n p = m[0];\n System.out.println(p);\n String [] m1 = {\"Mama\", \"Papa\", \"Son\"};\n System.out.println(m1[0] + \" \" + m1[2]);\n\n\n\n }",
"public static void main(String[] args) {\n\n //challenge 1:\n\n List<String> topNames2015 = Arrays.asList(\n \"Amelia\",\n \"Olivia\",\n \"emily\",\n \"Isla\",\n \"Ava\",\n \"oliver\",\n \"Jack\",\n \"Charlie\",\n \"harry\",\n \"Jacob\"\n );\n\n Function<List<String>, List<String>> upperCase = (List<String> WordList) -> {\n for (String word : WordList) {\n String capitalWord = word.substring(0, 1).toUpperCase() + word.substring(1);\n WordList.set(WordList.indexOf(word), capitalWord);\n }\n return WordList;\n };\n\n Comparator<String> titleComparator = (FirstWord, SecondWord) -> FirstWord.compareTo(SecondWord);\n\n // makes the first letter upper case\n List<String> UppercaseWordList = upperCase.apply(topNames2015);\n // sorts the list in natural ordering\n Collections.sort(UppercaseWordList, titleComparator);\n for (String word : UppercaseWordList) {\n System.out.println(word);\n }\n\n //Challenge 2:\n\n List<String> topNames2016 = Arrays.asList(\n \"Amelia\",\n \"Olivia\",\n \"emily\",\n \"Isla\",\n \"Ava\",\n \"oliver\",\n \"Jack\",\n \"Charlie\",\n \"harry\",\n \"Jacob\"\n );\n\n // solution to challenge 2 it is commented out to allow for challenge 3\n// topNames2016.stream()\n// .map(obj -> {\n// String capitalWord = obj.substring(0, 1).toUpperCase() + obj.substring(1);\n// return capitalWord;\n// })\n// .sorted()\n// .forEach(System.out::println);\n//\n// }\n\n // challenge 3\n long countValue= topNames2016.stream()\n .map(obj -> {\n String capitalWord = obj.substring(0, 1).toUpperCase() + obj.substring(1);\n return capitalWord;\n })\n .filter(s -> s.startsWith(\"A\"))\n .count();\n\n System.out.println(\"Th number of names starting with A is: \"+countValue);\n\n }",
"@Test\n\tpublic void moreComplexAssertion() {\n\t\tOrder order1 = null, order2 = null, order3 = null, order4 = null;\n\t\t// when\n\t\tList<Order> orders = null;// orderSearchService.getOrders(trader,\n\t\t\t\t\t\t\t\t\t// tradingAcct, goldIsinCode);\n\t\t// then\n\t\t// Using Basic JUnit\n\t\tassertEquals(orders.size(), 2);\n\t\tIterator<Order> itr = orders.iterator();\n\t\tassertEquals(itr.next(), order3);\n\t\tassertEquals(itr.next(), order4);\n\t\t// Using Hamcrest\n\t\tassertThat(orders, hasItems(order3, order4));\n\t\tassertThat(orders.size(), is(2));\n\t\t// Using FEST Assertions\n\t\tassertThat(orders).containsOnly(order3, order4);\n\t\t// Using FEST Assertions (chained assertions)\n\t\tassertThat(orders).containsOnly(order3, order4).containsSequence(order3, order4);\n\t}",
"public int logic2()\r\n\t{\r\n\t\tint changesMade = 0;\r\n\t\t\t\r\n\t\treturn changesMade;\r\n\t}",
"public boolean method_2453() {\r\n return false;\r\n }",
"@Test\n public void countDistinctUpToAlgebraicTest() throws IOException\n {\n\t countDistinctUpToAlgebraic(\"50\", 20); \n\t \n\t // check flow in which Intermediate passes the max count as a null in its result\n\t countDistinctUpToAlgebraic(\"5\", 5);\n }",
"void test1(IAllOne obj) {\n assertEquals(\"\", obj.getMaxKey());\n assertEquals(\"\", obj.getMinKey());\n obj.inc(\"a\");\n assertEquals(\"a\", obj.getMaxKey());\n assertEquals(\"a\", obj.getMinKey());\n obj.inc(\"a\");\n obj.inc(\"b\");\n obj.inc(\"b\");\n obj.inc(\"b\");\n obj.inc(\"c\");\n assertEquals(\"b\", obj.getMaxKey());\n assertEquals(\"c\", obj.getMinKey());\n obj.dec(\"b\");\n obj.inc(\"a\");\n assertEquals(\"a\", obj.getMaxKey());\n assertEquals(\"c\", obj.getMinKey());\n obj.inc(\"c\");\n obj.dec(\"b\");\n assertEquals(\"b\", obj.getMinKey());\n obj.dec(\"b\");\n assertEquals(\"c\", obj.getMinKey());\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int len = in.nextInt();\n int total = len * len;\n int count = 1;\n int d1Sum = 0; \n int d2Sum = 0;\n int d1Count = 1;\n int d2Count = len;\n boolean d1 = true;\n boolean d2 = true;\n \n for(int i = 0; i < total; i++){\n int temp = in.nextInt();\n if(count > len){\n count -= len;\n d1 = true;\n d2 = true;\n }\n if(count == d1Count && d1){\n d1Sum += temp;\n d1Count ++;\n d1 = false;\n }\n if(count == d2Count && d2){\n d2Sum += temp;\n d2Count--;\n d2 = false;\n }\n count++;\n }\n \n System.out.println(Math.abs(d1Sum - d2Sum));\n }",
"private void a(java.lang.String r6, java.lang.StringBuilder r7) {\n /*\n r5 = this;\n r0 = F;\n r1 = J;\n r2 = 35;\n r1 = r1[r2];\n r1 = r6.indexOf(r1);\n if (r1 <= 0) goto L_0x0057;\n L_0x000e:\n r2 = J;\n r3 = 38;\n r2 = r2[r3];\n r2 = r2.length();\n r2 = r2 + r1;\n r3 = r6.charAt(r2);\n r4 = 43;\n if (r3 != r4) goto L_0x0039;\n L_0x0021:\n r3 = 59;\n r3 = r6.indexOf(r3, r2);\n if (r3 <= 0) goto L_0x0032;\n L_0x0029:\n r3 = r6.substring(r2, r3);\t Catch:{ RuntimeException -> 0x0072 }\n r7.append(r3);\t Catch:{ RuntimeException -> 0x0072 }\n if (r0 == 0) goto L_0x0039;\n L_0x0032:\n r2 = r6.substring(r2);\t Catch:{ RuntimeException -> 0x0072 }\n r7.append(r2);\t Catch:{ RuntimeException -> 0x0072 }\n L_0x0039:\n r2 = J;\t Catch:{ RuntimeException -> 0x0074 }\n r3 = 37;\n r2 = r2[r3];\t Catch:{ RuntimeException -> 0x0074 }\n r2 = r6.indexOf(r2);\t Catch:{ RuntimeException -> 0x0074 }\n r3 = J;\t Catch:{ RuntimeException -> 0x0074 }\n r4 = 36;\n r3 = r3[r4];\t Catch:{ RuntimeException -> 0x0074 }\n r3 = r3.length();\t Catch:{ RuntimeException -> 0x0074 }\n r2 = r2 + r3;\n r1 = r6.substring(r2, r1);\t Catch:{ RuntimeException -> 0x0074 }\n r7.append(r1);\t Catch:{ RuntimeException -> 0x0074 }\n if (r0 == 0) goto L_0x005e;\n L_0x0057:\n r0 = l(r6);\t Catch:{ RuntimeException -> 0x0074 }\n r7.append(r0);\t Catch:{ RuntimeException -> 0x0074 }\n L_0x005e:\n r0 = J;\n r1 = 39;\n r0 = r0[r1];\n r0 = r7.indexOf(r0);\n if (r0 <= 0) goto L_0x0071;\n L_0x006a:\n r1 = r7.length();\t Catch:{ RuntimeException -> 0x0076 }\n r7.delete(r0, r1);\t Catch:{ RuntimeException -> 0x0076 }\n L_0x0071:\n return;\n L_0x0072:\n r0 = move-exception;\n throw r0;\n L_0x0074:\n r0 = move-exception;\n throw r0;\n L_0x0076:\n r0 = move-exception;\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.a(java.lang.String, java.lang.StringBuilder):void\");\n }",
"@Test(timeout = 4000)\n public void test16() throws Throwable {\n StringReader stringReader0 = new StringReader(\"0(Hu\");\n StreamTokenizer streamTokenizer0 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer1 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer2 = new StreamTokenizer(stringReader0);\n JSTerm jSTerm0 = new JSTerm(streamTokenizer0);\n stringReader0.reset();\n StreamTokenizer streamTokenizer3 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer4 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer5 = new StreamTokenizer(stringReader0);\n streamTokenizer0.ordinaryChars(0, 1723);\n streamTokenizer0.nextToken();\n StreamTokenizer streamTokenizer6 = new StreamTokenizer(stringReader0);\n StreamTokenizer streamTokenizer7 = new StreamTokenizer(stringReader0);\n JSTerm jSTerm1 = new JSTerm(streamTokenizer2);\n streamTokenizer2.commentChar((-4));\n jSTerm0.equals((JSPredicateForm) jSTerm1);\n jSTerm1.standarizerPredicateForm();\n StreamTokenizer streamTokenizer8 = new StreamTokenizer(stringReader0);\n JSTerm jSTerm2 = new JSTerm(streamTokenizer8);\n jSTerm2.print();\n JSPredicateForm jSPredicateForm0 = jSTerm2.standarizerPredicateForm();\n jSTerm1.print();\n // Undeclared exception!\n try { \n jSPredicateForm0.matches((JSPredicateForm) jSTerm2, (JSSubstitution) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"umd.cs.shop.JSPredicateForm\", e);\n }\n }",
"private static void validateChainingMethods(SelfPredicate<String> one , SelfPredicate<String> two) {\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"jai shree ram\")); // true\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"20\")); // false\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"23\")); // flase\n\t\nSystem.out.println(\"final result \"+two.not().test(\"jai shree ram\")); // true\n\t\n\tSystem.out.println(\"final result \"+two.not().test(\"20\")); // true\n\t\n\tSystem.out.println(\"final result \"+two.not().test(\"23\")); // false\n\t\n}",
"private static boolean method_2690(ahb var0, int var1, int var2, int var3, int var4) {\r\n int var6 = var1 + class_1707.field_8947[var4];\r\n int var7 = var2 + class_1707.field_8948[var4];\r\n int var8 = var3 + class_1707.field_8949[var4];\r\n String[] var5 = class_752.method_4253();\r\n int var9 = 0;\r\n\r\n int var10000;\r\n while(true) {\r\n if(var9 < 13) {\r\n label68: {\r\n var10000 = var7;\r\n if(var5 == null) {\r\n break;\r\n }\r\n\r\n if(var5 != null) {\r\n if(var7 > 0) {\r\n var10000 = var7;\r\n if(var5 == null) {\r\n return (boolean)var10000;\r\n }\r\n\r\n if(var7 < 255) {\r\n aji var10 = var0.getBlock(var6, var7, var8);\r\n aji var11 = var10;\r\n if(var5 != null) {\r\n if(var10.method_2424() == awt.field_4170) {\r\n break label68;\r\n }\r\n\r\n var11 = var10;\r\n }\r\n\r\n var10000 = method_2689(var11, var0, var6, var7, var8, true);\r\n if(var5 != null) {\r\n if(var10000 == 0) {\r\n return false;\r\n }\r\n\r\n var10000 = var10.method_2514();\r\n }\r\n\r\n if(var5 == null) {\r\n break;\r\n }\r\n\r\n if(var10000 != 1) {\r\n var10000 = var9;\r\n int var10001 = 12;\r\n if(var5 != null) {\r\n if(var9 == 12) {\r\n return false;\r\n }\r\n\r\n var6 += class_1707.field_8947[var4];\r\n var7 += class_1707.field_8948[var4];\r\n var10000 = var8;\r\n var10001 = class_1707.field_8949[var4];\r\n }\r\n\r\n var8 = var10000 + var10001;\r\n ++var9;\r\n if(var5 != null) {\r\n continue;\r\n }\r\n }\r\n break label68;\r\n }\r\n }\r\n\r\n var10000 = 0;\r\n }\r\n\r\n return (boolean)var10000;\r\n }\r\n }\r\n\r\n var10000 = 1;\r\n break;\r\n }\r\n\r\n return (boolean)var10000;\r\n }",
"private static int benchmarkedMethod() {\n return 3;\n }",
"public static void main(String[] args) {\n StringBuilder sb = new StringBuilder(\"Amit\");\n String s1 = sb.toString();\n /*\n if(sb.toString() == s1){\n System.out.println(\"sb and s1 are equal\");\n }\n else{\n System.out.println(\"sb and s1 are not equal\");\n }\n if(s1 == sb.toString()){\n System.out.println(\"s1 and sb are equal\");\n }\n else{\n System.out.println(\"s1 and sb are not equal\");\n }\n if(s1.equals(sb)){\n System.out.println(\"s1 and sb are equal using equals method\");\n }\n else{\n System.out.println(\"s1 and sb are not equal using equals method\");\n }\n if(sb.equals(sb)){\n System.out.println(\"sb and s1 are equal using equals method\");\n }\n else{\n System.out.println(\"sb and s1 are not equal using equals method\");\n }\n */\n System.out.println(sb);\n System.out.println(s1);\n sb.append(\" \");\n sb.append(\"Sharma\");\n System.out.println(sb);\n sb.insert(4, \" Kumar\");\n System.out.println(sb);\n //System.out.println(sb.reverse());\n //System.out.println(sb.delete(5,10));\n System.out.println(sb.replace(5,10,\"Ku\"));\n }",
"@Test\n public void testSeparateNumber131() { // FlairImage: 131\n java.util.concurrent.atomic.AtomicBoolean totuus = new java.util.concurrent.atomic.AtomicBoolean(false); \n StringBuilder testi = new StringBuilder(); \n assertEquals(\"From: FlairImage line: 135\", 0, separateNumber(testi,'-',totuus)); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd\"); \n assertEquals(\"From: FlairImage line: 139\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 140\", \"asdasd\", testi.toString()); \n assertEquals(\"From: FlairImage line: 141\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 145\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 146\", \"asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 147\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 151\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 152\", \"asd-asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 153\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-123\"); \n assertEquals(\"From: FlairImage line: 157\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 158\", \"asd-asdasd-123\", testi.toString()); \n assertEquals(\"From: FlairImage line: 159\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-123-muumi\"); \n assertEquals(\"From: FlairImage line: 163\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 164\", \"asd-123-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 165\", false, totuus.get()); \n }"
] | [
"0.5351627",
"0.53516126",
"0.52328247",
"0.5188321",
"0.51307106",
"0.5081979",
"0.5057126",
"0.50397336",
"0.50201124",
"0.50111866",
"0.50063986",
"0.5004658",
"0.49764296",
"0.49633303",
"0.4938444",
"0.49374342",
"0.4928889",
"0.49218184",
"0.4906384",
"0.4892367",
"0.4879728",
"0.4872957",
"0.48656085",
"0.48605263",
"0.48305628",
"0.4827559",
"0.48164675",
"0.48147926",
"0.4814265",
"0.48106632",
"0.47836858",
"0.478237",
"0.47803065",
"0.47763118",
"0.4775158",
"0.47747314",
"0.47700268",
"0.47663742",
"0.4765433",
"0.47639772",
"0.47625616",
"0.4761179",
"0.47586355",
"0.4754955",
"0.47519505",
"0.47495964",
"0.47490615",
"0.47448468",
"0.473962",
"0.4735437",
"0.4735095",
"0.47327173",
"0.4731446",
"0.47311088",
"0.47293067",
"0.47269586",
"0.47223982",
"0.47222102",
"0.47160104",
"0.47157735",
"0.47144037",
"0.471384",
"0.4712296",
"0.47119278",
"0.47083843",
"0.47077122",
"0.47044608",
"0.47004122",
"0.469896",
"0.46953684",
"0.46906006",
"0.4682791",
"0.46797",
"0.46782064",
"0.46769533",
"0.46759495",
"0.46742406",
"0.46712017",
"0.46709704",
"0.46690184",
"0.46681038",
"0.46677327",
"0.46661153",
"0.46656355",
"0.465685",
"0.46564212",
"0.4654471",
"0.46523947",
"0.46519932",
"0.4651879",
"0.46517724",
"0.4650961",
"0.46501184",
"0.4647793",
"0.46436143",
"0.46426138",
"0.46384197",
"0.4637589",
"0.46349567",
"0.4633768",
"0.46326968"
] | 0.0 | -1 |
this is the value that the node stores(values may also be repeated/are not unique) | public Node(K key, V value) {// this is the constructor of a new Node
mKey = key;// it takes as an arguments a key
mValue = value;// and a value
mParent = mSentinel;// and makes a nodw with no parent
mLeft = mSentinel;// or children
mright = mSentinel;// that stores the key and the value
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AbstractNode getValue()\n\t\t{\n\t\t\treturn value;\n\t\t}",
"public E value()\r\n\t// post: returns value associated with this node\r\n\t{\r\n\t\treturn val;\r\n\t}",
"@Override\n public N value() {\n return value;\n }",
"public Object getValue() { return _value; }",
"public String getNodeValue ();",
"public S getValue() { return value; }",
"@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}",
"public Object getValue()\n {\n\treturn value;\n }",
"public Object getValue(){\n \treturn this.value;\n }",
"public Object getValue() { return this.value; }",
"public int getValue() \n {\n return value;\n }",
"@Override\r\n public Object getValue() {\r\n return value;\r\n }",
"public Value getValue(){\n return this.value;\n }",
"@Override\n\t\t\tpublic String getValue() {\n\t\t\t\treturn value;\n\t\t\t}",
"@Override\n public Object getValue()\n {\n return value;\n }",
"public int getValue() \n {\n return value;\n }",
"public Object getValue()\n {\n return value;\n }",
"@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}",
"@Override\n\tpublic Integer getValue() {\n\t\treturn value;\n\t}",
"public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}",
"public Object getValue() {\r\n return value;\r\n }",
"public int getValue()\n {\n return value;\n }",
"public V getValue() {\r\n\t\treturn value;\r\n\t}",
"public Object getValue() {\n\t\treturn value;\n\t}",
"public Object getValue() {\n\t\treturn value;\n\t}",
"public String getValue () { return value; }",
"public int getValue() {\r\n return Value;\r\n }",
"String getValue()\n {\n return value.toString();\n }",
"public long getValue() {\n\treturn value;\n }",
"public String getValue() {\n return value;\n }",
"public int getValue(){\n\t\treturn value;\n\t}",
"public Object getValue()\r\n {\r\n return this.value;\r\n }",
"public Object getValue() {\n\t\t\treturn value;\n\t\t}",
"public V getValue() {\n\t\treturn value;\n\t}",
"public V getValue() {\n\t\treturn value;\n\t}",
"public int getValue() {\r\n return value;\r\n }",
"public int getValue(){\n return value;\n }",
"public int getValue() {\r\n return value;\r\n }",
"public Object getValue() {\n return value;\n }",
"public Object getValue() {\n return value;\n }",
"public Object getValue() {\n return value;\n }",
"public Object getValue() {\n return value;\n }",
"public Object getValue() {\n return value;\n }",
"public V getValue() {\n return value;\n }",
"public V getValue() {\n return value;\n }",
"public String getValue() { return value; }",
"public int value() { \n return this.value; \n }",
"public String getValue()\n {\n return value;\n }",
"@Override\n\t\tpublic V getValue() {\n\t\t\treturn v;\n\t\t}",
"public E getValue() {\n\t\treturn value;\n\t}",
"public String getValue() {\r\n return value;\r\n }",
"public V getValue() {\n return value;\n }",
"public V getValue() {\n return value;\n }",
"public V getValue() {\n return value;\n }",
"public V getValue() {\n return value;\n }",
"public int getValue(){\n return this.value;\n }",
"@Override\r\n\tpublic Integer getValue() {\n\t\treturn null;\r\n\t}",
"V getValue() {\n return value;\n }",
"public int value(){\n return this.value;\n }",
"public int value() \n {\n return value;\n }",
"public String getValue()\r\n\t{\r\n\t\treturn value;\r\n\t}",
"@Override\r\n\tpublic String getValue() {\n\t\treturn value;\r\n\t}",
"public int getValue()\r\n {\r\n return value;\r\n }",
"@Override\r\n\t\t\tpublic Object getValue() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"public String getValue(){\n\t\treturn _value;\n\t}",
"public int getValue()\n {\n return value;\n }",
"public Entity getValue() {\r\n\t\t\treturn value;\r\n\t\t}",
"public int getValue()\n\t{\n\t\treturn value;\n\t}",
"public int getValue()\n\t{\n\t\treturn value;\n\t}",
"public int getValue()\n\t{\n\t\treturn value;\n\t}",
"public E getValue() {\r\n return value;\r\n }",
"public Integer getValue() {\n return _value ;\n }",
"public int getValue () {\n return value;\n }",
"public int getValue() {\r\n return value;\r\n }",
"public E getValue()\n {\n return value;\n }",
"@Override\n public String getValue() {\n return this.value.toString();\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public int getVertexVal()\r\n\t{\r\n\t\treturn this.value;\r\n\t}",
"public String getValue()\n {\n return value;\n }",
"public long getValue() {\n return value_;\n }",
"public String getValue()\n {\n return value;\n }",
"public String getValue()\n {\n return value;\n }",
"public String getValue() {\r\n return value;\r\n }",
"public String getValue() {\r\n return value;\r\n }",
"public String getValue() {\r\n return value;\r\n }",
"public String getValue() {\r\n return value;\r\n }",
"public String getValue() {\r\n return value;\r\n }",
"public String toString() {\n return value;\r\n }",
"public int getValue() {\n return value;\n }",
"public int getValue() {\n return value;\n }",
"public String value()\n {\n return value;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn value;\n\t}",
"@Override\n\tpublic String getValue() {\n\t\treturn value;\n\t}",
"public int getValue() {\n return value_;\n }",
"public String value() {\n return value;\n }",
"public T getValue() {\r\n return value;\r\n }"
] | [
"0.7258867",
"0.68827885",
"0.68041456",
"0.676643",
"0.67583287",
"0.67311823",
"0.67281145",
"0.6714702",
"0.6697304",
"0.6676799",
"0.66598517",
"0.6651908",
"0.6642995",
"0.6630013",
"0.6589907",
"0.65742594",
"0.65657675",
"0.6559706",
"0.6559706",
"0.65441763",
"0.6543577",
"0.654315",
"0.6530821",
"0.652432",
"0.652432",
"0.6517225",
"0.6511147",
"0.6510894",
"0.65071535",
"0.64961404",
"0.64941573",
"0.6483451",
"0.6482888",
"0.6480813",
"0.6480813",
"0.6477642",
"0.64759934",
"0.64736885",
"0.6460394",
"0.6460394",
"0.6460394",
"0.6460394",
"0.6460394",
"0.6457073",
"0.6457073",
"0.6456122",
"0.64374083",
"0.6429974",
"0.6429686",
"0.64274156",
"0.6425484",
"0.64228886",
"0.64228886",
"0.64228886",
"0.64228886",
"0.6422027",
"0.6417759",
"0.6413669",
"0.64114046",
"0.64095306",
"0.6407812",
"0.64004457",
"0.639973",
"0.6394794",
"0.63932955",
"0.63899976",
"0.63837945",
"0.63815635",
"0.63815635",
"0.63815635",
"0.6380444",
"0.63790995",
"0.6372709",
"0.6369522",
"0.6367595",
"0.6366764",
"0.63659126",
"0.63659126",
"0.63659126",
"0.63659126",
"0.63659126",
"0.63659126",
"0.63620526",
"0.6358721",
"0.63515353",
"0.63472474",
"0.63472474",
"0.63463074",
"0.63463074",
"0.63463074",
"0.63463074",
"0.63463074",
"0.63460165",
"0.63390905",
"0.63390905",
"0.6337916",
"0.6333901",
"0.63257337",
"0.63214046",
"0.6317523",
"0.63145494"
] | 0.0 | -1 |
returns the key and the value of a given node as a formated string | public String toString() {
if (this.getKey() == null) {
return "";
} else {
return "Key:" + this.getKey() + " Value:" + this.getValue();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getNodeValue(Node node) throws Exception;",
"String getNodeMetadataValue(int node, String key);",
"@Override\n\t\tpublic String toString() {\n\t\t\treturn \"<\"+key.toString()+\",\"+value.toString()+\">\";\n\t\t}",
"public String getNodeValue ();",
"public static String getNodeValue(Node node)\r\n\t{\r\n\t\treturn node.getFirstChild().getNodeValue();\r\n\t}",
"public static String getNodeValue(Element node)\n {\n StringBuilder sb = new StringBuilder();\n NodeList children = node.getChildNodes();\n int numNodes = children.getLength();\n for (int i = 0; i < numNodes; i++)\n {\n Node next = children.item(i);\n if (next instanceof Text)\n {\n sb.append(next.getNodeValue());\n }\n }\n return sb.toString();\n }",
"public String toString(){\n String s = \"\";\n Node N = front;\n while( N != null){\n s += N.key + \" \" + N.value + \"\\n\"; \n N = N.next;\n }\n return s;\n }",
"public String toString() {\r\n\t\treturn \"(\" + key + \",\" + value + \")\";\r\n\t}",
"public String get(String key) {\n \ttmp = getNode(key);\n \tif (tmp != null) { \n \t\treturn tmp.getVal();\n \t}\n \treturn null;\n }",
"public String toString() {\n return key + \"=\" + value;\n }",
"Map<String,String> getNodeData(T node);",
"@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder buffer = new StringBuilder(128);\n\t\tIterator<Map.Entry<String, AbstractNode>> it = pairs.entrySet().iterator();\n\t\twhile (it.hasNext())\n\t\t{\n\t\t\tMap.Entry<String, AbstractNode> pair = it.next();\n\t\t\tbuffer.append(keyToString(pair.getKey()));\n\t\t\tbuffer.append(KEY_VALUE_SEPARATOR_CHAR);\n\t\t\tbuffer.append(' ');\n\t\t\tbuffer.append(pair.getValue());\n\t\t\tif (it.hasNext())\n\t\t\t{\n\t\t\t\tbuffer.append(PAIR_SEPARATOR_CHAR);\n\t\t\t\tbuffer.append(' ');\n\t\t\t}\n\t\t}\n\t\treturn buffer.toString();\n\t}",
"@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn keyConverter.apply(key) + KEY_VALUE_SEPARATOR_CHAR + ' ' + value;\n\t\t}",
"public String toString(Tree<K, V> t) {\n\t\tString result = \"\", leftString, rightString;\n\n\t\tleftString = left.toString(left);\n\t\trightString = right.toString(right);\n\t\tresult = leftString + (leftString.equals(\"\") ? \"\" : \" \") + key + \"/\"\n\t\t\t\t+ value + (rightString.equals(\"\") ? \"\" : \" \") + right;\n\n\t\treturn result;\n\t}",
"@Override\r\n\t\tpublic String toString() {\r\n\t\t\treturn key.toString() + \"=\" + value.toString();\r\n\t\t}",
"protected String toString(Node<T> node) {\n\t\tif (node == null) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn node.value.toString() + \" \" \n\t\t\t\t+ toString(node.left) + \" \"\n\t\t\t\t+ toString(node.right);\n\t}",
"public String getTextValue (Node node);",
"@Override\r\n public String toString() {\r\n return key.toString() + \"=\" + value.toString();\r\n }",
"public String toString() {\r\n \treturn key;\r\n }",
"private String getStringValue(Node node) {\n switch (node.getNodeType()) {\n case Node.ATTRIBUTE_NODE:\n case Node.TEXT_NODE:\n return node.getNodeValue();\n default: {\n try {\n Transformer transformer = TRANSFORMER_FACTORY.newTransformer();\n StringWriter buffer = new StringWriter();\n transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n transformer.transform(new DOMSource(node), new StreamResult(buffer));\n return buffer.toString();\n } catch (Exception e) {\n }\n return null;\n }\n }\n }",
"@Override\r\n\tpublic String toString() {\n\t\treturn key + \"\";\r\n\t}",
"public String printNodeData(Node<T> node){\n return String.valueOf(node.data);\n }",
"public String toString()\r\n\t\t{\r\n\t\t\treturn \"|Key: \" + key + \", Value: \" + value + \"|\";\r\n\t\t}",
"@Override\n\tpublic String toString() {\n\t\t\n\t\tSet<KeyValueData> keyvalueset = key_value_treemap.keySet();\n\t\tIterator<KeyValueData> iterator = keyvalueset.iterator();\n\t\tStringBuilder builder = new StringBuilder(\"*\");\n\t\twhile(iterator.hasNext()){\n\t\t\tKeyValueData data = iterator.next();\n\t\t\tbuilder.append(data.key);\n\t\t\tbuilder.append(\" \");\n\t\t\tbuilder.append(data.value);\n\t\t\tbuilder.append(\" \");\n\t\t}\n\t\treturn builder.toString();\n\t}",
"public String getNodeKey() {\n return nodeKey;\n }",
"@Override\r\n\tpublic String toString() {\n\t\treturn this.key;\r\n\t}",
"@Override\n public String toString() {\n return key + \"=\" + value;\n }",
"Map<String, String> getAttr(NodeKey key);",
"@Override\n public String toString() {\n return String.valueOf(key);\n }",
"@Override\n public Object string(Object node) {\n return ((Node<E>) node).element.toString();\n }",
"public String lookup(String key){\n Node N;\n N = findKey(root, key);\n return ( N == null ? null : N.item.value );\n }",
"@Override\n public String toString() {\n return key;\n }",
"public String toString()\n {\n return key.toString() + \" => \" + item.toString();\n }",
"public static String getNodeStr(Node curr) {\r\n\t\treturn curr.str;\r\n\t}",
"java.lang.String getEntryNode();",
"@Override\n public String toString(){\n return key;\n }",
"public String getString(String key);",
"public String getValue(Node node) {\n return (node == null) ? null : node.getTextContent();\n }",
"public String getKey()\r\n {\r\n return getValue().toString();\r\n }",
"interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }",
"String getString(String key);",
"public String get(BSTMapNode element) \n\t{\n\t\tif(element.getKey() == this.key)\n\t\t{\n\t\t\treturn this.value;\n\t\t}\n\t\telse if(element.getKey() < this.key)\n\t\t{\n\t\t\tif(this.left == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn this.left.get(element);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(this.right == null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn this.right.get(element);\n\t\t\t}\n\t\t}\n\t}",
"public String lookup(String key){\n Node N = front;\n while( N != null){\n if( N.key.equals(key)){\n return N.value;\n }\n N = N.next;\n }\n return null;\n }",
"public String key(String name) {\r\n String value;\r\n value = this.children.stream().filter(child -> child.equals(name)).findFirst().get().children.get(0).data;\r\n return value;\r\n }",
"public String toString() {\n\treturn \"Key: \" + key.toString() + \"\\tData: \" + data;\n }",
"public String toString(T value) {\n\t\treturn toStringReverse(getNode(value));\n\t}",
"@Override\n\tpublic java.lang.String getNode_2() {\n\t\treturn _dictData.getNode_2();\n\t}",
"public String toString() {\r\n\t\tString result = \"[ \";\r\n\t\tLinkedNode nextNode = firstNode;\r\n\t\twhile (nextNode != null) {\r\n\t\t\tresult = result + nextNode.getKey() + \"\\n\";\r\n\t\t\tnextNode = nextNode.getNextNode();\r\n\t\t}\r\n\t\tresult = result + \" ]\";\r\n\t\treturn result;\r\n\t}",
"public NodeKey createNodeKey();",
"public static String nodeToString(Node node)\n {\n StringWriter sw = new StringWriter();\n try\n {\n Transformer t = TransformerFactory.newInstance().newTransformer();\n t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n t.setOutputProperty(OutputKeys.INDENT, \"no\");\n /* CB - Since everything is already stored as strings in memory why shoud an encoding be required here? */\n t.setOutputProperty(OutputKeys.ENCODING, RuntimeConstants.ENCODING_DEFAULT);\n t.transform(new DOMSource(node), new StreamResult(sw));\n }\n catch (TransformerException te)\n {\n LOGGER.error(\"could not convert XML node to string\", te);\n }\n return sw.toString();\n }",
"public String toString() {\r\n\t\tString cad = \"\";\r\n\t\tfor (int i = 0; i < nodes_.size(); i++) {\r\n\t\t\tcad += nodes_.get(i).getVal() + \" - \";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"java.lang.String getKey();",
"private String toSortedString( Node n ){\n String s = \"\";\n if(n != null){\n s += toSortedString(n.left);\n s += n.data + \"\";\n s += toSortedString(n.right);\n }\n return s;\n }",
"@Override\n public Object string(Object node) {\n Node<E> myNode = (Node<E>)node;\n String parentString = \"null\";\n if (myNode.parent != null) {\n parentString = myNode.parent.element.toString();\n }\n return myNode.element + \"_p(\" + parentString + \")\"; }",
"private String toString2(BinaryNode<E> t) {\n if (t == null) return \"\";\n StringBuilder sb = new StringBuilder();\n sb.append(toString2(t.left));\n sb.append(t.element.toString() + \" \");\n sb.append(toString2(t.right));\n return sb.toString();\n }",
"public static String getNodeValue(Node node, String id)\r\n\t{\r\n\t\t\r\n\t\tNodeList list = ((Element)node).getElementsByTagName(id);\r\n\t\t\r\n\t\treturn list.item(0).getFirstChild().getNodeValue();\r\n\t}",
"private String keyAsString(Map map, String key) {\n Object value = map.get(key);\n return (value != null) ? value.toString() : null;\n }",
"public String toString() {\r\n\t\t\tListNode current = header;\r\n\t\t\tString s = \"\";\r\n\t\t\twhile (current != null) {\r\n\t\t\t\ts += \"k: \" + current.key + \" v: \" + current.value + \"\\n\";\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn s;\r\n\t\t}",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"String getKey();",
"public String getKey() { \n\t\treturn getKeyElement().getValue();\n\t}",
"String key();",
"private static String node2Str(JsonNode node) {\n try {\n return jsonWriter.writeValueAsString(node);\n } catch (JsonProcessingException e) {\n throw new IllegalStateException(\"Error writing JsonNode as a String: \" + node.asText(), e);\n }\n }",
"@Override\n\tpublic java.lang.String getNode_1() {\n\t\treturn _dictData.getNode_1();\n\t}",
"public String toString() {\n\t\tString tester = \"\";\n\t\tfor(String node : nodes.keySet())\n\t\t{\n\t\t\ttester += \" \" + nodes.get(node) + \" \\n\";\n\t\t}\n\t\treturn tester;\n\t}",
"public String getDPTag(String key)\r\n {\n return tagHash.get(key).toString();\r\n }",
"public String getKey();",
"public String getKey();",
"public String getKey();",
"public String getKey();",
"private HashMap<String, String> getNodeInfo(String input) {\n HashMap<String, String> tmp = new HashMap<>();\n /* mark negative value*/\n if (input.charAt(0) == '-')\n input = input.replaceFirst(\"-\", \"!\");\n\n Pattern pattern = Pattern.compile(\"(sin|cos|tan|atan|log10|log2|sqrt|/|\\\\^|\\\\+|\\\\*|-)\");\n Matcher matcher = pattern.matcher(input);\n if (matcher.find()) {\n String op = input.substring(matcher.start(), matcher.end());\n tmp.put(\"operator\", op);\n switch (op) {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n case \"^\":\n String[] a = input.split(\"\\\\\" + op);\n tmp.put(\"arg1\", a[0]);\n tmp.put(\"arg2\", a[1]);\n break;\n case \"sin\":\n case \"cos\":\n case \"tan\":\n case \"atan\":\n case \"log10\":\n case \"log2\":\n case \"sqrt\":\n tmp.put(\"arg1\", input.replace(op, \"\"));\n tmp.put(\"arg2\", null);\n break;\n }\n } else {\n tmp.put(\"operator\", input.replaceFirst(\"!\", \"-\"));\n tmp.put(\"arg1\", null);\n tmp.put(\"arg2\", null);\n }\n return tmp;\n }",
"@VisibleForTesting\n NodeKey getNodeKey() {\n return nodeKey;\n }",
"public String get(final Book key) {\n Node x = root;\n while (x != null) {\n int cmp = key.getName().compareTo(x.getKey().getName());\n if (cmp < 0) {\n x = x.getLeft();\n }\n if (cmp > 0) {\n x = x.getRight();\n }\n if (cmp == 0) {\n return x.getValue();\n }\n }\n return null;\n }",
"public interface KeySegmentConverter<K> {\n // Return key segment object based on node object\n // Key segment equality is used to identify the source node object\n // The .toString() of the key segment object will be used to write DOM node IDs.\n public Object getSegment(K node);\n // Used to create complete NodeKey with segment objects parsed from their .toString()\n // representations.\n public NodeKey parseSegments(String[] segments);\n}",
"public String serialize(TreeNode root) {\n StringBuilder sb = new StringBuilder();\n if (root==null) return \"#\";\n sb.append(String.valueOf(root.val));\n String left = serialize(root.left);\n String right = serialize(root.right);\n sb.append(\",\").append(left).append(\",\").append(right);\n return sb.toString();\n }",
"private String toString(String pre) {\n StringBuilder sb = new StringBuilder();\n\n sb.append(key);\n if (values1 != null) {\n sb.append(\" \");\n sb.append(values1);\n sb.append(\", \");\n sb.append(values2);\n }\n sb.append(\"\\n\");\n\n String newpre = pre + \" \";\n if (!son.empty) {\n sb.append(newpre);\n sb.append(\"son: \");\n sb.append(son.toString(newpre));\n }\n if (!left.empty) {\n sb.append(newpre);\n sb.append(\"left: \");\n sb.append(left.toString(newpre));\n }\n if (!right.empty) {\n sb.append(newpre);\n sb.append(\"right: \");\n sb.append(right.toString(newpre));\n }\n return sb.toString();\n }",
"public String toString(org.w3c.dom.Node n){\n int nodeHandle=getDTMHandleFromNode(n);\n DTM dtm=getDTM(nodeHandle);\n XMLString strVal=dtm.getStringValue(nodeHandle);\n return strVal.toString();\n }",
"public String getKey() {\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tif (getLineNo() != null) {\r\n\t\t\tbuilder.append(getLineNo());\r\n\t\t} else if (this.getEntityId() != null) {\r\n\t\t\tbuilder.append(getEntityId());\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}",
"public String serialize(TreeNode root) {\n if(root == null)\n return \"N\";\n else\n return root.val + \" \"+ serialize(root.left) + \" \"+ serialize(root.right);\n \n }",
"private Element getElementByKeyRef(Node node) {\n\t\tElement ref ;\n\t\t\t\n\t\tString refType = getDocumentXpath(node);\n\t\tSystem.out.println(\"search ref for : \"+refType);\n\t\t/* get ref attribute */\n\t\tString refId = node.getTextContent();\n\t\tif (refId == null || refId.equals(\"\")){ \n\t\t\tfor (int i = 0; i< node.getAttributes().getLength(); i++) {\n//\t\t\t\tSystem.out.println(node.getAttributes().item(i).getNodeName()+\" :: \"+node.getAttributes().item(i).getTextContent());\n\t\t\t\tif (node.getAttributes().item(i).getNodeName().equals(refAttribute)){\n\t\t\t\t\t\trefId = node.getAttributes().item(i).getNodeValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tString referedType = (String) refType2referedType.get(refType)\t;\t\n\t\t\n\t\tref = (Element) xsKeyNodes.get(referedType+\"#\"+refId);\t\t\n\t\treturn ref;\n\t}",
"public Value valueOf(Key key) \n {\n Node n = root;\n while (n != null) \n {\n int cmp = key.compareTo(n.key);\n \n if (cmp < 0) \n n = n.left;\n else if (cmp > 0) \n n = n.right;\n else \n return n.val;\n }\n return null; \n \n }",
"public String toString(){\n return \"Node: \" + data;\n }",
"Object get(Node node);",
"@AutoEscape\n\tpublic String getNode_2();"
] | [
"0.69844526",
"0.694273",
"0.6655487",
"0.6481375",
"0.6398487",
"0.6375746",
"0.6371899",
"0.6347924",
"0.6333329",
"0.6328259",
"0.6308937",
"0.63047487",
"0.63031584",
"0.62972105",
"0.6292303",
"0.6284161",
"0.6270612",
"0.62664115",
"0.6253211",
"0.61837333",
"0.6180526",
"0.61681",
"0.6162753",
"0.6100146",
"0.6046204",
"0.604546",
"0.6037323",
"0.6019781",
"0.59982485",
"0.589538",
"0.58870465",
"0.58375746",
"0.58370036",
"0.58357733",
"0.5818463",
"0.57895666",
"0.5785894",
"0.57731676",
"0.5764723",
"0.5758808",
"0.57433194",
"0.5713047",
"0.57071644",
"0.5680616",
"0.56638956",
"0.5640348",
"0.5621452",
"0.5610913",
"0.55747277",
"0.555019",
"0.55433625",
"0.5537242",
"0.5537242",
"0.5537242",
"0.5537242",
"0.5537242",
"0.5537242",
"0.55033666",
"0.5498492",
"0.5496594",
"0.54942364",
"0.5494178",
"0.5490372",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.54872113",
"0.5467898",
"0.54598916",
"0.54539376",
"0.54424703",
"0.5435948",
"0.54315835",
"0.54313076",
"0.54313076",
"0.54313076",
"0.54313076",
"0.5429672",
"0.54270697",
"0.5425664",
"0.5419651",
"0.5400269",
"0.53959286",
"0.5395365",
"0.53893733",
"0.53827816",
"0.5379496",
"0.53723633",
"0.53662175",
"0.5365856",
"0.5357038"
] | 0.5876816 | 31 |
checks if the tree is empty | public boolean isEmpty() {
return mSentinel == mRoot;// if the root is equal to the sentinel(empty
// node) then the tree is empty otherwise it
// is not
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isEmpty() \n\t{\n\t\treturn root == null;//if root is null, tree is empty\n\t}",
"public boolean empty() {\r\n\t\t return(this.root == null);\r\n\t }",
"private boolean isEmpty()\r\n\t{\r\n\t\treturn getRoot() == null;\r\n\t}",
"public boolean empty() {\n\t\treturn (this.root == null); // to be replaced by student code\n\t}",
"public boolean isEmpty()\r\n {\r\n return root == null;\r\n }",
"@Override\n public boolean isEmpty() {\n return root == null;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\tmodCount = root.numChildren();\n\t\treturn (modCount == 0);\n\t}",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn (this.root == null);\r\n\t}",
"public boolean empty( ) {\n return (root == null);\n }",
"public boolean isEmpty(){\n return this.root == null;\n }",
"@Override\n public boolean isEmpty() {\n return (that.rootNode == null);\n }",
"public boolean isEmpty()\r\n {\r\n return root == null;\r\n }",
"boolean isEmpty(){\r\n\t\t\r\n\t\treturn root == null;\r\n\t}",
"public boolean isEmpty( )\r\n\t{\r\n\t\treturn root == null;\r\n\t}",
"public boolean isEmpty()\n {\n return root == null;\n }",
"public boolean isEmpty()\n {\n return root == null;\n }",
"public boolean isEmpty()\n {\n return root == nil;\n }",
"public boolean isEmpty()\n {\n return root == nil;\n }",
"public boolean empty() {\n if(root==EXT_NODE) {\r\n \treturn true;\r\n }\r\n return false;\r\n }",
"@Override\r\n public boolean isEmpty(){\r\n // Set boolean condition to false\r\n boolean isEmpty = false;\r\n // If the root is null, the tree is empty\r\n if(root == null){\r\n //Set condition to true\r\n isEmpty = true;\r\n }\r\n // Return the condition\r\n return isEmpty;\r\n }",
"public boolean isEmpty() {\r\n\t\treturn root == null;\r\n\t}",
"public boolean isEmpty() {\r\n\t\treturn root == null;\r\n\t}",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty() {\n return root == null;\n }",
"public boolean isEmpty(){\n return (root == null);\n }",
"public boolean isEmpty() {\n // if the root has nothing then there can be no tree. so True\n if (root == null) {\n return true;\n } else {\n return false;\n }\n }",
"boolean isEmpty(){\n return root == null;\n }",
"public boolean isEmpty() {\n\t\treturn root == null;\n\t}",
"public boolean isEmpty() { \n return (bst.size() == 0);\n }",
"public boolean isEmpty() {\r\n \r\n // return a boolean, true if empty\r\n return root == null;\r\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\tif (root == null) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean isEmpty() {\n\t\treturn BST.isEmpty();\n\t\t}",
"public boolean isEmpty() {\n\t\treturn treeMap.isEmpty();\n\t}",
"@Override\n \t\tpublic boolean isEmpty() {\n \t\t\treturn (state != null && state.getChildrenCount(currentPage) == 0);\n \t\t}",
"public boolean checkEmpty() \n { \n return header.rightChild == nullNode; \n }",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn getNumberOfNodes() == 0;\r\n\t}",
"@Override\n public boolean isEmpty() {\n return this.numNodes == 0;\n }",
"public void testIsEmpty() {\r\n assertTrue(tree.isEmpty());\r\n tree.insert(\"apple\");\r\n assertFalse(tree.isEmpty());\r\n }",
"public boolean empty() {\n if(root.next==null)\n return true;\n return false;\n }",
"public boolean isNotEmpty(){\n return root != null;\n }",
"public boolean isEmpty() {\r\n\t\t\r\n\t\treturn topNode == null; // Checks if topNode is null;\r\n\t\t\r\n\t}",
"public boolean isEmpty()\n {\n return(nodes.isEmpty());\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\tif(nodeCount == 0) return true;\n\t\telse return false;\n\t}",
"public boolean isEmpty(){\n return firstNode == null;\n }",
"public boolean isEmpty(){\n return firstNode == null;\n }",
"public boolean isEmpty()\n {\n return (numNodes == 0);\n }",
"private boolean isTreeFull() {\n // The number of leaf nodes required to store the whole vector\n // (each leaf node stores 32 elements).\n int requiredLeafNodes = (totalSize >>> 5);\n\n // The maximum number of leaf nodes we can have in a tree of this\n // depth (each interior node stores 32 children).\n int maxLeafNodes = (1 << treeDepth);\n\n return (requiredLeafNodes > maxLeafNodes);\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn firstNode.equals(null);\n\t}",
"public boolean empty() \n { \n\treturn(top==-1);\n \n }",
"@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn top==null;\r\n\t}",
"public boolean isEmpty() {\n return firstNode == null;\n }",
"public boolean isEmpty() {\n\t\treturn firstNode == null;\n\t}",
"boolean isEmpty() {\n\t\treturn m_list_nodes.size() == 0;\n\t}",
"public Boolean isEmpty() {\n\t\tBoolean empty=true;\n\t\tif(nodes.isEmpty()==false) {\n\t\t\tempty=false;\n\t\t}\n\t\treturn empty;\n\t}",
"public boolean isEmpty() {\r\n return (top == null);\r\n }",
"public boolean isEmpty() {\n return top==-1;\n }",
"public boolean isEmpty(){\n return (top == 0);\n }",
"public boolean isEmpty()\r\n {\n return this.top == null;\r\n }",
"public boolean isEmpty(){\n \treturn top==-1;\n\t}",
"public boolean empty() {\n return left.isEmpty()&&right.isEmpty();\n }",
"public boolean isEmpty() {\n return this.top == null;\n }",
"public boolean empty(){\n return this.top == -1;\n }",
"public boolean isEmpty()\r\n\t{\r\n\t\treturn top<=0;\r\n\t}",
"public boolean isEmpty() {\n\n return (top == null);\n }",
"public boolean empty() { \n if (top == -1) {\n return true;\n }\n else {\n return false;\n }\n }",
"boolean isEmpty() {\r\n\t\treturn top==0;\r\n\t}",
"public boolean isEmpty()\n\t{\n\t\treturn top == null;\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn bst.isEmpty();\n\t}",
"public boolean isEmpty() {\n return top == null;\n }",
"public boolean isEmpty() {\n return top == null;\n }",
"public boolean isEmpty(){\n if(top == null)return true;\n return false;\n }",
"public boolean isEmpty() {\n return (this.top == 0);\n }",
"public boolean isEmpty() {\n\t\treturn (top == null) ? true : false;\n\t}",
"public boolean isEmpty() {\n\t\t\n\t\treturn top == null;\n\t}",
"boolean isEmpty() {\n // -\n if(top == null)\n return true;\n return false;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn top < 0;\n\t}",
"public boolean isEmpty() {\n if(this.top== -1) {\n return true;\n }\n return false;\n }",
"public boolean isEmpty()\n{\n // If any attributes are not default return false\n if(getMaxTime()!=5 || getFrameRate()!=25 || !SnapUtils.equals(getEndAction(),\"Loop\"))\n return false;\n \n // Iterate over owner children and if any are not empty, return false\n for(int i=0, iMax=getOwner().getChildCount(); i<iMax; i++)\n if(!isEmpty(getOwner().getChild(i)))\n return false;\n \n // Return true since every child was empty\n return true;\n}",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn topIndex < 0;\r\n\t}",
"private boolean findEmptyGroup(){\r\n boolean isEmpty = true;\r\n TreeNode root = (TreeNode)sponsorHierarchyTree.getModel().getRoot();\r\n TreePath result = findEmptyGroup(sponsorHierarchyTree, new TreePath(root));\r\n if( result != null && result.getLastPathComponent() instanceof Integer ){\r\n CoeusOptionPane.showInfoDialog(\r\n coeusMessageResources.parseMessageKey(\"sponsorHierarchyList_exceptionCode.1204\"));\r\n isEmpty = false;\r\n }\r\n return isEmpty;\r\n }",
"public boolean isEmpty(){\n\t\treturn firstNode == null; //return true if List is empty\n\t}",
"boolean treeFinished(treeNode root){\n\t\treturn (root.parent == null && root.lc == null && root.rc == null);\n\t}",
"public boolean isEmpty() {\n return downStack.isEmpty();\n }",
"public boolean isEmpty() {\n \treturn stack.size() == 0;\n }",
"public boolean is_empty() \n\t{\n\t\tif (this.nb_disk == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn stack.isEmpty();\r\n\t}",
"public boolean hasChildren()\n/* */ {\n/* 487 */ return !this.children.isEmpty();\n/* */ }",
"public boolean isEmpty(){\n return myHeap.getLength() == 0;\n }",
"public boolean isEmpty()\n {\n return graph.isEmpty();\n }",
"public void checkTree() {\r\n checkTreeFromNode(treeRoot);\r\n }",
"@Test\n public void whenTreeIsBlankThanHasNextIsFalse() {\n assertThat(this.tree.iterator().hasNext(), is(false));\n }",
"@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}",
"@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}",
"@Test\n public void allowedEmptyLeaf() throws Exception {\n Query query = Query.parse(\"/allow-empty-leaf\");\n doAllowedEmptyTest(query);\n }",
"public boolean empty() {\r\n return stack.isEmpty();\r\n }"
] | [
"0.8395433",
"0.8381555",
"0.8307231",
"0.82619244",
"0.82015055",
"0.81967",
"0.8134039",
"0.8128115",
"0.8118073",
"0.8101598",
"0.8078683",
"0.8040988",
"0.8029515",
"0.7998356",
"0.79943424",
"0.79943424",
"0.79618496",
"0.79618496",
"0.79553217",
"0.79433376",
"0.79282755",
"0.79282755",
"0.79170114",
"0.79170114",
"0.79170114",
"0.79170114",
"0.79170114",
"0.79170114",
"0.7916377",
"0.79059047",
"0.7898541",
"0.7891194",
"0.7842537",
"0.7823974",
"0.7821023",
"0.78149545",
"0.7802525",
"0.7797949",
"0.76819587",
"0.76814795",
"0.76804",
"0.7672245",
"0.76667595",
"0.7657208",
"0.76542395",
"0.7572695",
"0.7562961",
"0.75054866",
"0.75054866",
"0.7491782",
"0.7474274",
"0.74491173",
"0.74021864",
"0.7369951",
"0.7362129",
"0.7325492",
"0.7312308",
"0.730562",
"0.7291016",
"0.7272499",
"0.72670263",
"0.7264193",
"0.72628754",
"0.72609943",
"0.72555447",
"0.7238604",
"0.72334486",
"0.72232795",
"0.72207177",
"0.71997523",
"0.7185266",
"0.7180409",
"0.7171171",
"0.7171171",
"0.7148992",
"0.71482545",
"0.71377295",
"0.7122431",
"0.71084166",
"0.70934665",
"0.7087343",
"0.70578724",
"0.70358366",
"0.7034411",
"0.70311546",
"0.69781584",
"0.697231",
"0.6972159",
"0.6960641",
"0.69554126",
"0.6954847",
"0.6952509",
"0.6941848",
"0.69372207",
"0.6932895",
"0.6919182",
"0.6917483",
"0.6917483",
"0.6911663",
"0.69068533"
] | 0.7768542 | 38 |
inserts a new node | public Node insertNode(K key, V value) {
Node newNode = new Node(key, value);// first we need to create the new
// node
Node currentNode = this.getRoot();// then we move to the root ot the
// tree that has called the method
Node currentNodeParent = mSentinel;// the parent of the root is of
// course sentinel
while (currentNode != mSentinel) {// and while the current node(starting
// from the root) is not a sentinel
currentNodeParent = currentNode;// then remember this node as a
// parent
if (key.compareTo(currentNode.getKey()) < 0) {// and appropriate its
currentNode = currentNode.getLeftChild();// left
} else {// or
currentNode = currentNode.getrightChild();// right child as the
// next current node
}
}
// we iterate through the described loop in order to get to the
// appropriate place(in respect to the given key) where the new node
// should be put
newNode.setParent(currentNodeParent);// we make the new node's parent
// the last non empty node that
// we've reached
if (currentNodeParent == mSentinel) {
mRoot = newNode;// if there is no such node then the tree is empty
// and our node is actually going to be the root
} else {
if (key.compareTo(currentNodeParent.getKey()) < 0) {// otherwise we
// put our new
// node
currentNodeParent.setLeftChild(newNode);// as a left
} else { // or
currentNodeParent.setrightChild(newNode);// right child of the
// last node we've
// reached
}
}
return newNode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void insert(Node n);",
"public void insertnode ()\n\t// insert an empty node\n\t{\n\t\tif (Pos.haschildren() && !GF.askInsert()) return;\n\t\tNode n = new Node(Pos.node().number());\n\t\tPos.insertchild(new TreeNode(n));\n\t\tn.main(Pos);\n\t\tgetinformation();\n\t\tPos = Pos.lastChild();\n\t\tsetlast();\n\t\tshowinformation();\n\t\tcopy();\n\t}",
"public void insert(HuffmanTree node);",
"@Override\n\tpublic void insert(Node node) {\n\t\tchildren.add(node);\n\t}",
"private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}",
"public void insertNode(String node) {\n Nodo newNode = new Nodo(node);\n newNode.next = lastIn;\n lastIn = newNode;\n size++;\n }",
"public Node appendNode(Node node);",
"public void insertNode(Item it) {\n this.currentPosition = new Node(this.currentPosition, it, this.currentPosition.next);\n }",
"public void insert(T info){\n NodeList<T> n = new NodeList<>();\n n.setInfo(info);\n n.setNext(first);\n this.first = n;\n }",
"void addNode(String node);",
"public void insert(SplayNode n) {\n\t\t\t SplayNode y = null;\n\t\t\t SplayNode temp = this.root;\n\t\t while(temp != null) {\n\t\t y = temp;\n\t\t if(n.data < temp.data)\n\t\t temp = temp.left;\n\t\t else\n\t\t temp = temp.right;\n\t\t }\n\t\t n.parent = y;\n\n\t\t if(y == null) //newly added node is root\n\t\t this.root = n;\n\t\t else if(n.data < y.data)\n\t\t y.left = n;\n\t\t else\n\t\t y.right = n;\n\n\t\t this.splay(n);\n\t\t }",
"public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}",
"public Node insertBefore(Node node);",
"private void insert(Node node) {\n//\t\t//A*\n\t\topen.add(node);\n\t\tCollections.sort(open);\n//\t\t\n//\t\t//dfs\n//\t\topen.add(0, node);\n\t\t\n\t\t//bfs\n//\t\topen.add(node);\n\t}",
"public void insertNode(int d){\n if(root == null){\n root = new TreeNode(d);\n }\n else{\n root.insert(d);\n }\n }",
"private void addNode(String name)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MERGE (a:Node {value: {x}})\", parameters(\"x\", name));\n tx.success(); // Mark this write as successful.\n }\n }\n }",
"public void insert(int nodeId, int priority) {\n // FILL IN CODE\n\n }",
"public void insert(Point2D p) {\n if (this.n ==0) {\n this.root = new Node(p, true, new RectHV(0,0,1,1));\n this.n++;\n } else {\n if (insert1(root, p)) this.n++;\n }\n }",
"public void insertNode(T insertValue){\n if(root == null)\n root = new TreeNode<T>(insertValue);\n else\n root.insert(insertValue);\n }",
"public void insertNode(int data){\r\n\t\troot = insert(data, root);\r\n\t}",
"protected int insert(int toAdd){\n\n tnode object = new tnode();\n\n return object.insert(toAdd);\n\n }",
"private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }",
"public void insert(int key){\n\t\tif(this.root == null){\n\t\t\tNode r = new Node(key);\n\t\t\tthis.root = r;\t\n\t\t}else{\n\t\t\t//if not recursively insert the node\n\t\t\trecInsert(this.root, key);\n\t\t}\n\t\treturn;\n\t}",
"public void insert(int info) {\n\t\tnode one = new node(info);\n\t\tif(head != null) {\n\t\t\tone.next = head;\n\t\t} \n\t\thead = one;\n\n\t\t//OR\n\t\t//insertAt(info, 0);\n\t}",
"public Node insertAfter(Node node);",
"void addNode(Node n) {\n nodes.put(n.id, n);\n }",
"@Override\n public void insert(K key) {\n try {\n this.rootNode = insertNode(this.rootNode, key);\n } catch (DuplicateKeyException e) {\n System.out.println(e.getMessage());\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }",
"@Override\n\tpublic void insert() {\n\t\t\n\t}",
"public void insert(Node newNode)\r\n {\n newNode.prev = prev;\r\n prev.next = newNode;\r\n prev = newNode;\r\n System.out.println(\"Node with Traffic Data \" + Arrays.toString(newNode.trafficEntry.toStringArray()) + \" Inserted before Node with Traffic Data \" + Arrays.toString(trafficEntry.toStringArray()));\r\n }",
"@Test\n\tpublic void addNodeBeforeGiveNode() {\n\t\tSystem.out.println(\"Given a node as prev_node, insert a new node Before the given node \");\n\t\tdll.push(4);\n\t\tdll.push(3);\n\t\tdll.push(1);\n\t\tdll.InsertBefore(dll.head.next, 2);\n\t\tdll.print();\n\t}",
"public Node<T> insert(T data){\n Node<T> newnode=new Node<T>(data);\n newnode.next=null;\n if(head==null){\n head=newnode;\n }\n else{\n Node temp=head;\n while(temp.next!=null) {\n temp = temp.next;\n }\n temp.next=newnode;\n }\n return head;\n }",
"public void insertTest(T info){\n NodeList<T> n = new NodeList<>();\n n.setInfo(info);\n n.setNext(first);\n this.first = n;\n }",
"String addNewNode(Double lat, Double lon);",
"public void insertNode(T d) {\n /* Functions to insert data */\n TreeNode newNode = new TreeNode(d);\n nodesToInsertAt.add(newNode);\n size++;\n if(root == null){\n root = newNode;\n return;\n }\n TreeNode current; \n current = nodesToInsertAt.get(0);\n if(current.left == null){\n current.left = newNode;\n return;\n }\n if(current.right == null){\n current.right = newNode;\n nodesToInsertAt.remove(0);\n }\n }",
"private BTNode<T> insert(T data, BTNode<T> node){\n\t\t// if the node does not exist, create it\n\t\tinsertCount++;\n\t\tif(node == null) return new BTNode<T>(data, null, null);\n\n\t\t//left placement\n\t\tinsertCount++;\n\t\tif(data.compareTo(node.getData()) <= 0) node.setLeft(insert(data, node.getLeft()));\n\n\t\telse node.setRight(insert(data, node.getRight()));\n\n\t\t//balance the tree after insertion\n\t\treturn balance(node);\n\t}",
"public void insert(int value){\n head = new Node(value,head);\n size++;\n }",
"protected void addingNode( SearchNode n ) { }",
"private BTNode insert(BTNode node, T data)\r\n {\r\n if (node == null)\r\n node = new BTNode(data);\r\n else\r\n {\r\n if (node.getLeft() == null)\r\n node.left = insert(node.left, data);\r\n else\r\n node.right = insert(node.right, data); \r\n }\r\n return node;\r\n }",
"void addNode(int node);",
"public void insert()\n\t{\n\t}",
"public void insert(TKey key, TValue data) {\n Node n = new Node(key, data, true); // nodes start red\n // normal BST insert; n will be placed into its initial position.\n // returns false if an existing node was updated (no rebalancing needed)\n boolean insertedNew = bstInsert(n, mRoot); \n if (!insertedNew) return;\n // check cases 1-5 for balance violations.\n checkBalance(n);\n }",
"public void insert(T data)\r\n {\r\n root = insert(root, data);\r\n }",
"public Node insert(int key, Node node) {\n\n\t\tif (node == null)\n\t\t\treturn getNewNode(key);\n\t\telse\n\t\t\tnode.next = insert(key, node.next);\n\n\t\treturn node;\n\t}",
"boolean addNode(N node);",
"public Node insert(Key key, Value value) { \r\n // inserting into an empty tree results in a single value leaf node\r\n return new LeafNode(key,value);\r\n }",
"public void insertNode(int val)\r\n {\r\n temp=new TriLinkNode();\r\n temp.v1=val;\r\n temp.d1=false;\r\n temp.i1=true;\r\n if(root==null)\r\n {\r\n root=temp;\r\n }else\r\n {\r\n recInsertNode(root);\r\n }\r\n \r\n }",
"public void insert(T key) {\r\n RBNode<T> node = new RBNode<>(key, RED, null, null, null);\r\n if(node != null)\r\n insert(node);\r\n }",
"public void insert(T data){\n\t\troot = insert(data, root);\n\t}",
"public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }",
"public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }",
"public void insert(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null){\n\t\t\tif (currentNode.getKey() == key){\n\t\t\t\tSystem.out.println(\"This value already exists in the tree!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\t// once we reached the bottom of the tree, we insert the new node.\n\t\t// to do that we need to know the leaf node which is stored in the BSTNode parent\n\t\t// by comparing with its value, we know which side to insert the new node.\n\t\tif (key < parent.getKey()){\n\t\t\tparent.setLeft(new BSTNode(key, null, null));\n\t\t}else{\n\t\t\tparent.setRight(new BSTNode(key, null, null));\n\t\t}\n\t\tsize++;\n\t}",
"public void insertNode(Node newNode) {\r\n\t\thFlag = 0;\r\n\t\tif( newNode == null ) {\r\n\t\t\tthrow new NullPointerException(\"Inserted node is null\");\r\n\t\t}\r\n\t\t//if tree is empty, make this node the root\r\n\t\tif( size == 0 ) {\r\n\t\t\troot = newNode;\r\n\t\t\tnewNode.parent = nilNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 1;\r\n\t\t\theight = 1;\r\n\t\t} else {\r\n\t\t\t//otherwise, start at root and climb down tree until a spot is found\r\n\t\t\tNode y = nilNode;\r\n\t\t\tNode x = root;\r\n\t\t\tint count = 1;\r\n\r\n\t\t\twhile(x != nilNode) {\r\n\t\t\t\ty = x;\r\n\t\t\t\tif(newNode.key < x.key || (newNode.key == x.key && newNode.p == 1) )\r\n\t\t\t\t\tx = x.left;\r\n\t\t\t\telse\r\n\t\t\t\t\tx = x.right;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tif(height < count) {\r\n\t\t\t\theight = count;\r\n\t\t\t\thFlag = 1;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tnewNode.parent = y;\r\n\t\t\tif(newNode.key < y.key || (newNode.key == y.key && newNode.p == 1) )\r\n\t\t\t\ty.left = newNode;\r\n\t\t\telse\r\n\t\t\t\ty.right = newNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 0;\r\n\r\n\t\t\t//fix up tree\r\n\t\t\tRBFixup(newNode);\r\n\t\t\t\r\n\t\t\t//Time to update the vaules in each node in O(h) time\r\n\t\t\t//after the fix up, newNode may have children who need to be updated,so\r\n\t\t\t//if newNode has nonNil children, start updating from either child\r\n\t\t\tif( !newNode.right.isNil || !newNode.left.isNil ) {\r\n\t\t\t\t//start from newNode's left child (right would work too)\r\n\t\t\t\trecUpdateNode(newNode.left);\r\n\t\t\t} else {\r\n\t\t\t\t//start from newNode\r\n\t\t\t\trecUpdateNode(newNode);\r\n\t\t\t}\n\t\t}\r\n\t\tsize++;\r\n\t}",
"public void insert(Point2D p2d) {\n if (size == 0) {\n root = new Node();\n root.p2d = p2d;\n root.rect = new RectHV(0.0, 0.0, 1.0, 1.0);\n size++;\n }\n insert(root, p2d, true);\n }",
"private Node _insert(Node node, T value) {\n if (node == null) {\n node = new Node(null, null, value);\n }\n /**\n * If the value is less than the current node's value, choose left.\n */\n else if (value.compareTo(node.element) < 0) {\n node.left = _insert(node.left, value);\n }\n /**\n * If the value is greater than the current node's value, choose right.\n */\n else if (value.compareTo(node.element) > 0) {\n node.right = _insert(node.right, value);\n }\n /** \n * A new node is created, or\n * a node with this value already exists in the tree.\n * return this node\n * */\n return node;\n\n }",
"public abstract void addChild(Node node);",
"public void add(Node<T> n){\n\t\tconnect.add(n);\n\t}",
"public void insert(int data){\n Node node = new Node();\n node.data=data;\n node.next=null;\n if(head==null){\n head = node;\n }\n else{\n Node n = head;\n while (n.next != null){\n\n\n n = n.next;\n }\n n.next=node;\n }\n}",
"public void insert(int index, char data)\n {\n if(index >= 0 && index <= numNodes){\n if(index == 0)\n {\n Node node = new Node(data);\n node.next = head;\n head = node;\n }\n else\n {\n //find your previous and your current\n Node curr = find(index);\n Node prev = find(index - 1);\n \n //add the new node with current as the successor and previous as the \n //predecessor\n Node node = new Node(data, curr);\n prev.next = node;\n }\n numNodes++;\n }\n else\n {\n throw new IndexOutOfBoundsException();\n }\n }",
"Node insertBefore(Node newChild, Node refChild);",
"@Override\n\tpublic void putNode(N node) {\n\t\t\n\t}",
"public void insert(Point2D p) { // add the point to the set (if it is not already in the set)\n // \"write a simplified version of insert() which does everything except set up the RectHV for each node\"\n if (p == null) throw new IllegalArgumentException();\n\n\n if (root == null) {\n Node node = new Node();\n node.p = p;\n node.horizontal = false;\n node.rect = new RectHV(0.0, 0.0, 1.0, 1.0);\n root = node;\n size = 1;\n return;\n }\n\n if (!contains(p)) {\n size++;\n insertNextFreeSubTree(p, root);\n }\n\n }",
"public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}",
"@Test\n\tpublic void addNodeAfterGiveNode() {\n\t\tSystem.out.println(\"Given a node as prev_node, insert a new node after the given node \");\n\t\tdll.push(4);\n\t\tdll.push(2);\n\t\tdll.push(1);\n\t\tdll.InsertAfter(dll.head.next, 3);\n\t\tdll.print();\n\t}",
"private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }",
"public void insert(Entity entity){\n\n //Find the correct node for that object\n int index = this.getIndex(entity);\n if(index != -1){\n // Recursively insert\n this.getNodes().get(index).insert(entity);\n }\n\n //There is no subnode fit for this lets add it to the current node\n this.entities.add(entity);\n\n\n //Now that we have a new node, is the node ok with it?\n if(this.entities.size()> MAX_OBJECTS && this.level < MAX_LEVELS){\n // Nah... We need to split!\n this.split();\n\n // Let's reinsert all the objets in the current node into the right place\n int i = 0;\n while (i < this.entities.size()){\n Entity gObj = this.entities.get(i);\n index = this.getIndex(gObj);\n if(index != -1){\n //WE need to reinsert it in the correct place\n this.entities.remove(gObj);\n this.nodes.get(index).insert(gObj);\n }else{\n i += 1; //To the next gameObject\n }\n }\n }\n }",
"public void insert(K k, E e) \n\t{\n\t\troot = inserthelp(root, k, e);\n\t\tnodecount++;\n\t}",
"private Node insert(Order ord2) {\n\t\treturn null;\n\t}",
"public void insert(T value) {\n\n // Assigns the new node as the root if root is empty.\n if (root == null) root = new Node<>(value);\n\n // Otherwise, traverses the tree until an appropriate empty branch is found.\n else insertRecursively(root, value);\n }",
"public void insert(Key key, Value value){\n this.root = this.insertHelper(key, value, root);\n }",
"private void insertFirst(T data){\n Node<T> node = new Node<T>(data);\n this.begin = node;\n this.end = node;\n }",
"public void insert(String key, String value) throws KeyCollisionException{\n if( lookup(key) != null){\n throw new KeyCollisionException(\"cannot insert dublicate key\");\n }\n else{\n if( front == null){\n Node N = new Node(key,value);\n front = N;\n numItems++;\n }\n else{\n Node N = front;\n while( N != null){\n if(N.next == null){\n break;\n }\n N = N.next;\n }\n N.next = new Node(key,value);\n numItems++;\n }\n }\n }",
"public TrieNode insert(Character key) {\n if (children.containsKey(key)) {\n return null;\n }\n\n TrieNode next = new TrieNode();\n next.key = key;\n children.put(key, next);\n\n return next;\n }",
"@Override\r\n public void insert(K key, V value) {\r\n // call insert of the root\r\n root.insert(key, value);\r\n }",
"public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}",
"void append(SNode node);",
"public void insertAt(int index,int data){\n Node node =new Node();\n node.data=data;\n node.next=null;\n\n if (index == 0) {\n insertAtStart(data);\n }\n\n\nelse{\n Node n = head;\n for (int i=0; i < index-1;i++){\n n =n.next;\n }\n node.next =n.next;\n n.next = node;\n\n}}",
"public void insert(String word) {\n char[] chars = word.toCharArray();\n Node theNode = root;\n for (char c : chars) {\n if (!theNode.leaf) theNode.leaf = false;\n if (theNode.children.containsKey(c)) {\n theNode = theNode.children.get(c);\n } else {\n Node newNode = new Node(c);\n theNode.children.put(c, newNode);\n theNode = newNode;\n }\n }\n theNode.leaf = true;\n }",
"public void insert(int key)\n {\n root = insertRec(root,key);\n }",
"TreeNode addChild(TreeNode node);",
"public void addNode(Node node){subNodes.add(node);}",
"public void insert(int key)\n\t{\n\t\tTreeHeapNode newNode = new TreeHeapNode();\n\t\tnewNode.setKey(key);\n\t\tif(numNodes == 0) root = newNode;\n\t\telse\n\t\t{\n\t\t\t//find place to put newNode\n\t\t\tTreeHeapNode current = root;\n\t\t\tint n = numNodes+1;\n\t\t\tint k;\n\t\t\tint[] path = new int[n];\n\t\t\tint j = 0;\n\t\t\twhile(n >= 1)\n\t\t\t{\n\t\t\t\tpath[j] = n % 2;\n\t\t\t\tn /= 2;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t//find parent of new child\n\t\t\tfor(k = j-2; k > 0; k--)\n\t\t\t{\n\t\t\t\tif(path[k] == 1)\n\t\t\t\t\tcurrent = current.rightChild;\n\t\t\t\telse\n\t\t\t\t\tcurrent = current.leftChild;\n\t\t\t}\n\t\t\t//find which child new node should go into\n\t\t\t\n\t\t\tif(current.leftChild != null)\n\t\t\t{\n\t\t\t\tcurrent.rightChild = newNode;\n\t\t\t\tnewNode.isLeftChild = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcurrent.leftChild = newNode;\n\t\t\t\tnewNode.isLeftChild = true;\n\t\t\t}\n\t\t\tnewNode.parent = current;\n\t\t\t\n\t\t\ttrickleUp(newNode);\n\t\t}\n\t\tnumNodes++;\n\t}",
"protected Node<T> insert(Node<T> node, Comparable<T> item)\r\n {\r\n // if current root has not been previously instantiated\r\n // instantiate a new Node with item added as the data\r\n if (node == null) {\r\n return new Node<T>(item); // when your node is null, insert at leaf\r\n }\r\n if (item.compareTo((T) node.data) < 0) {\r\n node.left = insert(node.left,item);\r\n }\r\n else {\r\n node.right = insert(node.right,item);\r\n }\r\n return node; // re-link the nodes\r\n }",
"private void insert(Node<E> x) {\n\t\tlast = last.next = x;\n\t}",
"void addNode()\n {\n Node newNode = new Node(this.numNodes);\n this.nodeList.add(newNode);\n this.numNodes = this.numNodes + 1;\n }",
"public void insert(String word) {\r\n tree.add(word);\r\n }",
"public void insert(double x, double y){\n root = insert(root, new Node(x, y), X_AXIS);\n\t\t}",
"boolean addNode(long idNum, String label);",
"public void insert(int data) { \n\t\troot = insert(root, data);\t\n\t}",
"@Override\n public void insertAtAnyPosition(T value, int index) {\n Node<T> new_node = new Node<>(value);\n if(index < 0)\n throw new IndexOutOfBoundsException();\n else if(index == 0){\n new_node.next = start;\n start = new_node;\n }else{\n Node<T> previous = start;\n for(int i =0;i<index-1;i++)\n {\n previous = previous.next;\n }\n Node<T> curr = previous.next;\n new_node.next = curr;\n previous.next = new_node;\n }\n\n }",
"private void addNode(Node node)\n\t{\n\t\tif (node == null)\n\t\t\treturn;\n\t\tthis.nodes[node.getRowIndex()][node.getColumnIndex()] = node;\n\t}",
"private Node insert(Node curr, Node node) {\n\t\tif(curr==null){\n\t\t\tcurr = node;\n\t\t\treturn curr;\n\t\t}\n\t\telse if(curr.getId() > node.getId()){\n\t\t\t curr.setLeft(insert(curr.getLeft(),node));\n\t\t}\n\t\telse if(curr.getId() < node.getId()){\n\t\t\t curr.setRight(insert(curr.getRight(),node));\n\t\t}\n\t\treturn curr;\n\t}",
"public void insert(int key) {\n\t\tprivateInsert(key, root, null, new Ref<Integer>(1));\n\t}",
"private void insert(Node current, Node newNode)\r\n\t{\r\n\t\t// Prevent the same name from being inserted as a new Node by doing nothing\r\n\t\tif(newNode.getName().equalsIgnoreCase(current.getName()))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// The name is lexicographically less than the current Node's name\r\n\t\telse if(newNode.getName().compareToIgnoreCase(current.getName()) < 0)\r\n\t\t{\r\n\t\t\t// Spot is open, add name\r\n\t\t\tif(current.getLeftChild() == null)\r\n\t\t\t{\r\n\t\t\t\tcurrent.setLeftChild(newNode);\r\n\t\t\t\tnewNode.setParent(current);\r\n\t\t\t\tincrementCounter();\r\n\t\t\t}\r\n\t\t\t// Spot is occupied, keep searching through the Binary Tree recursively\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tinsert(current.getLeftChild(), newNode);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// The name is lexicographically greater than the current Node's name\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Spot is open, add name\r\n\t\t\tif(current.getRightChild() == null)\r\n\t\t\t{\r\n\t\t\t\tcurrent.setRightChild(newNode);\r\n\t\t\t\tnewNode.setParent(current);\r\n\t\t\t\tincrementCounter();\r\n\t\t\t}\r\n\t\t\t// Spot is occupied, keep searching through the Binary Tree recursively\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tinsert(current.getRightChild(), newNode);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void insert(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"insert: Point2D is null\");\n if (root == null) {\n root = new Node(p);\n size++;\n root.rect = new RectHV(0.0, 0.0, 1.0, 1.0); // the whole unit\n }\n else root = insertNode(root, p, true);\n }",
"public void insert(T e) {\n if (e == null) return;\n root = insert(root, e);\n }",
"static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}",
"public void insert(int key,int value){\n\t\tif(map.containsKey(key)){\n\t\t\tNode n = map.get(key);\n\t\t\tdeleteNode(n);\n\t\t\taddToHead(n);\n\t\t} else {\n\t\t\tif(count > capacity){\n\t\t\t\tint key1 = tail.key;\n\t\t\t\tmap.remove(key1);\n\t\t\t\tdeleteTail();\n\t\t\t\tNode n = new Node(key,value);\n\t\t\t\tmap.put(key, n);\n\t\t\t\taddToHead(n);\n\t\t\t} else {\n\t\t\t\tNode n = new Node(key,value);\n\t\t\t\tmap.put(key, n);\n\t\t\t\taddToHead(n);\n\t\t\t}\n\t\t}\n\t}",
"public void insert( AnyType x )\r\n\t{\r\n\t\troot = insert( x, root );\r\n\t}",
"public void insert(Point p) {\n if (p == null) {\n System.out.println(\"Illegal point argument\");\n }\n if (head == null || !search(p)) { //if root is empty or when the point isn't in the tree we insert it\n size++;\n head = insert(head, p, true);\n }\n }",
"public void insert(String word) {\n var node = root;\n for(char currentChar : word.toCharArray()){\n if(!node.containsKey(currentChar)) {\n node.put(currentChar, new Node());\n }\n node = node.get(currentChar);\n }\n node.setEnd();\n }"
] | [
"0.8219565",
"0.7697395",
"0.76193434",
"0.748612",
"0.7465784",
"0.72557336",
"0.7196218",
"0.71160513",
"0.70998704",
"0.7083355",
"0.7061961",
"0.70314497",
"0.7016833",
"0.7005316",
"0.6905715",
"0.689392",
"0.6890209",
"0.6888708",
"0.6867628",
"0.6858425",
"0.68568933",
"0.6830499",
"0.6814434",
"0.68008083",
"0.68001837",
"0.6773488",
"0.6769525",
"0.67246854",
"0.6710816",
"0.67043257",
"0.67019033",
"0.6698302",
"0.6693418",
"0.6678525",
"0.6675478",
"0.66753846",
"0.66654366",
"0.6663482",
"0.66582775",
"0.66527414",
"0.66248757",
"0.6610775",
"0.6596007",
"0.6580034",
"0.65781164",
"0.6551738",
"0.65461946",
"0.65433884",
"0.6541802",
"0.6530895",
"0.65275687",
"0.65259194",
"0.6517932",
"0.6511009",
"0.65084994",
"0.650826",
"0.6493142",
"0.64907604",
"0.6478497",
"0.6471095",
"0.646086",
"0.64603645",
"0.6450389",
"0.64443594",
"0.6443422",
"0.64376897",
"0.6433043",
"0.6430349",
"0.6428257",
"0.64182156",
"0.6418183",
"0.64160347",
"0.6413139",
"0.641052",
"0.64064854",
"0.6403504",
"0.63906175",
"0.63884985",
"0.6387695",
"0.6386934",
"0.6385686",
"0.638503",
"0.6380737",
"0.638059",
"0.6377194",
"0.63727385",
"0.63710296",
"0.6366353",
"0.63626206",
"0.6356498",
"0.63554776",
"0.6338169",
"0.6328586",
"0.6325477",
"0.63213634",
"0.6319723",
"0.6319031",
"0.6318642",
"0.63133144",
"0.6312321"
] | 0.64711106 | 59 |
this is a simple method that helps the visual representation of trees | private String indent(int spaces) {
String result = "";
for (int i = 0; i < spaces; i++) {
result = result + " ";// it creates as much spaces as it is told to
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createTree() {\n\n // custom brown color\n Color brown = new Color(149, 99, 57);\n\n // trunk\n NscComponent trunk = new NscRectangle(49, 164, 13, 51);\n createShape(trunk, brown, true);\n\n // branches\n drawLine(50, 125, 50, 165, 10, brown);\n drawLine(25, 125, 50, 165, 10, brown);\n drawLine(75, 125, 50, 165, 10, brown);\n\n // branch outlines\n drawLine(49, 125, 49, 150, 1, Color.black);\n drawLine(60, 125, 60, 150, 1, Color.black);\n drawLine(24, 125, 49, 165, 1, Color.black);\n drawLine(35, 125, 50, 150, 1, Color.black);\n drawLine(85, 125, 60, 165, 1, Color.black);\n drawLine(74, 125, 60, 150, 1, Color.black);\n\n // leafs\n NscEllipse leafs2 = new NscEllipse(0, 5, 60, 122);\n NscEllipse leafs3 = new NscEllipse(50, 5, 60, 122);\n NscEllipse leafs = new NscEllipse(25, 0, 60, 127);\n NscEllipse leafs4 = new NscEllipse(25, 1, 60, 124);\n createShape(leafs2, treeColor, true);\n createShape(leafs3, treeColor, true);\n createShape(leafs, treeColor, true);\n createShape(leafs4, treeColor, false);\n\n repaint();\n }",
"@Test\n public void visualiseTree()\n {\n System.out.println(avlTree.toString());\n }",
"public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}",
"void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}",
"public void display() {\n ITree.Node root = this.createNode(0);\n TreePrinter.printNode(root);\n }",
"public static String printTree()\n {\n \tString tree = \"\";\n ArrayList<String> letters = converter.toArrayList();\n for(int i = 0; i < letters.size(); i++)\n {\n tree += letters.get(i);\n if(i + 1 < letters.size())\n \t tree += \" \";\n }\n \n return tree;\n }",
"public void showTree(IGPProgram a_prog, String a_filename)\n throws InvalidConfigurationException {\n if (a_prog == null) {\n return;\n }\n TreeNode myTree = createTree(a_prog);\n if (myTree == null) {\n return;\n }\n TreeVisualizer tv = new TreeVisualizer();\n tv.setTreeBranchRenderer(new JGAPTreeBranchRenderer());\n tv.setTreeNodeRenderer(new JGAPTreeNodeRenderer());\n tv.setBranchStartWidth(18.0);\n tv.setArenaColor(Color.black);\n tv.setBkgndColor(Color.black);\n tv.setRenderNodes(true);\n tv.setSide(1024);\n tv.setCircleDiminishFactor(0.5);\n tv.writeImageFile(tv.renderTree(myTree), new File(a_filename));\n }",
"public static void graphTree(CommonTree tree){\n\t\tDOTTreeGenerator gen = new DOTTreeGenerator(); \n\t\tStringTemplate st = gen.toDOT(tree); \n\n\t\tString type = \"jpg\";\n\t\tGraphViz gv = new GraphViz();\n\t\tgv.addln(st.toString());\n\n\t\tSystem.out.println(\"Before\");\n\n\t\tImageIcon img = new ImageIcon(gv.getGraph(gv.getDotSource(), type));\n\n\t\tSystem.out.println(\"After\");\n\n\t\tint newHeight = 775, newWidth = 1255; \n\t\t/* This is for writing the image to disk*/\n\t\tFile out = new File(\"graph.\" + type); // Linux\n\t\tgv.writeGraphToFile( gv.getGraph( gv.getDotSource(), type ), out );\n\t\t//\t\tif (iw > newWidth){\n\t\t//\t\t\tnewHeight = newWidth * ih/iw ;\n\t\t//\t\t\tBufferedImage resizedImg = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);\n\t\t//\t\t\tGraphics2D g2 = resizedImg.createGraphics();\n\t\t//\t\t\t\n\t\t//\t\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\t//\t\t\tg2.drawImage(img.getImage(), 0, 0, newWidth, newHeight, null);\n\t\t//\t\t\tg2.dispose();\n\t\t//\t\t\timg = new ImageIcon(resizedImg);\n\t\t//\t\t}\n\n\t\tJFrame jf = new JFrame(\"Abstract Syntax Tree\");\n\t\tjf.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n\t\tJLabel photographLabel = new JLabel();\n\t\tphotographLabel.setHorizontalAlignment(JLabel.CENTER);\n\t\t//private Image getScaledImage(Image srcImg, int w, int h){\n\n\n\t\tphotographLabel.setIcon(img);\n\t\tJScrollPane scrollPane = new JScrollPane(photographLabel);\n\t\tjf.add(scrollPane, BorderLayout.CENTER);\n\t\tjf.pack();\n\t\tjf.setSize(newWidth+50, newHeight+50);\n\t\tjf.setResizable(true);\n\t\tjf.setVisible(true);\n\t\t/*end graphical display*/\n\t}",
"public void display() {\n\t\ttree.resize(30,50);\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree,25,i);\n\t\t}\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree, 575, i);\n\t\t}\n\t}",
"public void showTree(IGPProgram a_prog, String a_filename,\n TreeBranchRenderer a_treeBranchRenderer,\n TreeNodeRenderer a_treeNodeRenderer)\n throws InvalidConfigurationException {\n TreeNode myTree = createTree(a_prog);\n if (myTree == null) {\n return;\n }\n TreeVisualizer tv = new TreeVisualizer();\n tv.setTreeBranchRenderer(a_treeBranchRenderer);\n tv.setTreeNodeRenderer(a_treeNodeRenderer);\n tv.setBranchStartWidth(18.0);\n tv.setArenaColor(Color.black);\n tv.setBkgndColor(Color.black);\n tv.setRenderNodes(true);\n tv.setSide(1024);\n tv.setCircleDiminishFactor(0.5);\n tv.writeImageFile(tv.renderTree(myTree), new File(a_filename));\n }",
"public String printTree() {\n printSideways();\n return \"\";\n }",
"@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}",
"public static String printTree()\r\n {\r\n String result = \"\";\r\n for (String s: tree.toArrayList())\r\n result = result + \" \" + s;\r\n return result;\r\n }",
"private void showTree(Node root) {\r\n int currentDepth = 0;\r\n int leftBorder = sourceCodeDistance;\r\n int nrOfNodesInTree = countNodes(root);\r\n HashMap<String, Node> nMap = new HashMap<String, Node>();\r\n nMap = fillNodeMap(root, nMap);\r\n\r\n Queue<Node> queue = new LinkedList<Node>();\r\n queue.add(root);\r\n while (!queue.isEmpty()) {\r\n Node node = queue.poll();\r\n if (currentDepth != node.getDepth()) {\r\n leftBorder = calculateLeftBorder(true, node, nrOfNodesInTree, nMap);\r\n currentDepth++;\r\n }\r\n int x;\r\n int y = (nodeSize + leafPositionY) * node.getDepth();\r\n\r\n if (node.isLeaf()) {\r\n x = leftBorder;\r\n } else {\r\n int totalWidth = (nodeSize + leafPositionX) * node.getLeafCount()\r\n - leafPositionX;\r\n\r\n x = (totalWidth / 2) + leftBorder - (nodeSize / 2);\r\n }\r\n drawNodes(x, y, node);\r\n\r\n if (node.isLeaf()) {\r\n leftBorder += calculateLeftBorder(false, node, nrOfNodesInTree, nMap);\r\n } else {\r\n leftBorder += (nodeSize + leafPositionX) * node.getLeafCount();\r\n }\r\n queue.addAll(node.getChildren());\r\n }\r\n }",
"public void displayTree()\r\n {\r\n Stack globalStack = new Stack();\r\n globalStack.push(root);\r\n int nBlanks = 32;\r\n boolean isRowEmpty = false;\r\n System.out.println(\r\n \"......................................................\");\r\n while(isRowEmpty==false)\r\n {\r\n Stack localStack = new Stack();\r\n isRowEmpty = true;\r\n\r\n for(int j=0; j<nBlanks; j++)\r\n System.out.print(' ');\r\n\r\n while(globalStack.isEmpty()==false)\r\n {\r\n Node temp = (Node)globalStack.pop();\r\n if(temp != null)\r\n {\r\n if((temp.getStoredChar()) != '\\u0000'){\r\n System.out.print(\"{\"+temp.getStoredChar() + \",\" + temp.getFrequency()+\"}\");\r\n \r\n }\r\n else{\r\n System.out.print(\"{_,\"+ temp.getFrequency()+\"}\");\r\n \r\n }\r\n localStack.push(temp.getLeftChild());\r\n localStack.push(temp.getRightChild());\r\n\r\n if(temp.getLeftChild() != null ||\r\n temp.getRightChild() != null)\r\n isRowEmpty = false;\r\n }\r\n else\r\n {\r\n System.out.print(\"-\");\r\n localStack.push(null);\r\n localStack.push(null);\r\n }\r\n for(int j=0; j<nBlanks*2-2; j++)\r\n System.out.print(' ');\r\n } // end while globalStack not empty\r\n System.out.println();\r\n nBlanks /= 2;\r\n while(localStack.isEmpty()==false)\r\n globalStack.push( localStack.pop() );\r\n } // end while isRowEmpty is false\r\n System.out.println(\r\n \"......................................................\");\r\n System.out.println(\"\");\r\n }",
"public String makeTree() {\r\n // Create a stack to store the files/directories in the tree\r\n Stack<DirectoryTreeNode> itemStack = new Stack<>();\r\n // Initialize a string variable to store the tree diagram\r\n String tree = \"\";\r\n // Push the root directory into the stack\r\n itemStack.push(this.rootDir);\r\n\r\n // Loop through the items in the Stack until all the items have been\r\n // traversed (this is similar to the pre-order traversal of the tree)\r\n while (!itemStack.isEmpty()) {\r\n // Get the item on the top of the stack and store it in current\r\n DirectoryTreeNode current = (DirectoryTreeNode) itemStack.pop();\r\n // Get the number of tabs required in the output for this item\r\n int numTabs = this.getNumberOfAncestors((E) current);\r\n // Get the string of tabs needed to put before current's name\r\n String tabs = this.getNumberOfTabs(numTabs);\r\n // Add the required number of tabs, the current item's of name and a\r\n // newline\r\n tree += tabs + current.getName() + \"\\n\";\r\n\r\n // Check if current is a Directory (in which case it may have\r\n // sub directories and files)\r\n if (current instanceof Directory) {\r\n // Get the list of files and directories of current directory\r\n ArrayList<DirectoryTreeNode> contents =\r\n ((Directory) current).getContents();\r\n // Loop through the contents of current and add them to the stack\r\n for (int i = contents.size() - 1; i >= 0; i--) {\r\n itemStack.add(contents.get(i));\r\n }\r\n }\r\n }\r\n // Return the generated tree diagram\r\n return tree;\r\n }",
"@FXML\n private void renderTree() {\n unmountTree();\n buildTree(inputN, treePane.getWidth() / 2, treePane.getHeight(), Math.toRadians(inputTrunkAngle), inputBranchLength);\n mountTree();\n }",
"public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }",
"public void printTree() {\n printTreeHelper(root);\n }",
"public void printTree(){\n if(root!=null) // มี node ใน tree\n {\n super.printTree(root); // ปริ้นโดยส่ง node root ไป static fn\n }\n else\n {\n System.out.println(\"Empty tree!!!\");\n }\n }",
"private void displayOutput() {\n\t\tlevel = 2;\n\t\t// Level 1 by default\n\t\ttreeBWLevel1.setIcon(new ImageIcon(ClassLoader.getSystemResource(\"image/treeBW.png\")));\n\t\tJLabel text = new JLabel(firstState.getName());\n\t\ttext.setFont(new Font(\"Serif\", Font.BOLD, 16));\n\t\ttext.setForeground(Color.white);\n\t\ttreeBWLevel1.add(text);\n\n\t\tfirstBlock.setTreeLabel(treeBWLevel1);\n\n\t\tline = new Line2D.Double(550, 975, 100, 200);\n\n\t\t// Since , NFA's are practically never ending, we have kept our\n\t\t// implementation upto 4 levels.\n\t\twhile (level != 5) {\n\t\t\tint parentTreeNo = 0;\n\t\t\tfor (StateBlockTreeNo block : previousBlock) {\n\t\t\t\tint currentLevelCounter = 0;\n\t\t\t\tint temp;\n\t\t\t\tHashMap<StateBlock, ArrayList<TransitionBlock>> list = block.getStateBlock().getStateTransitionList();\n\t\t\t\tfor (Map.Entry<StateBlock, ArrayList<TransitionBlock>> entry : list.entrySet()) {\n\t\t\t\t\tStateBlock key = entry.getKey();\n\t\t\t\t\tArrayList<TransitionBlock> value = entry.getValue();\n\t\t\t\t\tfor (TransitionBlock transitionBlock : value) {\n\n\t\t\t\t\t\tString stateName = \"\" + key.getName().toString();\n\t\t\t\t\t\tJLabel stateNo = new JLabel(stateName);\n\t\t\t\t\t\tstateNo.setFont(new Font(\"Serif\", Font.BOLD, 16));\n\t\t\t\t\t\tstateNo.setForeground(Color.white);\n\t\t\t\t\t\t++currentLevelCounter;\n\t\t\t\t\t\tStateBlockTreeNo stateBlockTreeNo = new StateBlockTreeNo();\n\t\t\t\t\t\tstateBlockTreeNo.setStateBlock(key);\n\t\t\t\t\t\tstateBlockTreeNo.setTreeNo(((block.getTreeNo() - 1) * 3) + currentLevelCounter);\n\t\t\t\t\t\tstateBlockTreeNo.setTreeLabel(labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))));\n\t\t\t\t\t\tstateBlockTreeNo.setForestPosition(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo())));\n\n\t\t\t\t\t\tblock.getTreeConnectionList().put(stateBlockTreeNo, transitionBlock.getName());\n\n\t\t\t\t\t\tint x = labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).getX();\n\t\t\t\t\t\tint y = labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).getY();\n\t\t\t\t\t\tJLabel transitionLabel = new JLabel();\n\t\t\t\t\t\tlabelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).setLayout(new FlowLayout(FlowLayout.CENTER));\n\t\t\t\t\t\tlabelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).add(stateNo);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * if (level == 4) { transitionLabel.setBounds(x, y +\n\t\t\t\t\t\t * 40, 30, 30); transitionLabel.setIcon(new\n\t\t\t\t\t\t * ImageIcon(\"image/appleLevel4.png\"))); //\n\t\t\t\t\t\t * labelList.get(new Integer(Integer.toString(level) //\n\t\t\t\t\t\t * + //\n\t\t\t\t\t\t * Integer.toString(stateBlockTreeNo.getTreeNo()))).\n\t\t\t\t\t\t * setIcon(new // ImageIcon(\"image/treeLevel4.png\")));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 10)); fl.setVgap(10); } else {\n\t\t\t\t\t\t * transitionLabel.setBounds(x + 55, y, 40, 40);\n\t\t\t\t\t\t * transitionLabel.setIcon(new\n\t\t\t\t\t\t * ImageIcon(\"image/apple.png\")));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 16)); // labelList.get(new\n\t\t\t\t\t\t * Integer(Integer.toString(level) // + //\n\t\t\t\t\t\t * Integer.toString\n\t\t\t\t\t\t * (stateBlockTreeNo.getTreeNo()))).setIcon(new //\n\t\t\t\t\t\t * ImageIcon(\"image/tree.png\"))); fl.setVgap(15); }\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tJLabel transitionValue = new JLabel();\n\t\t\t\t\t\ttransitionValue = appleLabels.get(Integer.parseInt(block.getTreeLabel().getName() + stateBlockTreeNo.getTreeLabel().getName()));\n\n\t\t\t\t\t\tSystem.out.println(Integer.parseInt(block.getTreeLabel().getName() + stateBlockTreeNo.getTreeLabel().getName()));\n\t\t\t\t\t\tString transitionText = transitionBlock.getName();\n\t\t\t\t\t\ttransitionValue.setFont(new Font(\"Serif\", Font.BOLD, 20));\n\t\t\t\t\t\ttransitionValue.setForeground(Color.WHITE);\n\t\t\t\t\t\ttransitionValue.setText(transitionText);\n\t\t\t\t\t\ttransitionValue.setHorizontalTextPosition(JLabel.CENTER);\n\t\t\t\t\t\ttransitionValue.setVerticalTextPosition(JLabel.CENTER);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * JLabel transitionValue = new JLabel(transitionText);\n\t\t\t\t\t\t * transitionValue.setForeground(Color.white);\n\t\t\t\t\t\t * FlowLayout fl = new FlowLayout(FlowLayout.CENTER);\n\t\t\t\t\t\t * transitionLabel =\n\t\t\t\t\t\t * appleLabels.get(Integer.parseInt(block\n\t\t\t\t\t\t * .getTreeLabel().getName() +\n\t\t\t\t\t\t * stateBlockTreeNo.getTreeLabel().getName()));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 16)); transitionLabel.setLayout(fl);\n\t\t\t\t\t\t * transitionLabel.add(transitionValue);\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tactionPanel.add(transitionValue);\n\n\t\t\t\t\t\tcurrentBlock.add(stateBlockTreeNo);\n\t\t\t\t\t}\n\t\t\t\t\ttemp = currentLevelCounter / 3;\n\t\t\t\t\tcurrentLevelCounter = currentLevelCounter * (temp + 1);\n\t\t\t\t}\n\t\t\t\tparentTreeNo++;\n\t\t\t}\n\t\t\tlevel++;\n\t\t\tpreviousBlock = (ArrayList<StateBlockTreeNo>) currentBlock.clone();\n\t\t\tcurrentBlock.clear();\n\n\t\t}\n\n\t}",
"public static TreeNode getTree() {\n\t\tTreeNode a = new TreeNode(\"a\", 314);\n\t\tTreeNode b = new TreeNode(\"b\", 6);\n\t\tTreeNode c = new TreeNode(\"c\", 271);\n\t\tTreeNode d = new TreeNode(\"d\", 28);\n\t\tTreeNode e = new TreeNode(\"e\", 0);\n\t\tTreeNode f = new TreeNode(\"f\", 561);\n\t\tTreeNode g = new TreeNode(\"g\", 3);\n\t\tTreeNode h = new TreeNode(\"h\", 17);\n\t\tTreeNode i = new TreeNode(\"i\", 6);\n\t\tTreeNode j = new TreeNode(\"j\", 2);\n\t\tTreeNode k = new TreeNode(\"k\", 1);\n\t\tTreeNode l = new TreeNode(\"l\", 401);\n\t\tTreeNode m = new TreeNode(\"m\", 641);\n\t\tTreeNode n = new TreeNode(\"n\", 257);\n\t\tTreeNode o = new TreeNode(\"o\", 271);\n\t\tTreeNode p = new TreeNode(\"p\", 28);\n\t\t\n\t\ta.left = b; b.parent = a;\n\t\tb.left = c; c.parent = b;\n\t\tc.left = d;\t d.parent = c;\n\t\tc.right = e; e.parent = c;\n\t\tb.right = f; f.parent = b;\n\t\tf.right = g; g.parent = f;\n\t\tg.left = h; h.parent = g;\n\t\ta.right = i; i.parent = a;\n\t\ti.left = j; j.parent = i;\n\t\ti.right = o; o.parent = i;\n\t\tj.right = k; k.parent = j;\n\t\to.right = p; p.parent = o;\n\t\tk.right = n; n.parent = k;\n\t\tk.left = l; l.parent = k;\n\t\tl.right = m; m.parent = l;\n\t\t\n\t\td.childrenCount = 0;\n\t\te.childrenCount = 0;\n\t\tc.childrenCount = 2;\n\t\tb.childrenCount = 6;\n\t\tf.childrenCount = 2;\n\t\tg.childrenCount = 1;\n\t\th.childrenCount = 0;\n\t\tl.childrenCount = 1;\n\t\tm.childrenCount = 0;\n\t\tn.childrenCount = 0;\n\t\tk.childrenCount = 3;\n\t\tj.childrenCount = 4;\n\t\to.childrenCount = 1;\n\t\tp.childrenCount = 0;\n\t\ti.childrenCount = 7;\n\t\ta.childrenCount = 15;\n\t\t\n\t\treturn a;\n\t}",
"private void displayTree(Node<Integer> n, double xCord, double yCord, double horizontalGap, double verticalGap,double treeHeight, String key, Color color){\r\n // base condition \r\n if(n == null)\r\n return;\r\n // recursive call to left sub-tree\r\n displayTree(n.getLeftNode(),xCord-horizontalGap,yCord+verticalGap, horizontalGap/3, verticalGap+1*treeHeight,treeHeight, key, color);\r\n // recursive call to middle sub-tree\r\n if(n.getRightElement() != null)\r\n displayTree(n.getMidNode(),xCord+25,yCord+verticalGap, horizontalGap/3, verticalGap+1*treeHeight,treeHeight, key, color);\r\n else\r\n displayTree(n.getMidNode(),xCord+horizontalGap,yCord+verticalGap, horizontalGap/3,verticalGap+1*treeHeight,treeHeight, key, color);\r\n // recursive call to right sub-tree\r\n displayTree(n.getRightNode(),xCord+horizontalGap,yCord+verticalGap, horizontalGap/3,verticalGap+1*treeHeight,treeHeight, key, color);\r\n // draw single square node\r\n if(n.is2Node()){\r\n if(n.getLeftElement() != null)\r\n draw2Node(n.getLeftElement().toString(),xCord,yCord,n.isLeaf(), horizontalGap, verticalGap, key, color);\r\n }\r\n // draw double square node\r\n if(n.is3Node()){\r\n draw3Node(n.getLeftElement().toString(),n.getRightElement().toString(),xCord,yCord,n.isLeaf(),horizontalGap,verticalGap, key, color);\r\n }\r\n }",
"public void printTree() {\n\t\tSystem.out.println(printHelp(root));\r\n\t\t\r\n\t}",
"protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }",
"private void showTree(EarleyParser.Node root,int level, String previous) {\n\t\tSystem.out.print(level);\n\t\tfor(int i = 0; i <= level; i++)\n\t\t\tSystem.out.print(\" \");\n\t\tSystem.out.println(root.text);\n\t\tString cur = root.text;\n\t\twhile(graph.containsVertex(cur)) {\n\t\t\tcur = cur + \" \";\n\t\t}\n\n\t\tgraph.addVertex(cur);\n\t\tif(previous != null) {\n\t\t\tgraph.addEdge(edgeid++, previous, cur);\n\t\t}\n\t\tfor(EarleyParser.Node sibling : root.siblings) {\n\t\t\tshowTree(sibling, level+1, cur);\n\t\t}\n\t}",
"public TreePainting() {\n\t\t// Add a mouse listener for its own events\n\t\taddMouseListener(this);\n\t}",
"private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}",
"public GenerateJTree1() {\n UIManager.put(\"Tree.rendererFillBackground\", false);\n initComponents();\n BasicInternalFrameUI bifui = (BasicInternalFrameUI) this.getUI();\n bifui.setNorthPane(null);\n bifui.setSouthPane(null);\n\n// UIDefaults d = new UIDefaults();\n// d.put(\"Tree.selectionBackground\", Color.GREEN);\n// jTree1.putClientProperty(\"Nimbus.Overrides\", d);\n// jTree1.putClientProperty(\"Nimbus.Overrides.InheritDefaults\", false);\n cellColour();\n try {\n loadTree();\n } catch (NotBoundException | MalformedURLException | RemoteException | ClassNotFoundException | SQLException | InterruptedException ex) {\n Logger.getLogger(GenerateJTree1.class.getName()).log(Level.SEVERE, null, ex);\n }\n ToolTipManager.sharedInstance().registerComponent(jTree1);\n }",
"public void displayTree(String key, Color color){\r\n // first clear the screen\r\n this.getChildren().clear();\r\n double treeHeight = tree.height();\r\n // make space for more nodes\r\n if (treeHeight == 3){\r\n this.setPrefSize(3500,1500);\r\n }\r\n else if (treeHeight == 4){\r\n this.setPrefSize(7500,1500);\r\n }\r\n else if(treeHeight > 4){\r\n this.setPrefSize(Math.pow(3,treeHeight-2)*1500,1500);\r\n }\r\n // display tree if root is not null\r\n if (tree.getRoot() != null){\r\n displayTree(tree.getRoot(),getWidth()/2,5,getWidth()/3, 150,treeHeight+1, key, color);\r\n }\r\n }",
"public String treeJSON() {\n\t\ttry{\r\n\t\tList trees = this.getTransedTrees();\r\n\t\tString result = this.treeJSON(trees);\r\n\t\treturn result;\r\n\t\t}catch(Exception e){\r\n\t\t\tlog.info(\">>>>faceye error in method:treeJSON() is\"+e.toString());\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}",
"public static String printTree(Tree t) {\n\tStringWriter sw = new StringWriter();\n\tPrintWriter pw = new PrintWriter(sw);\n\tTreePrint tp = new TreePrint(\"penn\", \"markHeadNodes\", tlp);\n\ttp.printTree(t, pw);\n\treturn sw.toString();\n }",
"public void printTree() {\r\n printTree(overallRoot, 0);\r\n }",
"protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }",
"private JTree makeCatalogTree() {\n\t\t\n\t\ttree_root = new DefaultMutableTreeNode(\"all photos\");\n\t\ttree_root.setUserObject(root);\n\t\t\n\t\tfinal JTree tree = new JTree(tree_root);\n\t\ttree.setMinimumSize(new Dimension(200,400));\n\n\t\ttree.setToggleClickCount(3); // so that we can use double-clicks for previewing instead of expanding/collapsing\n\n\t\tDefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel();\n\t\tselectionModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);\n\t\ttree.setSelectionModel(selectionModel);\n\t\t\n\t\ttree.addMouseListener(new MouseInputAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t// if left-double-click @@@changed =2 to ==1\n\t\t\t\tif (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {\n\t\t\t\t\tDefaultMutableTreeNode tempNode = getSelectedTreeNode();\n\t\t\t\t\tAlbum chosenAlbum =(Album) tempNode.getUserObject();\n\t\t\t\t\t\n\t\t\t\t\tpreviewPane.display(chosenAlbum);\n\t\t\t\t\t\n\t\t\t\t\t// YOUR CODE HERE\n\t\t\t\t\tSystem.out.println(\"show the photos for album \" + getSelectedTreeNode());\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t\t\n\t\treturn tree;\n\t}",
"public void encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }",
"public void prettyPrintTree() {\r\n\t\tSystem.out.print(\"prettyPrintTree starting\");\r\n\t\tfor (int i = 0; i <= this.getTreeDepth(); i++) {\r\n\t\t\tprettyPrintTree(root, 0, i);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"public void placeTreeNodes() {\n int width;\n float rad;\n\n // Stores width and rad for convenience.\n width = MainActivity.getCanvas().getWidth();\n rad = AnimationParameters.NODE_RADIUS;\n\n // Places the Nodes.\n placeTreeNodes((int) (width / 2 + rad * 1.5), (int) (rad * 2),\n (int) (width - rad * 5), (int) AnimationParameters.depthLen);\n\n }",
"TreeNode getTreeNode();",
"public ShowTree(GUIMain guiMn) throws HeadlessException {\n setSize(200, 400);\n\n guiMn.simMain.rootNode = new DefaultMutableTreeNode(\"Physiology systems\");\n guiMn.simMain.treeModel = new DefaultTreeModel(guiMn.simMain.rootNode);\n guiMn.simMain.treeModel.addTreeModelListener(new WBodyTreeModelListener());\n\n guiMn.myTree = new ConnectionJTree(guiMn.simMain.treeModel);\n\n guiMn.myTree.setEditable(true);\n guiMn.myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n\n guiMn.myTree.setCellRenderer(new CountryTreeCellRenderer());\n\n // even rootNode could be foldable\n guiMn.myTree.setShowsRootHandles(true);\n\n // make it possible to select a insideLeaf\n JLabel selectedLabel = new JLabel();\n add(selectedLabel, BorderLayout.SOUTH);\n\n /*\n * this call the routine managing clicks on tree's elements\n */\n guiMn.myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {\n @Override\n public void valueChanged(TreeSelectionEvent e) {\n DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) guiMn.myTree.getLastSelectedPathComponent();\n if (selectedNode != null) {\n // A button has been clicked\n WBodyTreeEvent wbte = new WBodyTreeEvent(guiMn);\n wbte.buttonClicked(selectedLabel, selectedNode);\n }\n }\n\n });\n\n }",
"public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}",
"public void paint() {\n int L = 150; // Local convenience var\n\n // Declare three lines (left, middle, and right)\n Line left = new Line(L, L, L, getHeight() - L);\n Line middle = new Line(L, getHeight() / 2, getWidth() - L, getHeight() / 2);\n Line right = new Line(getWidth() - L, L, getWidth() - L, getHeight() - L);\n\n getChildren().clear(); // Clear the pane before redisplay\n\n displayHTree(order, left, middle, right); // Call the recursive method\n }",
"public void printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, this.root); \n }",
"public void draw() {\n drawSubtree(root);\n }",
"public void printTree() {\r\n\t\tif (isEmpty())\r\n\t\t\tSystem.out.println(\"Empty tree\");\r\n\t\telse\r\n\t\t\tprintTree(root);\r\n\t}",
"public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }",
"@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}",
"public TtreeNode() {\n\t numberOfNodes++;\n\t }",
"@Override\n public String toString() { // display subtree in order traversal\n String output = \"[\";\n LinkedList<Node<T>> q = new LinkedList<>();\n q.add(this);\n while(!q.isEmpty()) {\n Node<T> next = q.removeFirst();\n if(next.leftChild != null) q.add(next.leftChild);\n if(next.rightChild != null) q.add(next.rightChild);\n output += next.data.toString();\n if(!q.isEmpty()) output += \", \";\n }\n return output + \"]\";\n }",
"@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }",
"public void tree(Graphics bbg, int n, int length, int x, int y, double angle){\n double r1 = angle + Math.toRadians(-30);\n double r2 = angle + Math.toRadians(30);\n double r3 = angle + Math.toRadians(0);\n\n //length modifications of the different branches\n double l1 = length/1.3 + (l1I*5);\n double l2 = length/1.3 + (l2I*5);\n double l3 = length/1.3 + (l3I*5);\n\n //x and y points of the end of the different branches\n int ax = (int)(x - Math.sin(r1)*l1)+(int)(l1I);\n int ay = (int)(y - Math.cos(r1)*l1)+(int)(l1I);\n int bx = (int)(x - Math.sin(r2)*l2)+(int)(l2I);\n int by = (int)(y - Math.cos(r2)*l2)+(int)(l2I);\n int cx = (int)(x - Math.sin(r3)*l3)+(int)(l3I);\n int cy = (int)(y - Math.cos(r3)*l3)+(int)(l3I);\n\n if(n == 0){\n return;\n }\n\n\n increment();\n Color fluidC = new Color(colorR,colorG,colorB);\n //bbg.setColor(new Color((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random()*255)));\n bbg.setColor(fluidC);\n\n\n //draw different branches\n bbg.drawLine(x,y,ax,ay);\n bbg.drawLine(x,y,bx,by);\n bbg.drawLine(x,y,cx,cy);\n\n //call recursively to draw fractal\n tree(bbg,n-1,(int)l1, ax,ay,r1);\n tree(bbg, n - 1, (int)l2, bx,by,r2);\n tree(bbg, n - 1, (int)l3, cx,cy,r3);\n\n\n }",
"public void printTree( )\r\n\t{\r\n\t\tif( isEmpty( ) )\r\n\t\t\tSystem.out.println( \"Empty tree\" );\r\n\t\telse\r\n\t\t\tprintTree( root );\r\n\t}",
"private CategoryView buildComplicatedExpectedTree() {\n\n CategoryView root = new CategoryView(\"ROOT\");\n CategoryView a = new CategoryView(\"a\");\n CategoryView b = new CategoryView(\"b\");\n CategoryView c = new CategoryView(\"c\");\n CategoryView d = new CategoryView(\"d\");\n CategoryView e = new CategoryView(\"e\");\n\n root.addChild(a);\n root.addChild(e);\n root.addChild(new CategoryView(\"f\"));\n root.addChild(new CategoryView(\"g\"));\n root.addChild(new CategoryView(\"z\"));\n a.addChild(b);\n b.addChild(c);\n a.addChild(c);\n c.addChild(d);\n d.addChild(e);\n c.addChild(e);\n\n root.addChild(new CategoryView(\"1\") {{\n addChild(new CategoryView(\"2\") {{\n addChild(new CategoryView(\"3\"));\n }});\n }});\n root.addChild(new CategoryView(\"x\") {{\n addChild(new CategoryView(\"y\"));\n }});\n\n return root;\n }",
"private ArrayList<T> printBSTree(Node<T> u) {\n\n\t\tArrayList<T> breadth = constructTree(u); // very wasteful\n\t\tconstructBSTree(u); // very wasteful\n\t\tSystem.out.println(breadth);\n\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"CAUTION: horizontal positions are correct only relative to each other\");\n\n\t\tfor (int i = 1; i < pT.size(); i++) {\n\t\t\tSystem.out.printf(\"d = %3d: \", i - 1);\n\t\t\tint theSize = pT.get(i).size();\n\t\t\tint baseWidth = 90;\n\t\t\tString thePadding = CommonSuite.stringRepeat(\" \",\n\t\t\t\t\t(int) ((baseWidth - 3 * theSize) / (theSize + 1)));\n\t\t\tfor (int j = 0; j < theSize; j++)\n\t\t\t\tSystem.out.printf(\"%s%3s\", thePadding, pT.get(i).get(j));\n\t\t\tSystem.out.println();\n\t\t}\n\t\treturn breadth;\n\t}",
"public void printTree() {\r\n\t if (expressionRoot == null) {\r\n\t return;\r\n\t }\r\n if (expressionRoot.right != null) {\r\n printTree(expressionRoot.right, true, \"\");\r\n }\r\n System.out.println(expressionRoot.data);\r\n if (expressionRoot.left != null) {\r\n printTree(expressionRoot.left, false, \"\");\r\n }\r\n }",
"@Override\r\n\tpublic JTree getJTree() {\r\n\t\tif (jTree == null) {\r\n\t\t\tjTree = new JLagerTree();\r\n\t\t\tjTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION );\r\n\t\t\tGenericNode root = new GenericNode(null);\r\n\t\t\tjTree.setModel(getTreeModel(root));\r\n\t\t\tjTree.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n//\t\t\tjTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {\r\n//\t\t\t\tpublic void valueChanged(javax.swing.event.TreeSelectionEvent e) {\r\n//\t\t\t\t\ttreeValueChanged(e,BaugruppeTreePaneView.this.getJTree());\r\n////\t\t\t\t\tSystem.out.println(\"valueChanged()\"); // TODO Auto-generated Event stub valueChanged()\r\n//\t\t\t\t}\r\n//\t\t\t});\r\n//\t\t\tjTree.addTreeSelectionListener(getTreeSelectionListner());\r\n\t\t\t//Aussehen von JTree\r\n\t\t\tjTree.setCellRenderer(new AnfoderungTreeRenderer());\r\n\t\t\tjTree.setToolTipText(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\treturn jTree;\r\n\t}",
"public void summarize () {\n\n TreeNodeVisitor visitor = new TreeNodeVisitor();\n traversal (visitor);\n visitor.log();\n \n }",
"public AvlTree<E> printTree(){\n printTree(root);\n return this;\n }",
"public void show() {\n\t\tfor (Leaf l : leaves) {\n\t\t\tl.show();\n\t\t}\n\t\tfor (int i = 0; i < branches.size(); i++) {\n\t\t\tBranch3D b = branches.get(i);\n\t\t\tif (b.getParent() != null) {\n\t\t\t\t/*\n\t\t\t\t * core.stroke(255); core.line(b.getPos().x, b.getPos().y,\n\t\t\t\t * b.getParent().getPos().x, b.getParent().getPos().y);\n\t\t\t\t */\n\t\t\t\tfloat sw = PApplet.map(i, 0, branches.size(), 6, 0);\n\t\t\t\tcore.strokeWeight(sw);\n\t\t\t\tcore.stroke(255);\n\n\t\t\t\tcore.line(b.getPos().x, b.getPos().y, b.getPos().z, b.getParent().getPos().x, b.getParent().getPos().y,\n\t\t\t\t\t\tb.getParent().getPos().z);\n\n\t\t\t\t/*\n\t\t\t\t * core.pushMatrix(); core.translate(b.getPos().x, b.getPos().y,\n\t\t\t\t * b.getPos().z); float height = b.getPos().z -\n\t\t\t\t * b.getParent().getPos().z;\n\t\t\t\t * DrawUtils.getInstance().drawCylinder(core, 1, 1, height, 3);\n\t\t\t\t * core.popMatrix();\n\t\t\t\t */\n\t\t\t}\n\t\t}\n\t}",
"public Git.Tree displayTree(String h) {\n return displayTree(h, \"root\", null); \n }",
"public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n KdTree tree = new KdTree();\n String filename = args[0];\n In in = new In(filename);\n while (!in.isEmpty()) {\n double x = in.readDouble();\n double y = in.readDouble();\n Point2D p = new Point2D(x, y);\n tree.insert(p);\n }\n tree.draw();\n // tree.info();\n // RectHV rect = new RectHV(0.793893, 0.345492, 1.0, 0.654508);\n // rect.draw();\n // Point2D point = new Point2D(0.5, 0.5);\n // point.draw();\n // StdDraw.show();\n // StdDraw.pause(40);\n // StdDraw.text(0.5, 0.5, \"ksdjlfjasdlfkjsadkflasdjfdaslkjfas\");\n // StdDraw.show();\n // while (true) {\n // System.out.println(StdDraw.mouseX());\n // StdDraw.show();\n // }\n // // Point2D point = new Point2D(0.5, 0.5);\n // // Point2D point2 = new Point2D(0.25, 0.25);\n // // Point2D point3 = new Point2D(0.75, 0.75);\n // // RectHV rect = new RectHV(0.0, 0.0, 0.3, 0.3);\n // // RectHV rect2 = new RectHV(0.0, 0.0, 0.3, 0.3);\n // tree.insert(new Point2D(0.5, 0.5));\n // tree.insert(new Point2D(0.0, 0.0));\n // tree.insert(new Point2D(0.75, 1.0));\n // tree.insert(new Point2D(0.75, 0.0));\n // tree.insert(new Point2D(1.0, 1.0));\n // tree.insert(new Point2D(0.25, 1.0));\n // tree.insert(new Point2D(0.75, 0.75));\n // tree.insert(new Point2D(1.0, 0.5));\n // tree.insert(new Point2D(1.0, 0.0));\n // tree.insert(new Point2D(1.0, 0.75));\n // // tree.insert(new Point2D(0.375, 1.0));\n // // Point2D point = new Point2D(0.375, 1.0);\n // // System.out.println(tree.get(point));\n // // A 0.5 0.5\n // // B 0.0 0.0\n // // C 0.75 1.0\n // // D 0.75 0.0\n // // E 1.0 1.0\n // // F 0.25 1.0\n // // G 0.75 0.75\n // // H 1.0 0.5\n // // I 1.0 0.0\n // // J 1.0 0.75\n // // System.out.println(tree.isEmpty());\n // // tree.insert(point);\n // // tree.insert(point2);\n // // tree.insert(point3);\n // // tree.insert(point);\n // // tree.insert(point);\n // // tree.insert(point);\n // // System.out.println(tree.isEmpty());\n // System.out.println(tree.size());\n // // System.out.println(tree.get(new Point2D(0.375, 1.0)));\n // System.out.println(tree.contains(new Point2D(1.0, 0.0)));\n // // System.out.println(tree.contains(new Point2D(0.5, 0.5)));\n // // tree.draw();\n // // for (Point2D points : tree.range(rect)) System.out.println(points);\n // // System.out.println();\n // // for (Point2D points : tree.range(rect2)) System.out.println(points);\n }",
"public void draw() {\n Node curr = root;\n RectHV rect = new RectHV(0, 0, 1, 1);\n print_ele(curr, true, rect);\n StdDraw.setPenRadius();\n }",
"public String toString() {\n return tree.toString();\n }",
"public void drawTree(GUIMain guiMn, MenuDoAction menu, DoNewInsertOpenModel doNewInsertOpenModel) {\n DefaultMutableTreeNode tissueBranch;\n HumanBody body = null;\n\n if (guiMn.simMain.solver == null) {\n System.err.println(\"The model files are not correct\\n\");\n }\n HostModel host = guiMn.simMain.solver.getHostModelToSolve().getHostModel();\n body = host.getPlacentalia();\n Map<Tissue, DefaultMutableTreeNode> ancestor = new HashMap<>();\n if (body.getNumOrganSystems() > 0) {\n Iterator<PhysioSystem> iter = body.getOrganSystems().iterator();\n\n // loop over PhysioSystems (usually there is only one)\n while (iter.hasNext()) {\n PhysioSystem organsys = iter.next();\n NodeLeaf organSystem = new NodeLeaf(organsys, \"./data/images/iconOrganSystem.gif\");\n DefaultMutableTreeNode organBranch = guiMn.simMain.st.addObject(guiMn, organSystem);\n ArrayList<Tissue> tissues = organsys.tissues;\n Iterator<Tissue> tissueIterator = tissues.iterator();\n\n // loop over Tissues in this PhysioSystem\n while (tissueIterator.hasNext()) {\n NodeLeaf leaf = null;\n\n Tissue tiss = tissueIterator.next();\n if (tiss.getName() == null) {\n System.out.println(\"Error null Tissue\");\n }\n NodeLeaf leafTissue = new NodeLeaf(tiss, \"./data/images/iconTissue.gif\");\n tissueBranch = guiMn.simMain.st.addObject(guiMn, organBranch, leafTissue, true);\n ancestor.put(tiss, tissueBranch);\n ArrayList<CompartmentSBML> comps = tiss.getInternVolumes();\n Iterator<CompartmentSBML> compIterator = comps.iterator();\n\n // loop over compartments in this Tissues\n while (compIterator.hasNext()) {\n CompartmentSBML compa = compIterator.next();\n leaf = processComp(guiMn, compa, tissueBranch);\n }\n // Post processing for \"outside\" field\n ArrayList<CompartmentSBML> compbis = tiss.getInternVolumes();\n Iterator<CompartmentSBML> postIterator = compbis.iterator();\n // loop over compartments in this Tissue\n CompartmentSBML compInside;\n while (postIterator.hasNext()) {\n compInside = postIterator.next();\n if(compInside == null)\n {\n System.out.println(\"No id in model: \" + compInside.getName());\n }\n postProcessComp(guiMn, tiss, tissueBranch, compInside);\n }\n // now there are still compartments in root that are at the wrong place\n } // end of Tissue loop\n } // end of Physiological systems loop\n }\n // when a tissue is embedded in another tissue \n careForPartOf(guiMn, ancestor);\n }",
"public void dumpTree() {\n\t\tsendMessage(\"/g_dumpTree\", new Object[] { 0, 0 });\n\t}",
"FractalTree() {\r\n }",
"public void printTreeNodes(){\n logger.trace(\"Name: \"+this.getName());\n for(int i=0;i<this.getChildCount();i++){\n SearchBaseNode node = (SearchBaseNode) this.getChildAt(i);\n node.printTreeNodes();\n }\n }",
"public void update(){\r\n try {\r\n TreePrinter.print(root);\r\n } catch (Exception e) {\r\n System.out.println(\"[Alert] Could not print diagram!\");\r\n }\r\n }",
"private void printTree( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t{\t\t\t\r\n\t\t\tprintTree( t.left );\r\n\t\t\tSystem.out.print( t.element+\" \");\r\n\t\t\tprintTree( t.right );\r\n\t\t}\r\n\t}",
"public static void main(String a[]) {\n TreeNode root = new TreeNode(1,\n new TreeNode(2,\n null,\n new TreeNode(4, null, null)),\n new TreeNode(3, null, null));\n StringBuffer sb = new StringBuffer();\n tree2str(root, sb);\n System.out.println(sb.toString());\n }",
"private void getTreeShape() {\n int treeSizeInBytes = (int) (Math.ceil(treeSize / (double) Byte.SIZE));\n // converting tree shape in bytes to the bitset;\n BitSet bs = BitSet.valueOf(Arrays.copyOfRange(buffer.array(), bufferPosition, bufferPosition + treeSizeInBytes));\n bufferPosition += treeSizeInBytes;\n\n int treeLeavesAmount = 0;\n for (int i = 0; i < treeSize; i++) {\n boolean bit = bs.get(i);\n if (!bit) {\n treeLeavesAmount += 1;\n }\n treeShape.add(bit);\n }\n\n // adding tree leaves to the linked list;\n for (int i = bufferPosition; i < bufferPosition + treeLeavesAmount; i++) {\n treeLeaves.add(buffer.get(i));\n }\n // increasing buffer position for the amount of leaves(unique bytes);\n bufferPosition = bufferPosition + treeLeavesAmount;\n }",
"@Override\r\n public String toString() {\r\n Queue<List<Node>> queue = new LinkedList<List<Node>>();\r\n queue.add(Arrays.asList(root));\r\n StringBuilder sb = new StringBuilder();\r\n while (!queue.isEmpty()) {\r\n Queue<List<Node>> nextQueue = new LinkedList<List<Node>>();\r\n while (!queue.isEmpty()) {\r\n List<Node> nodes = queue.remove();\r\n sb.append('{');\r\n Iterator<Node> it = nodes.iterator();\r\n while (it.hasNext()) {\r\n Node node = it.next();\r\n sb.append(node.toString());\r\n if (it.hasNext())\r\n sb.append(\", \");\r\n if (node instanceof BPTree.InternalNode)\r\n nextQueue.add(((InternalNode) node).children);\r\n }\r\n sb.append('}');\r\n if (!queue.isEmpty())\r\n sb.append(\", \");\r\n else {\r\n sb.append('\\n');\r\n }\r\n }\r\n queue = nextQueue;\r\n }\r\n return sb.toString();\r\n }",
"public void interactiveTreeEditingRToL() {\r\n JTree tree = new JTree(); \r\n TreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }",
"private TreeNode createTree() {\n // Map<String, String> map = new HashMap<>();\n // map.put(\"dd\", \"qq\");\n // 叶子节点\n TreeNode G = new TreeNode(\"G\");\n TreeNode D = new TreeNode(\"D\");\n TreeNode E = new TreeNode(\"E\", G, null);\n TreeNode B = new TreeNode(\"B\", D, E);\n TreeNode H = new TreeNode(\"H\");\n TreeNode I = new TreeNode(\"I\");\n TreeNode F = new TreeNode(\"F\", H, I);\n TreeNode C = new TreeNode(\"C\", null, F);\n // 构造根节点\n TreeNode root = new TreeNode(\"A\", B, C);\n return root;\n }",
"public TreeTag()\n {\n setNoField(true);\n setRootVisible(true);\n icons = new HashMap<String, Object>();\n }",
"public Tree() {\n super.springPictureName = \"tree2.png\";\n super.summerPictureName = \"tree4.png\";\n super.autumnPictureName = \"tree5.png\";\n super.winterPictureName = \"tree7.png\";\n super.eachElementCapacity = 3;\n\n }",
"private void showSortedTree(boolean sorted) {\n \n if (sorted) {\n if (rootSortedTreeNode == null) {\n // this extra tree is only built if the user requests it\n rootSortedTreeNode = buildSortedTree(\n (DefaultMutableTreeNode)rootUnsortedTreeNode);\n }\n rootTreeNode = rootSortedTreeNode;\n }\n else {\n rootTreeNode = rootUnsortedTreeNode;\n }\n \n tree.setModel(new DefaultTreeModel(rootTreeNode));\n }",
"private void buildeAccessoryTree() {\n\t DefaultKingdeeTreeNode root = new DefaultKingdeeTreeNode(\"版模类型\");\r\n\t DefaultKingdeeTreeNode parentrNode = root;\r\n\t DefaultKingdeeTreeNode currentNode = null;\r\n\t \r\n//\t for(AccessoryTypeEnum s : AccessoryTypeEnum.getEnumList()){\r\n//\t\t\r\n//\t }\r\n\t List accessorylist =AccessoryTypeEnum.getEnumList();\r\n\t Class clz = AccessoryTypeEnum.class;\r\n\t for (int i=0;i<accessorylist.size();i++) {\r\n\t\tSystem.out.println(accessorylist.get(i));\r\n\t\tcurrentNode = new DefaultKingdeeTreeNode(accessorylist.get(i));\r\n\t\tcurrentNode.setUserObject(accessorylist.get(i));\r\n\r\n\t\tparentrNode.add(currentNode);\r\n\t }\r\n\t kDTree1.setModel(new KingdeeTreeModel(root));\r\n\t kDTree1.setSelectionNode(root);\r\n\t \r\n\t}",
"public String treeType();",
"public static void display(Node root){\r\n String str = \"[\"+root.data+\"] -> \";\r\n for(Node child : root.children){\r\n str += child.data + \", \";\r\n }\r\n System.out.println(str + \" . \");\r\n \r\n for(int i=0; i<root.children.size(); i++){\r\n Node child = root.children.get(i);\r\n display(child);\r\n }\r\n }",
"public static void main(String[] args) {\n GenericTree tree = new GenericTree();\n tree.display();\n System.out.println(\"Size \" + tree.size());\n\n System.out.println(\"Calc Size \" + tree.calculateSize());\n\n System.out.println(\"Max Node Data \" + tree.getMaxNodeData());\n\n System.out.println(\"Element 120 exists ? \" + tree.isElementExists(120));\n\n System.out.println(\"Element 56 exists ? \" + tree.isElementExists(56));\n\n System.out.println(\"Height of tree \" + tree.height());\n\n tree.preOrder();\n\n tree.postOrder();\n\n tree.levelOrder();\n\n tree.levelOrderLW();\n\n tree.levelOrderLW2();\n\n tree.levelOrderZigZag();\n\n tree.levelOrderZigZagPepVersion();\n\n // tree.linearize();\n // tree.display();\n\n // tree.removeLeaves();\n\n // tree.display();\n\n // // changes original data\n // tree.printMirrorImage();\n\n // tree.linearizeEffective();\n // tree.display();\n\n\n System.out.println(tree.isSymmetric());\n\n tree.predSucc(120);\n\n tree.justLarger(83);\n\n System.out.println(tree.kthSmallest(3));\n\n }",
"public String toString(){\n String str = \"\";\n for(int i = level; i>0; i--){\n str+=\"\\t\";\n }\n str += getClass().toString();\n if(noOfChildren != 0){\n str+=\" containing\\n\";\n for (int i = 0; i<this.noOfChildren; i++)\n str += getChild(i).toString();\n }\n else{\n str+=\"\\n\";\n }\n return str;\n }",
"public void paintTree(Graphics2D g2, int i) {\n\t\tg2.setColor(new Color(color, color, color));\r\n\r\n\t\tif (i == 0) {\r\n\t\t\tg2.setColor(Color.RED);\r\n\t\t}\r\n\t\tpaintBranch(g2, root);\r\n\t}",
"public void initTreeModel() {\n\t\t\n\t}",
"public void initTreeModel() {\n\t\t\n\t}",
"public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }",
"public Arvore() {\n initComponents();\n\n DefaultMutableTreeNode raiz = new DefaultMutableTreeNode(\"Raiz\");\n\n DefaultMutableTreeNode filho1 = new DefaultMutableTreeNode(\"Filho 1\");\n DefaultMutableTreeNode filho2 = new DefaultMutableTreeNode(\"Filho 2\");\n\n raiz.add(filho1);\n raiz.add(filho2);\n\n DefaultMutableTreeNode neto1 = new DefaultMutableTreeNode(\"Neto 1\");\n DefaultMutableTreeNode neto2 = new DefaultMutableTreeNode(\"Neto 2\");\n \n filho1.add(neto1);\n filho1.add(neto2);\n\n DefaultMutableTreeNode neto3 = new DefaultMutableTreeNode(\"Neto 3\");\n filho2.add(neto3);\n\n jTree1.setModel(new DefaultTreeModel(raiz));\n }",
"public JTree getTree(){\n return tree;\n }",
"private void loadTree(){ \n PBarHelper.show();\n DataProvider.getTreeHierarchy(mScreenId, new DataProvider.AsyncCallback<ViewNodeJSO>() {\n @Override\n public void onError(Request r, Throwable t) {\n PBarHelper.hide();\n Window.alert(t.getMessage());\n }\n\n @Override\n public void onDownloaded(ViewNodeJSO result) {\n mRoot = result; \n CellTree.Resources res = GWT.create(CustomTreeResources.class);\n //create tree model\n mTreeViewModel = new ViewHierarchyTreeViewModel(result);\n //add selection handler to select view on canvas\n mTreeViewModel.setOnSelectionChangedListener(new OnSelectionChangedListener() { \n @Override\n public void onSelectionChanged(ViewNodeJSO viewNode, boolean selected) { \n ScreenPreviewPage.this.onViewTreeNodeSelectionChanged(viewNode, selected);\n }\n });\n //add hover listener just to highlight view\n mTreeViewModel.setOnViewNodeMouseOverListener(new OnViewNodeMouseOverListener() {\n @Override\n public void onMouseOver(ViewNodeJSO viewNode) {\n if (mTreeViewModel.getSelectedNode() == null) {\n clearCanvas();\n drawRectForView(viewNode);\n }\n }\n });\n //remove old tree if necessary, currently there is no reload support (reload page only)\n if (mCellTree != null) {\n mCellTree.removeFromParent();\n }\n mCellTree = new CellTree(mTreeViewModel, null, res); \n mCellTree.setDefaultNodeSize(1000);//no show more button\n centerPanel.add(mCellTree); \n CellTreeTools.expandAll(mCellTree.getRootTreeNode());\n mCellTree.setAnimationEnabled(true);\n PBarHelper.hide();\n } \n });\n }",
"private void printTree(BinaryNode<AnyType> t) {\r\n\t\tif (t != null) {\r\n\t\t\tprintTree(t.left);\r\n\t\t\tSystem.out.println(t.element);\r\n\t\t\tprintTree(t.right);\r\n\t\t}\r\n\t}",
"private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}",
"public static void main(String[] args) {\n IntTree tree = new IntTree(\r\n new IntTreeNode(\r\n 9, \r\n new IntTreeNode(8,\r\n null,\r\n new IntTreeNode(3)), \r\n new IntTreeNode(7,\r\n new IntTreeNode(5),\r\n null)\r\n ));\r\n\r\n\r\n\r\n\r\n\r\n\r\n tree.printSideways();\r\n tree.slightStutter();\r\n System.out.println(\"---------------------------------\");\r\n tree.printSideways();\r\n\r\n }",
"public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}",
"private Tree<NodeView> generateRectangleTree(final float centerX, final float topY, final Tree<?> tree, int level, final Paint paint, final ExportOptions options) {\n\n //Calculate text bounds\n final String text = tree.getValue().toString();\n paint.setStyle(Paint.Style.FILL);\n paint.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, options.itemTextSize, getResources().getDisplayMetrics()));\n final Rect bounds = getStringBounds(text, paint);\n\n final float left = bounds.left;\n final float bottom = bounds.bottom;\n\n bounds.offset(((int) centerX - (bounds.width() / 2)), ((int) (topY - bounds.top + 1 + paddingTop)));\n\n final int height = bounds.height();\n final float stringHeight = getStringHeight(paint);\n\n final float textX = bounds.left - left;\n final float textY = bounds.bottom - bottom + 1 + ((stringHeight - height) / 2);\n\n final Tree<NodeView> itemTree = new Tree<>(new NodeView(text, bounds, textX, textY));\n\n //Apply padding\n bounds.left -= paddingLeft;\n bounds.top -= paddingTop;\n bounds.right += paddingRight;\n bounds.bottom += paddingBottom + (stringHeight - height);\n\n if (tree.getChildren().size() > 0) {\n float totalWidth = 0;\n float[] sizes = new float[tree.getChildren().size()];\n for (int i = 0; i < tree.getChildren().size(); i++) {\n sizes[i] = getStringWidth(tree.getChildren().get(i).getValue().toString(), paint);\n totalWidth += sizes[i];\n }\n final float totalSpacing = tree.getChildren().size() > 0 ? (tree.getChildren().size() - 1) * horizontalSpacing[level + 1] : 0;\n\n float previousOffset = 0;\n for (int i = 0; i < tree.getChildren().size(); i++) {\n final float offset = previousOffset + (sizes[i] / 2);\n itemTree.addNode(generateRectangleTree(centerX - ((totalWidth + totalSpacing) / 2) + offset, topY + bounds.height()/*+ getStringHeight(paint)*/ /*+ paddingTop + paddingBottom*/ + options.verticalSpacing, tree.getChildren().get(i), level + 1, paint, options));\n previousOffset = offset + (sizes[i] / 2) + horizontalSpacing[level + 1];\n }\n }\n\n return itemTree;\n }",
"public String toString() {\n if (size == 0) {\n return \"Empty tree\";\n }\n\n\n StringBuilder sb = new StringBuilder();\n Node<T> right = root.getRight();\n Node<T> left = root.getLeft();\n\n if (right != null) {\n right.buildBranch(true, \"\", sb);\n }\n\n sb.append(root.getData() + \"\\n\");\n\n if (left != null)\n left.buildBranch(false, \"\", sb);\n\n return sb.toString();\n }",
"private void printTree(AvlNode<E> node){\n if(node != null){\n printTree(node.left);\n System.out.print(node.value);\n System.out.print(\" \");\n printTree(node.right);\n }\n }",
"public ChangeBinaryTree(){\n\t\tsetLayout(new BorderLayout());\n\t\tJPanel p1 = new JPanel(new GridLayout(1,5));\n\t\tp1.add(new JLabel(\"Enter a value:\"));\n\t\tp1.add(jtfValue);\n\t\tp1.add(jbtSearch);\n\t\tp1.add(jbtInsert);\n\t\tp1.add(jbtRemove);\n\t\tadd(p1,BorderLayout.SOUTH);\n//\t\tadd(paintLinkedList,BorderLayout.CENTER);\n/*\t\tjbtSearch.addActionListener(new SearchListener());\n\t\tjbtInsert.addActionListener(new InsertListener());\n\t\tjbtRemove.addActionListener(new jbtRemoveListener());*/\n\t}",
"public String getTree ( ) {\n\n String tree;\n StringWriter s = new StringWriter();\n PrintWriter out = null;\n\n try {\n out = new PrintWriter(s);\n } catch ( Exception ex ) {};\n\n program.printIndividual(param.Parameters.STATE, out);\n\n tree = s.toString();\n String list2[] = tree.split(\"\\n\");\n\n out.close();\n try { s.close(); } catch ( Exception e ) {};\n\n return list2[list2.length - 1];\n\n }",
"static void printTree(AbstractNode root) throws IOException {\n if (root == null) {\n return;\n }\n System.out.println(root.toString());\n if(root.getTypeNode() == 0) {\n ConscellNode nextNode = (ConscellNode)root;\n printTree(nextNode.getFirst());\n printTree(nextNode.getNext());\n }\n }",
"public String bottomView(Tree<T> tree)\n {\n // Your code here\n Node root = tree.getRoot();\n bottomViewUtil(root, 0);\n StringBuilder str = new StringBuilder();\n for(Map.Entry<Integer, Node> e: map.entrySet()){\n str.append(e.getValue().data).append(\" \");\n }\n return str.toString();\n }"
] | [
"0.75365156",
"0.7253983",
"0.71968085",
"0.7112814",
"0.70762324",
"0.6982406",
"0.6967107",
"0.6944461",
"0.69378316",
"0.6894723",
"0.6892162",
"0.6875118",
"0.68705547",
"0.68357366",
"0.68296534",
"0.681333",
"0.6811807",
"0.6788014",
"0.67609113",
"0.67121583",
"0.66096413",
"0.660903",
"0.6603529",
"0.6597173",
"0.658625",
"0.656424",
"0.6562162",
"0.6536075",
"0.652715",
"0.6524086",
"0.6511537",
"0.64887285",
"0.6468121",
"0.64580595",
"0.64524704",
"0.64406127",
"0.6433816",
"0.64268655",
"0.6419402",
"0.6413841",
"0.6401785",
"0.63904047",
"0.63899887",
"0.63737905",
"0.63694197",
"0.63527787",
"0.63511145",
"0.633891",
"0.6329824",
"0.6313389",
"0.6310072",
"0.6302765",
"0.62927574",
"0.6288691",
"0.6285148",
"0.62819916",
"0.62621164",
"0.62589943",
"0.62577957",
"0.6253968",
"0.624919",
"0.623871",
"0.6238453",
"0.62313026",
"0.6223088",
"0.621514",
"0.62082404",
"0.62049615",
"0.6196978",
"0.619485",
"0.61925584",
"0.6189174",
"0.6188795",
"0.6179499",
"0.61757016",
"0.61664826",
"0.61640465",
"0.6163594",
"0.61586404",
"0.6155358",
"0.6153943",
"0.61538947",
"0.6148131",
"0.6148027",
"0.6147749",
"0.6147749",
"0.61477023",
"0.6146145",
"0.6141898",
"0.6139079",
"0.61349994",
"0.6126753",
"0.6121076",
"0.6119275",
"0.61154395",
"0.6115111",
"0.6112865",
"0.6107051",
"0.6086828",
"0.60837424",
"0.607586"
] | 0.0 | -1 |
this method translates a node v at the place of node u | private void transplant(Node u, Node v) {
if (u.getParent() == mSentinel) {// if u is the root
this.mRoot = v;// simply make v the root
} else if (u == u.getParent().getLeftChild()) {// if u is a left child
// then make v u's
// parent's left child
u.getParent().setLeftChild(v);
} else {
u.getParent().setrightChild(v);// otherwise u is a right child and
// we should make v u's parent's
// right child
}
if (v != mSentinel) {
v.setParent(u.getParent());// and of course if v is not empty make
// u's parent - v's parent
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void transplant(Node<E> u, Node<E> v) {\n\t //compares the u.getParent() and the sentinel \n \t\tif (u.getParent() == sentinel) {\n\t\t\troot = v;\n\t\t} else if (u == u.getParent().getLeftChild()) {\n\t\t\tu.getParent().setLeftChild(v);\n\t\t} else {\n\t\t\tu.getParent().setRightChild(v);\n\t\t}\n\t\tif (v != null) {\n\t\t\tv.setParent(u.getParent());\n\t\t}\n\n\n }",
"public void RBTransplant(Website root, Website u, Website v) {\r\n\t\tif (u.getParent() == null) { // If U is the root\r\n\t\t\tsetRoot(v); // Root is now V\r\n\t\t} else if (u == u.getParent().getLeft()) {// If left child,\r\n\t\t\tu.getParent().setLeft(v); // parent takes V as new Child\r\n\t\t} else {\r\n\t\t\tu.getParent().setRight(v); // else U is a right Child\r\n\t\t}\r\n\t\tif(v!=null) {\r\n\t\tv.setParent(u.getParent()); // updates its parent pointer to u's old parent\r\n\t\t}\r\n\t}",
"void visit(Graph.Vertex u, Graph.Vertex v) {\n\t\tDFSVertex bv = getVertex(v);\n\t\tbv.seen = true;\n\t\tbv.parent = u;\n\t\tbv.distance = distance(u) + 1;\n\t}",
"private void merge(int u, int v){\n\t\tArrayList<Integer> rvAdj = id[root(v)].getAdjList(); // root(v)'s adj list\n\t\tArrayList<Integer> ruAdj = id[root(u)].getAdjList(); // root(u)'s adj list\n\n\t\tfor( int i = 0; i < ruAdj.size(); i++){ // remove internal edges\n\t\t\tif(find(ruAdj.get(i), v)){\n\t\t\t\truAdj.remove(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfor( int i = 0; i < rvAdj.size(); i++){ // combine adj lists\n\t\t\tif(!find(rvAdj.get(i), u)){ // avoid self-loops\n\t\t\t\truAdj.add(rvAdj.get(i));\n\t\t\t}\n\t\t}\n\t\tkeyPool.remove(keyPool.indexOf(root(v)));\n\t\tunion(u, v); // important to union after to access v's adj list\n\t}",
"private NodoGrafo Vert2Nodo(int v) {\n\t\tNodoGrafo aux = origen;\n\t\twhile (aux != null && aux.nodo != v)\n\t\t\taux = aux.sigNodo;\t\t\n\t\treturn aux;\n\t}",
"public static void union(int u, int v) {\n\t\tu = root(u); // optimizations\n\t\tv = root(v); // to make find faster\n\t\tif (u == v) return; // already in same component\n\t\t\n\t\tif (size[u] >= size[v]) {\n\t\t\tp[v] = u;\n\t\t\tsize[u] += size[v];\n\t\t} else {\n\t\t\tp[u] = v;\n\t\t\tsize[v] += size[u];\n\t\t}\n\t}",
"void ldraw_addVertexWithUV(double x, double y, double z, double u, double v) {\n lDraw.a(x, y, z, u, v);\n }",
"public void addEdge(int u, int v) {\n if (u > nodes.size() || v > nodes.size() || u <= 0 || v <= 0) {\n throw new IllegalArgumentException(\"An invalid node was given\");\n }\n // note that we have to subtract 1 from each since node 1 is located in index 0\n nodes.get(u - 1).addEdge(nodes.get(v - 1));\n }",
"public boolean insert(int u, int v) {\n\n forward.addEdge(u, v);\n backward.addEdge(v, u);\n\n // classify the insertion of the edge\n int type = T.classifyInsertion(u, v);\n\n // type 1 insertion: do nothing\n if (type == 1) return true;\n\n //type 3 insertion: absorb free nodes\n if (type == 3) {\n\n MetaNode x = T.getMetaNode(u);\n MetaNode y = T.getMetaNode(v);\n\n // least common ancestor of x and y\n MetaNode z = T.leastCommonAncestor(x, y);\n\n HashSet<Integer> F = z.getMid().getSet();\n ArrayList<Integer> orderF = z.getMid().getOrder();\n\n HashSet<Integer> A = new HashSet<Integer>();\n HashSet<Integer> B = new HashSet<Integer>();\n\n int recourse = 0;\n\n if (F.contains(v)) {\n forward.restrictedDFS(v, F, A);\n ArrayList<Integer> orderA = new ArrayList<Integer>();\n orderA.addAll(orderF);\n orderA.retainAll(A);\n z.getMid().removeFromSet(A);\n recourse = T.ADD(z.getRight(), A, B, orderA, new ArrayList<Integer>(), forward, backward);\n }\n if (F.contains(u)) {\n backward.restrictedDFS(u, F, B);\n ArrayList<Integer> orderB = new ArrayList<Integer>();\n orderB.addAll(orderF);\n orderB.retainAll(B);\n z.getMid().removeFromSet(B);\n recourse = T.ADD(z.getLeft(), A, B, new ArrayList<Integer>(), orderB, forward, backward);\n }\n\n totalRecourse += recourse;\n\n // break it down into an STP after if they are in same set\n if (T.getMetaNode(u).equals(T.getMetaNode(v)))\n type = 2;\n }\n\n //type 2 insertion: break down into further STP\n if (type == 2) {\n\n // the set containing both u and v\n MetaNode x = T.getMetaNode(u);\n\n // nodes we wants to search\n HashSet<Integer> S = x.getSet();\n\n // nodes found in forward search\n HashSet<Integer> R = new HashSet<Integer>();\n\n // nodes found in backward search\n HashSet<Integer> L = new HashSet<Integer>();\n\n forward.restrictedDFS(v, S, R);\n backward.restrictedDFS(u, S, L);\n\n int recourse = 0;\n\n recourse += L.size(); // CAN BE IMPROVED\n recourse += R.size();\n\n totalRecourse += recourse;\n\n // break down x into 3 children\n ArrayList<Integer> orderL = new ArrayList<Integer>();\n orderL.addAll(x.getOrder());\n orderL.retainAll(L);\n\n MetaNode xL = new MetaNode(L, orderL);\n\n ArrayList<Integer> orderR = new ArrayList<Integer>();\n orderR.addAll(x.getOrder());\n orderR.retainAll(R);\n\n MetaNode xR = new MetaNode(R, orderR);\n\n HashSet<Integer> F = new HashSet<Integer>();\n F.addAll(S);\n F.removeAll(L);\n F.removeAll(R);\n\n ArrayList<Integer> orderF = new ArrayList<Integer>();\n orderF.addAll(x.getOrder());\n orderF.retainAll(F);\n\n MetaNode xF = new MetaNode(F, orderF);\n\n x.breakDown(xL, xF, xR);\n }\n\n return false;\n }",
"public DynamicCuboid setUV(float u, float v) {\n return this.setU(u).setV(v);\n }",
"protected Node<T> removeFixupCase2(Node<T> u) {\n\t\tNode<T> w = u.parent;\n\t\tNode<T> v = w.right;\n\t\tpullBlack(w); // w.left\n\t\tflipLeft(w); // w is now red\n\t\tNode<T> q = w.right;\n\t\tif (q.colour == red) { // q-w is red-red\n\t\t\trotateLeft(w);\n\t\t\tflipRight(v);\n\t\t\tpushBlack(q);\n\t\t\tif (v.right.colour == red)\n\t\t\t\tflipLeft(v);\n\t\t\treturn q;\n\t\t} else {\n\t\t\treturn v;\n\t\t}\n\t}",
"protected Node<T> removeFixupCase1(Node<T> u) {\n\t\tflipRight(u.parent);\n\t\treturn u;\n\t}",
"public void AgregarVertice(int v) {\n\t\tNodoGrafo aux = new NodoGrafo();\n\t\taux.nodo = v;\n\t\taux.arista = null;\n\t\taux.sigNodo = origen;\n\t\torigen = aux;\n\t}",
"protected Node<T> removeFixupCase3(Node<T> u) {\n\t\tNode<T> w = u.parent;\n\t\tNode<T> v = w.left;\n\t\tpullBlack(w);\n\t\tflipRight(w); // w is now red\n\t\tNode<T> q = w.left;\n\t\tif (q.colour == red) { // q-w is red-red\n\t\t\trotateRight(w);\n\t\t\tflipLeft(v);\n\t\t\tpushBlack(q);\n\t\t\treturn q;\n\t\t} else {\n\t\t\tif (v.left.colour == red) {\n\t\t\t\tpushBlack(v); // both v's children are red\n\t\t\t\treturn v;\n\t\t\t} else { // ensure left-leaning\n\t\t\t\tflipLeft(v);\n\t\t\t\treturn w;\n\t\t\t}\n\t\t}\n\t}",
"public void setTo(Vertex<VV> vertex)\r\n { this.to = vertex; }",
"static PointDouble translate(PointDouble p, Vec v) {\n return new PointDouble(p.x + v.x , p.y + v.y);\n }",
"public void setUV(float u0, float v0,\n float u1, float v1,\n float u2, float v2) {\n // sets & scales uv texture coordinates to center of the pixel\n u_array[0] = (u0 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[1] = (u1 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[2] = (u2 * F_TEX_WIDTH + 0.5f) * 65536f;\n v_array[0] = (v0 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[1] = (v1 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[2] = (v2 * F_TEX_HEIGHT + 0.5f) * 65536f;\n }",
"public void setFrom(Vertex<VV> vertex)\r\n { this.from = vertex; }",
"public void add (V u, V v) {\n this.add(u); this.add(v);\n dag.get(u).add(v);\n \n List<V> newVertexOrder = getNewVertexOrderIfAcyclic();\n if(newVertexOrder == null){\n \t/**\n \t * This will be null only when the graph is cyclic. Remove the current added edge to remove the cycle.\n \t */\n \tremove(u,v);\n }else{\n \tvertexOrder = newVertexOrder;\n }\n }",
"protected void swapColors(Node<T> u, Node<T> w) {\n\t\tbyte tmp = u.colour;\n\t\tu.colour = w.colour;\n\t\tw.colour = tmp;\n\t}",
"private void transPose(graph g) {\n\t\tIterator it = g.getV().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tnode_data temp = (node_data) it.next();\n\t\t\tif(g.getE(temp.getKey())!=null) {\n\t\t\t\tIterator it1 = g.getE(temp.getKey()).iterator();\n\t\t\t\twhile (it1.hasNext()) {\n\t\t\t\t\tedge_data temp1 = (edge_data) it1.next();\n\t\t\t\t\tif (temp1 != null && temp1.getTag() == 0) {\n\t\t\t\t\t\tif (g.getEdge(temp1.getDest(), temp1.getSrc()) != null) {\n\t\t\t\t\t\t\tEdge temps = new Edge((Edge)g.getEdge(temp1.getSrc(),temp1.getDest()));\n\t\t\t\t\t\t\tdouble weight1 = g.getEdge(temp1.getSrc(),temp1.getDest()).getWeight();\n\t\t\t\t\t\t\tdouble weight2 = g.getEdge(temp1.getDest(),temp1.getSrc()).getWeight();\n\t\t\t\t\t\t\tg.connect(temp1.getSrc(),temp1.getDest(),weight2);\n\t\t\t\t\t\t\tg.connect(temps.getDest(),temps.getSrc(),weight1);\n\t\t\t\t\t\t\tg.getEdge(temps.getDest(), temps.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.getEdge(temps.getSrc(),temps.getDest()).setTag(1);\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tg.connect(temp1.getDest(), temp1.getSrc(), temp1.getWeight());\n\t\t\t\t\t\t\tg.getEdge(temp1.getDest(), temp1.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.removeEdge(temp1.getSrc(), temp1.getDest());\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected void removeFixup(Node<T> u) {\n\t\twhile (u.colour > black) {\n\t\t\tif (u == r) {\n\t\t\t\tu.colour = black;\n\t\t\t} else if (u.parent.left.colour == red) {\n\t\t\t\tu = removeFixupCase1(u);\n\t\t\t} else if (u == u.parent.left) {\n\t\t\t\tu = removeFixupCase2(u);\n\t\t\t} else {\n\t\t\t\tu = removeFixupCase3(u);\n\t\t\t}\n\t\t}\n\t\tif (u != r) { // restore left-leaning property if needed\n\t\t\tNode<T> w = u.parent;\n\t\t\tif (w.right.colour == red && w.left.colour == black) {\n\t\t\t\tflipLeft(w);\n\t\t\t}\n\t\t}\n\t}",
"protected Node introduceSVNode(NodeList nodesToJoin, Node sv) {\n Node introducedNode;\n NodeList parents;\n Node auxNode;\n Function functionSV;\n UtilityPotential potSV;\n Function functionNewNode;\n\n parents = sv.getParentNodes();\n\n if (nodesToJoin.size() == parents.size()) {\n //It isn't necessary to introduce a new super value node\n introducedNode = sv;\n } else {\n String nameOfNewNode;\n Node newNode;\n\n //Create a node to join the 'nodesToJoin'\n nameOfNewNode = nodesToJoin.elementAt(0).getName() + nodesToJoin.elementAt(1).getName();\n newNode = new Continuous();\n newNode.setName(nameOfNewNode);\n newNode.setKindOfNode(Node.UTILITY);\n\n //Add the new node to the diagram\n try {\n diag.addNode(newNode);\n } catch (InvalidEditException iee) {\n };\n diag.addRelation(newNode);\n\n //Removal of the links among the nodes 'nodesToJoin'\n //and the node 'sv' and redirect the 'nodesToJoin'\n //to the new super value node\n for (int i = 0; i < nodesToJoin.size(); i++) {\n auxNode = nodesToJoin.elementAt(i);\n\n //Remove the link to the node 'sv'\n try {\n diag.removeLink(auxNode, sv);\n } catch (InvalidEditException iee) {\n ;\n }\n\n //Direct the link from 'auxNode' to the new super value node\n try {\n diag.createLink(auxNode, newNode);\n } catch (InvalidEditException iee) {\n ;\n }\n\n }\n\n //Set the potentials as arguments in newNode\n for (int i = 0; i < nodesToJoin.size(); i++) {\n auxNode = nodesToJoin.elementAt(i);\n ReductionAndEvalID.updateArgumentChild(\n (IDWithSVNodes) diag,\n auxNode,\n newNode);\n }\n\n //Create a link between 'newNode' and 'sv'\n try {\n diag.createLink(newNode, sv);\n } catch (InvalidEditException iee) {\n ;\n }\n\n //Set the appropiate kind of super value node\n potSV = ((UtilityPotential) diag.getRelation(sv).getValues());\n functionSV = potSV.getFunction();\n if (functionSV.getClass() == SumFunction.class) {\n functionNewNode = new SumFunction();\n } else {\n functionNewNode = new ProductFunction();\n }\n ((UtilityPotential) (diag.getRelation(newNode).getValues())).setFunction(functionNewNode);\n //Set the potential of newNode as arguments in sv\n ReductionAndEvalID.updateArgumentChild(\n (IDWithSVNodes) diag,\n newNode,\n sv);\n\n introducedNode = newNode;\n }\n return introducedNode;\n }",
"protected void addFixup(Node<T> u) {\n\t\twhile (u.colour == red) {\n\t\t\tif (u == r) { // u is the root - done\n\t\t\t\tu.colour = black;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tNode<T> w = u.parent;\n\t\t\tif (w.left.colour == black) { // ensure left-leaning\n\t\t\t\tflipLeft(w);\n\t\t\t\tu = w;\n\t\t\t\tw = u.parent;\n\t\t\t}\n\t\t\tif (w.colour == black)\n\t\t\t\treturn; // no red-red edge = done\n\t\t\tNode<T> g = w.parent; // grandparent of u\n\t\t\tif (g.right.colour == black) {\n\t\t\t\tflipRight(g);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tpushBlack(g);\n\t\t\t\tu = g;\n\t\t\t}\n\t\t}\n\t}",
"protected void visit(Graph<VLabel, ELabel>.Vertex v) {\n }",
"Object translate( Object source );",
"int query_up(int u, int v) {\n int uchain, vchain = chainInInd[v], ans = 0;\n // uchain and vchain are chain numbers of u and v\n int last = -1;\n while (true) {\n uchain = chainInInd[u];\n if (uchain == vchain) {\n // Both u and v are in the same chain, so we need to query from u to v, update answer and break.\n // We break because we came from u up till v, we are done\n if (u == v) break;\n out.println(\"query = \" + (posInBase[v]) + \" \" + (posInBase[u]));\n out.println(query_tree(1, posInBase[v], posInBase[u], 1, pointer));\n ans += query_tree(1, posInBase[v], posInBase[u], 1, pointer);\n // Above is call to segment tree query function\n break;\n }\n out.println(\"query = \" + posInBase[chainInHead[uchain]] + \" \" + (posInBase[u]));\n out.println(query_tree(1, posInBase[chainInHead[uchain]], posInBase[u], 1, pointer));\n ans += query_tree(1, posInBase[chainInHead[uchain]], posInBase[u], 1, pointer);\n // Above is call to segment tree query function. We do from chainHead of u till u. That is the whole chain from\n // start till head. We then update the answer\n u = chainInHead[uchain]; // move u to u's chainHead\n u = par[u]; //Then move to its parent, that means we changed chains\n }\n out.println(ans+\" =ans\");\n return ans;\n }",
"public Vector transform(Vector v) {\n\t\treturn new Vector(a * v.x + c, b * v.y + d);\n\t}",
"public Vector3D addVector(Vector3D u, Vector3D v) {\n\t\treturn new Vector3D(this.x = u.x + v.x, this.y = u.y + v.y, \n\t\t\t\tthis.z = u.z + v.z);\n\t}",
"public Node(E v, Node l, Node r)\n { \n value = v;\n left = l;\n right = r;\n }",
"Edge(Vertex u, Vertex v) {\n From = u;\n To = v;\n\n }",
"public Entrepot(Vector v){\r\n\t\tthis.id =(Integer)v.get(0);\r\n\t\tthis.localisation=new Localisation(\r\n\t\t\t\t(Integer)v.get(1),\r\n\t\t\t\t(String)v.get(2),\r\n\t\t\t\t(String)v.get(3),\r\n\t\t\t\t(String)v.get(4));\r\n\t\tthis.telephone=(String)v.get(5);\r\n\t}",
"public void add(int v) {\n if (isIn(v)) return; // do not add if it v is in set\n TNode t = root;\n while (t != null) {\n if (v < t.element) { // if v is less than current node\n if (t.left == null) { // add node to left when left is null\n t.left = new TNode(v, null, null);\n return;\n }\n t = t.left;\n }\n else {\n if (t.right == null) { // add node to right when right is null\n t.right = new TNode(v, null, null);\n return;\n }\n t = t.right;\n }\n }\n }",
"private void traverseHelper(Graph<VLabel, ELabel>.Vertex v) {\n PriorityQueue<Graph<VLabel, ELabel>.Vertex> fringe =\n new PriorityQueue<Graph<VLabel,\n ELabel>.Vertex>(_graph.vertexSize(), _comparator);\n fringe.add(v);\n while (fringe.size() > 0) {\n Graph<VLabel, ELabel>.Vertex curV = fringe.poll();\n try {\n if (!_marked.contains(curV)) {\n _marked.add(curV);\n visit(curV);\n for (Graph<VLabel, ELabel>.Edge e: _graph.outEdges(curV)) {\n if (!_marked.contains(e.getV(curV))) {\n preVisit(e, curV);\n fringe.add(e.getV(curV));\n }\n }\n }\n } catch (StopException e) {\n _finalVertex = curV;\n return;\n }\n }\n }",
"public int union(int u, int v) {\n int p1 = find(u), p2 = find(v);\n if (p1 == p2) {\n return p1;\n }\n int s1 = _sizes[p1], s2 = _sizes[p2];\n if (s1 > s2) {\n _sizes[p1] += s2;\n// int i = 1;\n// while (s2 > 0) {\n// if (_parents[i] == p2) {\n// _parents[i] = p1;\n// s2 -= 1;\n// }\n// i += 1;\n// }\n _parents[p2] = p1;\n return s1;\n } else {\n _sizes[p2] += s1;\n// int j = 1;\n// while (s1 > 0) {\n// if (_parents[j] == p1) {\n// _parents[j] = p2;\n// s1 -= 1;\n// }\n// j += 1;\n// }\n _parents[p1] = p2;\n return s2;\n }\n }",
"GWTJahiaNodeProperty translate(GWTJahiaNodeProperty property, GWTJahiaItemDefinition definition, String srcLanguage, String destLanguage, String siteUUID) throws GWTJahiaServiceException;",
"public Vector get_vTo() {\n\t\treturn _vTo;\n\t}",
"private void updateLabels(ArSceneView sceneView,Node node)\n {\n\n Vector3 camera = sceneView.getScene().getCamera().getWorldPosition();\n Vector3 uiPosition = node.getWorldPosition();\n Vector3 direction = Vector3.subtract(camera, uiPosition);\n Quaternion lookRotation = Quaternion.lookRotation(direction, Vector3.up());\n node.setLocalPosition(new Vector3(0,0.02f,0));\n node.setWorldRotation(lookRotation);\n }",
"public double[] partialU(double u, double v) {\n return null;\n }",
"private Node put(Node x, K k, V v) {\n if (x == null) {\n return new Node(k, v, 1, RED);\n }\n int cmp = k.compareTo(x.key);\n if (cmp < 0) {\n x.left = put(x.left, k, v);\n } else if (cmp > 0) {\n x.right = put(x.right, k, v);\n } else {\n x.val = v;\n }\n // Lean left\n if (isRed(x.right) && !isRed(x.left)) {\n x = rotateLeft(x);\n }\n // Balance 4-node\n if (isRed(x.left) && isRed(x.left.left)) {\n x = rotateRight(x);\n }\n // Split 4-node\n if (isRed(x.left) && isRed(x.right)) {\n flipColors(x);\n }\n x.size = size(x.left) + size(x.right) + 1;\n\n return x;\n }",
"private static void outputVertex(RootedTree tree, StringBuffer sb, Object v) {\r\n\t\tif (!tree.isLeaf(v)) {\r\n\t\t\tsb.append('(');\r\n\t\t\tList l = tree.getChildrenOf(v);\r\n\t\t\tfor (int i = 0; i < l.size(); i++) {\r\n\t\t\t\toutputVertex(tree, sb, l.get(i));\r\n\t\t\t\tif (i != l.size() - 1) sb.append(',');\r\n\t\t\t}\r\n\t\t\tsb.append(')');\r\n\t\t}\r\n\t\t// Call this to make the vertex's label nicely formatted for Nexus\r\n\t\t// output.\r\n\t\tString s = getNexusCompliantLabel(tree, v);\r\n\t\tif (s.length() != 0) sb.append(s);\r\n\t\tObject p = tree.getParentOf(v);\r\n\t\tif (p != null) {\r\n\t\t\tdouble ew = tree.getEdgeWeight(tree.getEdge(p, v));\r\n\t\t\tif (ew != 1.0) sb.append(\":\" + Double.toString(ew));\r\n\t\t}\r\n\t}",
"void addEdge(Vertex u, Vertex v) {\r\n\t\tu.addNeighbor(v);\r\n\t}",
"public abstract Point_3 evaluate(double u, double v);",
"@Override\n public void visit(NodeVisitor v){\n v.visit(this);\n }",
"public void addEdge(int u, int v)\n {\n // Add v to u's list.\n adjList[u].add(v);\n }",
"private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }",
"private void update(int v, int from, int to, int value) {\n\t\tNode node = heap[v];\n\n\t\t/**\n\t\t * If the updating-range contains the portion of the current Node We lazily update it. This means We\n\t\t * do NOT update each position of the vector, but update only some temporal values into the Node;\n\t\t * such values into the Node will be propagated down to its children only when they need to.\n\t\t */\n\t\tif (contains(from, to, node.from, node.to)) {\n\t\t\tchange(node, value);\n\t\t}\n\n\t\tif (node.size() == 1)\n\t\t\treturn;\n\n\t\tif (intersects(from, to, node.from, node.to)) {\n\t\t\t/**\n\t\t\t * Before keeping going down to the tree We need to propagate the the values that have been\n\t\t\t * temporally/lazily saved into this Node to its children So that when We visit them the values are\n\t\t\t * properly updated\n\t\t\t */\n\t\t\tpropagate(v);\n\n\t\t\tupdate(2 * v, from, to, value);\n\t\t\tupdate(2 * v + 1, from, to, value);\n\n\t\t\tnode.sum = heap[2 * v].sum + heap[2 * v + 1].sum;\n\t\t\tnode.min = Math.min(heap[2 * v].min, heap[2 * v + 1].min);\n\t\t}\n\t}",
"public abstract void visit(V v) throws VisitorException;",
"protected Node<T, V> getLocalVersionOfNode(Node<T, V> node) {\r\n\t\treturn ext2int.get(node.getPoint());\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic void translate(){\n\t\tnodeSigs();\n\t\tedgeSigs();\n\t\tpre_source_valid();\n\t\tList<Object> constraints = new ArrayList<Object>();\n\t\tconstraints.addAll(hash.keySet());\n\t\tfor (int i = 0; i < constraints.size() ; i++) {\n\t\t\tfor (int j = i + 1; j < constraints.size() ; j++) {\n\t\t\t\tObject iter = constraints.get(i), iter1 = constraints.get(j);\n\t\t\t\tObject[] overlap = findOverlap(iter, iter1);\n\t\t\t\tif(overlap == null) continue;\n\t\t\t\talloycommands.add(new Object[]{iter, iter1});\n\t\t\t\tbuffer.append(\"run{(\" + hash.get(iter) + \"[] and not \" + hash.get(iter1) + \"[]) or (not \" + hash.get(iter) + \"[] and \" + hash.get(iter1) + \"[])} for 0 but \");\n\t\t\t\tList<Node> nodes = (List<Node>) overlap[0];\n\t\t\t\tList<Arrow> edges = (List<Arrow>) overlap[1];\n\t\t\t\tList<String> strings = new ArrayList<String>();\n\t\t\t\tfor(Node in : nodes){\n\t\t\t\t\tstrings.add(nodeSig(in));\n\t\t\t\t}\n\t\t\t\tfor(Arrow ie : edges){\n\t\t\t\t\tstrings.add(edgeSig(ie));\n\t\t\t\t}\n\t\t\t\tbuffer.append(\"5 \" + strings.get(0));\n\t\t\t\tfor (int k = 1; k < strings.size(); k++) {\n\t\t\t\t\tbuffer.append(\", 5 \" + strings.get(k));\n\t\t\t\t}\n\t\t\t\tbuffer.append(LINE);\n\t\t\t}\n\t\t}\n//\t\tif(check == null)\n//\t\t\tbuffer.append(\"run {}\");\n//\t\telse\n//\t\t\ttranslate(check, \"check\");\n//\t\tbuffer.append(\" for 5\");\n\t\t\t\n\t}",
"public CMLVector3 projectOnto(CMLVector3 v) {\r\n Vector3 veucl3 = this.getEuclidVector3();\r\n Vector3 vv = null;\r\n try {\r\n vv = (veucl3 == null) ? null : veucl3.projectOnto(v\r\n .getEuclidVector3());\r\n } catch (EuclidRuntimeException je) {\r\n }\r\n return (vv == null) ? null : CMLVector3.createCMLVector3(vv);\r\n }",
"protected void preVisit(Graph<VLabel, ELabel>.Edge e,\n Graph<VLabel, ELabel>.Vertex v0) {\n }",
"public static void unitify(mVector3 v){\r\n\t\tfloat r = (float)Math.sqrt(v.x*v.x+v.y*v.y+v.z*v.z);\r\n\t\tv.x = v.x/r;\r\n\t\tv.y = v.y/r;\r\n\t\tv.z = v.z/r;\r\n\t}",
"public Vector3D multVector(Vector3D u, Vector3D v) {\n\t\treturn new Vector3D(\n\t\t\t\tthis.x = (u.y * v.z) - (u.z * v.y), \n\t\t\t\tthis.y = (u.z * v.x) - (u.x * v.z),\n\t\t\t\tthis.z = (u.x * v.y) - (u.y * v.x));\n\t}",
"private RegressionTreeNode traverseNumericalNode(Double v) {\n\t\tdouble val = (Double) this.value;\n\t\tif(v.compareTo(val) <= 0){\n\t\t\treturn this.leftChild;\n\t\t}else{\n\t\t\treturn this.rightChild;\n\t\t}\n\t}",
"public TreeNode(T v, TreeNode l, TreeNode r) {\n value = v; left = l; right = r;\n }",
"Node invert(String text);",
"public void EliminarVertice(int v) {\n\t\tNodoGrafo aux = origen;\n\t\tif (origen.nodo == v) \n\t\t\torigen = origen.sigNodo;\t\t\t\n\t\twhile (aux != null){\n\t\t\t// remueve de aux todas las aristas hacia v\n\t\t\tthis.EliminarAristaNodo(aux, v);\n\t\t\tif (aux.sigNodo!= null && aux.sigNodo.nodo == v) {\n\t\t\t\t// Si el siguiente nodo de aux es v , lo elimina\n\t\t\t\taux.sigNodo = aux.sigNodo.sigNodo;\n\t\t\t}\n\t\t\taux = aux.sigNodo;\n\t\t}\t\t\n\t}",
"abstract Vertex apply(Vertex v);",
"public void valor(V v) {\n value = v;\n }",
"public void accept(UnarniOperator uo) {\n\t\tvisitChildren(uo);\n\t}",
"protected void postVisit(Graph<VLabel, ELabel>.Vertex v) {\n }",
"@Override\r\n\tpublic void translate(float vx, float vy) {\n\t\t\r\n\t}",
"R apply(T t, U u, V v);",
"public double[] partialV(double u, double v) {\n return null;\n }",
"protected void xremove(Node<T> u) {\n\t\tif (u == r) {\n\t\t\tremove();\n\t\t} else {\n\t\t\tif (u == u.parent.left) {\n\t\t\t\tu.parent.left = nil;\n\t\t\t} else {\n\t\t\t\tu.parent.right = nil;\n\t\t\t}\n\t\t\tu.parent = nil;\n\t\t\tr = merge(r, u.left);\n\t\t\tr = merge(r, u.right);\n\t\t\tr.parent = nil;\n\t\t\tn--;\n\t\t}\n\t}",
"public void union(Vertex v1, Vertex v2) {\n\n // find the two vertices' path root\n Vertex r1 = find(v1);\n Vertex r2 = find(v2);\n\n // if the two roots are equal, just return\n if(r1.equals(r2)){\n return;\n } else if(r1.getSize()>r2.getSize()){\n // if the r1 path size is greater than r2\n // just change the vertex 2's root to vertex 1\n r2.setRoot(r1);\n // increment the size of r1 set\n r1.setSize(r2.getSize());\n } else {\n r1.setRoot(r2);\n r2.setSize(r1.getSize());\n }\n \n }",
"static void unifyVariable(Solution solution, Type.Variable v, Type against) {\n\t\tif (v == against) solution.trivial();\n\t\telse if (Variable(against, a -> solution.alias(v, a))) ;\n\t\telse if (occurs(v, against)) solution.recursive(v, against);\n\t\telse solution.substitute(v, against);\n\t}",
"public ArrayList<String> shortestPath(String u, String v)\n {\n ArrayList<String> path = new ArrayList<>();\n HashMap<String, Boolean> flag = new HashMap<>();\n HashMap<String, String> prev = new HashMap<>();\n\n Queue<GraphVertex> queue = new LinkedList<>();\n HashMap<String, Boolean> visited = new HashMap<>();\n\n GraphVertex src = graphVertexHashMap.get(u);\n flag.put(src.getVertexName(), true);\n queue.add(src);\n visited.put(src.getVertexName(), true);\n\n while(!queue.isEmpty()){\n GraphVertex node = queue.poll();\n\n HashMap<String, GraphVertex> edges = node.getOutDegrees();\n Iterator it = edges.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry pair = (Map.Entry)it.next();\n if(flag.get(pair.getKey()) == null || flag.get(pair.getKey()) == false){\n String vertex = (String)pair.getKey();\n flag.put(vertex, true);\n prev.put(vertex, node.getVertexName());\n queue.add(edges.get(pair.getKey()));\n }\n }\n\n }\n path = backTrackPath(prev, u, v);\n return path;\n }",
"public void removeEdgeTo(char v) {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.outList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\t// remove from neighbor's inList\r\n\t\t\t\tneighbor.vertex.inList.remove(findNeighbor(neighbor.vertex.inList, currentVertex.label)); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tcurrentVertex.outList.remove(neighbor); // remove from current's outList\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Edge to \" + v + \" does not exist.\");\r\n\t}",
"public void add(T v) {\n add(new Node(v));\n }",
"public void translate(int i, int j) {\n\t\t\n\t}",
"void query(int u, int v) {\n int lca = lca2(u, v, spar, dep);\n// out.println(query_up(u, lca) + \" dv\");\n// out.println(query_up(v, lca) + \" ds\");\n int ans = query_up(u, lca) + query_up(v, lca); // One part of path\n out.println(ans);\n// if (temp > ans) ans = temp; // take the maximum of both paths\n// printf(\"%d\\n\", ans);\n }",
"public V addVertex(V v);",
"public void accept(uWDLVisitor v) {\n\t\tv.visit(this);\r\n\t}",
"int query_tree(int v, int l, int r, int tl, int tr) {\n int ans = query(1, l, r, r, tl, tr);\n return r - l + 1 - ans;\n }",
"public Node (int id, float x ,float y) {\n\tthis.id = id;\n\tthis.x = x;\n\tthis.y = y;\n\telements = new ArrayList();\n\tu = 0.0;\n\tv = 0.0;\n }",
"private void modifyFringe(int v, int w) {\n\t\tgetEdge(v, w).setSelected(true);\n\t\tgetEdge(getVertex(w).getParent(), w).setSelected(false);\n\t\tdouble cost = newCost(v, w);\n\t\tGreedyVertex vertex = getVertex(w);\n\t\tvertex.setParent(v);\n\t\tvertex.setCost(cost);\n\t\tp.promote(vertex);\n\t}",
"abstract void translate(double x, double y, double z);",
"public void getInterpolatedPositionVector (float u, Vector3f newPos) {\r\n // if linear interpolation\r\n if (this.linear == 1) {\r\n newPos.x = keyFrame[1].position.x + \r\n ((keyFrame[2].position.x - keyFrame[1].position.x) * u);\r\n newPos.y = keyFrame[1].position.y + \r\n ((keyFrame[2].position.y - keyFrame[1].position.y) * u);\r\n newPos.z = keyFrame[1].position.z + \r\n ((keyFrame[2].position.z - keyFrame[1].position.z) * u);\r\n } else {\r\n\r\n newPos.x = c0.x + u * (c1.x + u * (c2.x + u * c3.x));\r\n newPos.y = c0.y + u * (c1.y + u * (c2.y + u * c3.y));\r\n newPos.z = c0.z + u * (c1.z + u * (c2.z + u * c3.z));\r\n\r\n }\r\n }",
"public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}",
"URI translate(URI original);",
"double lat(long v) {\n return nodes.get(v).lat;\n }",
"public Shape transform(DeusVertex v) {\n\t\tif (v.getElementType() == \"Engine\") {\n\t\t\treturn factory.getRegularPolygon(v, 3);\n\t\t} else if (v.getElementType() == \"Process\") {\n\t\t\treturn factory.getRectangle(v);\n\t\t} else if (v.getElementType() == \"Event\") {\n\t\t\treturn factory.getEllipse(v);\n\t\t} else if (v.getElementType() == \"Network\") {\n\t\t\treturn factory.getRegularStar(v, 7);\n\t\t}\n\t\telse\n\t\t\treturn factory.getRegularPolygon(v, 8);\n\t}",
"@Override\r\n\t\tpublic void translate(Point3D vec) {\r\n\t\t\t// TODO Auto-generated method stub \r\n\t\t\tMyCoords mc= new MyCoords();\r\n\t\t\tPoint3D p=new Point3D(vec);\r\n\t\t\tPoint3D newPoint=mc.add(p, vec);\r\n\t\t\tthis.point=newPoint;\r\n\t\t}",
"public static Vector2f transformVect(Transform t, Vector2f v) {\n\t\treturn new Vector2f(t.a * v.x + t.c * v.y, t.b * v.x + t.d * v.y);\n\t}",
"public static Transform newTranslation(Vec3 tr){\n return newTranslation(tr.x, tr.y, tr.z);\n }",
"public void preOrder(Visitor v) {\r\n\t\tpreOrder(root, v);\r\n\t}",
"public String vertexToName(int v){\n if (v < 0){ return \"Error, invalid vertex, bellow bounds \" + v;}\n if (v < this.sororityLen){ return this.soroityNames[v];}\n if (v < this.fraternityLen+this.sororityLen){ return this.fraternityNames[v-this.sororityLen];}\n return \"Error, invalid vertex, beyond bounds \" + v; \n }",
"public void skaliere(double u)\n {\n p1.setX(p1.getX() * u);\n p1.setY(p1.getY() * u);\n p2.setX(p2.getX() * u);\n p2.setY(p2.getY() * u);\n p3.setX(p3.getX() * u);\n p3.setY(p3.getY() * u);\n p4.setX(p4.getX() * u);\n p4.setY(p4.getY() * u);\n }",
"public void transform(Vector3D V) {\r\n\t\tVector3D rv = new Vector3D();\r\n\t\trv.x = V.x * M11 + V.y * M21 + V.z * M31 + V.w * M41;\r\n\t\trv.y = V.x * M12 + V.y * M22 + V.z * M32 + V.w * M42;\r\n\t\trv.z = V.x * M13 + V.y * M23 + V.z * M33 + V.w * M43;\r\n\t\trv.w = V.x * M14 + V.y * M24 + V.z * M34 + V.w * M44;\r\n\t\tV.set(rv);\r\n\t}",
"public Vector2 xform(Vector2 v) \n\t{\n\t\treturn new Vector2(this.tDotX(v), tDotY(v)).add(this.matrix[2]);\n\t}",
"public synchronized void setData(Vector v) {\n // parse integer elements from the string and insert in the vector\n if (v != null) {\n TreeData = (Vector)v.clone();\n }\n else {\n TreeData = null;\n }\n }",
"public void translate(int x, int y);",
"public NodoGraficaTopologia(int id, double v) {\r\n\t\tthis.id = id;\r\n\t\tthis.v = v;\r\n\t\tthis.p = new Point(0, 0);\r\n\t}",
"private void rv2Elements(VectorN r, VectorN v)\n\t{\n\t\tr.checkVectorDimensions(3);\n\t\tv.checkVectorDimensions(3);\n\t\t//Constants c = new Constants();\n\t\tVectorN evec = new VectorN(3); // e vector\n\t\tVectorN k = new VectorN(3); // unit vector in z direction\n\n\t\tthis.rv = new VectorN(r, v);\n\n\t\tdouble rmag = r.mag();\n\t\tdouble vmag = v.mag();\n\t\tdouble energy = vmag * vmag / 2.0 - this.mu / rmag;\n\n\t\tk.x[0] = 0.0;\n\t\tk.x[1] = 0.0;\n\t\tk.x[2] = 1.0;\n\n\t\tVectorN h = r.crossProduct(v);\n\t\tVectorN n = k.crossProduct(h);\n\n\t\tdouble rdotv = r.dotProduct(v);\n\n\t\tdouble q1 = (vmag * vmag - this.mu / rmag) / this.mu;\n\t\tdouble q2 = rdotv / this.mu;\n\n\t\tevec.x[0] = q1 * r.x[0] - q2 * v.x[0];\n\t\tevec.x[1] = q1 * r.x[1] - q2 * v.x[1];\n\t\tevec.x[2] = q1 * r.x[2] - q2 * v.x[2];\n\n\t\tthis.e = evec.mag();\n\n\t\tif (e != 1.0)\n\t\t{\n\t\t\tthis.a = -this.mu / (2.0 * energy);\n\t\t} else\n\t\t{\n\t\t\tthis.a = 1.0E30;\n\t\t\tSystem.out.println(\"parabolic orbit\");\n\t\t}\n\n\t\tthis.i = Math.acos(h.x[2] / h.mag()); // inclination\n\n\t\tthis.raan = Math.acos(n.x[0] / n.mag()); // raan\n\t\tif (n.x[1] < 0.0)\n\t\t{\n\t\t\tthis.raan = 2.0 * Constants.pi - raan;\n\t\t}\n\n\t\tthis.w = Math.acos(n.dotProduct(evec) / (n.mag() * e));\n\t\tif (evec.x[2] < 0.0)\n\t\t{\n\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t}\n\n\t\tif (i == 0.0) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] < 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tif (i == Constants.pi) // equatorial orbit, things blow up\n\t\t{\n\t\t\t//\t\t System.out.println(\"KeplerElements: equatorial orbit, RAAN no good\");\n\t\t\tthis.raan = 0.0;\n\t\t\tthis.w = Math.acos(evec.x[0] / e);\n\t\t\tif (evec.x[1] > 0.0)\n\t\t\t{\n\t\t\t\tthis.w = 2.0 * Constants.pi - this.w;\n\t\t\t}\n\t\t}\n\n\t\tthis.ta = Math.acos(evec.dotProduct(r) / (e * rmag));\n\t\tif (rdotv < 0.0)\n\t\t{\n\t\t\tthis.ta = 2.0 * Constants.pi - this.ta;\n\t\t}\n\t}",
"Graph.Vertex getParent(Graph.Vertex u) {\n\t\treturn getVertex(u).parent;\n\t}",
"public void transferLink(Node one, Node two){ \n\t\t//System.out.println(\" in transferLink\");\n\t\tif (one.parent == nil){\n\t\t\t//System.out.println(\" u is root \" + u.id + \" v is \" + v.id);\n\t root=two;\n\t }else if(one==one.parent.right){\n\t \tone.parent.right = two; \n\t }else{\n\t \tone.parent.left = two;\n\t }\n\t \n\t two.parent = one.parent;\n\t}",
"public Vertex<VV> getTo()\r\n { return to; }",
"public void union(int v1, int v2, int[] parent) {\n\t\tint parentV1 = findParent(parent, v1); // 4\n\t\tint parentV2 = findParent(parent, v2); // 6\n\n\t\t// 2. kya disjoint hai dono/ parent/leader different hai?\n\t\tif (parentV1 != parentV2) {\n\t\t\t// Ab tum union kr sakte ho\n\t\t\t// parent[v1] = v2;\n\t\t\t// parent[4] = 6\n\t\t\tparent[parentV1] = parentV2;\n\t\t}\n\t}"
] | [
"0.6841266",
"0.63036543",
"0.60952735",
"0.5937897",
"0.5892984",
"0.5792859",
"0.5583467",
"0.55326736",
"0.5517994",
"0.5476515",
"0.5461003",
"0.5417584",
"0.540159",
"0.5389842",
"0.5388934",
"0.53768146",
"0.53579724",
"0.5321564",
"0.5282639",
"0.52738523",
"0.5258514",
"0.52284247",
"0.5219687",
"0.52176785",
"0.52158815",
"0.5209534",
"0.5189182",
"0.51628596",
"0.5153042",
"0.51500624",
"0.5140165",
"0.51222605",
"0.51002073",
"0.50899255",
"0.50756943",
"0.50729346",
"0.50689137",
"0.5050894",
"0.50291276",
"0.50184923",
"0.50118816",
"0.4998284",
"0.49916524",
"0.49902356",
"0.49817446",
"0.49812883",
"0.49788618",
"0.4963462",
"0.49452266",
"0.49435163",
"0.49382827",
"0.4935006",
"0.49336246",
"0.4919334",
"0.49178034",
"0.49143958",
"0.49138695",
"0.49062762",
"0.489862",
"0.48910573",
"0.48877126",
"0.48825738",
"0.48772857",
"0.4870758",
"0.48524666",
"0.48477027",
"0.48463005",
"0.48454198",
"0.48165938",
"0.48053685",
"0.4803155",
"0.47944587",
"0.47943392",
"0.47870544",
"0.4785914",
"0.4784699",
"0.4783273",
"0.47604883",
"0.4760484",
"0.4759599",
"0.47336602",
"0.47267088",
"0.47153237",
"0.47137123",
"0.4710592",
"0.4706747",
"0.4703597",
"0.46969947",
"0.4693002",
"0.46923226",
"0.46920818",
"0.4690048",
"0.4685479",
"0.4684066",
"0.46834224",
"0.46818516",
"0.4681203",
"0.46734974",
"0.46732154",
"0.46730018"
] | 0.68965256 | 0 |
method allowing the removal of a given node | public void remove(Node nodeBeingRemoved) {
if (nodeBeingRemoved.getLeftChild() == mSentinel) {
// if the node that is being remove does not possess a left child
// then translate the right child of the node that is being removed
// in the place of the node itself
transplant(nodeBeingRemoved, nodeBeingRemoved.getrightChild());
} else if (nodeBeingRemoved.getrightChild() == mSentinel) {
// act on analogy if the node does not possess a right child
transplant(nodeBeingRemoved, nodeBeingRemoved.getLeftChild());
} else {
// the tricky part
Node nextNode = getMinimalNode(nodeBeingRemoved.getrightChild());
// if the node that is being removed has both right and left
// children then get the minimal(rightmost child of the node as the
// next node that is going to replace it)
if (nextNode.getParent() != nodeBeingRemoved) {
// if the node that we've acquired does not coincide with the
// node that is being removed
transplant(nextNode, nextNode.getrightChild());// (1)
// replace it with its right child
nextNode.setrightChild(nodeBeingRemoved.getrightChild());
// and set its right child to be the right child of the node
// that is under removal
nextNode.getrightChild().setParent(nextNode);
// last but not least make the right' child's parent the not
// that we have transfered (look 1)
}
transplant(nodeBeingRemoved, nextNode);
// in all cases change the positions of the node that is being
// removed and the node that will replace it
// and adjust the children accordingly
nextNode.setLeftChild(nodeBeingRemoved.getLeftChild());
nextNode.getLeftChild().setParent(nextNode);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onRemoveNode(Node node) {\n\t}",
"public boolean removeNode(Node n);",
"public abstract void removeChild(Node node);",
"void removeNode(NodeKey key);",
"boolean removeNode(N node);",
"void removeHasNodeID(Integer oldHasNodeID);",
"protected void notifyChildRemoval(FONode node) {\n //nop\n }",
"@Override\n\tpublic void remove(DuNode s) {\n\t\t\n\t}",
"@Override\n\tpublic TreeNode remove() {\n\t\treturn null;\n\t}",
"public void remove() {\n removeNode(this);\n }",
"@Override\n\tpublic void nodeRemoved(TGGraph graph, TGNode node) {\n gLogger.log(TGLogger.TGLevel.Debug, \"Node is removed\");\n removedList.put(((AbstractEntity) node).getVirtualId(), node);\n\t}",
"void deleteNode(ZVNode node);",
"void removeNode(Entity entity) {\n\t\tProcessing.nodeSet.remove(entity);\n\t\tProcessing.friendMap.remove(entity);\n\n\t\tSystem.out.println(\"the person was successfully removed from the network.\");\n\t}",
"public abstract void removedFromWidgetTree();",
"public void remove () {}",
"public void nodeRemoved(GraphEvent e);",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"public void deleteNode ()\n {\n ConfigTreeNode node = _tree.getSelectedNode();\n ConfigTreeNode parent = (ConfigTreeNode)node.getParent();\n int index = parent.getIndex(node);\n ((DefaultTreeModel)_tree.getModel()).removeNodeFromParent(node);\n int ccount = parent.getChildCount();\n node = (ccount > 0) ?\n (ConfigTreeNode)parent.getChildAt(Math.min(index, ccount - 1)) : parent;\n if (node != _tree.getModel().getRoot()) {\n _tree.setSelectionPath(new TreePath(node.getPath()));\n }\n DirtyGroupManager.setDirty(group, true);\n }",
"@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}",
"private boolean removeNode(NeuralNode node) {\r\n\t\treturn innerNodes.remove(node);\r\n\t}",
"public void removeNode(N node)\r\n/* 71: */ {\r\n/* 72:135 */ assert (checkRep());\r\n/* 73:137 */ for (N endNode : getSuccessors(node)) {\r\n/* 74:138 */ ((Map)this.map.get(endNode)).remove(node);\r\n/* 75: */ }\r\n/* 76:140 */ this.map.remove(node);\r\n/* 77: */ }",
"protected void elementRemoved(MutationEvent evt) throws MelodyException {\r\n\t\tsuper.elementRemoved(evt);\r\n\t\t// the removed node\r\n\t\tElement t = (Element) evt.getTarget();\r\n\t\tDUNID tdunid = DUNIDDocHelper.getDUNID(t);\r\n\t\t// its parent node\r\n\t\tElement p = (Element) t.getParentNode();\r\n\t\tDUNID pdunid = DUNIDDocHelper.getDUNID(p);\r\n\t\t// Modify the DUNIDDoc\r\n\t\tDocument d = getOwnerDUNIDDoc(p).getDocument();\r\n\t\tElement tori = DUNIDDocHelper.getElement(d, tdunid);\r\n\t\tDUNIDDocHelper.getElement(d, pdunid).removeChild(tori);\r\n\t\t// Modify the targets descriptor\r\n\t\tif (!areTargetsFiltersDefined()) {\r\n\t\t\t/*\r\n\t\t\t * If there is no targets filters defined, there's no need to modify\r\n\t\t\t * the targets descriptor.\r\n\t\t\t */\r\n\t\t\treturn;\r\n\t\t}\r\n\t\td = getTargetsDescriptor().getDocument();\r\n\t\ttori = DUNIDDocHelper.getElement(d, tdunid);\r\n\t\tif (tori != null) { // removed node is in the targets descriptor\r\n\t\t\tDUNIDDocHelper.getElement(d, pdunid).removeChild(tori);\r\n\t\t}\r\n\t}",
"void arbitraryRemove(Nodefh node){\n\t\n\t\tif(node.Parent.Child == node){\n\t\t\tif(node.Right != null && node.Right != node){\n\t\t\t\tnode.Parent.Child = node.Right;\n\t\t\t\tif(node.Left!=null && node.Left != node){\n\t\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\t\tnode.Right.Left = node.Left;\n\t\t\t\t\tnode.Parent = null;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnode.Right.Left = node.Right;\n\t\t\t\t\tnode.Parent = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnode.Parent.Child = null;\n\t\t\t\tnode.Parent = null;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(node.Left != null && node.Left != node){\n\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\tnode.Right.Left = node.Left;\n\t\t\t}\n\t\t\tnode.Parent = null;\n\n\t\t}\n\t\tif(node.Child!=null){\n\t\t\tNodefh temp = node.Child;\n\t\t\tif(node.Child.Right!=null){\n\t\t\t\ttemp = node.Child.Right;\n\t\t\t}\n\t\t\tfhInsert(node.Child);\n\t\t\twhile(temp!=node.Child.Right){\n\t\t\t\tfhInsert(temp);\n\t\t\t\ttemp = temp.Right;\n\t\t\t}\n\n\t\t}\n\n\t}",
"public void nodeRemoved(TreeNode removedNode) {\n\t\t\tdefaultHandle(removedNode);\n\t\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"@Override\n\tpublic void remove() {\n\t\t\n\t}",
"public void remove() {\r\n //\r\n }",
"@Override\r\n\tpublic void remove() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void remove() {\n\t\t\r\n\t}",
"@Override\n\tpublic void remove(Element e) {\n\t\t\n\t}",
"void remove();",
"void remove();",
"void remove();",
"void remove();",
"void remove();",
"public void removeNode(Node<E> node) {\n super.removeNode(node);\n addNodeToCache(node);\n }",
"public void remove () { this.setAsDown(); n.remove(); }",
"@Override\n\t\t\t\tpublic void remove() {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\tpublic void remove() { }",
"@Override\n\t\tpublic Node remove(Geometry2D g, Point2D.Float origin, int width, int height) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}",
"void removeNode(ANode<T> a) {\n return;\n }",
"@Override\r\n\t\tpublic void remove() {\r\n\t\t\t// YOU DO NOT NEED TO WRITE THIS\r\n\t\t}",
"Object remove();",
"public boolean removeNode(DAGNode node) {\r\n\t\treturn false;\r\n\t}",
"public Node removeFromChain();",
"public void remove() {\n\t}",
"public void remove() {\n\t}",
"private E removeNode(Node n) {\n \tassert (n != sentinel);\n \tn.succ.pred = n.pred;\n \tn.pred.succ = n.succ;\n \tsize--;\n \treturn n.data;\n }",
"private E remove(Node node) {\n\n\t\tNode q = mHead;\n\n\t\tNode p = mHead.next;\n\n\t\twhile (p != node) {\n\n\t\t\tq = p;\n\t\t\tp = p.next;\n\t\t}\n\n\t\tq.next = p.next;\n\n\t\treturn node.data;\n\t}",
"public static void deleteNode(int nodeData){\n }",
"private void removeNode(DLinkedNode node){\n DLinkedNode pre = node.pre;\n DLinkedNode post = node.post;\n\n pre.post = post;\n post.pre = pre;\n }",
"public void nodeUnselected(ITreeNode node, ITree tree,boolean needNotifier);",
"abstract void removeNodeReferences(Node<T> node);",
"public void removeNode(NodeBINE node) {\n statistic.log(Type.REMOVED_NODES);\n if (removedNodeIds.contains(node.getId())) {\n System.err.println(\"Node: \" + node.getId() + \" already removed\");\n } else {\n removedNodeIds.add(node.getId());\n //storeNode(node);\n }\n nodes.remove(node.getId());\n }",
"private void removeNode(DLinkedNode node) {\n\t\t\tDLinkedNode pre = node.pre;\n\t\t\tDLinkedNode post = node.post;\n\n\t\t\tpre.post = post;\n\t\t\tpost.pre = pre;\n\t\t}",
"private T remove(Node<T> rm_node) {\n //if(node.previous == null) return removeFirst(); //If its a first node to remove.\n //if(node.next == null) return removeLast(); //If it's last node to remove.\n\n rm_node.next.previous = rm_node.previous; //pointing deleting nodes next element to deleting nodes prev. 3 <--- 4 ---> 5\n rm_node.previous.next = rm_node.next; //pointing deleting nodes prev element to deleting nodes next. deleting 4\n\n T data = rm_node.data; //to return deleted node data.\n\n rm_node.data = null;\n rm_node = rm_node.previous = rm_node.next = null; //Clearing node\n --size;\n\n return data;\n }",
"@Override\n public void remove() {\n }",
"public void remove() {\n\n\t\t\tsuprimirNodo(anterior);\n\n\t\t}",
"@Override\n public void remove() {\n }",
"public void removeFromParent();",
"private void removeNode(Node<E> node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }",
"public void remove(){\n }",
"private void removeElement(PathwayElement affectedData)\n \t{\n \n \t}",
"@Override\r\n\t\tpublic void remove() {\n\r\n\t\t}",
"public void removeNode()\n\t{\n\t\tif (parent != null)\n\t\t\tparent.removeChild(this);\n\t}",
"public abstract boolean remove(E e);",
"public E remove();",
"public E remove();",
"@Override\n public boolean remove(T item) {\n //find the node with the value\n Node n = getRefTo(item);\n //make sure it actually is in the set\n if(n == null)\n return false;\n //reassign the value from the first node to the removed node\n n.value = first.value;\n //take out the first node\n remove();\n return true;\n }",
"public Object remove();",
"public void removeChild(WSLNode node) {children.removeElement(node);}",
"protected abstract void removeItem();",
"private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}",
"private void removeNode(DLinkedNode node){\n\t\tDLinkedNode prev = node.prev;\n\t\tDLinkedNode next = node.next;\n\n\t\tprev.next = next;\n\t\tnext.prev = prev;\n\t}",
"@Override\n public synchronized boolean deleteNode(Node n){\n if((n.getNodes().size() > 0)) {\n return false;\n }\n //delete all node-tags\n for(Tag t : n.getTags()){\n removeNodeTag(n,t);\n }\n boolean dbResult = dbHandler.deleteNode(n.getID());\n if(dbResult) {\n this.allNodes.remove(n);\n return true;\n }\n else {\n return false;\n }\n }",
"public void entityRemoved() {}",
"public @Override E remove(int i) {\n \treturn removeNode(getNode(i));\n }",
"public void remove() {\n\t }",
"public void remove() {\n\t }",
"public void remove() {\n\t }",
"@Override\n\tpublic E remove(Position<E> p) throws IllegalArgumentException {\n\t\tif (!validPosition(p)) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\tNode<E> reference = convert(p);\n\t\tE temp = reference.getElement();\n\t\t\n\t\treference.prev.next = reference.next;\n\t\treference.next.prev = reference.prev;\n\t\t\n\t\tsize--;\n\t\treturn temp;\n\t}",
"public void removeNode(Node p_node) {\n\t\tnodes.remove(p_node);\n\t}",
"public void removeNode (int id)\r\n {\r\n uNodes.remove(id); //hard remove; See undo/redo/History.java\r\n }",
"private void removeFromModel(DefaultMutableTreeNode node, DefaultTreeModel model) {\n \t\tmodel.removeNodeFromParent(node);\n \t\tnodeTable.remove(node.getUserObject()); \n \t}",
"@DISPID(2)\n\t// = 0x2. The runtime will prefer the VTID if present\n\t@VTID(8)\n\tvoid removeChild(@MarshalAs(NativeType.VARIANT) java.lang.Object node);",
"public void removed() {\n }",
"private void removeNode(DNode node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }",
"public void remove() {\n\n }",
"public void remove()\n {\n removed();\n node.shapeRemoved(shape);\n }",
"@Override\n\tvoid remove(Inode inode) {\n\t\t\n\t}"
] | [
"0.79980516",
"0.7543207",
"0.7471591",
"0.74340415",
"0.73963755",
"0.7290228",
"0.7244936",
"0.72426623",
"0.7190414",
"0.715081",
"0.7132777",
"0.7132536",
"0.7120506",
"0.70235854",
"0.701797",
"0.69637287",
"0.6938318",
"0.6938318",
"0.6938318",
"0.6938318",
"0.6938318",
"0.6933565",
"0.6929774",
"0.6929774",
"0.6921048",
"0.6916283",
"0.69044566",
"0.6897834",
"0.68576646",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6845939",
"0.6838436",
"0.68187296",
"0.68187296",
"0.6813941",
"0.68076766",
"0.68076766",
"0.68076766",
"0.68076766",
"0.68076766",
"0.68046767",
"0.68039936",
"0.68020964",
"0.6801691",
"0.67929393",
"0.6774586",
"0.6773196",
"0.676061",
"0.6759928",
"0.67560935",
"0.67555785",
"0.67555785",
"0.67369485",
"0.67105013",
"0.67031527",
"0.6701433",
"0.67007786",
"0.6685573",
"0.6679863",
"0.66640896",
"0.6657657",
"0.6657425",
"0.66552305",
"0.6651469",
"0.6650019",
"0.6648079",
"0.66469795",
"0.66330177",
"0.66310173",
"0.66300726",
"0.662518",
"0.66199803",
"0.66199803",
"0.66190064",
"0.661613",
"0.6596999",
"0.6596263",
"0.65943444",
"0.659091",
"0.6566824",
"0.656655",
"0.65644425",
"0.65633994",
"0.65633994",
"0.65633994",
"0.6562769",
"0.65627337",
"0.65603495",
"0.65591335",
"0.6551934",
"0.65493655",
"0.65469867",
"0.65461886",
"0.6545456",
"0.65422636"
] | 0.0 | -1 |
this method returns the minimal/leftmost(relative to its key) node | public Node getMinimalNode(Node currentNode) {
while (currentNode.getLeftChild() != mSentinel) {
currentNode = currentNode.getLeftChild();
// simply go left until you reach an empty node
}
return currentNode;
// return the last non-empty node
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }",
"public K min() {\n if (root == null)\n return null;\n else {\n Node curr = root;\n while (true) {\n if (curr.left != null)\n curr = curr.left;\n else\n return curr.key;\n }\n }\n }",
"public Key min(Node node)\n {\n \tif(node==null)\n \t\treturn null;\n \tif(node.left==null)\n \treturn node.key;\n \telse\n \t\treturn min(node.left);\n \t\n }",
"public Node binomialHeapMinimum() {\n\t\tNode y = null;\n\t\tNode x = this.head;\n\t\tint min = Integer.MAX_VALUE;\n\t\twhile(x!=null) {\n\t\t\tif (x.key < min) {\n\t\t\t\tmin = x.key;\n\t\t\t\ty = x;\n\t\t\t}\n\t\t\tx = x.rightSibling;\n\t\t}\n\t\treturn y;\n\t}",
"public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}",
"public Key getFirst() {\n\t\treturn firstNode.key;\n\t}",
"public int minValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.left != null)\n current = current.left;\n\n return (current.key);\n }",
"public String getMinKey() {\n\t\tif(map.isEmpty()){\n\t\t\treturn \"\";\n\t\t}\n\t\treturn tail.prev.key;\n\t}",
"public Key min() {\n if (isEmpty()) throw new NoSuchElementException(\"called min() with empty symbol table\");\n return min(root).key;\n }",
"private K smallest(BSTnode<K> n) {\n\t\tif (n.getLeft() == null) {\n\t\t\treturn n.getKey();\n\t\t} else {\n\t\t\treturn smallest(n.getLeft());\n\t\t}\n\t}",
"public Node min() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getLeft() != null)\n\t\t\tx = x.getLeft();\n\t\treturn x;\n\t}",
"int getMinValue(AVLTreeNode node)\r\n {\n if (node == null) return Integer.MIN_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.left == null) return node.key;\r\n\r\n return getMinValue(node.left);\r\n }",
"public TreeNode<T> getMinElement(){\n TreeNode<T> t = this;\n while(t.left != null){\n t = t.left;\n }\n return t;\n }",
"public String getMinKey() {\n return dll.head.next == dll.tail ? \"\" : (String) dll.head.next.keySet.iterator().next();\n }",
"public String min() // return the value of the minimum key in the tree\r\n {\r\n\t \tif(empty()) {\r\n\t \t\treturn null;\r\n\t \t}\r\n return min(root).info;\r\n }",
"private Node minNode(Node node) {\n Node updt = node;\n // Finding the leftmost leaf\n while (updt.left != null) {\n updt = updt.left;\n }\n return updt;\n }",
"public K min() {\n if (isEmpty()) throw new NoSuchElementException(\"calls min() with empty symbol table\");\n return min(root).key;\n }",
"public K min() {\n if (isEmpty()) throw new NoSuchElementException(\"called min() with empty symbol table\");\n return min(root).key;\n }",
"public AVLNode findMin() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min;\n\t}",
"public TreeNode smallest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getLeftChild() != null) {\n\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"public T minimum() {\n return min.key;\n }",
"AVLTreeNode Min() {\r\n\r\n AVLTreeNode current = root;\r\n\r\n /* loop down to find the leftmost leaf */\r\n while (current.left != null)\r\n current = current.left;\r\n\r\n return current;\r\n\r\n\r\n }",
"private BSTNode<E> getLeftmostNode() {\r\n\t\tif (this.left != null) {\r\n\t\t\treturn this.left.getLeftmostNode();\r\n\t\t} else {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}",
"public Node getMin() {\n return getMin(root);\n }",
"private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}",
"public K min() throws EmptyTreeException {\n\t\tTree<K, V> t = this;\n\t\treturn min(t, key);\n\t}",
"public int findMin(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.left != nil){\n\t\t\ttemp=temp.left;\n\t\t}\n\t\treturn temp.id;\n\t}",
"public abstract Key getSmallest();",
"public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}",
"public int\ngetNodeIndexMin();",
"public String getMinKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getLast()).iterator().next();\n }",
"K getFirstLeafKey() {\r\n return keys.get(0);\r\n }",
"public E findMin() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a left child.\n // temp is then assigned to the next node in the left child and will return\n // the node with the minimum value in the BST. The node that does not have a left\n // child will be the minimum value.\n while(temp.left != null){\n temp = temp.left;\n }\n return temp.getInfo();\n }",
"abstract K getFirstLeafKey();",
"abstract K getFirstLeafKey();",
"Node findLeftmost(Node R){\n Node L = R;\n if( L!= null ) for( ; L.left != null; L = L.left);\n return L;\n }",
"protected final IntervalNode treeMin() {\n\tIntervalNode x = this;\n\twhile(x.left != IntervalNode.nullIntervalNode) {\n\t x = x.left;\n\t}\n\treturn(x);\n }",
"K getFirstLeafKey() {\r\n return children.get(0).keys.get(0);\r\n }",
"public Node getFirst() {\r\n\t\treturn getNode(1);\r\n\t}",
"public String min() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min.getValue();\n\t}",
"Node minValueNode(Node Node) {\n Node current = Node;\n\n /* loop down to find the leftmost leaf */\n while (current.left != null) {\n current = current.left;\n }\n\n return current;\n }",
"private IAVLNode minPointer(IAVLNode node) \r\n\t {\r\n\t\t\twhile (node.isRealNode())\r\n\t\t\t\tnode = node.getLeft();\r\n\t\t\treturn node.getParent();\t\r\n\t }",
"public String getMinKey();",
"public E getFirst()// you finish (part of HW#4)\n\t{\n\t\tif (root == null)\n\t\t\treturn null;\n\t\tBinaryNode<E> iteratorNode = root;\n\t\twhile (iteratorNode.hasLeftChild())\n\t\t\titeratorNode = iteratorNode.getLeftChild();\n\t\treturn iteratorNode.getData();\n\t}",
"private Node locatePrevNode(K key) { \n\t\tNode p = null; \n\t\tNode current = first; \n\t\twhile (current != null && current.getData().getKey().compareTo(key) < 0) {\n\t\t\tp = current; \n\t\t\tcurrent = current.getNext(); \n\t\t}\n\t\treturn p; \n\t}",
"@Override\n public TreeNode<E> tree_minimum() {\n return tree_minimum(root);\n }",
"public int minElement() {\n\t\tNode min=root;\n\t\tint out=-1;\n\t\twhile(min!=null) {\n\t\t\tout=min.data;\n\t\t\tmin=min.left;\n\t\t}\n\t\treturn out;\n\t}",
"public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }",
"public Key lowestCommonAncestor (Node node, Key key1, Key key2){\n \t\tif (node == null)\n return null;\n \t\tif (node.key == key1) {\n \t\t\treturn node.key;\n \t\t}\n \t\tif (node.key == key2) {\n \t\t\treturn node.key;\n \t\t}\n \t\tint cmp1 = node.key.compareTo(key1);\n \t\tint cmp2 = node.key.compareTo(key2);\n \t\t\n if (cmp1 >= 0 && cmp2 >= 0)\n return lowestCommonAncestor(node.left, key1, key2);\n \n if (cmp1 <= 0 && cmp2 <= 0)\n return lowestCommonAncestor(node.right, key1, key2);\n \n return node.key;\n \t}",
"private static <K extends Comparable<? super K>, V> Node<K, V> findSmallestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.left != null) {\n current = current.left;\n }\n return current;\n }",
"@Override\r\n\tpublic T minimum() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(this.root == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tBSTNode<T> node = minimum(this.root);\r\n\t\tif(node != null) {\r\n\t\t\treturn node.data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Node top() {\r\n\t\treturn start;\r\n\t}",
"Key max(Node node)\n {\n \tif(node==null)\n \t return null;\n \tif(node.right==null)\n \t return node.key;\n \telse\n \t return max(node.right);\n }",
"public K min(Tree<K, V> t, K key) {\n\t\treturn left.min(left, this.key);\n\t}",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Node<E> getMin(Node<E> x) {\n\t\tif (x.getLeftChild() != sentinel) {\n\t\t\treturn getMin(x.getLeftChild()); //Recurisvely go throughs the left side of the tree until a null node pops up\n\t\t} else {\n\n\t\t\treturn x; //x will be the node with the minimum value \n\t\t}\n\t}",
"private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }",
"private SearchNode findFirstNode(HashSet<SearchNode> set){\n\t\t\tSearchNode min = null;\n\t\t\tfor (SearchNode cur : set){\n\t\t\t\tif (min == null || cur.fScore < min.fScore)\n\t\t\t\t\tmin = cur;\n\t\t\t}\n\t\t\treturn min;\n\t\t}",
"public Key removeFirst(){\n\t\tKey key = firstNode.key;\n\t\tfirstNode = firstNode.next;\n\t\treturn key;\n\t}",
"private Node min(Node node){\n if(node == null)\n return null;\n else if(node.left == null)\n return node;\n\n //walk left nodes\n return min(node.left);\n }",
"public Node deleteMin() {\n\t\t// if the heap is empty\n\t\t// return MAXINT as output\n\t\tNode min = new Node(Integer.MAX_VALUE);\n\t\tif(this.head == null)\n\t\t\treturn min;\n\t\t\n\t\t\n\t\tNode prevMin = null;\n\t\tNode curr = this.head;\n\t\tNode prev = null;\n\t\t\n\t\t// find the smallest node\n\t\t// keep track of node who points to this minimum node\n\t\twhile(curr!=null) {\n\t\t\tif(curr.key<min.key) {\n\t\t\t\tmin = curr;\n\t\t\t\tprevMin = prev;\n\t\t\t}\n\t\t\tprev = curr;\n\t\t\tcurr = curr.rightSibling;\n\t\t}\n\t\t\n\t\t// if its the head then move one pointer ahead\n\t\tif(prevMin == null)\n\t\t\tthis.head = min.rightSibling;\n\t\telse {\n\t\t\t// else attach the previous node to the rightSibling of min\n\t\t\tprevMin.rightSibling = min.rightSibling;\n\t\t}\n\t\tmin.rightSibling = null;\n\t\t\n\t\t//return min node\n\t\treturn min;\n\t}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"public E findMin(){\n if(!isEmpty()){\n AvlNode<E> node = findMin(root);\n return (E)node.value;\n } else {\n return null;\n }\n }",
"public String getLowestChromKey();",
"public String getMinKey() {\n if (map.size() == 0)\n return \"\";\n return minKey;\n }",
"private Node findSmallest(Node curr) {\n Node prev = null;\n while(curr != null && !curr.isNull) {\n prev = curr;\n curr = curr.left;\n }\n return prev != null ? prev : curr;\n }",
"private Position<E> firstLeaf(){\n\t\tPosition<E> aux=null;\n\t\tif(tree.isEmpty())\n\t\t\treturn aux;\n\t\telse\n\t\t\taux=tree.root();\n\t\twhile(this.tree.hasLeft(aux)){\n\t\t\taux=tree.left(aux);\n\t\t}\n\t\treturn aux;\n\t}",
"int minValue(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tNode root = node;\r\n\t\twhile (root.left != null) {\r\n\t\t\troot = root.left;\r\n\t\t}\r\n\t\treturn root.data;\r\n\t}",
"public Key min();",
"public int minkeys() {\n\t\tint min = 0;\n\t\tif (parentref == null) {\n\t\t\treturn 1;\n\t\t}\n\t\tmin = (int)Math.ceil((degree) / 2.0) - 1;\n\t\t//min = (int)Math.ceil(degree / 2.0);\n\t\treturn Math.max(min, 0);\n\t}",
"private Node<Value> min(Node<Value> x)\r\n {\r\n while (x.left != null) x = x.left;\r\n return x;\r\n }",
"public static Node leftDescendant(Node node){\n if(node.left!=null){\n return leftDescendant(node.left); // คือการ (findMin) ด้ายซ้าย\n }\n else{\n return node;}\n }",
"private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }",
"public E minimum() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn heap.get(0);\n\t}",
"public E minimum() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn heap.get(0);\n\t}",
"public Node getFirstNode() {\n\t return firstNode;\r\n\t }",
"public Node<T> getFirst() {\r\n\t\treturn first;\r\n\t}",
"@Override\r\n public K firstKey() {\n return null;\r\n }",
"public AVLNode minValueNode(AVLNode node) {\n AVLNode current = node;\n\n // Loop to find the leaf at the left\n while (current.getLeft() != null) {\n current = current.getLeft();\n }\n\n return current;\n }",
"private AvlNode<E> findMin(AvlNode<E> node){\n if(node.left == null){\n return node;\n } else {\n return findMin(node.left);\n }\n }",
"public static Node findMin(Node node){\n if(node.left!=null){\n return findMin(node.left); // recursive left-subtree จนตกเกือบ null แล้ว return node นั้น\n }\n else{\n return node;}\n }",
"Node firstNode() {\r\n\t\treturn first.next.n;\r\n\t}",
"protected BinaryNode<AnyType> findMin(BinaryNode<AnyType> t) {\n\t\tif (t != null)\n\t\t\twhile (t.left != null)\n\t\t\t\tt = t.left;\n\n\t\treturn t;\n\t}",
"TreeNode<T> getLeft();",
"public K floor(K key) {\n if (root == null)\n return null;\n else {\n Node tmp = null;\n Node curr = root;\n while (true) {\n if (curr == null) {\n if (tmp != null)\n return tmp.key;\n return null;\n }\n int cmp = key.compareTo(curr.key);\n if (cmp == 0)\n return curr.key;\n else if (cmp < 0)\n curr = curr.left;\n else {\n tmp = curr;\n curr = curr.right;\n }\n }\n }\n }",
"public node_data heapMinimum(){return _a[0];}",
"public int getMin() {\r\n // get root\r\n RedBlackTree.Node<Grade> min = rbt.root;\r\n // loop to left of tree\r\n while (min.leftChild != null) {\r\n min = min.leftChild;\r\n }\r\n\r\n return min.data.getGrade();\r\n }",
"int nilaiMin(Node node){\n if (node.left != null) { // karena node yg nilainya minimum atau lebih kecil di sebelah kiri\n return nilaiMin(node.left);// maka jika != null akan me return node sebelah kiri\n }\n return node.data;\n }",
"public T smallest(Node node) {\n while (node.left != null) {\n node = node.left;\n }\n return node.element;\n }",
"public int getSmallestNodeIndex() {\n\t\tHuffmanTreeNode[] heap = this.getHuffmanHeap();\n\t\tint smallest = 0;\n\t\t\n\t\tfor (int i = 1; i < heap.length; i++) {\n\t\t\tif (heap[smallest].compareTo(heap[i]) > 0)\n\t\t\t\tsmallest = i;\n\t\t}\n\t\t\n\t\treturn smallest;\n\t}",
"private Node min(Node x) {\n if (x.left == null)\n return x;\n else\n return min(x.left);\n }",
"private BinaryNode<AnyType> findMin( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn null;\r\n\t\telse if( t.left == null )\r\n\t\t\treturn t;\r\n\t\treturn findMin( t.left );\r\n\t}",
"public Website treeMinimum(Website site) {\r\n\t\tWebsite localSite = site; // Local pointer to given Site\r\n\t\twhile (localSite.getLeft() != null&&localSite.getLeft().getPageRank()!=0) { // Traversing Loop, stops at null node\r\n\t\t\tlocalSite = localSite.getLeft(); // incrementation Condition\r\n\t\t}\r\n\t\treturn localSite; // Returns minimum\r\n\t}",
"private static Node min(Node root) {\n\t\tif(root.left == null) {\n\t\t\treturn root;\n\t\t}\n\t\treturn min(root.left);\n\t}",
"private Node getMinimumOld() {\n Node tmp = null;\n\n // TODO: optimize by putting in 1 list and\n // provide 'starting offset' for remaining nodes to find mimimum\n // note: see new getMinimum method above\n\n if (null != nodeA) {\n tmp = nodeA;\n if (null != nodeB && tmp.data > nodeB.data) {\n tmp = nodeB;\n }\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeB) {\n tmp = nodeB;\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeC) {\n tmp = nodeC;\n }\n\n // System.out.println(tmp);\n\n if (null == tmp ) {\n // terminating condition\n return null;\n }\n\n if (tmp.equals(nodeA)) {\n nodeA = nodeA.next;\n }\n if (tmp.equals(nodeB)) {\n nodeB = nodeB.next;\n }\n if (tmp.equals(nodeC)) {\n nodeC = nodeC.next;\n }\n\n System.out.println(tmp.data);\n\n return tmp;\n }",
"public Key getCeiling(Key key) {\n\n Node current = root;\n while (current != null) {\n if (current.key == key) {\n return key;\n }\n if (current.key.compareTo(key) > 0) {\n if (current.left != null && current.left.key.compareTo(key) < 0) {\n return current.key;\n } else {\n current = current.left;\n }\n } else {\n current = current.right;\n }\n }\n return null;\n }",
"private void gotoMinOf(IntTree<V> node) {\n while (node.size > 0) {\n stack = stack.plus(node);\n key += node.key;\n node = node.left;\n }\n }",
"private WAVLNode min(WAVLNode x) {\n\t while(x.left!=EXT_NODE) {\r\n \tx=x.left;\r\n }\r\n return x;\r\n }",
"private BSTNode<T> minimum(BSTNode node){\r\n\t\twhile(node.left != null) {\r\n\t\t\tnode = node.left;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"private Node smallest(Node p){\n if(p == null){\n return null;\n }\n Node smallest = p;\n while(smallest.left!=null){\n smallest = smallest.left;\n }\n return smallest;\n }"
] | [
"0.81612974",
"0.78027016",
"0.756999",
"0.7436632",
"0.7413336",
"0.7399567",
"0.7320764",
"0.72563154",
"0.72221386",
"0.7172183",
"0.7149134",
"0.7131017",
"0.7128583",
"0.71238536",
"0.712062",
"0.71080714",
"0.7081565",
"0.7081175",
"0.7075294",
"0.70197827",
"0.70087594",
"0.6983111",
"0.696358",
"0.6952005",
"0.6948255",
"0.6916055",
"0.69022864",
"0.6894259",
"0.68940574",
"0.6877187",
"0.68658346",
"0.685549",
"0.68414205",
"0.6838135",
"0.68197906",
"0.68197906",
"0.6806966",
"0.6799527",
"0.6794122",
"0.6779582",
"0.6779291",
"0.6769674",
"0.67442864",
"0.67237175",
"0.67232585",
"0.67165166",
"0.6712191",
"0.66898257",
"0.66619664",
"0.6660873",
"0.66607285",
"0.6638309",
"0.6631847",
"0.6611451",
"0.65986645",
"0.6573718",
"0.6571064",
"0.6566651",
"0.6562158",
"0.6542821",
"0.6526748",
"0.652518",
"0.65243995",
"0.65204823",
"0.6512017",
"0.65117055",
"0.650675",
"0.6499037",
"0.6497652",
"0.6493298",
"0.6491605",
"0.64858174",
"0.6483886",
"0.6481407",
"0.6475984",
"0.6475984",
"0.64585835",
"0.6458448",
"0.6453998",
"0.64471",
"0.643062",
"0.64268094",
"0.6426809",
"0.64233124",
"0.6421943",
"0.6408171",
"0.63928246",
"0.637619",
"0.6373096",
"0.6363532",
"0.6359142",
"0.63549465",
"0.6353246",
"0.6350067",
"0.6346577",
"0.63366467",
"0.63333166",
"0.63320553",
"0.63291484",
"0.63285816",
"0.6326047"
] | 0.0 | -1 |
this method returns the maximal/rightmost(relative to its key) node | public Node getMaximalNode(Node currentNode) {
while (currentNode.getrightChild() != mSentinel) {
currentNode = currentNode.getrightChild();
// simply go right until you reach an empty node
}
return currentNode;
// return the last non-empty node
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Key max(Node node)\n {\n \tif(node==null)\n \t return null;\n \tif(node.right==null)\n \t return node.key;\n \telse\n \t return max(node.right);\n }",
"public int getMaxKey() {\r\n return getMax(this.root).getKey();\r\n }",
"public TreeNode<T> getMaxElement(){\n TreeNode<T> t = this;\n while(t.right != null){\n t = t.right;\n }\n return t;\n }",
"public Node getMax() {\n Node current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"public String max()// return the value of the maximum key in the tree\r\n {\r\n\t if(empty()) {\r\n\t return null;\r\n\t }\r\n\t WAVLNode x = root;\r\n while(x.right!=EXT_NODE) {\r\n \tx=x.right;\r\n }\r\n return x.info;\r\n }",
"public E getLast()// you finish (part of HW#4)\n\t{\n\t\t// If the tree is empty, return null\n\t\t// FIND THE RIGHT-MOST RIGHT CHILD\n\t\t// WHEN you can't go RIGHT anymore, return the node's data to last Item\n\t\tif (root == null)\n\t\t\treturn null;\n\t\tBinaryNode<E> iteratorNode = root;\n\t\twhile (iteratorNode.hasRightChild())\n\t\t\titeratorNode = iteratorNode.getRightChild();\n\t\treturn iteratorNode.getData();\n\t}",
"public int maxValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.right != null)\n current = current.right;\n\n return (current.key);\n }",
"public Key max() {\n if (isEmpty()) throw new NoSuchElementException(\"called max() with empty symbol table\");\n return max(root).key;\n }",
"public Node max() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getRight() != null)\n\t\t\tx = x.getRight();\n\t\treturn x;\n\t}",
"AVLTreeNode Max() {\r\n\r\n AVLTreeNode current = root;\r\n\r\n /* loop down to find the leftmost leaf */\r\n while (current.right != null)\r\n current = current.right;\r\n\r\n return current;\r\n\r\n\r\n }",
"int getMaxValue(AVLTreeNode node) {\n if (node == null) return Integer.MAX_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.right == null) return node.key;\r\n\r\n return getMinValue(node.right);\r\n }",
"public K max() {\n if (isEmpty()) throw new NoSuchElementException(\"called max() with empty symbol table\");\n return max(root).key;\n }",
"public E findMax() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a right child.\n // temp is then assigned to the next node in the right child and will return\n // the node with the maximum value in the BST. The node that does not have a right\n // child will be the maximum value.\n while(temp.right != null){\n temp = temp.right;\n }\n return temp.getInfo();\n }",
"public Key getLastKey() {\n\t\treturn lastNode.key;\n\t}",
"public K max() {\n if (isEmpty()) throw new NoSuchElementException(\"calls max() with empty symbol table\");\n return max(root).key;\n }",
"public TreeNode largest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getRightChild() != null) {\n\t\t\t\tcurrent = current.getRightChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}",
"public String getMaxKey() {\n return dll.tail.prev == dll.head ? \"\" : (String) dll.tail.prev.keySet.iterator().next();\n }",
"public K max() throws EmptyTreeException {\n\t\tTree<K, V> t = this;\n\t\treturn max(t, key);\n\t}",
"public abstract Key getLargest();",
"public static Node maximumKey(Node ptr) {\n while (ptr.right != null) {\n ptr = ptr.right;\n }\n return ptr;\n }",
"protected final IntervalNode treeMax() {\n\tIntervalNode x = this;\n\twhile(x.right != IntervalNode.nullIntervalNode) {\n\t x = x.right;\n\t}\n\treturn(x);\n }",
"private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }",
"public int findMax(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.right != nil){\n\t\t\ttemp = temp.right;\n\t\t}\n\t\treturn temp.id;\n\t}",
"public String getMaxKey() {\n\t\tif(map.isEmpty()){\n\t\t\treturn \"\";\n\t\t}\n\t\treturn head.next.key;\n\t}",
"public Node getLast() {\r\n\t\treturn getNode(this.size());\r\n\t}",
"private E findRightmost(Node<E> node){\n\t\t/** the rightmost child found */\n\t\tif(node.right.right == null){\n\t\t\tE rightmost = node.right.item;\n\t\t\tnode.right = node.right.left;\n\t\t\treturn rightmost;\n\t\t}else{\n\t\t\treturn findRightmost(node.right);\n\t\t}\n\t}",
"public String max() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode max = (AVLNode) this.root;\n\t\twhile (max.getRight().getHeight() != -1) {\n\t\t\tmax = (AVLNode) max.getRight();\n\t\t}\n\t\treturn max.getValue();\n\t}",
"public Node findMax(){\n if(root!=null){ // มี node ใน tree\n return findMax(root); // Call the recursive version\n }\n else{\n return null;\n }\n }",
"public int maxElement() {\n\t\tNode max=root;\n\t\tint out=-1;\n\t\twhile(max!=null) {\n\t\t\tout=max.data;\n\t\t\tmax=max.right;\n\t\t}\n\t\treturn out;\n\t}",
"public static Node findMax(Node node){\n if(node.right!=null){ // recursive right-subtree จนตกเกือบ null แล้ว return node นั้น\n return findMax(node.right);\n }\n else{\n return node;}\n }",
"@Override\r\n\tpublic T maximum() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(this.root == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tBSTNode<T> node = maximum(this.root);\r\n\t\tif(node != null) {\r\n\t\t\treturn node.data;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"private static <K extends Comparable<? super K>, V> Node<K, V> findLargestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }",
"@Override\n public TreeNode<E> tree_maximum() {\n return tree_maximum(root);\n }",
"private IAVLNode maxPointer(IAVLNode node)\r\n\t{\r\n\t\twhile (node.isRealNode())\r\n\t\t\tnode = node.getRight();\r\n\t\treturn node.getParent();\t\r\n\t}",
"public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}",
"public T largest(Node node) {\n while (node.right != null) {\n node = node.right;\n }\n return node.element;\n }",
"public int\ngetNodeIndexMax();",
"public String getMaxKey();",
"private Node findLargestNodeIn(Node n) {\n if (n != null) {\n while (n.rightChild != null) {\n n = n.rightChild;\n }\n }\n return n;\n }",
"public E findMax(){\n if(!isEmpty()){\n AvlNode<E> node = findMax(root);\n return (E)node.value;\n } else {\n return null;\n }\n }",
"public SplayNode maximum(SplayNode x) {\n\t\t while(x.right != null)\n\t\t x = x.right;\n\t\t return x;\n\t\t }",
"private BinaryNode max(BinaryNode node) {\n if (node == null) return node.parent;\n else if (node.right == null) return node;\n else return max(node.right);\n }",
"public String getMaxKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getFirst()).iterator().next();\n }",
"private int getMax(TreeNode root) {\n\t\twhile(root.right!=null)\n\t\t\troot=root.right;\n\t\treturn root.val;\n\t}",
"private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}",
"private Node max(Node node){\n if(node == null)\n return null;\n else if(node.right == null)\n return node;\n\n //walk through right branch\n return max(node.right);\n }",
"public Node binomialHeapMinimum() {\n\t\tNode y = null;\n\t\tNode x = this.head;\n\t\tint min = Integer.MAX_VALUE;\n\t\twhile(x!=null) {\n\t\t\tif (x.key < min) {\n\t\t\t\tmin = x.key;\n\t\t\t\ty = x;\n\t\t\t}\n\t\t\tx = x.rightSibling;\n\t\t}\n\t\treturn y;\n\t}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"public K max(Tree<K, V> t, K key) {\n\t\treturn right.max(right, this.key);\n\t}",
"public K min() {\n if (root == null)\n return null;\n else {\n Node curr = root;\n while (true) {\n if (curr.left != null)\n curr = curr.left;\n else\n return curr.key;\n }\n }\n }",
"private AvlNode<E> findMax(AvlNode<E> node){\n if(node.right == null){\n return node;\n } else {\n return findMax(node.right);\n }\n }",
"private Node largest(Node p){\n if(p == null){\n return null;\n }\n Node largest = p;\n while(largest.right != null){\n largest = largest.right;\n }\n return largest;\n }",
"public String getHighestChromKey();",
"private BSTNode<T> maximum(BSTNode node){\r\n\t\twhile(node.right != null) {\r\n\t\t\tnode = node.right;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"private static Node mrvFindNode() {\n\t\tif (constrainedNodes.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// Was able to use this by 'implementing Comparable'\r\n\t\t// in the Node class\r\n\t\t// return max value node of constrained nodes\r\n\t\treturn Collections.max(constrainedNodes);\r\n\r\n\t}",
"public int getMax() {\r\n // get root\r\n RedBlackTree.Node<Grade> max = rbt.root;\r\n // loop to right of tree\r\n while (max.rightChild != null) {\r\n max = max.rightChild;\r\n }\r\n\r\n return max.data.getGrade();\r\n }",
"private BinaryNode<AnyType> findMax( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t != null )\r\n\t\t\twhile( t.right != null )\r\n\t\t\t\tt = t.right;\r\n\r\n\t\treturn t;\r\n\t}",
"public Node<T> getLast() \r\n {\r\n if (isEmpty()) return sentinel;\r\n return sentinel.prev;\r\n }",
"public static <T> T findMax(Node<T> t) {\n if (t == null)\n return null;\n else if (t.right == null)//right-most node found\n return t.data;\n else\n return findMax(t.right);//recursive call to traverse as far right\n }",
"public Key getCeiling(Key key) {\n\n Node current = root;\n while (current != null) {\n if (current.key == key) {\n return key;\n }\n if (current.key.compareTo(key) > 0) {\n if (current.left != null && current.left.key.compareTo(key) < 0) {\n return current.key;\n } else {\n current = current.left;\n }\n } else {\n current = current.right;\n }\n }\n return null;\n }",
"private BinaryNode<AnyType> findMax(BinaryNode<AnyType> t) {\n\t\tif (t != null)\n\t\t\twhile (t.right != null)\n\t\t\t\tt = t.right;\n\n\t\treturn t;\n\t}",
"public Dog findYoungest() {\r\n\t\tif (root == null)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\treturn root.findYoungest();\r\n\t}",
"private Node<Value> max(Node<Value> x)\r\n {\r\n while (x.right != null) x = x.right;\r\n return x;\r\n }",
"public int findMaxValueWithoutRecursion() {\n\t\tQueue<XTreeNode<Integer>> collectedNodes = new LinkedList<>();\n\t\tcollectedNodes.add( (XTreeNode<Integer>) this );\n\n\t\tint maxValue = Integer.MIN_VALUE;\n\t\twhile( !collectedNodes.isEmpty() ) {\n\t\t\tXTreeNode<Integer> node = collectedNodes.poll();\n\t\t\tmaxValue = node.getData() > maxValue ? node.getData() : maxValue;\n\n\t\t\tif( node.getLeftChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getLeftChild() );\n\t\t\t}\n\t\t\tif( node.getRightChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getRightChild() );\n\t\t\t}\n\t\t}\n\t\treturn maxValue;\n\t}",
"public int maximum() {\n \n if (xft.size() == 0) {\n return -1;\n }\n \n Integer maxRepr = xft.maximum();\n \n assert(maxRepr != null);\n \n int index = maxRepr.intValue()/binSz;\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n assert(map != null);\n \n Entry<Integer, Integer> lastItem = map.lastEntry();\n \n assert(lastItem != null);\n \n return lastItem.getKey();\n }",
"private BinaryNode<AnyType> findMax(BinaryNode<AnyType> t) {\r\n\t\tif (t != null)\r\n\t\t\twhile (t.right != null)\r\n\t\t\t\tt = t.right;\r\n\r\n\t\treturn t;\r\n\t}",
"public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}",
"public Node getLast()\n {\n return this.last;\n }",
"public Key ceiling(Key key)\t\t\t\t//smallest key greater than or equal to the given key\n\t{\n\t\tNode x=ceiling(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}",
"public AnyType findMax() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMax(root).element;\r\n\t}",
"Node findLeftmost(Node R){\n Node L = R;\n if( L!= null ) for( ; L.left != null; L = L.left);\n return L;\n }",
"public Node<T> getLast() {\r\n\t\treturn last;\r\n\t}",
"public E deleteMax() {\r\n\t\tE max = null;\r\n\t\tif (currentIndex > 0) { // replace the root of heap with the last element on the last level\r\n\t\t\tmax = heap.get(0); // save current max\r\n\t\t\t\r\n\t\t\theap.set(0, heap.get(currentIndex - 1));\r\n\t\t\theap.remove(currentIndex - 1);\r\n\t\t\tcurrentIndex--;\r\n\t\t\t\r\n\t\t\theapifyDown(0); // re-heapify\r\n\t\t}\r\n\t\treturn max; // if tree is empty, returns null\r\n\t}",
"public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }",
"public MoveNode getBestMove() {\n if (rootValues.isEmpty()) {\n return null;\n }\n\n MoveNode moveNode = rootValues.get(0);\n int maxScore = moveNode.getMinimaxValue();\n\n for(MoveNode m : rootValues) {\n if(m.getMinimaxValue() > maxScore) {\n moveNode = m;\n maxScore = m.getMinimaxValue();\n }\n }\n\n return moveNode;\n }",
"public String getMaxKey() {\n if (map.size() == 0)\n return \"\";\n return maxKey;\n }",
"public Map.Entry<CharSequence,T> getLongestMatch(CharSequence key)\n\t{\n\t\tif(root == null || key == null)\n\t\t\treturn null;\n\t\treturn root.getLongestMatch(key, 0);\n\t}",
"public Item max() {\n return heap[0];\n }",
"public FHeapNode removeMax()\r\n {\r\n FHeapNode z = maxNode;\r\n //hmap.remove(maxNode.gethashtag());\t\t\t\t\t\t\t\t\t\t//remove the node from the hashtable\r\n \r\n if (z != null) \r\n\t\t{\r\n \t for (HashMap.Entry<String, FHeapNode> entry : hmap.entrySet()) \r\n {\r\n \tif(entry.getValue() == maxNode)\r\n \t{\r\n \t\thmap.remove(entry.getKey());\r\n \t\tbreak;\r\n \t}\r\n }\r\n \t \r\n int numKids = z.degree;\r\n FHeapNode x = z.child;\r\n FHeapNode tempRight;\r\n\r\n while (numKids > 0) \t\t\t\t\t\t\t\t\t\t\t\t\t// iterate trough all the children of the max node\r\n\t\t\t{\r\n tempRight = x.right; \r\n x.left.right = x.right;\t\t\t\t\t\t\t\t\t\t\t\t// remove x from child list\r\n x.right.left = x.left;\r\n \r\n x.left = maxNode;\t\t\t\t\t\t\t\t\t\t\t\t\t// add x to root list of heap\r\n x.right = maxNode.right;\r\n maxNode.right = x;\r\n x.right.left = x;\r\n \r\n x.parent = null;\t\t\t\t\t\t\t\t\t\t\t\t\t// set parent[x] to null\r\n x = tempRight;\r\n numKids--;\r\n }\r\n\t\t\tz.left.right = z.right;\t\t\t\t\t\t\t\t\t\t\t\t\t// remove z from root list of heap\r\n z.right.left = z.left;\r\n\r\n if (z == z.right)\r\n\t\t\t{\r\n maxNode = null;\r\n } \r\n\t\t\telse \r\n\t\t\t{\r\n maxNode = z.right;\r\n meld();\r\n } \r\n nNodes--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// decrement size of heap\r\n }\r\n \r\n\r\n return z;\r\n }",
"private CommonTableExpression getLast() {\n\t\tCommonTableExpression cte = !nodes.isEmpty() ? (CommonTableExpression)nodes.get(nodes.size() - 1) : null;\n\t\tif (cte == null) {\n\t\t\tthrow new IllegalStateException(\"No nodes\");\n\t\t}\n\t\treturn cte;\n\t}",
"public T get(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node.value;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public static int max(treenode root)\n {\n treenode curr=root;\n while(curr.right!=null)\n {\n curr=curr.right;\n }\n return curr.val;\n }",
"public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}",
"protected BSTNode getMaximumChild(BSTNode n) {\n\t\tassert (n != null);\n\n\t\twhile (hasRightChild(n)) {\n\t\t\tn = n.right;\n\t\t\t_stats.incOtherTraversals();\n\t\t}\n\n\t\treturn n;\n\t}",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Key getFirst() {\n\t\treturn firstNode.key;\n\t}",
"public static Object max(TreeNode t)\n {\n if(t == null)\n return null;\n if(t.getRight() == null)\n return t.getValue();\n return max(t.getRight());\n }",
"public int minValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.left != null)\n current = current.left;\n\n return (current.key);\n }",
"public K topValue() {\n\t\tif(top!=null)\r\n\t\t\treturn top.data;\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public int findMax(TreeNode root){\r\n TreeNode current;\r\n if( isLeaf(root )){\r\n return root.getValue();\r\n }else {\r\n current = root;\r\n current = current.right;\r\n if( isLeaf(current)){\r\n return current.value;\r\n }\r\n if( current.left != null && current.right == null){\r\n return current.left.getValue();\r\n }\r\n }\r\n return current.getValue();\r\n }",
"public Subset getRightMostElement() {\n\t\tSubset res = this;\n\t\twhile(res.right != res) {\n\t\t\tres = res.right;\n\t\t}\n\t\treturn res;\n\t}",
"public int findMaxValue(Node root) {\n if(root == null) {\n return Integer.MIN_VALUE;\n }\n int output = (int)root.getData();\n int leftOutput = findMaxValue(root.getLeftChildNode());\n int rightOutput = findMaxValue(root.getRightChildNode());\n if(leftOutput > output){\n output = leftOutput;\n }\n if(rightOutput > output) {\n output = rightOutput;\n }\n return output;\n\n }",
"private int findMaxValue( XTreeNode<E> rootNode ) {\n\t\tif( rootNode == null ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\n\t\tint rootValue = (Integer) rootNode.getData();\n\t\tint maxValue = rootValue;\n\n\t\tint leftValue = findMaxValue( rootNode.getLeftChild() );\n\t\tint rightValue = findMaxValue( rootNode.getRightChild() );\n\n\t\t// not using if else if, as need to compare three values - root, left, right\n\t\tif( leftValue > rootValue ) {\n\t\t\tmaxValue = leftValue;\n\t\t}\n\t\tif( rightValue > maxValue ) {\n\t\t\tmaxValue = rightValue;\n\t\t}\n\t\treturn maxValue;\n\t}",
"public T last() throws NoSuchElementException {\n\t\tif (root == null) throw new NoSuchElementException();\n\n\t\tBinaryTreeNode current = root;\n\t\twhile (current.right != null) {\n\t\t\tcurrent = current.right;\n\t\t}\n\t\treturn current.data;\n\t}",
"private int helper(TreeNode root, int[] globalMax) {\r\n\t\tif (root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Step 1\r\n\t\tint left = helper(root.left, globalMax);\r\n\t\tint right = helper(root.right, globalMax);\r\n\t\t// Step 2\r\n\t\tleft = left < 0 ? 0 : left;\r\n\t\tright = right < 0 ? 0 : right;\r\n\t\tglobalMax[0] = Math.max(globalMax[0], root.key + left + right);\r\n\t\t// Step 3\r\n\t\treturn Math.max(left, right) + root.key;\r\n\t}",
"public T getLast()\n\t//POST: FCTVAL == last element of the list\n\t{\n\t\tNode<T> tmp = start;\n\t\twhile(tmp.next != start) //traverse the list to end\n\t\t{\n\t\t\ttmp = tmp.next;\n\t\t}\n\t\treturn tmp.value;\t//return end element\n\t}",
"public Data get(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n return next == null ? null\n : next.data;\n }",
"E top();",
"public BinaryNode getMaxNode(BinaryNode current, int max) throws Exception {\n getMaxNodeHelper(current, max);\n\n if (getMaxNodeFromSeq() == null) {\n throw new Exception(\"Alle Knoten sind groesser als der angegebene Wert!\");\n }\n\n return getMaxNodeFromSeq();\n }"
] | [
"0.78352994",
"0.74212664",
"0.7348507",
"0.73100805",
"0.72906965",
"0.7254407",
"0.7249522",
"0.7243569",
"0.7183592",
"0.71438265",
"0.7138847",
"0.70939666",
"0.708939",
"0.70773226",
"0.7062941",
"0.70628387",
"0.7035953",
"0.70149195",
"0.6959007",
"0.6935772",
"0.69286084",
"0.6888338",
"0.6887372",
"0.6857994",
"0.68518597",
"0.6824834",
"0.681709",
"0.6777479",
"0.6776501",
"0.67709553",
"0.67664146",
"0.67438143",
"0.67404294",
"0.6737357",
"0.6724481",
"0.6717233",
"0.66880536",
"0.667959",
"0.66781515",
"0.6666376",
"0.66021514",
"0.6600073",
"0.6597839",
"0.6595523",
"0.65676624",
"0.65394807",
"0.65320635",
"0.652672",
"0.6499764",
"0.6478699",
"0.64762056",
"0.6460687",
"0.64453864",
"0.6403266",
"0.6392146",
"0.6390454",
"0.6381952",
"0.6373222",
"0.636714",
"0.636328",
"0.6361654",
"0.6359517",
"0.6355523",
"0.63467205",
"0.6338352",
"0.6336103",
"0.63249856",
"0.63161474",
"0.6305426",
"0.62983656",
"0.6294157",
"0.6283823",
"0.6270441",
"0.62499964",
"0.62463",
"0.6235932",
"0.6232828",
"0.6227862",
"0.6214571",
"0.6192658",
"0.6183851",
"0.61601394",
"0.61462194",
"0.61256695",
"0.61239946",
"0.61184055",
"0.6105396",
"0.61048836",
"0.60987294",
"0.6095611",
"0.608563",
"0.60712034",
"0.6067407",
"0.6055606",
"0.60554165",
"0.6047899",
"0.6043937",
"0.604028",
"0.60380924",
"0.6029983"
] | 0.65020305 | 48 |
find the node with a specific key(it returns the first node that has the given key) | public Node search(K key) {
Node currentNode = this.mRoot;
// start from the root of the tree that calls the method
while (currentNode != mSentinel && key.compareTo(currentNode.getKey()) != 0) {
// if the current node is not empty and its key is not equal to the
// search key
if (key.compareTo(currentNode.getKey()) < 0) {
currentNode = currentNode.getLeftChild();
// go left if the search key is lower
} else {
currentNode = currentNode.getrightChild();
// go right if the search key is higher
}
// break the loop if the search key matches the node key
}
if (currentNode == mSentinel) {
return null;
// if there is not a match return nu;;
} else {
return currentNode;
// return the first node with the same key as the search key
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node findKey(String key){\n Node N = front;\n while(N != null){\n if(N.key.equals(key)){\n return N; \n }\n else{\n N = N.next; \n }\n }\n return null;\n }",
"@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }",
"public TFNode findNode(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n\r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node;\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }",
"private Node find(String key) {\n Node now = head;\n while (now != null) {\n if (now.pairStringString.getKey().equals(key)) {\n return now;\n }\n now = now.next;\n }\n return null;\n }",
"public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }",
"public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }",
"public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}",
"public Node getNode(String key) {\n \ttmp = first;\n \tint i;\n \tfor (i=0;i<len;i++) {\n \t\tif (tmp.key == key) {\n \t\t\treturn tmp;\n \t\t}\n \t\ttmp = tmp.getNext();\n \t}\n \treturn null;\n }",
"private ListNode find(K key) {\r\n\t\t\tif (key == null) throw new NullPointerException();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tif (current.key.equals(key)) return current;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}",
"private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }",
"public V find(K key) {\n Node<K,V> node = root;\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n return node.value;\n }\n }\n return null;\n }",
"public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}",
"private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }",
"public Entry find(Object key) {\n int i = compFunction(key.hashCode());\n SList chain = buckets[i];\n try {\n for (SListNode n = (SListNode) chain.front(); n.isValidNode(); n = (SListNode) n.next()) {\n Entry e = (Entry) n.item();\n if (e.key.equals(key)) {\n return e;\n }\n }\n } catch(InvalidNodeException e) {\n System.out.println(e);\n }\n return null;\n }",
"public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }",
"private SkipNode<K, V> findNode(Object key) {\n\t\tSkipNode<K, V> nodeOut;\n\t\tnodeOut = headNode;\n\t\twhile (true) {\n\t\t\twhile ((nodeOut.getNext().getKey()) != posInf\n\t\t\t\t\t&& (nodeOut.getNext().getKey()).compareTo((Integer) key) <= 0)\n\t\t\t\tnodeOut = nodeOut.getNext();\n\t\t\tif (nodeOut.getDown() != null)\n\t\t\t\tnodeOut = nodeOut.getDown();\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\treturn nodeOut;\n\t}",
"public static Node find(Node node, int search_key){\n if(node!=null){ // node ที่รับมาต้องมีตัวตน\n if (search_key== node.key){ //ถ้าเจอ node ที่ตามหา ส่งค่าออกไป\n return node;\n }\n else if (search_key > node.key) { //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n return find(node.right,search_key); // recursive โดยส่ง right-subtree\n }\n else{\n return find(node.left,search_key); // recursive โดยส่ง left-subtree\n }\n }\n else return null;\n\n }",
"public String find(int key) {\n\t\t//YOUR CODE HERE\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn find(key,root);\n\t}",
"public String lookup(String key){\n Node N = front;\n while( N != null){\n if( N.key.equals(key)){\n return N.value;\n }\n N = N.next;\n }\n return null;\n }",
"public TValue find(TKey key) {\n Node n = bstFind(key, mRoot); // find the Node containing the key if any\n if (n == null || n == NIL_NODE)\n throw new RuntimeException(\"Key not found\");\n return n.mValue;\n }",
"public Entry find(Object key) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n if(defTable[index].isEmpty()) {\n return null;\n }\n\n Entry entry = new Entry();\n ListNode current = defTable[index].front();\n\n try{\n while(true) {\n if(((Entry) current.item()).key().equals(key)) {\n entry.key = key;\n entry.value = ((Entry) current.item()).value();\n return entry;\n }\n if(current==defTable[index].back()) {\n break;\n }\n current = current.next();\n }\n } catch(Exception err) {\n System.out.println(err);\n }\n return null;\n }",
"private Node<Pair<K, V>> search(\n BiDirectionalNullTerminatedTailedLinkedList<Pair<K, V>> list,\n K key) {\n\n for (Node<Pair<K, V>> i = list.getHead().getNext(); i != list.getTail();\n i = i.getNext()) {\n if (i.getData().key.equals(key)) {\n return i;\n }\n }\n\n return null;\n }",
"private TFNode search(TFNode node, Object key) throws TFNodeException {\r\n\r\n // Check for empty node\r\n if (node.getNumItems() == 0) {\r\n throw new TFNodeException(\"Search discovered an empty node\");\r\n }\r\n\r\n int index = FFGTE(node, key);\r\n TFNode child = node.getChild(index);\r\n\r\n // If the node contains they key, return node\r\n if (index < node.getNumItems()) {\r\n if(treeComp.isEqual(node.getItem(index).key(), key)){\r\n return node;\r\n }\r\n }\r\n \r\n // If the node is a leaf, return node\r\n if (child == null) {\r\n return node;\r\n // If neither of the above, keep searching\r\n } else {\r\n return search(child, key);\r\n }\r\n \r\n }",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public MyBinaryNode<K> search(K key) {\n\t\t\n\t\treturn searchRecursive(root, key);\n\t}",
"public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }",
"public E find(K key){\n\t\tE output= null;\n\t\t\n\t\tint i = 0;\n\t\twhile (i<keys.length && output == null){\n\t\t\tif(keys[i] != null && keys[i].equals(key))\n\t\t\t\toutput = elem[i];\n\t\t\ti = i + 1;\n\t\t}\n\t\treturn output;\n\t}",
"private Node _locate(Object key){\n\t\tint hashCode = key.hashCode();\r\n\t\tint bucketNum = hashCode % _numBuckets;\r\n\t\treturn _locate(key, bucketNum);\r\n\t}",
"public V find (K key) throws KeyNotFoundException {\n\t\treturn findKey(root, key);\n\t}",
"private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}",
"public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}",
"public Entry find(Object key) {\r\n Entry entry_with_key = new Entry();\r\n entry_with_key.key = key; \r\n int comp_hash = compFunction(entry_with_key.key.hashCode());\r\n if (hash_table[comp_hash] == null) {\r\n return null;\r\n } else {\r\n DList searching = hash_table[comp_hash];\r\n for(Object entry: searching){\r\n if(((Entry) entry).key().equals(key)){\r\n return (Entry) entry;\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n\r\n\r\n }",
"private RadixTree find(Signature key) {\n if (key.isEmpty()) {\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.equals(key)) {\n return children.get(label);\n } else if (label.isPrefix(key)) {\n RadixTree child = children.get(label);\n int len = label.size();\n return child.find(key.suffix(len));\n }\n }\n }\n\n return null;\n }",
"public Entry<K, V> find(K key) {\r\n try {\r\n int hash = key.hashCode();\r\n ListNode<Entry<K, V>> node = table[compFunction(hash)].front();\r\n if (node.isValidNode()) {\r\n return (Entry<K, V>) node.getItem();\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }",
"public String search(Integer key) {\n\t\treturn root.search(key);\n\t}",
"public NodeT getNode(String key) {\n return nodeTable.get(key);\n }",
"public node_info getNode(int key)\n{\n\treturn getNodes().get(key);\n\t\n}",
"private Node findKey(Node R, String targetKey){ \n if(R == null || R.item.key.equals(targetKey)) return R;\n if(R.item.key.compareToIgnoreCase(targetKey)>0) return findKey(R.left, targetKey);\n else return findKey(R.right, targetKey); //(R.item.key.compareToIgnoreCase(targetKey)>0) \n }",
"public Integer search(Integer currentLine, int key) {\r\n\t\t//Key was found or there is not \r\n\t\t//any new Node to search\r\n\t\tif(increaseCompares() && (currentLine==-1 || key==getKey(currentLine))) {\r\n\t\t\treturn currentLine;\r\n\t\t}\r\n\t\t//Get left subtree for searching\t\r\n\t\tif(increaseCompares() && key<getKey(currentLine)) {\r\n\t\t\treturn search(getLeft(currentLine),key);\r\n\t\t}\r\n\t\t//Get right subtree for searching\r\n\t\telse {\r\n\t\t\treturn search(getRight(currentLine),key);\r\n\t\t}\r\n\t\t\r\n\t}",
"public HPTNode<K, V> search(List<K> key) {\n check(key);\n int size = key.size();\n\n // Start at the root, and only search lower in the tree if it is\n // large enough to produce a match.\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n if (current == null || (size - i) > current.maxDepth()) {\n return null;\n }\n current = find(current, i, key.get(i), false);\n }\n if (current == null || current.values == null) {\n return null;\n }\n return current.values.isEmpty() ? null : current;\n }",
"public BTreeNode search(long key) {\n\t\treturn searcher(root, key);\n\t}",
"public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }",
"@Override\n public boolean search(K key) {\n if (rootNode == null)\n return false;\n try {\n return exist(key, rootNode);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n return false;\n }\n }",
"public GraphNode getNode(String key) {\n\treturn nodes.get(key);\n }",
"@Override\r\n\tpublic CacheTreeNode searchTreeNode(String key) {\n\t\tassert (StringUtils.isNotEmpty(key));\r\n\t\tCacheTreeNode node = (CacheTreeNode)this.getCacheData(SUPER_ROOT_KEY);\r\n\t\tif(node != null){\r\n\t\t\treturn node.search(key);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public boolean search(String key){\n DataPair dp = getDataPair(key);\n BTNode out=null;\n if (dp != null)\n out = search(dp);\n return out != null;\n }",
"public DataItem find(int key){\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key);\n\t\twhile(hashArray[hashVal] != null){\n\t\t\tif(hashArray[hashVal].getKey() == key){\n\t\t\t\tDataItem temp = hashArray[hashVal]; //find the item\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t\thashVal += stepSize;\n\t\t\thashVal %= arraySize;\n\t\t}\n\t\treturn null;\n\t}",
"public T get(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node.value;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }",
"@Override\r\n\tpublic CacheTreeNode getOneRootNode(String key) {\n\t\treturn searchTreeNode(key);\r\n\t}",
"public String lookup(String key){\n Node N;\n N = findKey(root, key);\n return ( N == null ? null : N.item.value );\n }",
"public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }",
"public boolean search(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// If Node is less than the current Node then go left.\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\t// we go left\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// If Node is bigger than the current Node then go right.\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\t// we go right\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// Else they are equal\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// OtherWise return false, it doesnt exist.\r\n\t\treturn false;\r\n\t}",
"public Value find(Value key) {\n\t\tValue v = get(key);\n\t\tif (v != null)\n\t\t\treturn v;\n\t\tif (parent != null)\n\t\t\treturn parent.find(key);\n\t\treturn null;\n\t}",
"Node getChild(K key) {\r\n\t\t\tint loc = Collections.binarySearch(keys, key);\r\n\t\t\tint childIndex = loc >= 0 ? loc + 1 : -loc - 1;\r\n\t\t\treturn children.get(childIndex);\r\n\t\t}",
"private Node getChild(char key) {\n for (Node child : children) {\n if (child.getKey() == key) {\n return child;\n }\n }\n return null;\n }",
"public boolean search(int key) {\n\t\tNode currentNode = this.head;\n\t\tdo {\n\t\t\twhile (currentNode.next != null && currentNode.next.key < key) {\n\t\t\t\tcurrentNode = currentNode.next;\n\t\t\t}\n\t\t\tif (currentNode.next != null && currentNode.next.key == key) return true;\n\t\t\tcurrentNode = currentNode.down;\n\t\t} while (currentNode != null);\n\t\treturn false;\n\t}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"public V get(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n V result = null;\r\n if (data[hash] != null) {\r\n Node currentNode = data[hash];\r\n while (currentNode != null) {\r\n if (currentNode.key == key || currentNode.key.equals(key)) {\r\n result = (V) currentNode.value;\r\n }\r\n currentNode = currentNode.next;\r\n }\r\n }\r\n return result;\r\n }",
"@Override\n\tpublic node_data getNode(int key) {\n\n\t\treturn this.Nodes.get(key);\n\n\t}",
"public static <K,V> ItemNode<K,V> search(ItemNode<K,V> node, K k) {\n while (node != null && !k.equals(node.k))\n node = node.next;\n return node;\n }",
"public V search(K key);",
"private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}",
"@Override\n\tpublic Node findChild(byte partialKey) {\n\t\tpartialKey = BinaryComparableUtils.unsigned(partialKey);\n\t\tfor(int i = 0; i < noOfChildren; i++){\n\t\t\tif(keys[i] == partialKey){\n\t\t\t\treturn children[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Node namedItem(final String key) {\n final int length = getLength();\n for (int i = 0; i < length; i++) {\n final Node n = item(0);\n if (n instanceof Element) {\n final Element element = (Element) n;\n if (key.equals(element.getAttribute(\"id\")) || key.equals(element.getAttribute(\"name\"))) {\n return n;\n }\n }\n\n }\n return null;\n }",
"private TFNode findIoS(TFNode node, Object key) {\r\n if (node.getChild(0) != null) {\r\n // Go right once\r\n node = node.getChild(FFGTE(node, key) + 1);\r\n\r\n // Then go left all the way to the bottom\r\n while (node.getChild(0) != null) {\r\n node = node.getChild(0);\r\n }\r\n }\r\n return node;\r\n }",
"private Node locatePrevNode(K key) { \n\t\tNode p = null; \n\t\tNode current = first; \n\t\twhile (current != null && current.getData().getKey().compareTo(key) < 0) {\n\t\t\tp = current; \n\t\t\tcurrent = current.getNext(); \n\t\t}\n\t\treturn p; \n\t}",
"private KeyedItem retrieve(BinarySearchTree currentNode, Comparable key){\r\n\t\t\r\n\t\t//item to return if found\r\n\t\tKeyedItem item = null;\r\n\t\t\r\n\t\t//Node is null, we are at a empty leaf. Item not found\r\n\t\tif(currentNode == null){\r\n\t\t\tthrow new TreeException(\"Key not found. Tree is empty.\");\r\n\t\t}\r\n\t\t//Check right tree if key is greater\r\n\t\telse if(currentNode.getRoot().getKey().compareTo(key) < 0){\r\n\t\t\titem = retrieve(currentNode.getRightChild(), key);\r\n\t\t}\r\n\t\t//Check left tree if key is less than\r\n\t\telse if(currentNode.getRoot().getKey().compareTo(key) > 0){\r\n\t\t\titem = retrieve(currentNode.getLeftChild(), key);\r\n\t\t}\r\n\t\t//Key is equal, found the item\r\n\t\telse if(currentNode.getRoot().getKey().compareTo(key) == 0){\r\n\t\t\titem = currentNode.getRoot();\r\n\t\t}\r\n\t\t\r\n\t\treturn item;\r\n\t}",
"public Object get(Object key){\n\t\tNode tempNode = _locate(key);\r\n\t\tif(tempNode != null){\r\n\t\t\treturn tempNode._value;\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public Node findClosest(int search_key){\n\n Node current, closest; //จำตำแหน่ง node ตอนนี้\n closest = current = root; // เก็บตำแหน่ง node ที่ใกล้ค่าที่หามากสุด\n int min_diff = Integer.MAX_VALUE; // ตัวเปรียบเทียบคสาต่าง\n while (current!= null){ // Use while loop to traverse from root to the closest leaf\n if (search_key == current.key){ //ถ้าเจอก็ return\n return current;\n }\n else{\n if(Math.abs(current.key - search_key) < min_diff){ //หาค่าความต่าง ถ้าอันใหม่ต่างน้อยกว่า แสดงว่าใกล้กว่า\n min_diff = Math.abs(current.key - search_key);\n closest = current;\n }\n\n }\n\n if(search_key < current.key) // กำหยดว่าจะลงไปในทิศทางไหนของ subtree\n {current = current.left;}\n else{current = current.right;}\n }\n\n\n\n return closest;\n }",
"private Element getElementByKeyRef(Node node) {\n\t\tElement ref ;\n\t\t\t\n\t\tString refType = getDocumentXpath(node);\n\t\tSystem.out.println(\"search ref for : \"+refType);\n\t\t/* get ref attribute */\n\t\tString refId = node.getTextContent();\n\t\tif (refId == null || refId.equals(\"\")){ \n\t\t\tfor (int i = 0; i< node.getAttributes().getLength(); i++) {\n//\t\t\t\tSystem.out.println(node.getAttributes().item(i).getNodeName()+\" :: \"+node.getAttributes().item(i).getTextContent());\n\t\t\t\tif (node.getAttributes().item(i).getNodeName().equals(refAttribute)){\n\t\t\t\t\t\trefId = node.getAttributes().item(i).getNodeValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tString referedType = (String) refType2referedType.get(refType)\t;\t\n\t\t\n\t\tref = (Element) xsKeyNodes.get(referedType+\"#\"+refId);\t\t\n\t\treturn ref;\n\t}",
"@Nullable IStrongSlot find(LuaValue key);",
"@Override\n public Node getNodeByKey(String hashKey) {\n long key = Math.abs(Long.valueOf(hashKey));\n\n if (availableNodes.isEmpty()) {\n return null;\n }\n\n int index = (int) (key % availableNodes.size());\n Node node = availableNodes.get(index);\n if (node == null) {\n logger.error(\"failt to get hash node, the hash key:\" + hashKey);\n }\n return node;\n }",
"protected TSTNode<E> getNode(String key, TSTNode<E> startNode) {\n if(key == null || startNode == null || key.length() == 0) return null;\n TSTNode<E> currentNode = startNode;\n int charIndex = 0;\n \n while(true) {\n if (currentNode == null) return null;\n int charComp = compareCharsAlphabetically(key.charAt(charIndex), currentNode.splitchar);\n \n if (charComp == 0) {\n charIndex++;\n if(charIndex == key.length()) return currentNode;\n currentNode = currentNode.relatives[TSTNode.EQKID];\n } else if(charComp < 0) {\n currentNode = currentNode.relatives[TSTNode.LOKID];\n } else { \n // charComp must be greater than zero\n currentNode = (TSTNode<E>)currentNode.relatives[TSTNode.HIKID];\n }\n }\n }",
"@Override\n public node_data getNode(int key) {\n return nodes.get(key);\n }",
"public RBNode search(RBNode x, int k){\r\n\t\twhile (x != nil && k != x.key){\r\n\t\t\tif (k < x.key)\r\n\t\t\t\tx = x.left;\r\n\t\t\telse x = x.right;\r\n\t\t}\r\n\t\treturn x;\r\n\t}",
"private Node getChild(K key) {\r\n\r\n // binarySearch for the correct index\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int child_indexing;\r\n if (correct_place >= 0) {\r\n child_indexing = correct_place + 1;\r\n } else {\r\n child_indexing = -correct_place - 1;\r\n }\r\n\r\n return children.get(child_indexing);\r\n }",
"public MyNode findMyNode(Node node){\r\n\t\treturn nodesMap.get(node);\r\n\t}",
"@Override\n\tpublic K lookup(K key) {\n\t\treturn lookup(root, key);\n\t}",
"public boolean SearchElem(int key) {\n\t\t\n\t\tNode curr = head;\n\t\twhile(curr.next!=null) {\n\t\t\tif(curr.data == key)\n\t\t\t\treturn true;\t//Return true if element is found\n\t\t\tcurr = curr.next;\n\t\t}\n\t\t\n\t\treturn false; //Return false if element is not found\n\t}",
"public int find(K key){\r\n int k =0;\r\n int ik;\r\n while(true){\r\n ik = getIndex(k,key);\r\n if(hashTable[ik] == null || hashTable[ik].equals(key))\r\n return ik;\r\n else if(hashTable[ik].isDeleted){ // deleted\r\n break;\r\n }else{\r\n k++;\r\n }\r\n }\r\n int xspot = ik;\r\n while(true){\r\n k++;\r\n if(hashTable[ik]!=null && hashTable[ik].equals(key)){\r\n return ik;\r\n }\r\n if(hashTable[ik] == null){\r\n return xspot;\r\n }\r\n }\r\n }",
"private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public V get(K key){\n\t\t\n\n\t\tNode n=searchkey(root, key);\n\n\t\t\n\t\tif(n!=null && n.value!=null){\n\t\t\treturn n.value;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}",
"public E searchHelper(K key, BSTNode<E, K> node)\r\n\t{\r\n\t\tE left = null;\r\n\t\tE right = null;\r\n\t\t\r\n\t\tif(node.getKey().compareTo(key) <= -1) //root is less than key\r\n\t\t{\r\n\t\t\tif(node.getRight()!=null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getRight());\r\n\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) >= 1)\r\n\t\t{\r\n\t\t\tif(node.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getLeft());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) == 0)\r\n\t\t{\r\n\t\t\treturn node.getElement();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}",
"public Data get(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n return next == null ? null\n : next.data;\n }",
"public V search(K key) throws KeyNotFoundException {\n\tif (!RBT.containsKey(key))\n\t throw new KeyNotFoundException();\n return (V) RBT.get(key);\n }",
"public ElectionTable.ElectionNode searchElection(String key){\n int chain=hashFunction(key);\r\n if (electionTable[chain] !=null) {\r\n System.out.println(\"found Election!!!\");\r\n return electionTable[chain];\r\n } else {\r\n System.out.println(\"not found Election!!!\");\r\n return null;\r\n }\r\n }",
"public TSTNode<E> getNode(String key) {\n return getNode(key, rootNode);\n }",
"public Value get(Key key) {\n\t\tNode node = current_node;\n\t\twhile(!node.key.equals(key)) node = node.next;\n\t\treturn node.value;\n\t}",
"String search(int key);",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }"
] | [
"0.80861753",
"0.8083351",
"0.79533255",
"0.79017115",
"0.78995246",
"0.7881532",
"0.78505605",
"0.7728152",
"0.7564721",
"0.75455767",
"0.753012",
"0.751525",
"0.7506547",
"0.74879324",
"0.7406138",
"0.73363364",
"0.73351014",
"0.7335026",
"0.72983444",
"0.72664666",
"0.726346",
"0.7259529",
"0.7228452",
"0.71998554",
"0.7195224",
"0.71910226",
"0.71873856",
"0.7168304",
"0.7164504",
"0.7100124",
"0.7096052",
"0.7085046",
"0.7080458",
"0.70790607",
"0.70737433",
"0.7066866",
"0.7060936",
"0.7034",
"0.7031793",
"0.70210236",
"0.7008641",
"0.70058626",
"0.7000618",
"0.69843656",
"0.69556814",
"0.6952491",
"0.69144964",
"0.6913648",
"0.68874276",
"0.6857322",
"0.68254113",
"0.6816599",
"0.6788087",
"0.6784473",
"0.6775121",
"0.67600346",
"0.67592865",
"0.6754966",
"0.67544776",
"0.674199",
"0.6741076",
"0.672773",
"0.67263573",
"0.67206067",
"0.6718322",
"0.67132825",
"0.6710294",
"0.6708707",
"0.66993743",
"0.6667093",
"0.66447693",
"0.6633914",
"0.66323334",
"0.6612492",
"0.66083837",
"0.66050357",
"0.6588586",
"0.6584354",
"0.65831965",
"0.6561035",
"0.6549885",
"0.6543871",
"0.65425885",
"0.65422934",
"0.6539305",
"0.65286225",
"0.6527221",
"0.6525832",
"0.65239",
"0.6517739",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436",
"0.65125436"
] | 0.76255125 | 8 |
this method calculates the depth of a given node in a tree | public int calculateNodeDepth(Node startNode) {
int depthCounter = 0;
// start from zero
if (!(startNode == this.mRoot)) {
while (startNode.getParent() != this.mRoot) {
startNode = startNode.getParent();
depthCounter++;
// count upwards while the node's parent is not root
}
} else {
return 0;
}
return depthCounter;
// return the count
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int depth(BTNode node) {\n int d = 0;\n while (node != root) {\n node = node.parent;\n d++;\n }\n return d;\n }",
"public int getNodeDepth() {\n int depth = 0;\n TreeNode tn = this;\n \n while(tn.getFather() != null) {\n tn = tn.getFather();\n depth++;\n }\n \n return depth;\n }",
"public int depth(){\n if(root!=null){ // มี node ใน tree\n return height(root);\n }\n else {return -1;}\n }",
"public int depth ( BinTree tree){\n\t\tint x = 1; \n\t\twhile( tree.left != null){\n\t\t\ttree= tree.left;\n\t\t\tx++;\n\t\t}\n\t\treturn x;\n\t}",
"public int getDepthFromNode (String node){\n \t if (Flags.semant_debug){\n \t \tSystem.out.println(\"NODE NAME IS :\" + node);\n \t \tSystem.out.println(getDepth);\n\t }\n int depth = getDepth.get(node);\n return depth;\n }",
"public static int depth(Node root, Node node){\n\n if(node!=root){ // node มีตัวตน\n return 1 + depth (root,node.parent) ; // depth = length(path{node->root})\n\n }\n else {\n return 0;\n }\n\n }",
"public static int nodeDepth(PhyloTreeNode node) {\n if(node == null) {\n return -1;\n }\n else if(node.getParent() == null) {\n return 0;\n }\n else{\n return 1 + nodeDepth(node.getParent());\n }\n }",
"public static int getNodeDepth(BinaryTreeNode node) {\n int depth = 0;\n while (node != null) {\n node = node.parent;\n depth++;\n }\n return depth;\n }",
"private Integer getDepth(BinaryNode node, int depth) {\n\n if (node == null) return depth;\n else return Math.max(getDepth(node.left, depth + 1),getDepth(node.right, depth + 1));\n }",
"public int depth(){\n\t\tint depth = 0;\n\t\tif(this.isEmpty()){\n\t\t\treturn depth;\n\t\t} else {\n\t\t\tdepth= 1;\n\t\t}\n\t\tQueue queue = new Queue();\n\t\tqueue.enqueue(this);\n\t\t\n\t\twhile(!queue.isEmpty()){\n\t\t\tBinaryTree tree = (BinaryTree) queue.dequeue();\n\t\t\tif(tree.left.getElement()!=null){\n\t\t\t\tqueue.enqueue(tree.left);\n\t\t\t\tdepth++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn depth;\n\t}",
"public double getDepth();",
"public int depth ();",
"private int depth()\r\n\t{\r\n\t\t// If tree is empty then there are 0 levels\r\n\t\tif(isEmpty())\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Tree is not empty so use recursive depth method starting at Root level 1 to figure out depth\r\n\t\treturn depth(getRoot(), 1);\r\n\t}",
"int getDepth();",
"int depth();",
"int depth();",
"public int getDepth();",
"public int getDepth(HuffmanTreeNode node) {\n\t\tif (node == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\tint leftDepth = getDepth(node.getLeft());\n\t\t\tint rightDepth = getDepth(node.getRight());\n\t\t\t\n\t\t\tif (leftDepth > rightDepth)\n\t\t\t\treturn (leftDepth+1);\n\t\t\telse\n\t\t\t\treturn (rightDepth+1);\n\t\t}\n\t}",
"public int getDepth() {\n return getDepthRecursive(root);\n\n }",
"public int getDepth() {\r\n\t\tint depth = 0;\r\n\t\tSearchNode<S, A> ancestor = this;\r\n\t\twhile(ancestor.parent != null) {\r\n\t\t\tdepth++;\r\n\t\t\tancestor = ancestor.parent;\r\n\t\t}\r\n\t\treturn depth;\r\n\t}",
"private static int maxDepth(TreeNode node) {\r\n\t\tif (node == null) return 0;\r\n\t\treturn 1 + Math.max(maxDepth(node.left), maxDepth(node.right));\r\n\t}",
"float getDepth();",
"float getDepth();",
"int depth(Node root) {\n\t\tif (root == null) return 0;\n\t\treturn Math.max(depth(root.left), depth(root.right)) + 1 ;\n\t}",
"private static int calculateNodeDepths(Node root, int depth) {\n\t\tif(root == null)\n\t\t\treturn 0;\n//\t\tSystem.out.println(root.data);\n\t\treturn depth + calculateNodeDepths(root.left, depth + 1) + calculateNodeDepths(root.right, depth + 1); \n\t}",
"public int depthHelp(BSTNode<E,K> node)\r\n\t{\r\n\t\tint sum1 = 0;\r\n\t\tint sum2 = 0;\r\n\t\tif(node.getLeft() != null)\r\n\t\t{\r\n\t\t\tsum1 += depthHelp(node.getLeft());\r\n\t\t}\r\n\t\tif(node.getRight() != null)\r\n\t\t{\r\n\t\t\tsum2 += depthHelp(node.getRight());\r\n\t\t}\r\n\t\tif(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(sum1>sum2)\r\n\t\t{\r\n\t\t\treturn sum1 +1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn sum2 +1;\r\n\t\t}\r\n\t}",
"public int depth() { return Math.max(left.depth(), right.depth()) + 1; }",
"public int getDepth(){\n\t\treturn _depth;\n\t}",
"public int getDepth(){\r\n return this.depth;\r\n }",
"public static int getDepth() {\n return depth;\n }",
"public int getDepth(){\n\t\treturn depth;\n\t}",
"private int getDepthRecursive(Node currNode) {\n int max = 0;\n int val;\n\n // Return 0 if this Node is null or if it is invalid.\n if (currNode == null || currNode.key < 0) return 0;\n\n // Finds the maximum depth of this Node's subtrees.\n for (int i = 0; i < getNumChildren(); ++i) {\n val = getDepthRecursive(currNode.children[i]);\n max = Math.max(max, val);\n\n }\n\n // Returns the maximum depth of this Node's subtree plus one.\n return max + 1;\n\n }",
"public int getDepth() {\r\n return depth;\r\n }",
"private int depth(Node current, int level)\r\n\t{\r\n\t\t// Current Node has two Children\r\n\t\tif(current.hasTwo())\r\n\t\t{\r\n\t\t\t// Traverse left subtree and obtain its level\r\n\t\t\tint tempLeft = (depth(current.getLeftChild(), level + 1));\r\n\t\t\t// Traverse right subtree and obtain its level\r\n\t\t\tint tempRight = (depth(current.getRightChild(), level + 1));\r\n\t\t\t// Return the maximum of the levels that were traversed by the left and right subtrees\r\n\t\t\treturn Math.max(tempLeft, tempRight);\r\n\t\t}\r\n\t\t// Current Node has no children (aka is a leaf)\r\n\t\telse if(current.isLeaf())\r\n\t\t{\r\n\t\t\treturn level;\r\n\t\t}\r\n\t\t// Current Node only has right child\r\n\t\telse if(current.getLeftChild() == null)\r\n\t\t{\r\n\t\t\treturn depth(current.getRightChild(), level + 1);\r\n\t\t}\r\n\t\t// Current Node only has left child\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn depth(current.getLeftChild(), level + 1);\r\n\t\t}\r\n\t}",
"int depthNoR(Node root) {\n\t\tNode endOfLevelMarker = new Node(-100);\n\n\t\tQueue<Node> s = new LinkedList<Node>();\n\t\t\n\t\ts.add(root);\n\t\ts.add(endOfLevelMarker);\n\n\t\tint depth = 0;\n\n\n\t\twhile (!s.isEmpty()) {\n\t\t\tNode k = s.poll();\n\n\t\t\tif (k != null) {\n\t\t\t\tif (k.data == -100) {\n\t\t\t\t\tdepth++;\n\t\t\t\t\tif (!s.isEmpty()) { // It was the last node. Without this check we will keep putting and popping marker forever.\n\t\t\t\t\t\ts.add(endOfLevelMarker);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (k.left != null) {\n\t\t\t\t\t\ts.add(k.left);\n\t\t\t\t\t}\n\t\t\t\t\tif (k.right != null) {\n\t\t\t\t\t\ts.add(k.right);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn depth;\n\t}",
"int getRecursionDepth();",
"public int getDepth() {\n return depth;\n }",
"public int getDepth()\n {\n return depth; \n }",
"public int depth() {\r\n\t\treturn this.depth;\r\n\t}",
"public int getDepth()\n {\n return m_Depth;\n }",
"public String getnDepth() {\n return nDepth;\n }",
"public int getTreeDepth() {\r\n\t\tmaxDepth = 0;\r\n\t\treturn getTreeDepth(root, 0);\r\n\t}",
"public int depth() {\n\t\treturn depthHelp(root);\r\n\t}",
"public static int nodeDepths(BinaryTree node, int depth) {\n if(node == null) return 0;\n return depth + nodeDepths(node.left, depth + 1) + nodeDepths(node.right, depth + 1);\n }",
"public int treeDepth(TreeNode root){\n if(root == null){\n return 0;\n }\n return 1 + Math.max(treeDepth(root.left), treeDepth(root.right));\n }",
"private static int minDepth(TreeNode node) {\r\n\t\tif (node == null) return 0;\r\n\t\treturn 1 + Math.min(minDepth(node.left), minDepth(node.right));\r\n\t}",
"public int getDepth(String categoryName);",
"public int getDepth() {\n return depth_;\n }",
"public int getDepth() {\n return depth_;\n }",
"@Override\r\n\tpublic double getDepth()\r\n\t{\r\n\r\n\t\tList<Entity> roots = new Stack<Entity>();\r\n\t\troots.addAll(getRoots());\r\n\r\n\t\tif (roots.size() == 0) {\r\n\t\t\tlogger.error(\"There is no root for this lexical semantic resource.\");\r\n\t\t\treturn Double.NaN;\r\n\t\t}\r\n\t\telse if (roots.size() > 1) {\r\n\t\t\tlogger.error(\"There are several roots for this lexical semantic resource.\");\r\n\t\t\treturn Double.NaN;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tEntity root = roots.get(0);\r\n\t\t\t// return getEccentricity(root);\r\n\r\n\t\t\tdouble maxPathLength = 0.0;\r\n\t\t\tdouble[] returnValues = computeShortestPathLengths(root, 0.0,\r\n\t\t\t\t\tmaxPathLength, new HashSet<Entity>());\r\n\t\t\tmaxPathLength = returnValues[1];\r\n\t\t\treturn maxPathLength;\r\n\t\t}\r\n\t}",
"public int maxDepht(Node node){\n //if a tree is empty then return 0\n if (node == null)\n return 0;\n\n else {\n //compute the depth of each subtree\n int leftDepth = maxDepht(node.left);\n int rightDepth = maxDepht(node.right);\n\n if (leftDepth > rightDepth)\n return leftDepth+1;\n else\n return rightDepth+1;\n }\n }",
"public static int getDepth(FeatureNode word)\n\t{\n\t\tif (null == word) return 0;\n\t\tint maxdepth = 0;\n\t\tFeatureNode fn = word.get(\"phr-head\");\n\t\twhile (fn != null)\n\t\t{\n\t\t\tFeatureNode subf = fn.get(\"phr-head\");\n\t\t\tif (subf != null)\n\t\t\t{\n\t\t\t\tint depth = getDepth(fn);\n\t\t\t\tif (maxdepth < depth) maxdepth = depth;\n\t\t\t}\n\t\t\tfn = fn.get(\"phr-next\");\n\t\t}\n\t\treturn maxdepth+1;\n\t}",
"public float getDepth() {\r\n\t\treturn Float.parseFloat(getProperty(\"depth\").toString());\t\r\n\t}",
"public int getDepth()\n {\n return traversalStack.size();\n }",
"public static <E extends Comparable> int deep(TreeNode<E> root) {\r\n \r\n Queue<TreeNode<E>> queue = new LinkedList<>();\r\n \r\n int deep = 0;\r\n \r\n queue.add(root);\r\n TreeNode<E> startNewLine = root;\r\n \r\n while(!queue.isEmpty()) {\r\n TreeNode<E> currentNode = queue.poll();\r\n if(currentNode == startNewLine) {\r\n startNewLine = null;\r\n deep ++;\r\n }\r\n if(currentNode.getLeft() != null) queue.add(currentNode.getLeft());\r\n if(startNewLine == null) {\r\n startNewLine = currentNode.getLeft();\r\n }\r\n if(currentNode.getRight()!= null) queue.add(currentNode.getRight());\r\n if(startNewLine == null) {\r\n startNewLine = currentNode.getRight();\r\n }\r\n }\r\n \r\n \r\n return deep;\r\n }",
"static int sumOfDepths( TreeNode node, int depth ) {\n if ( node == null ) {\n // Since the tree is empty and there are no leaves,\n // the sum is zero.\n return 0;\n }\n else if ( node.left == null && node.right == null) {\n // The node is a leaf, and there are no subtrees of node, so\n // the sum of the leaf depth is just the depths of this node.\n return depth;\n }\n else {\n // The node is not a leaf. Return the sum of the\n // the depths of the leaves in the subtrees.\n return sumOfDepths(node.left, depth + 1) \n + sumOfDepths(node.right, depth + 1);\n }\n }",
"private int getDepthRaw(TreeNode root){\n if (root == null) {\n return 0;\n }\n\n int left = getDepthRaw(root.left);\n int right = getDepthRaw(root.right);\n if (left == -1 || right == -1) {\n return -1;\n }else{\n if (Math.abs(left - right) > 1) {\n return -1;\n }else{\n return Math.max(left, right) + 1;\n }\n }\n }",
"private int getTreeDepth(Node root, int depth) {\r\n\t\tif (root == null) {\r\n\t\t\treturn depth - 1;\r\n\t\t}\r\n\t\tif (depth > maxDepth) {\r\n\t\t\tmaxDepth = depth;\r\n\t\t}\r\n\t\tint lChildDepth = getTreeDepth(root.getlChild(), depth + 1);\r\n\t\tint rChildDepth = getTreeDepth(root.getrChild(), depth + 1);\r\n\r\n\t\treturn lChildDepth > rChildDepth ? lChildDepth : rChildDepth;\r\n\t}",
"private void computeClassDepth(Class toTag, int depth) {\n\t\t// Check transitive relations\n\t\tif (toTag.getDepth() > depth)\n\t\t\tdepth = toTag.getDepth();\n\n\t\t// Tag class\n\t\ttoTag.setDepth(depth);\n\t\tdepth++;\n\n\t\t// Explore childs\n\t\tfor (Class child : toTag.getSubClasses()) {\n\t\t\tcomputeClassDepth(child, depth);\n\t\t}\n\t}",
"private int setDepth() {\n int getDepth = depth;\n if (depth != -1) {\n getDepth = depth + 1;\n }\n return getDepth;\n }",
"int getMax_depth();",
"int maxDepth();",
"protected abstract double lookupDepth(int depthX, int depthY);",
"public float getDepth() {\n return depth;\n }",
"public float getDepth() {\n return depth_;\n }",
"void calculating(int depth);",
"public float getDepth() {\n return depth_;\n }",
"public float getDepth() {\n return depth_;\n }",
"public int treeHigh(TreeNode node) \n { \n if (node == null) \n return 0; \n else \n { \n /* compute the depth of each subtree */\n int lDepth = treeHigh(node.left); \n int rDepth = treeHigh(node.right); \n \n /* use the larger one */\n if (lDepth > rDepth) \n return (lDepth + 1); \n else \n return (rDepth + 1); \n } \n }",
"int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }",
"public static int getLevels(TreeNode node){ //pass root to this\n\t\t if(node == null){\n\t\t\t return 0; \n\t\t }\n\t\t \n\t\t return 1+Math.max(getLevels(node.left),getLevels(node.right));\n\t }",
"public float getDepth() {\n return depth_;\n }",
"public abstract int getNodeDegree(N value);",
"int getDepthIndex() {\n return depthIndex;\n }",
"private void assignDepths(String node, int depth){\n getDepth.put(node, depth);\n \tArrayList<String> children = adjacencyList.get(node);\n \n if (children == null) return;\n \t//if there are children, assign depths to each, and recurse\n if (!children.isEmpty()){\n\t \tdepth = depth +1;\n\t \tfor (String child : children) {\n\t \t assignDepths(child, depth);\n }\n }\n \n }",
"void incrementNewDepth() {\n mNewDepth++;\n }",
"@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}",
"private static int nodeDepthsIterativeQueue(Node root) {\n\t\tQueue<Level>q = new LinkedList<>();\n\t\tint result = 0;\n\t\tq.add(new Level(root, 0));\n\t\twhile(!q.isEmpty()) {\n\t\t\tLevel curr = q.poll();\n\t\t\tif(curr.root == null)\n\t\t\t\tcontinue;\n\t\t\tresult += curr.depth;\n\t\t\tSystem.out.println(curr.toString());\n\t\t\tq.add(new Level(curr.root.left, curr.depth + 1));\n\t\t\tq.add(new Level(curr.root.right, curr.depth + 1));\n\t\t}\n\t\treturn result;\n\t}",
"static int maximumDepth( TreeNode node, int depth ) {\n if ( node == null ) {\n // The tree is empty. Return 0.\n return 0;\n }\n else if ( node.left == null && node.right == null) {\n // The node is a leaf, so the maximum depth in this\n // subtree is the depth of this node (the only leaf \n // that it contains).\n return depth;\n }\n else {\n // Get the maximum depths for the two subtrees of this\n // node. Return the larger of the two values, which\n // represents the maximum in the tree overall.\n int leftMax = maximumDepth(node.left, depth + 1);\n int rightMax = maximumDepth(node.right, depth + 1);\n if (leftMax > rightMax)\n return leftMax;\n else\n return rightMax;\n }\n }",
"boolean hasDepth();",
"boolean hasDepth();",
"public int maxDepth2(Node root) {\r\n\t\tif(root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\tQueue<Node> queue = new LinkedList<Node>();\r\n\t\tqueue.offer(root);\r\n\t\t\r\n\t\tint depth = 0;\r\n\t\t\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\tint levelSize = queue.size();\r\n\t\t\t\r\n\t\t\tdepth++;\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<levelSize; i++) {\r\n\t\t\t\tNode current = queue.poll();\r\n\t\t\t\t\r\n\t\t\t\tfor(Node node : current.children) {\r\n\t\t\t\t\tqueue.offer(node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn depth;\r\n\t}",
"@Override\r\n public int getDepth() {\r\n final int len = getPath().length();\r\n if (len == 0 || len == 1 && getPath().charAt(0) == SEPARATOR_CHAR) {\r\n return 0;\r\n }\r\n int depth = 1;\r\n for (int pos = 0; pos > -1 && pos < len; depth++) {\r\n pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);\r\n }\r\n return depth;\r\n }",
"public JSONObject getDepth() throws Exception;",
"public byte getBitDepth();",
"public static int nodeDepths(BinaryTree root) {\n if (root == null)\n return 0;\n return nodeDepth(root, 0);\n }",
"public int findHieghtOfTree(Node r) {\r\n\t\tif(r==null) \r\n\t\t\treturn 0;\r\n\t\tif(r.left==null && r.right==null)\r\n\t\t\treturn 0;\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tint left=1,right=1;\r\n\t\t\tif(r.left!=null)\r\n\t\t\t\tleft=left+findHieghtOfTree(r.left);\r\n\t\t\tif(r.right!=null)\r\n\t\t\t\tright=right+findHieghtOfTree(r.right);\r\n\t\t\tif(left>right) \r\n\t\t\t\treturn left; \r\n\t\t\telse \r\n\t\t\t\treturn right;\r\n\t\t}\r\n\t\t\r\n\t}",
"private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }",
"private int getHeightofNode(TreeNode node){\n if (node == null) return 0;\n if (getColor(node) == RED) {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right));\n } else {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right))+1;\n }\n }",
"public void increaseDepth() {\n currentDepth++;\n }",
"private int Nodes(BTNode n){\r\n if (n == null)\r\n return 0;\r\n else {\r\n return ( (n.left == null? 0 : Nodes(n.left)) + (n.right == null? 0 : Nodes(n.right)) + 1 );\r\n }\r\n }",
"private static int nodeDepthsIterativeStack(Node root) {\n\t\tStack<Level>st = new Stack<>();\n\t\tst.add(new Level(root, 0));\n\t\tint result = 0;\n\t\twhile(!st.isEmpty()) {\n\t\t\tLevel curr = st.pop();\n\t\t\tif(curr.root == null)\n\t\t\t\tcontinue;\n\t\t\tSystem.out.println(curr.toString());\n\t\t\tresult += curr.depth;\n\t\t\t// Push right before left to process the nodes in inorder fashion.\n\t\t\tst.push(new Level(curr.root.right, curr.depth+1));\n\t\t\tst.push(new Level(curr.root.left, curr.depth+1));\n\t\t}\n\t\treturn result;\n\t}",
"public int maxDepth(Node root) {\n\n int depth = 0;\n\n if (root == null)\n return depth;\n\n Queue<Node> queue = new LinkedList<Node>();\n queue.offer(root);\n\n while (!queue.isEmpty()) {\n // as soon as we encounter node we have to increase the counter\n depth++;\n \n int levelSize = queue.size();\n\n for (int i = 0; i < levelSize; i++) {\n\n Node currentNode = queue.poll();\n\n for (Node child : currentNode.children) {\n queue.offer(child);\n }\n }\n }\n return depth;\n }",
"int getColorDepth();",
"public int diameter(TreeNode root) {\n if (root == null) {\n return 0;\n }\n diameter(root.left);\n diameter(root.right);\n int leftH = maxDepth(root.left);\n int rightH = maxDepth(root.right);\n cacheD = Math.max(cacheD, leftH + rightH);\n return cacheD;\n }",
"@Override\n\tpublic Integer getDepth()\n\t{\n\t\treturn null;\n\t}",
"public void setDepth(double aDepth);",
"int getNewDepth() {\n return mNewDepth;\n }",
"public int minDepth(Node root) \r\n\t {\r\n\t\t if(root == null)\r\n\t return 0;\r\n\t\t \r\n\t int lh = minDepth(root.leftChild);\r\n\t int rh = minDepth(root.rightChild);\r\n\t \r\n\t if(root.leftChild != null && root.rightChild != null)\r\n\t return 1 + Math.min(lh,rh);\r\n\t \r\n\t return 1 + Math.max(lh,rh); \r\n\t }",
"public int maxDepth(Node root)\r\n\t {\r\n\t if(root == null)\r\n\t return 0;\r\n\t \r\n\t int lh = maxDepth(root.leftChild);\r\n\t\t int rh = maxDepth(root.rightChild);\r\n\t\t \r\n\t return Math.max(lh, rh) + 1; \r\n\t }"
] | [
"0.7819409",
"0.76942414",
"0.7601714",
"0.75723034",
"0.7517223",
"0.7464283",
"0.7424462",
"0.7359595",
"0.7275473",
"0.7236457",
"0.7184921",
"0.7176689",
"0.7127687",
"0.71101695",
"0.7088153",
"0.7088153",
"0.70637214",
"0.7010329",
"0.6952117",
"0.68938017",
"0.68145156",
"0.6775589",
"0.6775589",
"0.6768269",
"0.67486155",
"0.6742819",
"0.66544276",
"0.66508967",
"0.6643111",
"0.6620014",
"0.66126657",
"0.6611301",
"0.6576675",
"0.6559414",
"0.65492356",
"0.6528459",
"0.652534",
"0.65124106",
"0.6503077",
"0.6478234",
"0.647456",
"0.64661443",
"0.64344865",
"0.6432272",
"0.6384345",
"0.635604",
"0.63527894",
"0.6342628",
"0.63135904",
"0.63096374",
"0.63080704",
"0.6277479",
"0.625311",
"0.62481296",
"0.62287736",
"0.62018013",
"0.6180379",
"0.6161857",
"0.61534965",
"0.61424655",
"0.6098473",
"0.6074005",
"0.6041853",
"0.6040999",
"0.603666",
"0.60179687",
"0.59978026",
"0.59978026",
"0.59875613",
"0.59791166",
"0.5974129",
"0.59680545",
"0.596261",
"0.59525025",
"0.59346825",
"0.5923614",
"0.59107894",
"0.59105325",
"0.5898774",
"0.5893199",
"0.5893199",
"0.5874779",
"0.585583",
"0.58499926",
"0.583903",
"0.58224094",
"0.57995784",
"0.57991064",
"0.57671297",
"0.57655776",
"0.57599664",
"0.57530856",
"0.5745451",
"0.5738354",
"0.57264036",
"0.5711641",
"0.57084256",
"0.56926197",
"0.5686022",
"0.56806195"
] | 0.70838904 | 16 |
this method calculates the height of a given node in a tree | public int calculateNodeHeigth(Node startNode) {
if (startNode == mSentinel) {
return 0;
// if the start node is empty return 0
} else {
return 1 + Math.max(calculateNodeHeigth(startNode.getLeftChild()),
calculateNodeHeigth(startNode.getrightChild()));
// otherwise recursively call the same function on the right and
// left child of the node(until u meet the recursion's end - empty
// node/0 and get the higher result)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int height(Node<T> node){\n if(node == null){\n return 0;\n }else{\n int leftHight = height(node.left) + 1;\n int rightHight = height(node.right) + 1;\n if(leftHight > rightHight){\n return leftHight;\n }else{\n return rightHight;\n }\n }\n }",
"private int height(Node<T> node){\n if(node == null)\n return 0;\n // get height of left and right side\n int left = height(node.left);\n int right = height(node.right);\n\n // height will be Max of height of left and right + 1 (Own level)\n return 1 + Math.max(left, right );\n\n }",
"public int height(Node tree){\n\t\tif(tree == null){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\tint lheight = height(tree.getLeft());\n\t\t\tint rheight = height(tree.getRight());\n\t\t\t\n\t\t\t//take the branch which is longer\n\t\t\tif(lheight>rheight){\n\t\t\t\treturn (lheight+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn(rheight+1);\n\t\t\t}\n\t\t}\n\t}",
"public int height(Node<T> n) \n\t { \n\t if (n == null) \n\t return 0; \n\t else \n\t { \n\t int lheight = height(n.left); \n\t int rheight = height(n.right); \n\t if (lheight > rheight) \n\t return (lheight + 1); \n\t else \n\t return (rheight + 1); \n\t } \n\t }",
"int get_height(Node node) {\n\t\tif (node == null) \n\t\t\treturn 0;\n\t\telse if (node.leftChild == null && node.rightChild == null)\n\t\t\treturn 0;\t\t\n\t\telse return 1 + max(get_height(node.leftChild), get_height(node.rightChild));\n\t}",
"public int height(){\r\n \r\n // call the recursive method with the root\r\n return height(root);\r\n }",
"@Override\n\tpublic int height() {\n\t\tif(root == null) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tNode tempRoot = root;\n\t\t\treturn heightHelper(tempRoot);\n\t\t}\n\t}",
"public int height(Node node) \n {\n \t if (node == null) return 0;\n \t return 1 + max(height(node.left), height(node.right));\n }",
"private int height(AvlNode<E> node){\n if(node == null){\n return 0;\n } else {\n return max(height(node.left), height(node.right)) + 1;\n }\n }",
"private int height(TreeNode<E> node) {\n\t\tif(isEmpty()) //if tree is empty\n\t\t\treturn 0; //height is 0 for empty tree\n\t\tif(node.right == null && node.left == null) //current node has no children\n\t\t\treturn 1; //return 1\n\t\tif(node.left == null) //current node has only a right child\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t\tif(node.right == null) //current node has only a left child\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\t//The below cases are for when the current node has two children\n\t\tif(height(node.left) > height(node.right)) //if left height is greater than right height\n\t\t\treturn 1 + height(node.left); //return 1 + height of left subtree\n\t\telse //if right height is greater than left height\n\t\t\treturn 1 + height(node.right); //return 1 + height of right subtree\n\t}",
"private int heightBST(Node tree) {\n if (tree == null) {\n return 0;\n }\n return tree.height;\n }",
"private int getHeightofNode(TreeNode node){\n if (node == null) return 0;\n if (getColor(node) == RED) {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right));\n } else {\n return Math.max(getHeightofNode(node.left), getHeightofNode(node.right))+1;\n }\n }",
"int height(Node N) { \n if (N == null) \n return 0; \n return N.height; \n }",
"int height(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn Math.max( height(node.left), height(node.right) ) + 1 ;\r\n\t}",
"public int height()\r\n {\r\n if(this.isLeaf())\r\n {\r\n return 0;\r\n }\r\n else if (this.getLeft()!=null&&this.getRight()==null)\r\n {\r\n return this.getLeft().height()+1;\r\n }\r\n else if(this.getLeft()==null&&this.getRight()!=null)\r\n {\r\n return this.getRight().height()+1;\r\n }\r\n else\r\n {\r\n return Math.max(this.getLeft().height(),this.getRight().height())+1;\r\n }\r\n }",
"private int height(Node node) {\n return node == null ? 0 : node.height;\n }",
"public int height (BTNode<T> node){\n\t\tif(node != null) return node.getHeight();\n\t\treturn -1;\n\t}",
"int height(Node N) \n { \n if (N == null) \n return 0; \n return N.height; \n }",
"int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }",
"private static int heightOfTree(Tree tree) {\n\n if(tree == null){\n return 0;\n }\n int leftHeight = 0;\n if(tree.left!=null){\n leftHeight = heightOfTree(tree.left);\n }\n int rightHeight = 0;\n if(tree.right!=null){\n rightHeight = heightOfTree(tree.right);\n }\n return (Math.max(leftHeight, rightHeight))+1;\n\n }",
"public int height(){\n return height(root);\n }",
"@Override\r\n\tpublic int height() {\r\n\t\tif (this.root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn height_sub(this.root);\r\n\t}",
"private int height(AvlTreeNode<?, ?> n) {\n if (n == null) return -1;\n return n.height;\n }",
"public int getHeight (BinaryTreeNode<T> treeNode) {\n if (treeNode == null) {\n return 0;\n }\n return 1 + Math.max(getHeight(treeNode.left), getHeight(treeNode.right));\n }",
"public int height() \n\t{\n\t\treturn height(root); //call recursive height method, starting at root\n\t}",
"int height(Node node) {\r\n\t\tif (node == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint left = height(node.left);\r\n\t\tint right = height(node.right);\r\n\t\tint max = Integer.max(left, right);\r\n\t\treturn max + 1;\r\n\t}",
"private static int height(TreeNode node) {\n\t\t\n\t\tif(node == null)\n\t\t\treturn 0;\n\n\t\treturn (Math.max(height(node.left) , height(node.right)) + 1);\n\t}",
"@Test\n public void getHeight() {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n assertEquals(2, BinarySearchTree.getHeight(root));\n }",
"private int calcNodeHeight(Node t) {\n\t\t\tif(t == null) return 0; //Base case of an empty tree. Has a height of zero. T is the root!\n\n\t\t\treturn (Math.max(calcNodeHeight(t.left), calcNodeHeight(t.right)) + 1); //The height of a binary tree is the height of the root's largest subtree + 1 for the root\n\t\t}",
"private int height( BinaryNode<AnyType> t )\r\n\t{\r\n\t\tif( t == null )\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max( height( t.left ), height( t.right ) ); \r\n\t}",
"public int getHeight() {\r\n\t\treturn getHeight(rootNode);\r\n\t}",
"public int height() { return height(root); }",
"@Override\r\n\tpublic int getNodeHeight() {\n\t\treturn getNodeHeight(this);\r\n\t}",
"private int height(BinaryNode<AnyType> t) {\r\n\t\tif (t == null)\r\n\t\t\treturn -1;\r\n\t\telse\r\n\t\t\treturn 1 + Math.max(height(t.left), height(t.right));\r\n\t}",
"public int height() {\r\n\t\t\tif (this.leaf) \t\r\n\t\t\t\treturn 0;\r\n\t\t\telse {\r\n\t\t\t\treturn 1 + Math.max( this.lowChild.height(), this.highChild.height());\r\n\t\t\t}\r\n\t\t}",
"public int treeHeight() {\n return height(root);\n }",
"int height(Node n)\n\t{\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn n.height;\n\t}",
"private static int height(TreeNode n){\n\t\tif(n==null)\n\t\t\treturn 0;\n\t\treturn 1+Math.max(height(n.left), height(n.right));\n\t}",
"public int height(Node n)\r\n\t{\r\n\t\tif(n==null)\r\n\t\t{\r\n\t\t\treturn -1;//empy node height is -1\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn n.height;\r\n\t\t}\r\n\t}",
"public int calcHeight(){\n\t\t\t\treturn calcNodeHeight(this.root);\n\t\t}",
"public int getHeight() {\n return nodeHeight(overallRoot);\n }",
"int height(Node N) {\n if (N == null) {\n return 0;\n }\n return N.height;\n }",
"@Override\n public int height() {\n \treturn height(root);\n }",
"public int height(Node node){\n return node==null? 0 : Math.max(height(node.getLeft()),height(node.getRight())) + 1;\n }",
"private int height(BSTNode<K, V> node) {\r\n if (node == null) {\r\n return 0;\r\n } else {\r\n if (height(node.left) >= height(node.right)) {\r\n return 1 + height(node.left);\r\n } else {\r\n return 1 + height(node.right);\r\n }\r\n }\r\n }",
"public static int nodeHeight(PhyloTreeNode node) {\n if(node == null) {\n return -1;\n }\n else{\n return 1 + Math.max(nodeHeight(node.getLeftChild()), nodeHeight(node.getRightChild()));\n }\n }",
"public int height(Node N) {\n if (N == null)\n return 0;\n\n return N.height;\n }",
"int height(BTNode node) {\n if (node == null) {\n return -1;\n }\n return 1 + Math.max(height(node.left), height(node.right));\n }",
"public int height() {\n if (root == null) {\n return -1;\n }\n else return height(root);\n }",
"public int height() {\n if (root == null) {\n return -1;\n } else {\n return getHeight(root, 0);\n }\n }",
"public int height() {\n\t\t// TODO\n return height(root);\n\t}",
"public int getHeight(){\n\tif (root == null) {\n\t return 0;\n\t}\n\treturn root.height();\n }",
"@Override\n\tpublic int height() {\n\t\tif (this.valCount == 0) { // if empty leaf\n\t\t\treturn 0;\n\t\t}\n\t\tint max = 1; \n\t\tfor (int i = 0; i < childCount; ++i) { // finds longest route among children\n\t\t\tmax = Math.max(max, children[i].height() + 1);\n\t\t}\n\t\treturn max;\n\t}",
"private int HeightCalc(IAVLNode node) {\r\n\t\tif (node.isRealNode()) \r\n\t\t\treturn Math.max(node.getLeft().getHeight(), node.getRight().getHeight())+1;\r\n\t\treturn -1; //external's height is -1 \r\n\t}",
"public int height() {\n\t\tif (root == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tBSTNode<K,V> temp = root;\n\t\t\treturn getHeight(temp);\n\t\t}\n\t}",
"public int height() {\n return heightNodes(root);\n }",
"int height(Node root) { return (root != null) ? Math.max(height(root.left), height(root.right)) + 1 : 0;}",
"public int getHeight() {\n return huffTree.getHeight(huffTree.root, 0); \n }",
"public int height() {\n return height(root);\n }",
"public int height() {\n return height(root);\n }",
"public int height() {\n return height(root);\n }",
"public int height() {\n return getHeight(root);\n }",
"int height(TreeNode root) \n { \n if (root == null) \n return 0; \n else\n { \n /* compute height of each subtree */\n int lheight = height(root.left); \n int rheight = height(root.right); \n \n /* use the larger one */\n if (lheight > rheight) \n return(lheight+1); \n else return(rheight+1); \n } \n }",
"public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }",
"public int height(){\n int level=0;\n \n //if is empty, we finish\n if(this.isEmpty()){\n return level;\n \n \n }else{\n //count this level and check the level under its childs recursively\n int levelSubTree1,levelSubTree2;\n \n levelSubTree1=1 + this.right.height();\n levelSubTree2=1 + this.left.height();\n \n //get the higher height\n if(levelSubTree1> levelSubTree2){\n level=levelSubTree1;\n }else{\n level=levelSubTree2;\n }\n }\n return level;\n }",
"private int getHeightDifference(long addr) throws IOException {\n Node current = new Node(addr);\r\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n\r\n if (current.left == 0) {\r\n left.height = -1;\r\n }\r\n if (current.right == 0) {\r\n right.height = -1;\r\n }\r\n return left.height - right.height;\r\n }",
"private int getHeight(Node n) {\n\t\tif (n==null)\n\t\t\treturn 0;\n\t\tint heightLeft = getHeight(n.left);\n\t\tif (heightLeft==-1)\n\t\t\treturn -1;\n\t\t\n\t\tint heightRight = getHeight(n.right);\n\t\tif (heightRight==-1) \n\t\t\treturn -1;\n\t\t\n\t\tif(Math.abs(heightRight-heightLeft) > 1)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn 1+Math.max(getHeight(n.left), getHeight(n.right));\n\t}",
"public int getHeight(){\n\t\tint h=maxDepth(root);\n\t\treturn h;\n\t}",
"@Override\n public int getHeight() {\n int height = 0;\n\n if (!isEmpty()) {\n height = root.getHeight();\n }\n\n return height;\n }",
"private int getHeight(Node current) throws IOException {\n Node left = new Node(current.left);\r\n Node right = new Node(current.right);\r\n if (current.left == 0 && current.right == 0) {\r\n return 0;\r\n }\r\n if (current.left == 0) {\r\n return 1 + right.height;\r\n }\r\n if (current.right == 0) {\r\n return 1 + left.height;\r\n }\r\n return 1 + Math.max(left.height, right.height);\r\n }",
"public int height()\r\n {\r\n return head.height; //Should return log base 2 of n or the height of our head node. \r\n }",
"default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }",
"int height(TreeNode root) {\n return root == null ? -1 : 1 + height(root.left);\n }",
"private static int getHeight(Node current) {\n if(current == null) {\n return 0;\n }\n //Return the greater of the height of either the left subtree or the right, then add 1 for every node that it finds\n else {\n return Math.max(getHeight(current.getLeftChild()), getHeight(current.getRightChild())) + 1;\n }\n }",
"private int calcHeight(ChartOptions options) {\n Node n = this; // current node in the level\n int realHeight = 0;\n boolean samelevel = true; // next node in same level?\n while (n != null && samelevel) {\n int tmpHeight = 0;\n if (n.typ.matches(NodeType.TERM, NodeType.NONTERM, NodeType.EXCEPTION)) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.ITER) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.OPT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.PREDICATE) {\n tmpHeight = n.size.getHeight();\n } else if (n.typ == NodeType.RERUN) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.ALT) {\n tmpHeight = n.sub.calcHeight(options);\n } else if (n.typ == NodeType.EPS) {\n tmpHeight = options.fontHeight() * 3 / 2;\n if (realHeight < tmpHeight) {\n tmpHeight = options.fontHeight()\n + options.componentGapHeight();\n } else {\n tmpHeight = 0;\n }\n }\n realHeight = Math.max(realHeight, tmpHeight);\n if (n.up) {\n samelevel = false;\n }\n n = n.next;\n }\n return realHeight;\n }",
"private int height_sub(BSTNode<T> node) {\r\n\t\tint heightLeft = 0;\r\n\t\tint heightRight = 0;\r\n\t\tif(node.left!= null) {\r\n\t\t\theightLeft = height_sub(node.left);\r\n\t\t}\r\n\t\tif(node.right!= null) {\r\n\t\t\theightRight = height_sub(node.right);\r\n\t\t}\r\n\t\treturn 1+ Math.max(heightLeft, heightRight);\r\n\t}",
"int height(Node root) {\n\t\tif (root == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\t/* compute height of each subtree */\n\t\t\tint lheight = height(root.left);\n\n\t\t\tint rheight = height(root.right);\n\n\t\t\t/* use the larger one */\n\t\t\tif (lheight > rheight) {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (lheight + 1);\n\t\t\t} else {\n\t\t\t\t//System.out.println(\"lheight : \" + lheight + \" rheight : \" + rheight + \" root data : \" + root.data);\n\t\t\t\treturn (rheight + 1);\n\t\t\t}\n\t\t}\n\t}",
"public int findHeight(Node temp) {\n\t\t\n\t\t\n\t\t//check whether tree is empty\n\t\tif(root==null) {\n\t\t\t\n\t\t\tSystem.out.println(\"Tree is Empty\");\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tint leftHeight=0; int rightHeight=0;\n\t\t//Calculate height of left subtree\n\t\t\tif(temp.left !=null) \n\t\t\t\t\n\t\t\t\tleftHeight = findHeight(temp.left);\n\t\t\tif(temp.right !=null) \n\t\t\t\t\n\t\t\t\trightHeight = findHeight(temp.right);\n\t\t\t\t\n\t\t\tint max = (leftHeight > rightHeight)? leftHeight: rightHeight;\n\t\t\t\n\t\t\treturn (max+1);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Test\r\n public void testHeightCompleteTree(){\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \ttree.add(\"apple\"); //adding to right side of right node\r\n \tassertEquals(tree.height(), 2); \r\n }",
"public int height() { return root == null ? 0 : root.height(); }",
"public static int height(Node root){\r\n int ht = -1;\r\n for(Node child : root.children){\r\n ht = Math.max(ht, height(child));\r\n }\r\n return ht + 1;\r\n }",
"int findHeight(AVLNode Node){\r\n\t\tint height = 0;\r\n\t\tif(Node != null){\r\n\t\t\tint leftH = findHeight(Node.left);\r\n\t\t\tint rightH = findHeight(Node.right);\t\t\t\r\n\t\t\tif(leftH > rightH){\r\n\t\t\t\theight = leftH + 1;\r\n\t\t\t}else{\r\n\t\t\t\theight = rightH + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Node.height = height;\r\n\t\treturn height;\r\n\t}",
"int height(AVLNode N) {\n if (N == null)\n return 0;\n\n return N.getHeight();\n }",
"public int computeHeight(Node root){\n\t if(root == null)\n\t return 0;\n\t /* Calculate recursively */\n\t return Math.max(computeHeight(root.leftChild), computeHeight(root.rightChild)) + 1;\n\t }",
"public int heightNodes(Node N) {\n if(N == null) return 0;\n if((N.getRight() == null) && (N.getLeft() == null)) return 0;\n int left = heightNodes(N.getLeft());\n int right = heightNodes(N.getRight());\n\n if(left > right) return 1 + left;\n else return 1 + right;\n\n }",
"int height(Node root)\n {\n if (root == null)\n return 0;\n else\n {\n /* compute height of each subtree */\n int lheight = height(root.left);\n int rheight = height(root.right);\n\n /* use the larger one */\n if (lheight > rheight)\n return(lheight+1);\n else return(rheight+1);\n }\n }",
"public int getHeight(AVLNode n) {\n if(n != null) {\n return n.getHeight();\n } \n return 0;\n }",
"public int height()\n {\n return _root.height();\n }",
"public int getHeight(){ \n\t if (left == null && right == null){\n\t\treturn 1;\n\t }else if (left == null){\n\t\treturn 1 + right.getHeight();\n\t }else if (right == null){\n\t\treturn 1 + left.getHeight();\n\t }else{\n\t\tif (right.getHeight() >= left.getHeight()){\n\t\t return 1 + right.getHeight();\n\t\t}else{\n\t\t return 1 + left.getHeight();\n\t\t}\n\t }\n\t}",
"public int depth(){\n if(root!=null){ // มี node ใน tree\n return height(root);\n }\n else {return -1;}\n }",
"public static int height(treenode root)\n {\n return root==null ? -1 : Math.max(height(root.left) , height(root.right)) +1;\n }",
"@Test\r\n public void testHeightFullTree(){\r\n \t\r\n \tBinarySearchTree<Integer> treeInt = new BinarySearchTree<Integer>();\r\n \t\r\n \ttreeInt.add(31);\r\n \ttreeInt.add(5);\r\n \ttreeInt.add(44);\r\n \t\r\n \tassertEquals(treeInt.height(), 1);\r\n \t\r\n \ttree.add(\"deer\");\r\n \ttree.add(\"bar\"); //adding as child to left\r\n \ttree.add(\"jar\"); //add as child to right \r\n \tassertEquals(tree.height(), 1); //height is now 1\r\n }",
"public int height(Node root){\n\t\tif(root==nil)return 0;\n\t\treturn Math.max(height(root.left),height(root.right))+1;\n\t}",
"private int findHeight(Node<T> current) {\n if (current == null) {\n return -1;\n }\n return current.getHeight();\n }",
"int height(Node root) {\n\t\tif (root == null)\n\t\t\treturn 0;\n\t\telse {\n\t\t\t //compute height of each subtree \n\t\t\tint lheight = height(root.left);\n\t\t\tint rheight = height(root.right);\n\n\t\t\t// use the larger one \n\t\t\tif (lheight > rheight)\n\t\t\t\treturn (lheight + 1);\n\t\t\telse\n\t\t\t\treturn (rheight + 1);\n\t\t}\n\t}",
"private static double weightedNodeHeightHelper(PhyloTreeNode node) {\n if(node == null) {\n return 0;\n }\n else{\n return Math.max(node.getDistanceToChild() + weightedNodeHeightHelper(node.getLeftChild()),\n node.getDistanceToChild() + weightedNodeHeightHelper(node.getRightChild()));\n }\n }",
"private int height(BSTNode root) {\r\n \r\n // if the root is null, return 0\r\n if (null == root) {\r\n \r\n return 0;\r\n }\r\n \r\n // find the height of the left subtree\r\n int heightLeftSub = height(root.left);\r\n \r\n // find the height of the right subtree\r\n int heightRightSub = height(root.right);\r\n \r\n // return the greatest subtree value plus 1 for the height\r\n return Math.max(heightLeftSub, heightRightSub) + 1; \r\n }",
"@Test\r\n public void testHeightAddNodesRight(){\r\n \ttree.add(\"g\");\r\n \ttree.add(\"f\");\r\n \ttree.add(\"e\");\r\n \tassertEquals(tree.height(),2);\r\n \t\r\n \t//testing height of 3\r\n \ttree.add(\"d\"); //height now 3, d is right\r\n \tassertEquals(tree.height(), 3);\r\n \t\r\n \ttree.add(\"c\");\r\n \ttree.add(\"b\"); \r\n \ttree.add(\"a\"); \r\n \tassertEquals(tree.height(),6); //last\r\n }",
"long getHeight();",
"public static int getHeight(Node2 root) {\n\t\t// Write your code here\n\t\tif (root.right != null || root.left != null) {\n\t\t\treturn 1 + Math.max(getHeight(root), getHeight(root));\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"private int heightAux(Iterator<Node> it) {\n\t\tNodeType nType = it.nodeType();\n\t\t\n\t\tint leftH = 0;\n\t\tint rightH = 0;\n\t\t\n\t\tif (nType == NodeType.LEAF) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif (nType == NodeType.DOUBLE) {\n\t\t\tit.goLeft();\n\t\t\tleftH = heightAux(it);\n\t\t\tit.goUp(); it.goRight();\n\t\t\trightH = heightAux(it);\n\t\t\tit.goUp();\n\t\t}\n\n\t\treturn Math.max( (leftH + 1), (rightH + 1) );\n\t}"
] | [
"0.8164452",
"0.8024024",
"0.78986263",
"0.78889775",
"0.7847998",
"0.7841207",
"0.7834053",
"0.783321",
"0.7821793",
"0.7816994",
"0.779777",
"0.77849025",
"0.77748066",
"0.77418333",
"0.7705788",
"0.76947874",
"0.7688929",
"0.7676178",
"0.76691353",
"0.76655567",
"0.76626515",
"0.76623315",
"0.7660754",
"0.7626589",
"0.76145095",
"0.75943404",
"0.75832176",
"0.75750685",
"0.75707227",
"0.75684553",
"0.7560183",
"0.7555347",
"0.75409746",
"0.75338787",
"0.75292826",
"0.75287503",
"0.75232494",
"0.75100607",
"0.7507875",
"0.750287",
"0.748509",
"0.74659187",
"0.7439503",
"0.7428926",
"0.7426406",
"0.74212015",
"0.7396078",
"0.7386649",
"0.7381303",
"0.7360518",
"0.7343251",
"0.7329483",
"0.72959524",
"0.72859216",
"0.7285879",
"0.72624505",
"0.7254399",
"0.719663",
"0.71964806",
"0.71964806",
"0.71964806",
"0.71954536",
"0.7193957",
"0.7176839",
"0.7154141",
"0.71340734",
"0.7127896",
"0.7115333",
"0.7097514",
"0.70804894",
"0.7056369",
"0.7042207",
"0.7037044",
"0.70320827",
"0.7024718",
"0.7014928",
"0.6966549",
"0.6962839",
"0.6952358",
"0.6951334",
"0.6950247",
"0.693938",
"0.69240683",
"0.6915741",
"0.6911106",
"0.6910725",
"0.68967825",
"0.68813455",
"0.68106604",
"0.6787675",
"0.6786984",
"0.67851883",
"0.6774764",
"0.67730063",
"0.67653036",
"0.67263806",
"0.6723038",
"0.66860837",
"0.6678705",
"0.6662397",
"0.66568863"
] | 0.0 | -1 |
Set title of the PhraseCollection before we shift to loading view | public void quitAndSave(final View v) {
mPhraseCollection.setListTitle(((EditText) findViewById(R.id.edit_list_title)).getText().toString());
// Open layout with ProgressBar while we are processing DriveFile
setContentView(R.layout.activity_circle);
// Open a new Thread to save the file and exit back to ListSelectionActivity
new Thread(new Runnable() {
@Override
public void run() {
if (mPhraseCollection.writeChangesToDrive((EditListActivity)v.getContext())) {
// Open new Intent to create Bundle to pass back to ListSelectionActivity
Intent rIntent = new Intent();
rIntent.putExtra("PhraseCollection", mPhraseCollection);
rIntent.putExtra("position", mPosition);
setResult(RESULT_CODE_SAVE, rIntent);
finish();
} else {
// TODO Display error to user when writing changes to Drive is unsuccessful
}
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void setTitle(java.lang.String title) {\n\t\t_dictData.setTitle(title);\n\t}",
"public void setTitle(String title) { this.title = title; }",
"public void setTitle(String title) {\r\n _title = title;\r\n }",
"public void setTitle(java.lang.String title);",
"@Override\r\n\t\tpublic void setTitle(String title)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"public void prepareTitle()\n {\n DuelTitle title = new DuelTitle();\n addObject(title, 539, 186);\n }",
"public void setTitle(String title){\n this.title = title;\n }",
"public void setTitle(String title){\n \tthis.title = title;\n }",
"@Override\n\tpublic void setTitle(String title) {\n\t\tmodel.setTitle(title);\n\t}",
"public void setTitle_(String title_) {\n this.title_ = title_;\n }",
"public void setTitle(String title) {\r\n this.title = title;\r\n }",
"public void setTitle(String title) {\r\n this.title = title;\r\n }",
"@Override\r\n\tpublic void getTitle() {\n\t\t\r\n\t}",
"protected void SetTitle(String newTitle){ title = newTitle; }",
"public void setTitle(String title) {\r\n this.title = title;\r\n }",
"public void setTitle(String title) {\r\n this.title = title;\r\n }",
"public void setTitle(String title)\n {\n this.title = title;\n }",
"public void setTitle(String title)\n {\n this.title = title;\n }",
"public void setTitle(String title)\n {\n this.title = title;\n }",
"public void setTitle(String title);",
"public void setTitle(String title);",
"public void setTitle(String title);",
"public void setTitle(Title title) {\r\n this.title = title;\r\n }",
"public void setTitle(String title) {\n\tthis.title = title;\n}",
"private void setTitle(java.lang.String title) {\n System.out.println(\"setting title \"+title);\n this.title = title;\n }",
"void setTitle(java.lang.String title);",
"@Override\r\n\tpublic void getTitle(String title) {\n\t\t\r\n\t}",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"protected void setTitle(String title) {\n this.title = title;\n }",
"@Override\r\n\tpublic void setTitle(String title) {\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void resetTitle ( ) {\n\t\texecute ( handle -> handle.resetTitle ( ) );\n\t}",
"public void setTitle(String title){\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n mTitle = title;\n }",
"@Override\n public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\r\n\tthis.title = title;\r\n }",
"@Override\n\tpublic void setTitle(String title) {\n\t\t\n\t}",
"public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}",
"public void setTitle(java.lang.Object title) {\n this.title = title;\n }",
"public void setTitle( String title )\n {\n _strTitle = title;\n }",
"private void setTitleMap(String title){\n if(title!=null && titleView.getVisibility() != View.GONE) {\n if (title.length() <= 50)\n titleView.setText(title);\n else\n titleView.setText(title.substring(0, 50));\n }\n }",
"public void setTitle(String title)\n\t{\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title; \n\t}",
"public void setTitle(java.lang.String title)\n {\n this.title = title;\n }",
"public void doSetTitle(String newTitle) \n {\n this.title = newTitle;\n }",
"@Override\n\tpublic void setTitle(java.lang.String title) {\n\t\t_candidate.setTitle(title);\n\t}",
"public void setTitle( String title ) {\n\t\t_title = title;\n\t}",
"public void setTitle(String strTitle) { m_strTitle = strTitle; }",
"public void setTitle(String title)\n {\n mTitle = title;\n }",
"public void setTitle(java.lang.String title) {\n this.title = title;\n }",
"public void setTitle(java.lang.String title) {\n this.title = title;\n }",
"public void setTitle(java.lang.String title) {\n this.title = title;\n }",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"public void setTitle(String title) {\n\t\tthis.title = title;\n\t}",
"@Override\n\tpublic void setTitle(java.lang.String title) {\n\t\t_esfTournament.setTitle(title);\n\t}",
"void setTitle(String title);",
"void setTitle(String title);",
"void setTitle(String title);",
"void setTitle(String title);",
"void setTitle(String title);",
"private void changeTitle(SingleDocumentModel model) {\n\t\tsetTitleAt(models.indexOf(model), model.getFilePath().getFileName().toString());\n\t}",
"public void setTitle(String title) {\n mTitle = title;\n }",
"@Override\n public void title_()\n {\n }",
"public void setTitle(String title) {\r\n if (title != null) {\r\n this.title = title;\r\n }\r\n else{\r\n System.out.println(\"Not a valid title\");\r\n }\r\n }",
"protected void setPopUpTitle(String title){\r\n\t\tthis.stage.setTitle(title);\r\n\t}",
"public void resetTitle();",
"public void setTitle(String newTitle)\r\n {\r\n title = newTitle;\r\n }",
"public void setTitle(final String title)\n {\n this.title = title;\n }",
"private void setTitle(String userTitle){\n title = userTitle;\n }"
] | [
"0.71820027",
"0.70993704",
"0.6973542",
"0.69734764",
"0.69667405",
"0.69636333",
"0.6963187",
"0.69502646",
"0.6939686",
"0.6937294",
"0.6933181",
"0.6933181",
"0.6930579",
"0.6924307",
"0.6919106",
"0.6919106",
"0.69065",
"0.69065",
"0.69065",
"0.69011706",
"0.69011706",
"0.69011706",
"0.68958795",
"0.68829554",
"0.6882247",
"0.6878507",
"0.687798",
"0.6874541",
"0.6874541",
"0.6874541",
"0.6874541",
"0.68676496",
"0.6866935",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.6865457",
"0.68646306",
"0.6857846",
"0.68538535",
"0.6852731",
"0.68507624",
"0.68458575",
"0.6843509",
"0.6807803",
"0.6807803",
"0.6807803",
"0.6807803",
"0.6807803",
"0.6799413",
"0.67942107",
"0.67885107",
"0.67840904",
"0.6778443",
"0.67741466",
"0.6764068",
"0.67515486",
"0.67382336",
"0.67244357",
"0.67221",
"0.6721739",
"0.6721739",
"0.6721739",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6713708",
"0.6708883",
"0.6700555",
"0.6700555",
"0.6700555",
"0.6700555",
"0.6700555",
"0.66854686",
"0.66764086",
"0.66679204",
"0.66652524",
"0.6662449",
"0.6657268",
"0.6650812",
"0.6641078",
"0.6633214"
] | 0.0 | -1 |
Utility function for creating log timestamps, in W3C/ISO8601 format, assuming UTC. Use current time. Format is yyyyMMdd'T'HH:mm:ss'Z' | public static String getLog14Date(){
return TIMESTAMP14ISO8601Z.get().format(new Date());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }",
"public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }",
"public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}",
"static String createNormalDateTimeString() {\n return NORMAL_STROOM_TIME_FORMATTER.format(ZonedDateTime.now(ZoneOffset.UTC));\n }",
"private static String zuluFormat(String beginTimestamp) {\n\t\tStringBuffer buf = new StringBuffer(beginTimestamp);\n\t\tbuf.insert(4, '-');\n\t\tbuf.insert(7, '-');\n\t\tbuf.insert(10, 'T');\n\t\tbuf.insert(13, ':');\n\t\tbuf.insert(16, ':');\n\t\tbuf.append('Z');\n\t\treturn buf.toString();\n\t}",
"private static String currentTimestamp()\r\n {\n \r\n long currentTime = System.currentTimeMillis();\r\n sCalendar.setTime(new Date(currentTime));\r\n \r\n String str = \"\";\r\n str += sCalendar.get(Calendar.YEAR) + \"-\";\r\n \r\n final int month = sCalendar.get(Calendar.MONTH) + 1;\r\n if (month < 10)\r\n {\r\n str += 0;\r\n }\r\n str += month + \"-\";\r\n \r\n final int day = sCalendar.get(Calendar.DAY_OF_MONTH);\r\n if (day < 10)\r\n {\r\n str += 0;\r\n }\r\n str += day;\r\n \r\n str += \"T\";\r\n \r\n final int hour = sCalendar.get(Calendar.HOUR_OF_DAY);\r\n if (hour < 10)\r\n {\r\n str += 0;\r\n }\r\n str += hour + \":\";\r\n \r\n final int minute = sCalendar.get(Calendar.MINUTE);\r\n if (minute < 10)\r\n {\r\n str += 0;\r\n }\r\n str += minute + \":\";\r\n \r\n final int second = sCalendar.get(Calendar.SECOND);\r\n if (second < 10)\r\n {\r\n str += 0;\r\n }\r\n str += second + \".\";\r\n \r\n final int milli = sCalendar.get(Calendar.MILLISECOND);\r\n str += milli;\r\n \r\n str += \"Z\";\r\n \r\n return str;\r\n }",
"UtcT time_stamp () throws BaseException;",
"private String getISO8601Timestamp(long date) {\n SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);\n // Convert the date into YYYY-MM-DDThh:mm:ss.sss\n String result = format.format(date);\n // Get default time zone in +/-hhmm format\n TimeZone tz = TimeZone.getDefault();\n int offset = tz.getRawOffset();\n // Convert the timezone format from +/-hhmm to +/-hh:mm\n String formatTimeZone = String.format(TIMEZONE_FORMAT, offset >= 0 ? \"+\" : \"-\", offset / 3600000, (offset / 60000) % 60);\n return result + formatTimeZone;\n }",
"public static String getRandomTimeStamp() {\n\t\treturn \"2014-12-12T10:39:40Z\";\n\t}",
"private String stringFormattedTime(Instant instant){\n ZonedDateTime zonedDateTime = instant.atZone(ZoneOffset.UTC);\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n return formatter.format(zonedDateTime);\n }",
"@ExecFunction(name = \"utc_timestamp\", argTypes = {}, returnType = \"INT\")\n public static Expression utcTimestamp() {\n return DateTimeLiteral.fromJavaDateType(LocalDateTime.now(ZoneId.of(\"UTC+0\")));\n }",
"private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}",
"public static String currentTimestamp()\n {\n \n long currentTime = System.currentTimeMillis();\n sCalendar.setTime(new Date(currentTime));\n \n String str = \"\";\n str += sCalendar.get(Calendar.YEAR) + \"-\";\n \n final int month = sCalendar.get(Calendar.MONTH) + 1;\n if (month < 10)\n {\n str += 0;\n }\n str += month + \"-\";\n \n final int day = sCalendar.get(Calendar.DAY_OF_MONTH);\n if (day < 10)\n {\n str += 0;\n }\n str += day;\n \n str += \"T\";\n \n final int hour = sCalendar.get(Calendar.HOUR_OF_DAY);\n if (hour < 10)\n {\n str += 0;\n }\n str += hour + \":\";\n \n final int minute = sCalendar.get(Calendar.MINUTE);\n if (minute < 10)\n {\n str += 0;\n }\n str += minute + \":\";\n \n final int second = sCalendar.get(Calendar.SECOND);\n if (second < 10)\n {\n str += 0;\n }\n str += second + \".\";\n \n final int milli = sCalendar.get(Calendar.MILLISECOND);\n str += milli;\n \n str += \"Z\";\n \n return str;\n }",
"private ZonedDateTime timestamp() {\n return Instant.now().atZone(ZoneId.of(\"UTC\")).minusMinutes(1);\n }",
"public static String fn_GetCurrentTimeStamp() {\n\t\tDate dte = new Date();\n\t\tDateFormat df = DateFormat.getDateTimeInstance();\n\t\tString strdte = df.format(dte);\n\t\tstrdte = strdte.replaceAll(\":\", \"_\");\n\t\treturn strdte;\n\t}",
"public static String timestamp()\n\t{\n\t\t/**\n\t\t * Get the current time formatted as HH:mm:ss.\n\t\t */\t\t\n\t\treturn new SimpleDateFormat(\"HH:mm:ss\").format(new Date());\n\t}",
"public String generateLocalDateTime() {\n LocalDateTime localDateTime = LocalDateTime.now();\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyyMMddHHmmss\");\n String formatLocalDateTime = localDateTime.format(dateTimeFormatter);\n return formatLocalDateTime;\n }",
"private String getcurrentTimeStamp() {\n\t\tDateTimeFormatter format = DateTimeFormatter\n\t\t\t\t.ofPattern(RidGeneratorPropertyConstant.TIMESTAMP_FORMAT.getProperty());\n\t\treturn LocalDateTime.now().format(format);\n\t}",
"public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}",
"OffsetDateTime creationTime();",
"OffsetDateTime timeCreated();",
"static String getCurrentDateTimeInUTC() {\n TimeZone utcTimeZone = TimeZone.getTimeZone(\"UTC\");\n Date now = Calendar.getInstance(utcTimeZone).getTime();\n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-DD HH:mm:ss z\");\n formatter.setTimeZone(utcTimeZone);\n return formatter.format(now);\n }",
"public static String getLogUtcDateStringFromTimestamp(Date timeStamp) {\n DateFormat df = new SimpleDateFormat(LOG_UTC_DATE_FORMAT);\n df.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n return df.format(timeStamp);\n }",
"public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}",
"public static void main(String[] args) {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssX\"); // Quoted \"Z\" to indicate UTC, no timezone offset\n// df.setTimeZone(tz);\n// String nowAsISO = df.format(\"2017-04-21T21:25:35+05:00\");\n try {\n Date date = df.parse(\"2017-04-21T21:25:35+05:00\");\n System.out.println(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n }",
"private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}",
"String getCreated_at();",
"java.lang.String getTimestamp();",
"java.lang.String getTimestamp();",
"String getTimestamp();",
"String getTimestamp();",
"public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }",
"private String makeEventStamp() {\n String name = \"DTSTAMP\";\n return formatTimeProperty(LocalDateTime.now(), name) + \"\\n\";\n }",
"com.google.protobuf.Timestamp getCreateTime();",
"com.google.protobuf.Timestamp getCreateTime();",
"com.google.protobuf.Timestamp getCreateTime();",
"com.google.protobuf.Timestamp getCreateTime();",
"com.google.protobuf.Timestamp getCreateTime();",
"public static SimpleDateFormat createDateFormat() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS\");\n TimeZone myTimeZone = TimeZone.getTimeZone(ZoneId.of(\"UTC\"));\n dateFormat.setTimeZone(myTimeZone);\n dateFormat.setLenient(false);\n return dateFormat;\n }",
"public static String toISO8601UTC(Date date) {\n TimeZone tz = TimeZone.getTimeZone(\"UTC\");\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\");\n df.setTimeZone(tz);\n Log.d(\"DateUtils\", String.format(\"toISO8601UTC: %s\", df.format(date)));\n return df.format(date);\n }",
"public static String now() {\n return dateTimeFormatZ.format(new Date());\n }",
"private String getNewTimestamp(String originTimestamp, String originFormat, int timezoneOffset, String destinationFormat) {\n final ZoneId originZoneId = ZoneId.ofOffset(\"UTC\", ZoneOffset.ofHours(timezoneOffset));\n final Instant originTimeAsInstant = Instant.from(DateTimeFormatter\n .ofPattern(originFormat)\n .withZone(originZoneId)\n .parse(originTimestamp));\n\n /* configure target time format and time zone (all times should be in UTC) */\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(destinationFormat);\n final ZoneId destinationZoneId = ZoneId.ofOffset(\"UTC\", ZoneOffset.UTC); //always UTC\n\n /* format timestamp from its origin form to destination form (form = format + time zone) */\n return formatter.format(ZonedDateTime.ofInstant(originTimeAsInstant, destinationZoneId));\n }",
"public static String getTimeStamp() {\n\t\tDate date = new Date();\n\t\treturn date.toString().replaceAll(\":\", \"_\").replaceAll(\" \", \"_\");\n\n\t}",
"private String syncTimeStamp(String timestamp){\r\n StringBuilder dateBuilder = new StringBuilder(timestamp);\r\n String time = dateBuilder.toString().split(\"T\")[1].substring(0, 8);\r\n String[] timeArr = time.split(\":\");\r\n String seconds = timeArr[2];\r\n String dd = dateBuilder.toString().split(\"T\")[0].split(\"-\")[2];\r\n String mm = dateBuilder.toString().split(\"T\")[0].split(\"-\")[1];\r\n String yyyy = dateBuilder.toString().split(\"T\")[0].split(\"-\")[0];\r\n int hour = Integer.parseInt(timeArr[0]);\r\n int minutes = Integer.parseInt(timeArr[1]);\r\n minutes += 30;\r\n hour+=5;\r\n if (minutes>=60){\r\n hour += 1;\r\n minutes -= 60;\r\n }\r\n if (hour >= 24){\r\n hour -= 24;\r\n dd = Integer.toString(Integer.parseInt(dd) + 1);\r\n if (Integer.parseInt(dd) < 10)\r\n dd = \"0\" + dd;\r\n }\r\n String minutesString;\r\n if (minutes < 10)\r\n minutesString = \"0\" + Integer.toString(minutes);\r\n else\r\n minutesString = Integer.toString(minutes);\r\n\r\n String hoursString;\r\n if (hour < 10)\r\n hoursString = \"0\" + Integer.toString(hour);\r\n else\r\n hoursString = Integer.toString(hour);\r\n String finalTime = hoursString + \":\" + minutesString + \":\" + seconds;\r\n String finalDate = dd + \"-\" + mm + \"-\" + yyyy;\r\n\r\n return (finalDate + \" \" + finalTime);\r\n }",
"private static ZonedDateTime toUTCDateTime(Timestamp timestamp) {\n return toInstant(timestamp).atZone(UTCZone);\n }",
"private String prettyTime() {\n String[] dt = time.split(\"T\");\n String[] ymd = dt[0].split(\"-\");\n String[] hms = dt[1].split(\":\");\n\n int hour = Integer.parseInt(hms[0]);\n\n String date = getMonth(Integer.parseInt(ymd[1])) + \" \" + ymd[2] + \", \" + ymd[0];\n String time = (hour > 12 ? hour - 12 : hour) + \":\" + hms[1] + \":\" + hms[2].substring(0, hms[2].indexOf(\".\"));\n return date + \" at \" + time;\n }",
"OffsetDateTime createdDateTime();",
"private static String getFormattedCurrentDateAndTime(){\n StringBuilder dateAndTime = new StringBuilder();\n LocalDateTime now = LocalDateTime.now();\n\n String hour = Integer.toString(now.getHour());\n String minute = Integer.toString(now.getMinute());\n\n if (hour.length() == 1){\n hour = \"0\" + hour;\n }\n if (minute.length() == 1){\n minute = \"0\" + minute;\n }\n\n //Creates \"XX/XX/XX @ XX:XX\" format (24 hours)\n dateAndTime.append(now.getMonthValue()).append(\"/\").\n append(now.getDayOfMonth()).append(\"/\").\n append(now.getYear()).append(\" @ \").\n append(hour).append(\":\").\n append(minute);\n\n return dateAndTime.toString();\n }",
"public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }",
"public RichOutboundFixMessageBuilder addUtcTimestamp(final int tag) {\n this.rawBuilder.addField(tag, DateSupplier.getUtcTimestamp());\n\n return this;\n }",
"public static Date getCurrentTimeStampUtc() {\n return Date.from(java.time.ZonedDateTime.now(ZoneOffset.UTC).toInstant());\n }",
"public static String timestamp() {\n\t\tString t = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\").format(new Date());\n\t\t// File f=new\n\t\t// File(String.format(\"%s.%s\",t,RandomStringUtils.randomAlphanumeric(8)));\n\t\tSystem.out.println(\"Time is :\" + t);\n\t\treturn t;\n\t}",
"String getTimestampFunction();",
"String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }",
"public static String getTimestamp() {\r\n\t\t\r\n\t\treturn new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t}",
"public static String timeCalc(String createdAt){\n String relativeDate = Utility.relativeTime(createdAt);\n String d = Utility.formatDate(createdAt);\n return d;\n\n }",
"@ZAttr(id=790)\n public String getCreateTimestampAsString() {\n return getAttr(Provisioning.A_zimbraCreateTimestamp, null);\n }",
"public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}",
"private String currentDateTime() {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n String date = df.format(Calendar.getInstance().getTime());\n return date;\n }",
"private String getCurrentTimestamp() {\n\n String mytime = java.text.DateFormat.getTimeInstance().format(Calendar.getInstance().getTime());\n String mydate =java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());\n return mytime;\n }",
"public java.lang.String getTimeStamp(){\r\n return localTimeStamp;\r\n }",
"public static String getTimestamp() {\n\t\tCalendar cal = Calendar.getInstance();\n\t\t//define the format of time stamp\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\treturn sdf.format(cal.getTime());\n\n\t}",
"private static String timeFormat(long t, String format) {\n SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);\n try {sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));} catch (Exception e) {}\n return sdf.format(new Date(t));\n }",
"DateTime nowUtc();",
"@Override\n\tpublic String getTimestamp()\n\t{\n\t\treturn new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\").format(new Date());\n\t}",
"protected String toXSTime() {\n\t\treturn String.format(\"%s,%s,%s,%s\",\"{0:00}:{1:00}:{2:00}\",\n\t\t\t\tthis.getHours(), this\n\t\t\t\t.getMinutes(), this.getSeconds());\n\t}",
"String timeCreated();",
"private TimestampUtils(){}",
"public static String generateReverseTimestampId() {\r\n\t\tString sTs = Str.leftPad(String.valueOf(Long.MAX_VALUE-System.currentTimeMillis()),'0',20);\r\n\t\tString sRd = Str.leftPad(String.valueOf(new Random().nextInt(Integer.MAX_VALUE)),'0',10);\r\n\t\treturn Str.leftPad(sTs+sRd,'0',32);\r\n\t }",
"public static String getCurrentTimeStamp(){\n try {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n // Find todays date\n String currentDateTime = dateFormat.format(new Date());\n\n return currentDateTime;\n } catch (Exception e) {\n e.printStackTrace();\n\n return null;\n }\n }",
"public static String getUtcDateStringFromTimestamp(Date timeStamp) {\n DateFormat df = new SimpleDateFormat(UTC_DATE_FORMAT);\n df.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n return df.format(timeStamp);\n }",
"com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();",
"com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();",
"com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();",
"public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }",
"protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}",
"public static UUID toTimeOrderedUuid(UUID uuid) {\n\n\t\tif (!UuidUtil.isTimeBased(uuid)) {\n\t\t\tthrow new IllegalArgumentException(String.format(\"Not a time-based UUID: %s.\", uuid.toString()));\n\t\t}\n\n\t\tlong timestamp = UuidUtil.extractTimestamp(uuid);\n\n\t\tlong msb = ((timestamp & 0x0ffffffffffff000L) << 4) //\n\t\t\t\t| (timestamp & 0x0000000000000fffL) //\n\t\t\t\t| 0x0000000000006000L; // set version 6\n\n\t\tlong lsb = uuid.getLeastSignificantBits();\n\n\t\treturn new UUID(msb, lsb);\n\t}",
"com.google.protobuf.ByteString getSignedTimeStamp();",
"InstantDt createHistoryToTimestamp() {\n\t\treturn InstantDt.withCurrentTime();\n\t}",
"public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}",
"private void addAnalysisTimestamp()\r\n throws XMLStreamException\r\n {\r\n SimpleStartElement start;\r\n SimpleEndElement end;\r\n\r\n addNewline();\r\n\r\n start = new SimpleStartElement(\"analysis_timestamp\");\r\n start.addAttribute(\"analysis\", mimicXpress ? \"xpress\" : \"q3\");\r\n start.addAttribute(\"time\", now);\r\n start.addAttribute(\"id\", \"1\");\r\n add(start);\r\n\r\n addNewline();\r\n\r\n if (mimicXpress)\r\n {\r\n start = new SimpleStartElement(\"xpressratio_timestamp\");\r\n start.addAttribute(\"xpress_light\", \"0\");\r\n add(start);\r\n\r\n end = new SimpleEndElement(\"xpressratio_timestamp\");\r\n add(end);\r\n\r\n addNewline();\r\n }\r\n\r\n end = new SimpleEndElement(\"analysis_timestamp\");\r\n add(end);\r\n }",
"public String getCreatedAtString() {\n String createdAt = \"\";\n\n // get the time in millis for the created at\n long createdDate = getCreatedAt().getTime();\n\n // get the time in millis for now\n long currentDate = new Date().getTime();\n\n int secondsBetween = (int) TimeUtils.getTimeSpan(createdDate, currentDate, TimeConstants.SEC);\n\n // get the number of minutes in between\n int minutesBetween = (int) TimeUtils.getTimeSpan(createdDate, currentDate, TimeConstants.MIN);\n\n // get the number of hours in between\n int hoursBetween = (int) TimeUtils.getTimeSpan(createdDate, currentDate, TimeConstants.HOUR);\n\n // if less than 1 minute ago return \"minutes ago\n if (secondsBetween < 60) {\n createdAt = DateUtils.getRelativeTimeSpanString(createdDate, currentDate, DateUtils.SECOND_IN_MILLIS).toString();\n }\n\n // if less than 1 hour ago return \"minutes ago\n if (minutesBetween >= 1 && minutesBetween < 60) {\n createdAt = DateUtils.getRelativeTimeSpanString(createdDate, currentDate, DateUtils.MINUTE_IN_MILLIS).toString();\n }\n\n // if less than 24 hours ago or greater than 1 return \"hours ago\"\n if (hoursBetween >= 1 && hoursBetween < 24) {\n createdAt = DateUtils.getRelativeTimeSpanString(createdDate, currentDate, DateUtils.HOUR_IN_MILLIS).toString();\n }\n\n // if more than 24 hours ago return \"days ago\"\n if (hoursBetween >= 24) {\n createdAt = DateUtils.getRelativeTimeSpanString(createdDate, currentDate, DateUtils.DAY_IN_MILLIS).toString();\n }\n\n return createdAt;\n }",
"private long makeTimestamp() {\n return new Date().getTime();\n }",
"public static String getUTCDate(){\n \t SimpleDateFormat sdf = new SimpleDateFormat(\"MM-dd-yyyy hh:mm\");\n \t Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n \t return sdf.format(cal.getTime());\n }",
"public long getTimestampMillisecUTC();",
"public Date getSentAt() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n Date d = null;\n try {\n d = sdf.parse(creationDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return d;\n }",
"public static String generateTimeStamp(String format)\n\t{\n\t\tif (Utils.isEmpty(format)) format = \"yyyy/MM/dd HH:mm:ss\";\n\n\t\tDateFormat dateFormat = new SimpleDateFormat(format);\n\t\tDate date = new Date();\n\t\treturn dateFormat.format(date);\n\t}",
"public final long getUTCTimeStamp()\n {\n // 86,400,000 = 1000 * 60 * 60 * 24 = milliseconds per day\n return ordinal == NULL_ORDINAL ? NULL_TIMESTAMP : (ordinal * 86400000L);\n }",
"public static String getGitTimestamp() {\n return StringUtils.defaultIfEmpty(gitProperties.getProperty(GIT_PROPERTIES_COMMIT_TS_KEY),\n StringUtils.EMPTY);\n }",
"public ScGridColumn<AcFossWebServiceMessage> newCreatedUtcTsColumn()\n {\n return newCreatedUtcTsColumn(\"Created Utc Ts\");\n }",
"private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }",
"long getCreateTime();",
"long getCreateTime();",
"public static Timestamp getNowTimestamp()\n {\n return new Timestamp(System.currentTimeMillis());\n }",
"public DateTime timestamp() {\n\n\t\tif (timestamp == null) {\n\n\t\t\tfinal DateTimeValue dt = ProtoDateUtil.fromDecimalDateTime(message.getBaseTimeStamp());\n\n\t\t\ttimestamp = new DateTime(dt.getYear(), dt.getMonth(), dt.getDay(), dt.getHour(), dt.getMinute(),\n\t\t\t\t\tdt.getSecond(), dt.getMillis(), ISOChronology.getInstanceUTC());\n\n\t\t}\n\n\t\treturn timestamp;\n\n\t}",
"@Nonnull\n @CheckReturnValue\n default OffsetDateTime creationTime() {\n return Utils.creationTimeOf(idAsLong());\n }",
"public synchronized String toString() {\n int trailingZeros = 0;\n int tmpNanos = this.getNanos();\n if (tmpNanos == 0) {\n trailingZeros = 8;\n } else {\n while (tmpNanos % 10 == 0) {\n tmpNanos /= 10;\n trailingZeros++;\n }\n }\n final String baseFormat = \"uuuu-MM-dd HH:mm:ss.\";\n StringBuilder buf = new StringBuilder(baseFormat.length() + 9 - trailingZeros);\n buf.append(baseFormat);\n for (int i = 0; i < 9 - trailingZeros; ++i) {\n buf.append(\"S\");\n }\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(buf.toString());\n\n LocalDateTime ldt =\n LocalDateTime.ofEpochSecond(this.getTime() / 1000, this.getNanos(), ZoneOffset.UTC);\n return ldt.format(formatter);\n }",
"public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }",
"private static String dateFormatLocal(Long timestamp) {\n DateFormat df = dateFormatLocal.get(); \n if (timestamp == null) {\n timestamp = System.currentTimeMillis();\n }\n \n return df.format(new Date(timestamp));\n }",
"public java.lang.String getSystemlogtime () {\n\t\treturn systemlogtime;\n\t}"
] | [
"0.652758",
"0.6412308",
"0.6233016",
"0.60804427",
"0.5977896",
"0.59601194",
"0.5914427",
"0.5833401",
"0.5821589",
"0.57322305",
"0.5708146",
"0.56595415",
"0.56404835",
"0.55953443",
"0.557633",
"0.5567938",
"0.5549819",
"0.5528512",
"0.54875004",
"0.54862964",
"0.5470828",
"0.5438435",
"0.54089284",
"0.54076684",
"0.53830737",
"0.537143",
"0.5352775",
"0.5338513",
"0.5338513",
"0.5329644",
"0.5329644",
"0.53174174",
"0.5281225",
"0.5275287",
"0.5275287",
"0.5275287",
"0.5275287",
"0.5275287",
"0.52715135",
"0.5259286",
"0.5247482",
"0.5246972",
"0.5242732",
"0.52157056",
"0.5213432",
"0.52071893",
"0.5203024",
"0.51960176",
"0.51928014",
"0.51873887",
"0.5170961",
"0.5164932",
"0.5154572",
"0.5146085",
"0.51350105",
"0.51325274",
"0.5127004",
"0.5098496",
"0.5098129",
"0.5093513",
"0.50770146",
"0.506762",
"0.50626314",
"0.5058321",
"0.50389975",
"0.5012353",
"0.5001687",
"0.49924517",
"0.4981785",
"0.4956686",
"0.49453187",
"0.49450627",
"0.49450627",
"0.49450627",
"0.49436277",
"0.4943588",
"0.49379438",
"0.4928731",
"0.49254507",
"0.4925312",
"0.49028957",
"0.4900723",
"0.48938963",
"0.4888299",
"0.48864454",
"0.48862433",
"0.4882405",
"0.48819977",
"0.48793232",
"0.48766133",
"0.48703423",
"0.48689973",
"0.48689973",
"0.48662993",
"0.48587993",
"0.48575574",
"0.485563",
"0.4852548",
"0.48478743",
"0.48472348"
] | 0.5849794 | 7 |
Log.d("DFM", "danmakuShown(): text=" + danmaku.text); | @Override
public void danmakuShown(BaseDanmaku danmaku) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void showText(String s){\n }",
"@Override\n public void run() {\n text_tracking.setText(tt);\n }",
"@Override\n public void run() {\n text_tracking.setText(tt);\n }",
"@Override\n public void display(String numeroPantalla) {\n debug (\"display\", \"numeroPantalla\", numeroPantalla);\n TextView display = (TextView) findViewById(R.id.numberRolled);\n display.setText(numeroPantalla);\n }",
"public void TampilkanHasil(String isi_hasil){\n TextView hasil = (TextView) findViewById(R.id.txt_mainactivity_hasilBMI);\n hasil.setText(isi_hasil);\n }",
"private void showInfo(String message){ infoLabel.setText(message);}",
"public void onClick(View view){\n\n String name = mNameField.getText().toString();\n Toast.makeText(this,\"Hello There\"+name, Toast.LENGTH_LONG).show();\n\n }",
"@Override\n public void showMessage(String msg) {\n String pesan = msg;\n if (pesan.equals(\"Post tidak ditemukan\")){\n txtNoData.setVisibility(View.VISIBLE);\n }\n }",
"public void showMessage(String text)\n {\n Toast.makeText(this, text, Toast.LENGTH_SHORT).show();\n }",
"public void show(View v) {\n\n wordName=searchWord.getText().toString().toLowerCase();//get word\n // Toast.makeText(this,word,Toast.LENGTH_LONG).show();\n showResult.setText(\"\");\n main_result=\"\";\n send=\"\";\n urlResult=\"\";\n wikiAPIUrl=\"https://en.wiktionary.org/w/api.php?action=query&prop=revisions&titles=\"+wordName+\"&rvprop=content&format=json&utf8=\";\n//\n\n //call asynctask method onpreexecute\n new getData().execute(wikiAPIUrl,\"s\",urlResult);\n }",
"@FXML\n\tprivate void onLoadLogClicked(){\n\n\t\tSystem.out.print(list);\n\t\tString showup = \"\";\n\t\tfor (int index = 0; index < list.size(); index++) {\n\t\t\tshowup += list.get(index)+\" & \"+dat.get(index);\n\t\t\tshowup += \"\\n\";\n\t\t}\n\t\ttextArea.setText(showup);\n\t}",
"public void run() {\n barcodeInfo.setText( // Update the TextView\n barcodes.valueAt(0).displayValue\n );\n }",
"public void nhapdltextlh(){\n\n }",
"public void in_macha(View view) {\n }",
"@Override\r\n\tpublic void setText() {\n\t\t\r\n\t}",
"public void clickFunction(View view){\n Toast.makeText(MainActivity.this, \"Hi there!\", Toast.LENGTH_LONG).show();\n\n // here we've created a variable \"myTextField\" of type \"EditText\" which collect the data from the ID i.e \"myTextField\" and convert the view ID into EditText type and stores into the variable.\n EditText myTextField = (EditText) findViewById(R.id.myTextField);\n\n // here the Log.i function is used to show the info to the logcat terminal which required two fields i.e Tag & the data to show (here the data is taken from the myTextField variable created above.\n Log.i(\"Info\",myTextField.getText().toString());\n }",
"@Override\n\tpublic void SuccessText(String text) {\n\t\tLog.i(TAG, \"==-->text:=\"+text);\n\t\tmain_one.setText(text);\n\t}",
"public void onClick(View v) {\n lbl.setText(\"Hola jose\");\n }",
"@Override\n public void run() {\n Toast.makeText(rootView.getContext(), mensaje,\n Toast.LENGTH_LONG).show();\n }",
"public void show(){\n sensorTextView.setText(String.format(Locale.US,\"Earth\\nx: %f\\n\" +\"y: %f\\nz: %f\", earthMag[0], earthMag[1], earthMag[2]));\n }",
"public void onDisplay() {\n }",
"public final void beK() {\n AppMethodBeat.i(88975);\n if (this.kaS.aZV().vTW != null && this.kaS.aZV().vTW.size() > 0) {\n tm tmVar = (tm) this.kaS.aZV().vTW.get(0);\n if (this.iPD != null) {\n this.iPD.setText(tmVar.title);\n }\n if (this.ksp != null) {\n if (TextUtils.isEmpty(tmVar.kbW)) {\n this.ksp.setVisibility(8);\n } else {\n this.ksp.setText(tmVar.kbW);\n }\n }\n if (this.ksq != null) {\n if (TextUtils.isEmpty(tmVar.kbX)) {\n this.ksq.setVisibility(8);\n } else {\n this.ksq.setText(tmVar.kbX);\n AppMethodBeat.o(88975);\n return;\n }\n }\n }\n AppMethodBeat.o(88975);\n }",
"void showPlaceholderGui() {\n this.game.a(new da());\n }",
"public void show() \n{\n\tSystem.out.println(this.getContenido().toString());//NOSONAR\n\t\n}",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\ttextView.setText(text);\n\t\t\t\t\t\t\t}",
"public void visMedlemskabsMenu ()\r\n {\r\n System.out.println(\"Du har valgt medlemskab.\");\r\n System.out.println(\"Hvad Oensker du at foretage dig?\");\r\n System.out.println(\"1: Oprette et nyt medlem\");\r\n System.out.println(\"2: Opdatere oplysninger paa et eksisterende medlem\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }",
"private void showText(String msg)\n {\n\n popup.setText(msg);\n\n listView.animate().alpha(0.3f).setDuration(1000);\n\n popup.setVisibility(View.VISIBLE);\n\n }",
"@Override\n public void onClick(View view) {\n //Metodos Getters y Setters\n tvSaludo.setVisibility(View.VISIBLE);\n tvSaludo.setText(\"HOLA ANDROIDS JUNIORS\"); // hard coding\n }",
"public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String value = dataSnapshot.getValue(String.class);\n text.setText(value);\n }",
"private void dismissShowText() {\n\t}",
"private void setInfo(String info) {\n// TextView textView = (TextView) findViewById(R.id.info);\n// textView.setText(info);\n }",
"@DSComment(\"ToggleButton, check callbacks modeled\")\n @DSSafe(DSCat.GUI)\n @DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:31:45.973 -0500\", hash_original_method = \"3E15133DBF34E1DA0E6FF67809AEAC81\", hash_generated_method = \"68589246CEB40B35E20815867173DA1D\")\n \npublic TextView getText2() {\n return mText2;\n }",
"public void onDisplay() {\n\n\t}",
"void noDataFoundTextView();",
"@Override\r\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tshowtalk.setText(result);\r\n\t\t}",
"@Override\n public void onClick(View view) {\n AddWordFromDaum();\n }",
"private void txt() {\n\n\t}",
"public void showToast(String text){\n Toast.makeText(this,text,Toast.LENGTH_SHORT).show();\n }",
"void displayMessage(){\r\n Toast toast = Toast.makeText(this, getString(R.string.congratz_message, String.valueOf(playerScore)), Toast.LENGTH_SHORT);\r\n toast.show();\r\n }",
"@Override\n\tpublic void on() {\n\t\tSystem.out.println(\"컬러모니터가 켜졌습니다\");\n\t}",
"public void displayMessage(View view) {\n // I got the following line of code from StackOverflow: http://stackoverflow.com/questions/5620772/get-text-from-pressed-button\n String s = (String) ((Button)view).getText();\n CharSequence msg = new StringBuilder().append(\"This button will launch my \").append(s.toString()).append(\" app\").toString();\n Toast.makeText(view.getContext(),msg, Toast.LENGTH_SHORT).show();\n }",
"private void setAttackText(){\n if (this.attack >= 0){\n pokemonText.setText(\"Ataque: \" + this.attack);\n } else {\n pokemonText.setText(\"\");\n }\n }",
"String getDisplayText();",
"@DSComment(\"ToggleButton, check callbacks modeled\")\n @DSSafe(DSCat.GUI)\n @DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:31:45.972 -0500\", hash_original_method = \"6D31016C3EFADAD00849C6FB753C3139\", hash_generated_method = \"94B57183344FE551C5A82AD82F7E846A\")\n \npublic TextView getText1() {\n return mText1;\n }",
"public void Makan()\n\t{\n\tSystem.out.println(\"Harimau Makan Daging dan minum susu\");\n\tSystem.out.println();\n\t}",
"@Override\n public void run() {\n if (mToast == null) {\n mToast = Toast.makeText(getApplicationContext(), text,\n Toast.LENGTH_SHORT);\n } else {\n mToast.setText(text);\n }\n mToast.show();\n }",
"public void updateText(String s){\n TextView articleText = (TextView) findViewById(R.id.article_text);\n articleText.setText(s);\n }",
"@Override\r\n\tpublic void onShow() {\n\t\t\r\n\t}",
"@Override\n\tpublic void shown() {\n\n\t}",
"private void setLabelInloggNamn() {\n String hittaNamn = (\"select namn from agent where agent_id = \" + agentID);\n\n try {\n inloggadSom.setText(\"Du är inloggad som: \" + mib.fetchSingle(hittaNamn));\n } catch (InfException ettUndantag) {\n JOptionPane.showMessageDialog(null, \"Databasfel!\");\n System.out.println(\"1,5 - Internt felmeddelande\" + ettUndantag.getMessage());\n } catch (Exception ettUndantag) {\n JOptionPane.showMessageDialog(null, \"Något gick fel!\");\n System.out.println(\"2 - Internt felmeddelande\" + ettUndantag.getMessage());\n }\n }",
"@Override\n public void onClick(View view) {\n\n if (view.getId() == R.id.tvFrage ) {\n\n }else {\n int[] color = {Color.GREEN, Color.RED, Color.BLUE};\n Button bTemp = (Button) view;\n sButtText = bTemp.getText().toString();\n double[] eingrenzRight = logic.checkAnswer(sButtText);\n tvInfo.performHapticFeedback(3);\n\n String[] infoStrings = new String[8];\n\n infoStrings[0] = \" Round: \" + MySingleton.getInstance().getNext();\n infoStrings[1] = \" Count: \" + MySingleton.getInstance().getCount() + \" (\" + MySingleton.getInstance().getAktiviert() + \")\";\n infoStrings[2] = \" S: \" + eingrenzRight[2] ;\n infoStrings[3] = \" C: \" + (int)eingrenzRight[3] ;\n infoStrings[4] = \" R: \" + eingrenzRight[4] ;\n infoStrings[5] = \" V: \" + (int)eingrenzRight[5] ;\n infoStrings[6] = \" N: \" + (int)eingrenzRight[6] ;\n\n mCallback.onUpdate(infoStrings);\n\n String infoText = MySingleton.getInstance().vorschubText;\n tvInfo.setText(infoText);\n\n tvInfo.setBackgroundColor(color[(int)eingrenzRight[1]]);\n if (eingrenzRight[0] == 0 ) { // Eingrenzungsantwort\n setUpButtonsMC();\n } else if (eingrenzRight[1] == 0) { //Antwort richtig\n neueFrage();\n } else { //Antwort falsch\n neueFrage();\n }\n ;\n }\n }",
"@Override\n public void updateDebugText(MiniGame game) {\n }",
"@HippyMethod(name = \"show\")\n\tpublic void show(String message)\n\t{\n\t\tLogUtils.d(CLASSNAME, message);\n\t\t// Toast.makeText(hippyRootView.getContext(), message, Toast.LENGTH_SHORT).show();\n\t}",
"@Override\r\n public void onClick(View v)\r\n {\n DJIDrone.getDjiMainController().getAircraftSn(new DJIExecuteStringResultCallback(){\r\n\r\n @Override\r\n public void onResult(String result)\r\n {\r\n // TODO Auto-generated method stub\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"SN = \"+result));\r\n }\r\n \r\n });\r\n }",
"@Override\n public void updateDebugText(MiniGame game)\n {\n }",
"private void btnSpeaker2ActionPerformed(java.awt.event.ActionEvent evt) {\n txtSpeaker2.setText(Dialog());\n \n }",
"@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }",
"@Override\n\tpublic void setText(String arg0) {\n\t\t\n\t}",
"public void updateView(String message) {\n output.setText(message);\n \n }",
"public void working() {\n\t\t Dialog d = new Dialog(this);\r\n\t\t d.setTitle(\"hech yea!\");\r\n\t\t TextView tv = new TextView(this);\r\n\t\t tv.setText(\"Success\");\r\n\t\t d.setContentView(tv);\r\n\t\t d.show();\t\r\n\t}",
"@Override\n public void onSuccess(FirebaseVisionText firebaseVisionText) {\n\n Toast.makeText(CreateNoteActivity.this, firebaseVisionText.getText(), Toast.LENGTH_SHORT).show();\n }",
"public static void show() {\n\t\t\n\t}",
"private void display() {\n TextView textview = (TextView) findViewById(R.id.textView);\n EditText editText = (EditText) findViewById(R.id.editNumber) ;\n textview.setText(\"TEXT\");\n editText.setText(\"\");\n\n }",
"public void button0OnClick(View view){ display.setText(display.getText()+ \"0\");}",
"@Override\n public void setText(String englishText) {\n\n }",
"protected View ShowWord() {\n\t\tTextView btn=new TextView(this);\n\t\tbtn.setId(index);\n\t\tbtn.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));\n//\t\tbtn.setText(\"text not sent here!!!!! \"); //這一行是可以顯示文字的\n\t\treturn btn;\n\t}",
"public void run() {\n textView.setText(Html.fromHtml(title));\n textView.append(\"\\n\");\n textView.append(\" \" + message + \" \\n\");\n }",
"public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }",
"public void diler(View view) {\n//dialogi stexcman mek ayl dzev en kirarel\n dialog_diler.show();\n }",
"public void mostrarNuevaPregunta(){\n p = new Pregunta();\n preguntaView.setText(p.getPregunta());\n }",
"private void showLyrics(){\r\n\t\tif(mLyrics == null || mLyrics.equals(\"null\")){\r\n\t\t\tmTextView.setText(R.string.no_lyrics);\r\n\t\t}else{\r\n\t\t\tmTextView.setText(mLyrics);\r\n\t\t}\r\n\t\tmViewFlipper.setDisplayedChild(1);\r\n\t}",
"@Override\r\n public void onClick(View v)\r\n {\n DJIDrone.getDjiMainController().getGohomeAltitude(new DJIExecuteFloatResultCallback() {\r\n \r\n @Override\r\n public void onResult(float result)\r\n {\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, result + \"\"));\r\n }\r\n });\r\n }",
"private void onClickInfo() {\n if (!input.getText().toString().isEmpty()) {\n Toast.makeText(getContext(), convertLbsToKg(Float.parseFloat(input.getText().toString())) + \" kg\", Toast.LENGTH_SHORT).show();\n }\n }",
"public void onAddText(View view){\n setPage(view);\n int index = deleteView(view);\n addTextField(\"label:\", \"\", index);\n Toast.makeText(this, \"Short Query Added\", Toast.LENGTH_LONG).show();\n }",
"@Override\n\tpublic void attaquer() {\n\t\tSystem.out.println(\"Je suis \" + this.nom + \", j'ai \" + this.age + \" ans et je cueille le gui !\");\n\t}",
"public void d() {\n MiTalkiApp.n().postDelayed(new Runnable() {\n public void run() {\n SetMyOtherInfoActivity.this.k();\n }\n }, 500);\n }",
"@OnClick(R.id.tv_guankan)\n public void guankan() {\n\n }",
"public void showNoeudByClick() {\r\n\t\tSystem.out.print(\"Cliquez votre noeud: \");\r\n\t\tNoeud noeud = getNoeudByClick();\r\n\t\tthis.dessin.setColor(Color.RED);\r\n\t\tthis.dessin.putText(noeud.getLongitude(), noeud.getLatitude(), noeud.toString());\t\r\n\t\tSystem.out.println(noeud);\r\n\t}",
"public void showText(View view) {\n EditText editText = findViewById(R.id.editText_main);\n TextView textView = findViewById(R.id.text_phonelabel);\n if (editText != null) {\n // Assign to showString both the entered string and mSpinnerLabel.\n String showString = (editText.getText().toString() +\n \" - \" + mSpinnerLabel);\n // Display a Toast message with showString\n Toast.makeText(this, showString, Toast.LENGTH_SHORT).show();\n // Set the TextView to showString.\n textView.setText(showString);\n }\n }",
"@Override\n public void onClick(View v) {\n if (!vKenalan()){\n dialog.show();\n berbicara.play(\"it seems like we haven't met yet, don't know it then don't love, let's know you first\");\n return;\n }\n // untuk toogle\n if (diam){\n bolehMendengarkan();\n diam = false;\n }else {\n tidakBolehMendengarkan();\n diam = true;\n }\n }",
"public void mo68530k() {\n super.mo68530k();\n SearchAdBottomBar searchAdBottomBar = this.f89222bp;\n if (searchAdBottomBar != null) {\n searchAdBottomBar.setVisibility(8);\n }\n Aweme aweme = this.f77546j;\n boolean d = C25352e.m83221d(aweme);\n C7573i.m23582a((Object) aweme, \"aweme\");\n m110451a(aweme, d);\n if (d) {\n m110459at();\n mo86986ar();\n }\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tMusicPlayerContainer.this.adjustInfoTextViewAlpha();\r\n\t\t}",
"@Override\n public void onClick(View v) {\n contador++;\n if((contador%2)==0){\n elTexto.setText(\"Es divisible entre 2\");\n\n }else{\n elTexto.setText(R.string.titulo);\n elTexto.setText(elTexto.getText().toString()+contador);}\n //Texto directo\n //elTexto.setText(\"!!Soy el titulo!!! Contador:\"+contador);\n }",
"private void displayMessage(String message) {\n Log.d(\"Method\", \"displayMessage()\");\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void run() {\n mTextView.setText(String.valueOf(co));\n }",
"public void addText(String texto) {\n Platform.runLater(() -> {\n try {\n camadas.setExpandedPane(this);//Expandindo a camada\n //Thread.sleep(100);\n seta.setVisible(true);//Deixando a imagem da seta visivel\n seta.setLayoutY(posYSeta);//Alterando a posicao Y da seta\n textArea.setText(textArea.getText() + texto);//Adicionando o texto\n textArea.appendText(\"\");//Movendo o scroll bar da Area de texto\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n // Platform.runLater(new Runnable(){\n // @Override\n // public void run() {\n // try {\n // seta.setVisible(true);//Deixando a imagem da seta visivel\n // seta.setLayoutY(posYSeta);//Alterando a posicao Y da seta\n // textArea.setText(textArea.getText() + texto);//Adicionando o texto\n // textArea.appendText(\"\");//Movendo o scroll bar da Area de texto\n // } catch (Exception e) {\n // System.out.println(\"[ERRO] - Adicionar texto na \" + titulo);\n // e.printStackTrace();\n // }\n // }\n // });\n }",
"@Override\n\tpublic void show() {\n\t\t Gdx.app.log(\"GameScreen\", \"show called\");\n\t}",
"@Override\n public void run() {\n speak(getString(R.string.Data_saved), \"\");\n }",
"@Override\n public void run() {\n TextView tempDoe = (TextView) findViewById(R.id.tempMonitor);\n TextView humid = (TextView) findViewById(R.id.humidMonitor);\n TextView noisePol = (TextView) findViewById(R.id.noisePolMonitor);\n TextView carMon = (TextView) findViewById(R.id.coMonitor);\n float value = new BigInteger(tokens[0], 16).longValue();\n //System.out.println(value);\n float temp = (value * 50) / 65535;\n //System.out.println(temp);\n double tempFah = temp * 1.8000 + 32.00;\n String tempFahStr = String.valueOf(tempFah);\n //System.out.println(tempFah);\n int humidity = (Integer.parseInt(tokens[1],16) * 100) / 65535;\n String humidityDoe = String.valueOf(humidity);\n double noiseLev = Integer.parseInt(tokens[2],16);\n noiseLev = 20*(Math.log10(noiseLev/1024));\n String noiseLevStr = String.valueOf(noiseLev);\n int methane = Integer.parseInt(tokens[3],16);\n String methaneStr = String.valueOf(methane);\n tempDoe.setText(tempFahStr);\n humid.setText(humidityDoe);\n noisePol.setText(noiseLevStr);\n carMon.setText(methaneStr);\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tmytv.setText(String.valueOf(randomDouble));\n\t\t\tLog.d(\"runable\",\"settext\");\n\t\t}",
"public void Text_Message(View view) {\r\n adb= new AlertDialog.Builder(this);\r\n adb.setCancelable(false);\r\n adb.setTitle(\"Message Input\");\r\n final EditText eT= new EditText(this);\r\n eT.setHint(\"Type Message Here\");\r\n adb.setView(eT);\r\n adb.setPositiveButton(\"Show\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n String str= eT.getText().toString();\r\n Toast.makeText(MainActivity.this,str,Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n adb.setNegativeButton(\"Cancle\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.dismiss();\r\n }\r\n });\r\n AlertDialog ad=adb.create();\r\n ad.show();\r\n }",
"public void printToLogs(View view) {\n TextView firstItemToLog = (TextView) findViewById(R.id.menu_item_1);\n String firstLog = firstItemToLog.getText().toString();\n Log.i(\"Log Item 1\", firstLog);\n\n\n // Finds the second text from the TextView and prints the text to the logs\n TextView secondItemToLog = (TextView) findViewById(R.id.menu_item_2);\n String secondLog = secondItemToLog.getText().toString();\n Log.i(\"Log Item 2\", secondLog);\n\n // Finds the third text from the TextView and prints the text to the logs\n TextView thirdItemToLog = (TextView) findViewById(R.id.menu_item_3);\n String thirdLog = thirdItemToLog.getText().toString();\n Log.i(\"Log Item 3\", thirdLog);\n\n }",
"private void setLogScreen(String text){\n\t\t\t\n\t\tscreenUI.clearScreen();\n\t\tscreenUI.drawText(2, 1, text);\n\t}",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String value = dataSnapshot.getValue(String.class);\n txtDis.setText(value);\n // Log.d(TAG, \"Value is: \" + value);\n }",
"public static void show() {\n\n\t}",
"private void viewExtractedData() {\n txtViewer.setText(extractedData);\n }",
"private void yas(){\n System.out.println(namn);\n \n try{\n String fraga = \"SELECT TEXT FROM INLAGG WHERE RUBRIK = 'Borttappad strumpa'\";\n String XD = db.fetchSingle(fraga);\n System.out.println(XD);\n txtInlagg.append(XD);\n }\n catch(InfException e){\n JOptionPane.showMessageDialog(null, \"Kunde ej hämta inlägg\");\n }\n }",
"public void setarText() {\n txdata2 = (TextView) findViewById(R.id.txdata2);\n txdata1 = (TextView) findViewById(R.id.txdata3);\n txCpf = (TextView) findViewById(R.id.cpf1);\n txRenda = (TextView) findViewById(R.id.renda1);\n txCpf.setText(cpf3);\n txRenda.setText(renda.toString());\n txdata1.setText(data);\n txdata2.setText(data2);\n\n\n }",
"private void onOK() {\n show.setText(null);\n String s = (new ArithmeticExpressions(text.getText()).checkExpression());\n System.out.println(s);\n show.setText(s);\n }"
] | [
"0.6249965",
"0.5942046",
"0.5942046",
"0.59258574",
"0.5892634",
"0.58621484",
"0.5842554",
"0.58266723",
"0.57570475",
"0.5743536",
"0.5729315",
"0.57060194",
"0.56654847",
"0.5632636",
"0.5622229",
"0.5611961",
"0.5602906",
"0.56025577",
"0.5593052",
"0.5586007",
"0.5584994",
"0.55840033",
"0.5572023",
"0.55527985",
"0.5543061",
"0.5541764",
"0.5513527",
"0.551121",
"0.5505993",
"0.55038655",
"0.5492561",
"0.5486905",
"0.547759",
"0.54681104",
"0.5463949",
"0.54555094",
"0.5455112",
"0.5442043",
"0.54359365",
"0.5433494",
"0.5431868",
"0.54208744",
"0.54203683",
"0.541965",
"0.5413412",
"0.54050076",
"0.53957283",
"0.5389006",
"0.538626",
"0.53840876",
"0.5381563",
"0.53717494",
"0.53626347",
"0.53507376",
"0.53472996",
"0.53432447",
"0.53418916",
"0.53418034",
"0.5340575",
"0.53373224",
"0.5336659",
"0.5335567",
"0.53303045",
"0.53280026",
"0.5327527",
"0.5326764",
"0.53267425",
"0.532411",
"0.53217554",
"0.5318521",
"0.53128535",
"0.5312336",
"0.53107965",
"0.53090817",
"0.53075767",
"0.53042233",
"0.5303396",
"0.53029895",
"0.53025776",
"0.529933",
"0.5294226",
"0.52915394",
"0.52823555",
"0.527559",
"0.52745384",
"0.5274319",
"0.5274132",
"0.52638507",
"0.52602106",
"0.5255267",
"0.52541786",
"0.525382",
"0.52511495",
"0.5250437",
"0.52440345",
"0.52435374",
"0.5243322",
"0.5243095",
"0.52428734",
"0.52375084"
] | 0.6599065 | 0 |
Constructor using action field. | public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {
super(designer, action);
// for now support one single soap fault detail
SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();
soapFaultDetailValidationContext.addValidationContext(validationContext);
action.setValidationContext(soapFaultDetailValidationContext);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void init_actions()\n {\n action_obj = new CUP$ParserForms$actions(this);\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"public MemberAction() {\n\t\tsuper();\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$Parser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$parser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$FractalParser$actions(this);\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$CircuitCup$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"public VisitAction() {\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"public ActionManager() {\n\t\tsuper();\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$MJParser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CompParser$actions(this);\n }",
"public DocumentoVinculadoAction() {\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"protected void init_actions()\n {\n action_obj = new CUP$PCLParser$actions(this);\n }",
"public Action(long id) {\n this(id, \"\");\n }",
"public UpcomingContestsManagerAction() {\r\n }",
"public ExecuteAction()\n {\n this(null);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Asintactico$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Grm$actions();\n }",
"public void setAction(String action) { this.action = action; }",
"@Override\n public void doInit() {\n action = (String) getRequestAttributes().get(\"action\");\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$SintaxAnalysis$actions(this);\r\n }",
"public CreateIndividualPreAction() {\n }",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"public void createAction() {\n }",
"protected void init_actions()\n {\n action_obj = new CUP$XPathParser$actions(this);\n }",
"private ActionPackage() {}",
"Action(String desc){\n this.desc = desc;\n this.append = \"\";\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Sintactico$actions(this);\n }",
"public ActionFile() {\n }",
"public ScheduledActionAction() {\n\n }",
"public Action(Operation op, String[] args) {\n this.op = op;\n this.restriction = null;\n this.args = args;\n this.reqd = new boolean[this.args.length];\n this.cmps = new String[this.args.length];\n List<String> opts = analyzeRequiredArgs();\n this.opts = opts.toArray(new String[opts.size()]);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$include$actions(this);\n }",
"@Override\r\n public void initAction() {\n \r\n }",
"public RepeaterActionDefinition() {\n }",
"public AddApplicationReleaseAction() {\r\n }",
"public ConfigAction()\n {\n this(null, null, true);\n }",
"public SearchContestsManagerAction() {\r\n }",
"protected void init_actions() {\r\n action_obj = new CUP$SintacticoH$actions(this);\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$LuaGrammarCup$actions(this);\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$AnalizadorSintactico$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$A4Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$A4Parser$actions(this);\n }",
"public ActionMenuItem() {\n this(\"\");\n }",
"public Action(String name) {\n this.name = name;\n }",
"protected ConvActionSelector() {\n super();\n }",
"public void setAction (String action) {\n this.action = action;\n }",
"public Builder setAction(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n action_ = value;\n onChanged();\n return this;\n }",
"private void setAction(String action)\r\n/* 46: */ {\r\n/* 47: 48 */ this.action = action;\r\n/* 48: */ }",
"@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public SaveConstitutionInformationAction() {\n }",
"public void setAction(String action);",
"public HSRCreateDraftRequestProcessorAction() {\n\t\tlogger.warn(\"***** This constructor is for Test Cases only *****\");\n\t\t\n\t}",
"public void initiateAction() {\r\n\t\t// TODO Auto-generated method stub\t\r\n\t}",
"StateClass(String action) {\r\n setAccountAction(action); \r\n }",
"public Action(Operation op, String[] args, Map<String, String> restriction) {\n this.op = op;\n this.restriction = restriction;\n if (op == Operation.UPDATE || op == Operation.SEARCH) {\n Set<String> set = new HashSet<String>(restriction.keySet());\n for (int i = 0; i < args.length; ++i) set.add(args[i]);\n this.args = set.toArray(new String[set.size()]);\n } else {\n this.args = args;\n }\n this.reqd = new boolean[this.args.length];\n this.cmps = new String[this.args.length];\n List<String> opts = analyzeRequiredArgs();\n this.opts = opts.toArray(new String[opts.size()]);\n }",
"public void setAction(Action action) {\n this.action = action;\n }",
"public Action(String id) {\n\t\tthis.id = id;\n\t}",
"protected void init( CommonDockAction action ){\n if( this.action != null )\n throw new IllegalStateException( \"already initialized\" );\n \n if( action == null )\n throw new NullPointerException( \"action is null\" );\n \n this.action = action;\n }",
"public FlowAction(FlowActionType type) {\n this.actionType = type;\n }",
"public Action() {\n //ensureInterpolator();\n }",
"public void setAction(String action) {\n this.action = action;\n }",
"public void setAction(String action) {\n this.action = action;\n }",
"public BattleWeaponsSegmentAction() {\n }",
"public ClickButtonAction() {\n _target = new TargetComponent();\n }",
"protected void init_actions()\n {\n action_obj = new CUP$analisis_sintactico_re$actions(this);\n }",
"private SelectOSAction() {\r\n }",
"private QueryTerm(String action, String argument, boolean negateAction) {\n _action = Hope.that(action).named(\"action\").isNotNullOrEmpty().map(s -> Strings.lower(s)).value();\n _arg = Hope.that(Strings.safeTrimToNull(argument)).named(\"argument\").isNotNullOrEmpty().value();\n _negateAction = negateAction;\n }",
"@Override\n\tpublic void setAction() {\n\t}",
"public EmptyAction() {\n\t\tsetActionName(\"Empty Action\");\n\t}",
"public JRibbonAction()\n\t{\n\t\tsuper();\n\t}",
"@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}",
"public ActionManager(Editor editor) {\n\t\tthis.editor = editor;\n\t}",
"public InsertDataAction() {\n\t\tsuper();\n\t}",
"public void setAction(@NotNull Action action) {\n this.action = action;\n }",
"CaseAction createCaseAction();"
] | [
"0.7140362",
"0.69764364",
"0.6940265",
"0.6931596",
"0.69026864",
"0.69026864",
"0.69026864",
"0.69026864",
"0.69026864",
"0.68927425",
"0.6872586",
"0.6857899",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68503946",
"0.68478096",
"0.68134993",
"0.68134993",
"0.6789475",
"0.6779093",
"0.675568",
"0.6740722",
"0.6713527",
"0.6713527",
"0.6713527",
"0.67035085",
"0.67033184",
"0.67028975",
"0.66956514",
"0.6686818",
"0.6649637",
"0.6643457",
"0.6638716",
"0.6632918",
"0.66148067",
"0.6581415",
"0.65808725",
"0.65791786",
"0.6568213",
"0.6555169",
"0.6553576",
"0.65509045",
"0.6547022",
"0.65391046",
"0.65264636",
"0.6507053",
"0.648168",
"0.6473281",
"0.6471808",
"0.64607245",
"0.64571893",
"0.6455265",
"0.644519",
"0.64310366",
"0.64310366",
"0.64136577",
"0.64122826",
"0.64037174",
"0.6396902",
"0.6388375",
"0.6360445",
"0.6356574",
"0.633584",
"0.6334956",
"0.6319727",
"0.630222",
"0.629375",
"0.62885416",
"0.6283313",
"0.627981",
"0.6278595",
"0.626456",
"0.6255356",
"0.6246006",
"0.6236162",
"0.6236162",
"0.623507",
"0.6231336",
"0.621206",
"0.6211716",
"0.6208548",
"0.6197333",
"0.61928016",
"0.6182605",
"0.617274",
"0.61369705",
"0.6115284",
"0.60877675",
"0.60801184"
] | 0.0 | -1 |
Default constructor using runner and action container. | public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {
super(runner, action);
// for now support one single soap fault detail
SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();
soapFaultDetailValidationContext.addValidationContext(validationContext);
action.setValidationContext(soapFaultDetailValidationContext);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ActionManager() {\n\t\tsuper();\n\t}",
"protected TeststepRunner() {}",
"public ScheduledActionAction() {\n\n }",
"public UpcomingContestsManagerAction() {\r\n }",
"public ExecuteAction()\n {\n this(null);\n }",
"private ActionPackage() {}",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public SearchContestsManagerAction() {\r\n }",
"public RepeaterActionDefinition() {\n }",
"public SimpleEvaluationContributionsRunner() {\n\t}",
"public ConfigAction()\n {\n this(null, null, true);\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"public HSRCreateDraftRequestProcessorAction() {\n\t\tlogger.warn(\"***** This constructor is for Test Cases only *****\");\n\t\t\n\t}",
"public Runner(final Context c)\n {\n x= 0; y=0; // position de départ\n mContext=c; // sauvegarde du contexte\n }",
"public static void main(String[] args) {\n\t\tnew Actions();\r\n\t\t//call constructor\r\n\t}",
"public CreateIndividualPreAction() {\n }",
"public ActionManager(Editor editor) {\n\t\tthis.editor = editor;\n\t}",
"public InstrumentationTestRunner(IActivityFactory activityFactory, IActivityBinder activityBinder)\n\t{\n\t\tsuper();\n\n\t\tif (activityFactory == null)\n\t\t\tthrow new ArgumentNullException(\"activityFactory\");\n\n\t\tif (activityBinder == null)\n\t\t\tthrow new ArgumentNullException(\"activityBinder\");\n\n\t\tthis.m_activityBinder = activityBinder;\n\t\tthis.m_activityFactory = activityFactory;\n\t}",
"protected ConvActionSelector() {\n super();\n }",
"protected CommandDispatcher()\n {\n // do nothing\n }",
"public Stub(String label, ActionRunnable runnable) {\n\t\t\tthis(label, null, STYLE_DEFAULT, null, runnable);\n\t\t}",
"public VisitAction() {\n }",
"public ActionFile() {\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$FractalParser$actions(this);\n }",
"public Activator() {\r\n\t}",
"public MemberAction() {\n\t\tsuper();\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$parser$actions(this);\r\n }",
"protected TaskChain() {\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$Parser$actions(this);\r\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"public Action(long id) {\n this(id, \"\");\n }",
"private FlowExecutorUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }",
"private PSAAClientActionFactory()\n {\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$CircuitCup$actions(this);\r\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"public EmptyRuleActionImpl() {}",
"public BattleWeaponsSegmentAction() {\n }",
"public AcceptanceTestRun() {\n }",
"public TestInvoker()\n {\n super(new TestClient(), new ThreadPoolExecutorImpl(3));\n }",
"protected void init_actions()\n {\n action_obj = new CUP$PCLParser$actions(this);\n }",
"public RESTWorkItemHandler() {\n\t}",
"public abstract void init_actions() throws Exception;",
"public WorkerController(){\r\n\t}",
"public Action() {\n //ensureInterpolator();\n }",
"private CommandBrocker() {}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$MJParser$actions(this);\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$SintaxAnalysis$actions(this);\r\n }",
"public AddApplicationReleaseAction() {\r\n }",
"public Stub(String label, Image image, ActionRunnable runnable) {\n\t\t\tthis(label, image, STYLE_DEFAULT, null, runnable);\n\t\t}",
"public BattleRunnable() {\n\t\tdebug.i(\"BattleRunnable constructor\");\n\t}",
"public AbstractTtcsCommandController() {\n\t}",
"@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}",
"public ActionEditorTest(String name) {\n super(name);\n }",
"private Shell() { }",
"public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}",
"public JRibbonAction()\n\t{\n\t\tsuper();\n\t}",
"public ActionsValidator() {\n super();\n }",
"public ClickButtonAction() {\n _target = new TargetComponent();\n }",
"public RemoteFilingTest() {\n }",
"private StateActions(){}",
"public CommandManager() {}",
"public Workflow() {\n\t\tsuper();\n\t}",
"protected void init_actions()\n {\n action_obj = new CUP$CompParser$actions(this);\n }",
"public Core(Runnable initialize){\n\t\tthis(initialize, () -> {});\n\t}",
"public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }",
"private UI()\n {\n this(null, null);\n }",
"public PipelineImpl() {\n }",
"public Main() {\n\t\tsuper();\n\t}",
"public Simple(Dispatcher dispatcher) {\n this.dispatcher = dispatcher;\n }",
"protected void init_actions()\n {\n action_obj = new CUP$XPathParser$actions(this);\n }",
"@Override\n public void initComponent() {\n ActionManager am = ActionManager.getInstance();\n }",
"public Driver()\n {\n // instantiate joysticks & controllers here.\n\n // bind button objects to physical buttons here.\n\n // bind buttons to commands here.\n\n }",
"private RequestExecution() {}",
"@Deprecated\n public Stage() {\n // A dummy UI handle that run the specified runnable directly.\n this(new UiHandler() {\n public void post(Runnable runnable) {\n runnable.run();\n }\n });\n }",
"public GeneralRunnable(Goable<ReturnType, ParameterType> goable) {\n this.goable = goable;\n this.parameter = null;\n }",
"protected void init_actions()\n {\n action_obj = new CUP$include$actions(this);\n }",
"public void initialise() throws ActionLifecycleException;",
"public Stub(int style, ActionRunnable runnable) {\n\t\t\tthis(\"\", null, style, null, runnable);\n\t\t}"
] | [
"0.6814794",
"0.6527829",
"0.6442214",
"0.6437484",
"0.64117557",
"0.64088774",
"0.6335143",
"0.628364",
"0.6268999",
"0.6255189",
"0.62083817",
"0.6151275",
"0.61507094",
"0.61361605",
"0.6089673",
"0.6031053",
"0.59831065",
"0.59743637",
"0.59548295",
"0.5888215",
"0.5863296",
"0.5855786",
"0.58526224",
"0.58452743",
"0.58452743",
"0.58405423",
"0.58387446",
"0.58341545",
"0.5823188",
"0.58064777",
"0.5802301",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.579793",
"0.57899374",
"0.57899374",
"0.57899374",
"0.57899374",
"0.57899374",
"0.57873154",
"0.5778581",
"0.57504576",
"0.5749795",
"0.5748366",
"0.5748366",
"0.5748366",
"0.5748329",
"0.57462376",
"0.57408786",
"0.57359934",
"0.57305694",
"0.5720865",
"0.5714188",
"0.5713689",
"0.57126635",
"0.5711253",
"0.57040596",
"0.5688984",
"0.568669",
"0.56816465",
"0.5680984",
"0.56755596",
"0.5658172",
"0.56563455",
"0.564308",
"0.56391907",
"0.56375206",
"0.5634913",
"0.56273395",
"0.5622253",
"0.56211185",
"0.56199133",
"0.56057197",
"0.55964994",
"0.5595663",
"0.5588693",
"0.5575959",
"0.5568345",
"0.55682385",
"0.55638605",
"0.55594534",
"0.555041",
"0.5546682",
"0.55460286",
"0.55206937",
"0.5515584",
"0.5504477",
"0.5503037",
"0.55009687"
] | 0.0 | -1 |
Default constructor using test runner. | public AssertSoapFaultBuilder(TestRunner runner) {
this(runner, new AssertSoapFault());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected TeststepRunner() {}",
"public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }",
"public TestDriverProgram(){\n iTestList = new SortableArray(iSize); // tests if parameterized constructor works\n iTestFileList = new SortableArray(); // tests if default constructor works\n runAllTests(); // run all of the tests\n }",
"protected TestBench() {}",
"public Tests(){\n \n }",
"private TestReporter() {\n\n }",
"public AllLaboTest() {\n }",
"public test() {\n\t\tsuper();\n\t}",
"public RookTest()\r\n {\r\n }",
"public tester() {\r\n }",
"public HockeyTeamTest()\n {\n }",
"public AcceptanceTestRun() {\n }",
"public UnitTests()\n {\n }",
"public BookcaseTest () {\n }",
"public TestCase()\r\n {\r\n super();\r\n resetIO();\r\n }",
"public TokenControllerTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}",
"public RemoteFilingTest() {\n }",
"public ActivitiTestCase() {\n }",
"public TestPrelab2()\n {\n }",
"public PerezosoTest()\n {\n }",
"private StressTestHelper() {\n // Empty constructor.\n }",
"public ApplicationTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code should be\n\t\t * placed in the setUp() method instead.\n\t\t */\n\n\t}",
"private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}",
"public BazaarTests() {\r\n\t\tsuper();\r\n\t}",
"public Test()\n {\n }",
"public ServerTest() {\n\t\tsuper();\n\t}",
"public Test() {\n }",
"public AbstractTest() {\r\n\t\tlog = LogFactory.getLog(getClass());\r\n\t}",
"public ClimbingClubTest()\n {\n \n }",
"public Tester()\n {\n // initialise instance variables\n x = 0;\n }",
"public AppTest()\n {\n super(AppTest.class);\n }",
"public AcuityTest() {\r\n }",
"public TestRunJsonParser(){\n }",
"public FlightTest(){\n }",
"public RenderableTest()\n {\n }",
"public ZTest1() {\n this(\"z_test1\", null);\n }",
"public GUITest() {\n }",
"public ScriptCallableTest() {\n super(\"ScriptCallableTest\");\n }",
"public Vending_MachineTest()\n {\n // initialise instance variables\n \n \n }",
"public InstrumentationTestRunner(IActivityFactory activityFactory, IActivityBinder activityBinder)\n\t{\n\t\tsuper();\n\n\t\tif (activityFactory == null)\n\t\t\tthrow new ArgumentNullException(\"activityFactory\");\n\n\t\tif (activityBinder == null)\n\t\t\tthrow new ArgumentNullException(\"activityBinder\");\n\n\t\tthis.m_activityBinder = activityBinder;\n\t\tthis.m_activityFactory = activityFactory;\n\t}",
"public StrandUnitTest()\n {\n }",
"public Driver() {\n setupFiles();\n }",
"public Main() {\r\n\t}",
"public SampleJUnit(String name) {\r\n\t\tsuper(name);\r\n\t}",
"public GetResponseTest() {\n\t\t/*\n\t\t * This constructor should not be modified. Any initialization code\n\t\t * should be placed in the setUp() method instead.\n\t\t */\n\n\t}",
"protected AbstractTest() {\n\t\tlog = LogFactory.getLog(getClass());\n\t}",
"public Main() {\n\t\tsuper();\n\t}",
"public SimpleEvaluationContributionsRunner() {\n\t}",
"public BookingSystemTest()\n {\n }",
"public AppTest(String testName) {\n super(testName);\n }",
"public AppTest(String testName) {\n super(testName);\n }",
"public AppTest(String testName) {\n super(testName);\n }",
"public AppTest(String testName) {\n super(testName);\n }",
"public AppTest(String testName) {\r\n\t\tsuper(testName);\r\n\t}",
"public fileReaderTest()\n {\n }",
"public TestInvoker()\n {\n super(new TestClient(), new ThreadPoolExecutorImpl(3));\n }",
"@Test\n public void init() {\n }",
"private Main() {\n\n super();\n }",
"public Test() {\n super(0, \"A task\");\n this.answersArray = new String[]{\"a\", \"b\", \"c\"};\n }",
"public LoginPageTest()\n\t{\n\t\tsuper(); // calling TestBase Constructor\n\t}",
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}",
"public CustomerTest()\n {\n }",
"protected BaseTestObject()\n {\n\n fProp = new Properties(); // empty properties object\n fLog = TestLogger.getInstance(); // default level is DEBUG\n\n }",
"protected J2meTestRunner(J2meTestCase test) {\n super(test, null);\n midlet = null;\n }",
"public AppTest(String testName) {\n\t\tsuper(testName);\n\t}",
"public AppTest(String testName) {\n\t\tsuper(testName);\n\t}",
"public AppTest(String testName) {\n\t\tsuper(testName);\n\t}",
"public AppTest(String testName) {\n\t\tsuper(testName);\n\t}",
"public AppTest(String testName) {\n\t\tsuper(testName);\n\t}",
"public GenericTest()\n {\n }",
"public TestSequence() {\n }",
"public ControllerTest()\r\n {\r\n }",
"private AccuracyTestHelper() {\n // empty\n }",
"private Test emptyTest() {\n return new TestSuite();\n }",
"public Main() {\r\n }",
"public Main() {\r\n }",
"public TestBase() {\n try {\n properties = new Properties();\n FileInputStream fileInputStream = new FileInputStream(\"F:/LearningStuff/PracticalWork\" +\n \"/Frameworks/DataDrivenFrameworkSelenium/src/main/resources/config/config.properties\");\n properties.load(fileInputStream);\n } catch (FileNotFoundException f) {\n f.printStackTrace();\n } catch (IOException i) {\n i.printStackTrace();\n }\n }",
"public RecognitionTest(String testName) {\n super(testName);\n }",
"public Runner() {\n this.config = ConfigUtils.getDefaultConfig();\n this.noSuchBaseDir = Files.createTempDir();\n this.noSuchBaseDir.deleteOnExit();\n }",
"public BaseTest() {\n\t\t\n\t\tprop= new Properties();\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fle= new FileInputStream(\"C:\\\\Users\\\\19175\\\\eclipse-workspace\\\\com.toyota\\\\src\\\\test\\\\java\\\\Config\\\\config.properties\"); // Path of the Properties file\n\t\t\tprop.load(fle);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public SalesItemTest()\n {\n }",
"public TestsAsset() {\n tests = new LinkedList<TestBean>();\n }",
"public DummyTestResult() {\n this.testContext = null;\n }",
"public Main() {\n \n \n }",
"public FileTest() {\n }",
"public Main() {\n }",
"public LTest(String name) {\r\n\t\tsuper(name);\r\n\t}",
"public static Tester create() {\n\t\treturn new Tester();\n\t}",
"public EnvironmentPanelTest()\n {\n }",
"public Main() {\n // Required empty public constructor\n }",
"public TestArithmetic()\n {\n }",
"public HotelBookingTest() {\r\n\t\tsuper();\r\n\t}",
"public TcTestRunner(Class<?> klass) throws Throwable {\n super(klass, Collections.<Runner> emptyList());\n List<TestConfig> parametersList = getParametersList(getTestClass());\n for (int i = 0; i < parametersList.size(); i++)\n runners.add(new TestClassRunnerForParameters(getTestClass().getJavaClass(), parametersList, i));\n }",
"private ProtomakEngineTestHelper() {\r\n\t}",
"public AllTests() {\n\t\taddTest(new TestSuite(TestSuiteTest.class));\n\t}",
"public TestCase(String name)\r\n {\r\n super(name);\r\n resetIO();\r\n }",
"public ParallelUtilTest(\n String testName)\n {\n super(testName);\n }",
"public TestServerApi()\r\n\t{\r\n\t\t\r\n\t}",
"public Main() {\n }",
"public Main() {\n }",
"public ElfTest()\n {\n }"
] | [
"0.81325185",
"0.77971476",
"0.76674825",
"0.75791895",
"0.7553342",
"0.74560785",
"0.74057525",
"0.7404493",
"0.7395155",
"0.73674715",
"0.73540586",
"0.73382306",
"0.7323621",
"0.7314422",
"0.7311936",
"0.72899544",
"0.7262568",
"0.72588897",
"0.723808",
"0.71851766",
"0.7158991",
"0.71373117",
"0.71274114",
"0.7113312",
"0.70935416",
"0.70844215",
"0.7055298",
"0.7040749",
"0.70336276",
"0.70197076",
"0.70162904",
"0.70102954",
"0.6974197",
"0.690272",
"0.68755424",
"0.6874553",
"0.6860049",
"0.68588156",
"0.684622",
"0.6835396",
"0.68266225",
"0.682614",
"0.67986363",
"0.676044",
"0.6753372",
"0.6747527",
"0.6742727",
"0.6735159",
"0.67316216",
"0.6722249",
"0.6722249",
"0.6722249",
"0.6722249",
"0.67173314",
"0.6686046",
"0.66824865",
"0.6681239",
"0.66787726",
"0.6676407",
"0.66762185",
"0.6666011",
"0.6665819",
"0.6665473",
"0.66585535",
"0.664735",
"0.664735",
"0.664735",
"0.664735",
"0.664735",
"0.66287136",
"0.6627979",
"0.66200966",
"0.6615796",
"0.65985423",
"0.6585881",
"0.6585881",
"0.6583388",
"0.6577083",
"0.6568697",
"0.6560016",
"0.6557681",
"0.6540331",
"0.6539202",
"0.65390587",
"0.65371644",
"0.65283567",
"0.6526863",
"0.65222305",
"0.6512521",
"0.65072167",
"0.650458",
"0.6502748",
"0.64949846",
"0.64903694",
"0.64880306",
"0.64801645",
"0.64727265",
"0.6472365",
"0.64703834",
"0.64703834",
"0.64598316"
] | 0.0 | -1 |
Expect fault code in SOAP fault message. | public AssertSoapFaultBuilder faultCode(String code) {
action.setFaultCode(code);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFaultCode() {\n return faultCode;\n }",
"public void setFaultCode(final String faultCode) {\n this.faultCode = faultCode;\n }",
"NamespacedProperty getFaultCodeExpression();",
"String getFaultReasonValue();",
"String getFaultStringValue();",
"public int getFaultCode() {\n\t\treturn faultCode;\n\t}",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"public String getFaultString() {\n return faultString;\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"public String getFaultMessage() {\n return faultMessage;\n }",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"public static void serializeSOAPFault(SOAPFault fault, XMLStreamWriter writer) throws XMLStreamException {\n\n\t\tOMSerializerUtil.serializeStartpart(fault, writer);\n\t\tOMElement e = null;\n\n\t\t// based on the namespace (SOAP1.1 vs SOAP1.2) to serialize accordingly\n\t\tif (fault.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {\n\t\t\t// SOAP1.2\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\n\t\t} else {\n\t\t\t// SOAP1.1\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\t\t}\n\t}",
"public TR069Exception(String message, int faultCode) {\n\t\tthis(message, faultCode, null);\n\t}",
"String getFaultDetailValue();",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"public LibraryWsException(final String message, final LibraryWsFault fault) {\n super(message);\n this.fault = fault;\n }",
"protected Element getFaultMessage() {\n return mElement;\n }",
"NamespacedProperty getFaultReasonExpression();",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"public static Fault createFault(MessageExchange reply, Element part, QName type) \n throws Exception {\n Document doc = XmlUtil.newDocument();\n Element wrapper = WrapperUtil.createJBIMessageWrapper(doc, type, null);\n wrapper.appendChild(WrapperUtil.importJBIWrappedPart(doc, part));\n Fault fault = reply.createFault();\n fault.setContent(new DOMSource(doc));\n return fault;\n }",
"@Test\n\tpublic void testUpdatePoStatusErrorListenerFaultTest() {\n\t\ttry{\n\t\t\t //Is used in soap request preparation because value is used in reply soap header.\n\t\t\t final String callbackRefMockUri = mockOsbBusinessService(\n\t\t\t\t\t PATH_UPDATE_STATUS_CALLBACK,\n\t\t\t\t\t updatePoStatusCallbackPortMock);\t\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_ORDER_TRANSACTION_MONITORING,\n\t\t\t\t\t orderTransactionServiceFaultMock);\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_RESPONSE_RETRY_WRAPPER,\n\t\t\t\t\t responseRetryWrapperMock);\n\t\n\t\t\tfinal String requestString = new ParameterReplacer(readClasspathFile(\"Request_UpdatePOStatusErrorListener.xml\"))\n\t\t\t\t\t.replace(REPLACE_PARAM_CORRELATION_ID, randomCorrelationId)\n\t\t\t\t\t.replace(REPLACE_PARAM_PURCHASE_ORDER_NUMBER, randomPoNumber)\n\t\t\t\t\t.replace(REPLACE_PARAM_COMBOX_ID, randomCoboxId)\n\t\t\t\t\t.replace(REPLY_TO, callbackRefMockUri)\n\t\t\t\t\t.replace(MESSAGE_ID, randomMessageId).build();\n\t\t\t\t\t\n\t\t\tLOGGER.info(\"+++ request \" + requestString);\n\t\n\t\t\tinvokeOsbProxyService(PATH_SERVICE, requestString);\n\n\t\t\tassertThat(\"updatePoStatusCallbackPortMock is not invocked!\",!updatePoStatusCallbackPortMock.hasBeenInvoked());\n\t\t\t//This should be invoked\n\t\t\tassertThat(\"responseRetryWrapperMock is invocked!\",responseRetryWrapperMock.hasBeenInvoked());\n\t\t\t\n\t\t\t//Get message from process as it is\n\t\t\tString responseRetryWrapperMockMsg = responseRetryWrapperMock.getLastReceivedRequest();\n\t\t\tLOGGER.info(\"+++ responseRetryWrapperMockMsg \" + responseRetryWrapperMockMsg);\n\t\t\t\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:requestHeader/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:transactionId/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:category/text()\",\n\t\t\t\t\t\"TechnicalFault\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:payload/\"\n\t\t\t\t\t+ \"exc:exception/exc:context/exc:payload/navpom:updatePurchaseOrderStatus/navpom:header/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsDestination/text()\",\n\t\t\t\t\t\"h24jms.ERR_UpdatePOStatus_Q\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsFactory/text()\",\n\t\t\t\t\t\"h24jms.PurchaseOrder\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t} catch(ServiceException e) {\n\t\t\tfail();\t\t\t\n\t\t}\n\n\t}",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext arg0) {\r\n\t\treturn true;\r\n\t}",
"@Test\n public void cancelHotelTestError1() throws CancelHotelFault, DatatypeConfigurationException{ \n String input = \"hello you\";\n try {\n cancelHotel(input);\n } catch (CancelHotelFault e) {\n assertEquals(\"ERROR\",e.getMessage());\n } \n }",
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public static SOAPFaultCode createSOAPFaultCode(String namespaceURI, String faultCodeStr) {\n\n\t\tSOAPFactory soapFactory = null;\n\t\tif (namespaceURI != null) {\n\t\t\tif (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) {\n\t\t\t\tsoapFactory = OMAbstractFactory.getSOAP12Factory();\n\t\t\t}\n\t\t}\n\n\t\t// default is SOAP1.1\n\t\tif (soapFactory == null)\n\t\t\tsoapFactory = OMAbstractFactory.getSOAP11Factory();\n\n\t\tSOAPFaultCode code = soapFactory.createSOAPFaultCode();\n\t\tSOAPFaultValue value = soapFactory.createSOAPFaultValue(code);\n\t\tvalue.setText(faultCodeStr);\n\t\tcode.setValue(value);\n\t\treturn code;\n\t}",
"public TR069Exception(String message, int faultCode, DmtException e) {\n\t\tsuper(message, e);\n\t\tthis.faultCode = faultCode;\n\t\tthis.dmtException = e;\n\t}",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext smc) {\r\n\t\tSystem.out.println(\"Ignoring fault message...\");\r\n\t\treturn true;\r\n\t}",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"@Test\n\tpublic void testStatusCode() {\n\t\tassertEquals(\"404\", myReply.getStatusCode());\n\t}",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"public void errorResponse(int code, String msg){\n msg = errorMessage(code, msg);\n StringReader inputStream = new StringReader( msg );\n\n Content ct = new crc.content.text.html( inputStream, this );\n Transaction response = new HTTPResponse( Pia.instance().thisMachine,\n\t\t\t\t\t toMachine(), ct, false);\n response.setStatus( code );\n response.setContentType( \"text/html\" );\n response.setContentLength( msg.length() );\n Pia.debug(this, \"The header : \\n\" + response.headersAsString() );\n response.startThread();\n }",
"public void test1194() throws Exception {\n invokeAsync(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1194\");\n //Lets see we get a response in 60 s\n SOAPMessage m = respMsgExchanger.exchange(null, TestConstants.CLIENT_MAX_TIMEOUT, TimeUnit.SECONDS);\n// System.out.println(\"****************************\");\n// m.writeTo(System.out);\n// System.out.println(\"\\n****************************\");\n SOAPFault f = m.getSOAPBody().getFault();\n assertNotNull(f);\n assertEquals(USER_FAULT_CODE, f.getFaultCodeAsQName());\n\n }",
"public LibraryWsFault getFaultInfo() {\n return fault;\n }",
"private ResponseStatus(int code) {\n this.code = code;\n this.formatted = format(code, \"???\");\n this.symbolicName = String.format(\"0x%04x\", code);\n }",
"NamespacedProperty getFaultDetailExpression();",
"public LibraryWsException(\n final String message, final Throwable cause, final LibraryWsFault fault) {\n super(message, cause);\n this.fault = fault;\n }",
"NamespacedProperty getFaultStringExpression();",
"protocol.Msg.ReadTableMsg.ReadImportantTableRsp.ResultCode getResultCode();",
"protected String getFaultName() {\n return mName;\n }",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/error\")\n @RequestWrapper(localName = \"error\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericErrorType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void error(\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public AssertSoapFaultBuilder faultActor(String faultActor) {\n action.setFaultActor(faultActor);\n return this;\n }",
"public void testSetReplyCode_Invalid() {\n try {\n commandHandler.setReplyCode(-1);\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.ErrType getCode();",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"public String execute(SOAPMessage message) throws FIFException;",
"@Test\n void testGivenFaultyRequestWithExceptionString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?exception=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType getArrayOfFaultTypeArray(int i);",
"public void test1152() throws Exception {\n try {\n invoke(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToNoneFaultToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1152\");\n fail(\"WebServiceException must be thrown\");\n } catch (WebServiceException e) {\n assertEquals(\"No response returned.\", e.getMessage());\n }\n }",
"@Then(\"the API call got success with status code {int}\")\n public void the_API_call_got_success_with_status_code(Integer expectedCode) {\n System.out.println(\"Then1\");\n assertEquals(200,response.getStatusCode());\n\n\n // throw new io.cucumber.java.PendingException();\n }",
"@Override\n public void Wsdl2CodeFinishedWithException(Exception ex) {\n }",
"private static String getActionFromServiceModel(Message message,\n Exception fault) {\n String action = null;\n BindingOperationInfo bindingOpInfo =\n message.getExchange().get(BindingOperationInfo.class);\n if (bindingOpInfo != null) {\n if (bindingOpInfo.isUnwrappedCapable()) {\n bindingOpInfo = bindingOpInfo.getUnwrappedOperation();\n }\n if (fault == null) {\n action = (String) message.get(SoapBindingConstants.SOAP_ACTION);\n if (action == null) {\n SoapOperationInfo soi = \n bindingOpInfo.getExtensor(SoapOperationInfo.class);\n if (null != soi) {\n action = soi.getAction();\n }\n\n }\n if (action == null || \"\".equals(action)) {\n MessageInfo msgInfo = \n ContextUtils.isRequestor(message)\n ? bindingOpInfo.getOperationInfo().getInput()\n : bindingOpInfo.getOperationInfo().getOutput();\n String cachedAction = (String)msgInfo.getProperty(ACTION);\n if (cachedAction == null) {\n action = getActionFromMessageAttributes(msgInfo);\n } else {\n action = cachedAction;\n }\n }\n } else {\n Throwable t = fault.getCause();\n \n // FaultAction attribute is not defined in \n // http://www.w3.org/2005/02/addressing/wsdl schema\n for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {\n FaultInfo fi = bfi.getFaultInfo();\n if (t != null && t.getClass().isAssignableFrom(fi.getMessagePart(0).getTypeClass())) {\n if (fi.getExtensionAttributes() == null) {\n continue;\n }\n String attr = (String)\n fi.getExtensionAttributes().get(Names.WSAW_ACTION_QNAME);\n if (attr == null) {\n attr = (String) \n fi.getExtensionAttributes()\n .get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,\n Names.WSAW_ACTION_NAME)); \n }\n if (attr != null) {\n action = attr;\n break;\n }\n }\n }\n }\n }\n LOG.fine(\"action determined from service model: \" + action);\n return action;\n }",
"@Test\n public void testErrorDetectingOnCorrectMessage() {\n final int[] msgWithError = {0,0,1,0, 1,0,1,1, 1,0,0,0, 1,1,1,0};\n final int expectedErrorIndex = ResponseCode.NO_ERRORS.code;\n\n // When executing error detection\n final int errorIndex = HammingAlgorithm.calculateErrorIndex(msgWithError);\n\n // Then check if errorIndex is as expected\n assertThat(errorIndex).isEqualTo(expectedErrorIndex);\n }",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"@Override\n protected void handleErrorResponseCode(int code, String message) {\n }",
"ErrorCodes(int code){\n this.code = code;\n //this.message = message;\n }",
"public static TryExpression tryFault(Expression body, Expression fault) { throw Extensions.todo(); }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType addNewArrayOfFaultType();",
"public SoapFaultInfo getFaultInfo()\r\n {\r\n return faultInfo;\r\n }",
"@Override\n public String toString() {\n return new ToStringBuilder(this)\n .append(\"faultCode\", faultCode)\n .append(\"faultString\", faultString)\n .toString();\n }",
"@Override\n\tpublic void handlerFault(String msg) {\n\t\tSystem.out.println(\"Emailing the error \" +msg);\n\t}",
"@Test\n public void cancelHotelTestError() throws CancelHotelFault, DatatypeConfigurationException{ \n try {\n cancelHotel(null);\n } catch (CancelHotelFault e) {\n assertEquals(\"Empty\",e.getMessage());\n } \n }",
"public static boolean isFault(Message message) {\n return message != null\n && message.getExchange() != null\n && (message == message.getExchange().getInFaultMessage()\n || message == message.getExchange().getOutFaultMessage());\n }",
"public AssertSoapFaultBuilder faultString(String faultString) {\n action.setFaultString(faultString);\n return this;\n }",
"public LibraryWsFault() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"public HessianRPCReplyMessage(Object value, Object fault, HessianRPCCallMessage call)\r\n\t{\r\n\t\t_value = value;\r\n\t\t_fault = (Throwable) fault;\r\n\t\t_call = call;\r\n\t}",
"@Test(timeout = 4000)\n public void test292() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"0+_/OK]Z5%q-UP hR\");\n // Undeclared exception!\n try { \n xmlEntityRef0.code((Object) \"0+_/OK]Z5%q-UP hR\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"public void verifyRespStatus(OCSPResp resp) throws OCSPException\n {\n String statusInfo = \"\";\n if (resp != null)\n {\n int status = resp.getStatus();\n switch (status)\n {\n case OCSPResponseStatus.INTERNAL_ERROR:\n statusInfo = \"INTERNAL_ERROR\";\n LOG.error(\"An internal error occurred in the OCSP Server!\");\n break;\n case OCSPResponseStatus.MALFORMED_REQUEST:\n // This happened when the \"critical\" flag was used for extensions\n // on a responder known by the committer of this comment.\n statusInfo = \"MALFORMED_REQUEST\";\n LOG.error(\"Your request did not fit the RFC 2560 syntax!\");\n break;\n case OCSPResponseStatus.SIG_REQUIRED:\n statusInfo = \"SIG_REQUIRED\";\n LOG.error(\"Your request was not signed!\");\n break;\n case OCSPResponseStatus.TRY_LATER:\n statusInfo = \"TRY_LATER\";\n LOG.error(\"The server was too busy to answer you!\");\n break;\n case OCSPResponseStatus.UNAUTHORIZED:\n statusInfo = \"UNAUTHORIZED\";\n LOG.error(\"The server could not authenticate you!\");\n break;\n case OCSPResponseStatus.SUCCESSFUL:\n break;\n default:\n statusInfo = \"UNKNOWN\";\n LOG.error(\"Unknown OCSPResponse status code! \" + status);\n }\n }\n if (resp == null || resp.getStatus() != OCSPResponseStatus.SUCCESSFUL)\n {\n throw new OCSPException(\"OCSP response unsuccessful, status: \" + statusInfo);\n }\n }",
"public int getEventCode() {\n/* 41 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType insertNewArrayOfFaultType(int i);",
"public sample.ws.HelloWorldWSStub.HelloResponse hello(\n\n sample.ws.HelloWorldWSStub.Hello hello4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"hello\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n hello4,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"hello\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] getArrayOfFaultTypeArray();",
"public QName getFaultDetailName() {\n\treturn this.faultDetailName;\n }",
"public void testConstructor_String_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-1);\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }",
"public FaultException raise(Throwable e);",
"public sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse helloAuthenticated(\n\n sample.ws.HelloWorldWSStub.HelloAuthenticated helloAuthenticated8)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName());\n _operationClient.getOptions().setAction(\"helloAuthenticated\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n helloAuthenticated8,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"helloAuthenticated\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public static void storeMAPFaultName(String faultName, \n Message message) {\n message.put(MAP_FAULT_NAME_PROPERTY, faultName);\n }",
"@Test(timeout = 4000)\n public void test00() throws Throwable {\n int int0 = (-519);\n String string0 = \"kutSn)_E\";\n FBProcedureCall fBProcedureCall0 = new FBProcedureCall();\n fBProcedureCall0.getOutputParam((-2051));\n // Undeclared exception!\n try { \n fBProcedureCall0.addParam((-519), \"kutSn)_E\");\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -519\n //\n verifyException(\"java.util.Vector\", e);\n }\n }",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public void setRespcode(String respcode) {\n\t\tthis.respcode = respcode;\n\t}",
"public void faultsFound(int mCode, String description)\r\n\t {\r\n\t\t if(mCode < maxMRs)\r\n\t\t {\r\n\t\t\t MRs[mCode].faultsFound(description);\r\n\t\t\t setChanged();\r\n\t\t notifyObservers(); // Note: notifies ALL Observing views\r\n\t\t }\r\n\t }",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"public void addSourceFaultType(Class<?> type) {\n faultTypes.add(type);\n }",
"@Then(\"^the status code is (\\\\d+)$\")\npublic void the_status_code_is(int arg1) throws Throwable {\n throw new PendingException();\n}",
"void setArrayOfFaultTypeArray(int i, com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType arrayOfFaultType);",
"public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg)\n throws MessagingException;",
"public AssertSoapFaultBuilder faultDetail(String faultDetail) {\n action.getFaultDetails().add(faultDetail);\n return this;\n }",
"Response.StatusType getStatus(Exception exception);",
"String getFaultActor();",
"public void setCode(org.openarchives.www.oai._2_0.OAIPMHerrorcodeType.Enum code)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CODE$0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CODE$0);\n }\n target.setEnumValue(code);\n }\n }",
"@Test(timeout = 4000)\n public void test20() throws Throwable {\n FBProcedureCall fBProcedureCall0 = new FBProcedureCall();\n // Undeclared exception!\n try { \n fBProcedureCall0.registerOutParam((-3231), 40);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -3232\n //\n verifyException(\"java.util.Vector\", e);\n }\n }",
"@Test(timeout = 4000)\n public void test162() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"vhe\");\n // Undeclared exception!\n try { \n xmlEntityRef0.code();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"public void verifyResponseCode(int responseCode){\n\n Assert.assertEquals(responseCode,response.statusCode());\n System.out.println(\"Verify Response code: \"+responseCode);\n }",
"public void testConstructor_StringString_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-99, \"text\");\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }",
"public String getFailResult(String response) {\n\n\t\tString result=\"failed\";\n\t\tPattern pattern = Pattern.compile(FAULT_CODE);\n\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tresult= (match.group(1));\n\t\t}\n\t\treturn result;\t\n\t}",
"public void setCode(OAIPMHErrorcodeType code) {\r\n this.code = code;\r\n }",
"abstract Integer getStatusCode();"
] | [
"0.708266",
"0.69826007",
"0.6776471",
"0.6611714",
"0.6533891",
"0.64262116",
"0.6308855",
"0.6257969",
"0.62096184",
"0.6206776",
"0.614063",
"0.6088593",
"0.60798985",
"0.59847796",
"0.586281",
"0.5859033",
"0.58479613",
"0.58302796",
"0.577657",
"0.57442796",
"0.57143784",
"0.5566684",
"0.55591094",
"0.5546649",
"0.5543049",
"0.55351955",
"0.55160874",
"0.5499668",
"0.545688",
"0.5448476",
"0.54342306",
"0.538245",
"0.53738713",
"0.5369708",
"0.53675234",
"0.5351518",
"0.5318384",
"0.5315651",
"0.53071475",
"0.53032875",
"0.5302914",
"0.5286953",
"0.5286683",
"0.5286304",
"0.52775747",
"0.52766556",
"0.52632797",
"0.5258982",
"0.52505887",
"0.52493316",
"0.52479655",
"0.5229087",
"0.5218055",
"0.52116865",
"0.5206707",
"0.51988",
"0.5192225",
"0.5190846",
"0.51665705",
"0.516434",
"0.51618683",
"0.5150727",
"0.514826",
"0.5143631",
"0.513981",
"0.51163477",
"0.5102637",
"0.5076195",
"0.5053646",
"0.5049244",
"0.50424945",
"0.5039548",
"0.5032795",
"0.5026683",
"0.5026199",
"0.50148207",
"0.49944693",
"0.49815887",
"0.49587494",
"0.49557173",
"0.49542546",
"0.4951108",
"0.49404296",
"0.493798",
"0.49364263",
"0.49322268",
"0.49288017",
"0.49149188",
"0.49145877",
"0.49133468",
"0.48908296",
"0.48900083",
"0.4888799",
"0.48853347",
"0.48834938",
"0.48797333",
"0.48766673",
"0.48633337",
"0.4849818",
"0.4844404"
] | 0.7081484 | 1 |
Expect fault string in SOAP fault message. | public AssertSoapFaultBuilder faultString(String faultString) {
action.setFaultString(faultString);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public String getFaultString() {\n return faultString;\n }",
"String getFaultStringValue();",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"NamespacedProperty getFaultStringExpression();",
"String getFaultReasonValue();",
"public String getFaultMessage() {\n return faultMessage;\n }",
"public AssertSoapFaultBuilder faultActor(String faultActor) {\n action.setFaultActor(faultActor);\n return this;\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"public static void serializeSOAPFault(SOAPFault fault, XMLStreamWriter writer) throws XMLStreamException {\n\n\t\tOMSerializerUtil.serializeStartpart(fault, writer);\n\t\tOMElement e = null;\n\n\t\t// based on the namespace (SOAP1.1 vs SOAP1.2) to serialize accordingly\n\t\tif (fault.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {\n\t\t\t// SOAP1.2\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\n\t\t} else {\n\t\t\t// SOAP1.1\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\t\t}\n\t}",
"public LibraryWsException(final String message, final LibraryWsFault fault) {\n super(message);\n this.fault = fault;\n }",
"public AssertSoapFaultBuilder faultDetail(String faultDetail) {\n action.getFaultDetails().add(faultDetail);\n return this;\n }",
"@Test\n public void cancelHotelTestError1() throws CancelHotelFault, DatatypeConfigurationException{ \n String input = \"hello you\";\n try {\n cancelHotel(input);\n } catch (CancelHotelFault e) {\n assertEquals(\"ERROR\",e.getMessage());\n } \n }",
"public void setFaultCode(final String faultCode) {\n this.faultCode = faultCode;\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"protected Element getFaultMessage() {\n return mElement;\n }",
"public LibraryWsException(\n final String message, final Throwable cause, final LibraryWsFault fault) {\n super(message, cause);\n this.fault = fault;\n }",
"public AssertSoapFaultBuilder faultCode(String code) {\n\t action.setFaultCode(code);\n\t return this;\n\t}",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"public static Fault createFault(MessageExchange reply, Element part, QName type) \n throws Exception {\n Document doc = XmlUtil.newDocument();\n Element wrapper = WrapperUtil.createJBIMessageWrapper(doc, type, null);\n wrapper.appendChild(WrapperUtil.importJBIWrappedPart(doc, part));\n Fault fault = reply.createFault();\n fault.setContent(new DOMSource(doc));\n return fault;\n }",
"NamespacedProperty getFaultReasonExpression();",
"String getFaultDetailValue();",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"public String getFaultCode() {\n return faultCode;\n }",
"public static void storeMAPFaultName(String faultName, \n Message message) {\n message.put(MAP_FAULT_NAME_PROPERTY, faultName);\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext arg0) {\r\n\t\treturn true;\r\n\t}",
"protected String getFaultName() {\n return mName;\n }",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"@Test\n public void cancelHotelTestError() throws CancelHotelFault, DatatypeConfigurationException{ \n try {\n cancelHotel(null);\n } catch (CancelHotelFault e) {\n assertEquals(\"Empty\",e.getMessage());\n } \n }",
"NamespacedProperty getFaultDetailExpression();",
"public static boolean isFault(Message message) {\n return message != null\n && message.getExchange() != null\n && (message == message.getExchange().getInFaultMessage()\n || message == message.getExchange().getOutFaultMessage());\n }",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"@Test\n\tpublic void testUpdatePoStatusErrorListenerFaultTest() {\n\t\ttry{\n\t\t\t //Is used in soap request preparation because value is used in reply soap header.\n\t\t\t final String callbackRefMockUri = mockOsbBusinessService(\n\t\t\t\t\t PATH_UPDATE_STATUS_CALLBACK,\n\t\t\t\t\t updatePoStatusCallbackPortMock);\t\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_ORDER_TRANSACTION_MONITORING,\n\t\t\t\t\t orderTransactionServiceFaultMock);\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_RESPONSE_RETRY_WRAPPER,\n\t\t\t\t\t responseRetryWrapperMock);\n\t\n\t\t\tfinal String requestString = new ParameterReplacer(readClasspathFile(\"Request_UpdatePOStatusErrorListener.xml\"))\n\t\t\t\t\t.replace(REPLACE_PARAM_CORRELATION_ID, randomCorrelationId)\n\t\t\t\t\t.replace(REPLACE_PARAM_PURCHASE_ORDER_NUMBER, randomPoNumber)\n\t\t\t\t\t.replace(REPLACE_PARAM_COMBOX_ID, randomCoboxId)\n\t\t\t\t\t.replace(REPLY_TO, callbackRefMockUri)\n\t\t\t\t\t.replace(MESSAGE_ID, randomMessageId).build();\n\t\t\t\t\t\n\t\t\tLOGGER.info(\"+++ request \" + requestString);\n\t\n\t\t\tinvokeOsbProxyService(PATH_SERVICE, requestString);\n\n\t\t\tassertThat(\"updatePoStatusCallbackPortMock is not invocked!\",!updatePoStatusCallbackPortMock.hasBeenInvoked());\n\t\t\t//This should be invoked\n\t\t\tassertThat(\"responseRetryWrapperMock is invocked!\",responseRetryWrapperMock.hasBeenInvoked());\n\t\t\t\n\t\t\t//Get message from process as it is\n\t\t\tString responseRetryWrapperMockMsg = responseRetryWrapperMock.getLastReceivedRequest();\n\t\t\tLOGGER.info(\"+++ responseRetryWrapperMockMsg \" + responseRetryWrapperMockMsg);\n\t\t\t\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:requestHeader/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:transactionId/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:category/text()\",\n\t\t\t\t\t\"TechnicalFault\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:payload/\"\n\t\t\t\t\t+ \"exc:exception/exc:context/exc:payload/navpom:updatePurchaseOrderStatus/navpom:header/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsDestination/text()\",\n\t\t\t\t\t\"h24jms.ERR_UpdatePOStatus_Q\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsFactory/text()\",\n\t\t\t\t\t\"h24jms.PurchaseOrder\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t} catch(ServiceException e) {\n\t\t\tfail();\t\t\t\n\t\t}\n\n\t}",
"private static String getActionFromServiceModel(Message message,\n Exception fault) {\n String action = null;\n BindingOperationInfo bindingOpInfo =\n message.getExchange().get(BindingOperationInfo.class);\n if (bindingOpInfo != null) {\n if (bindingOpInfo.isUnwrappedCapable()) {\n bindingOpInfo = bindingOpInfo.getUnwrappedOperation();\n }\n if (fault == null) {\n action = (String) message.get(SoapBindingConstants.SOAP_ACTION);\n if (action == null) {\n SoapOperationInfo soi = \n bindingOpInfo.getExtensor(SoapOperationInfo.class);\n if (null != soi) {\n action = soi.getAction();\n }\n\n }\n if (action == null || \"\".equals(action)) {\n MessageInfo msgInfo = \n ContextUtils.isRequestor(message)\n ? bindingOpInfo.getOperationInfo().getInput()\n : bindingOpInfo.getOperationInfo().getOutput();\n String cachedAction = (String)msgInfo.getProperty(ACTION);\n if (cachedAction == null) {\n action = getActionFromMessageAttributes(msgInfo);\n } else {\n action = cachedAction;\n }\n }\n } else {\n Throwable t = fault.getCause();\n \n // FaultAction attribute is not defined in \n // http://www.w3.org/2005/02/addressing/wsdl schema\n for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {\n FaultInfo fi = bfi.getFaultInfo();\n if (t != null && t.getClass().isAssignableFrom(fi.getMessagePart(0).getTypeClass())) {\n if (fi.getExtensionAttributes() == null) {\n continue;\n }\n String attr = (String)\n fi.getExtensionAttributes().get(Names.WSAW_ACTION_QNAME);\n if (attr == null) {\n attr = (String) \n fi.getExtensionAttributes()\n .get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,\n Names.WSAW_ACTION_NAME)); \n }\n if (attr != null) {\n action = attr;\n break;\n }\n }\n }\n }\n }\n LOG.fine(\"action determined from service model: \" + action);\n return action;\n }",
"public static TryExpression tryFault(Expression body, Expression fault) { throw Extensions.todo(); }",
"NamespacedProperty getFaultCodeExpression();",
"public void testConstructor_StringString_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-99, \"text\");\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }",
"public FaultException raise(Throwable e);",
"public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg)\n throws MessagingException;",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext smc) {\r\n\t\tSystem.out.println(\"Ignoring fault message...\");\r\n\t\treturn true;\r\n\t}",
"public TR069Exception(String message, int faultCode) {\n\t\tthis(message, faultCode, null);\n\t}",
"@Override\n public String toString() {\n return new ToStringBuilder(this)\n .append(\"faultCode\", faultCode)\n .append(\"faultString\", faultString)\n .toString();\n }",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"@Test\n void testGivenFaultyRequestWithExceptionString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?exception=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType addNewArrayOfFaultType();",
"public FaultException raise(Throwable e, Object argument);",
"public LibraryWsFault() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"@Test\n public void bookHotelTestError() throws BookHotelFault{\n try {\n assertTrue(bookHotel(null));\n } catch (BookHotelFault e) {\n assertEquals(\"Empty\", e.getMessage());\n } \n }",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Test(expected = Inputfault.class)\r\n public void classCrashInvalidChar() throws Inputfault {\r\n LocationServiceImpl lSI = new LocationServiceImpl();\r\n\r\n lSI.locationService(\"3731@X\"); // this postcode has a @ which is an illegal character\r\n }",
"public String execute(SOAPMessage message) throws FIFException;",
"public void testConstructor_String_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-1);\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }",
"public FaultAccumulator error(String message)\n {\n if(builder == null)\n builder = new StringBuilder();\n else\n builder.append(\", \");\n \n builder.append(message);\n \n return this;\n }",
"public QName getFaultDetailName() {\n\treturn this.faultDetailName;\n }",
"public static SOAPFaultCode createSOAPFaultCode(String namespaceURI, String faultCodeStr) {\n\n\t\tSOAPFactory soapFactory = null;\n\t\tif (namespaceURI != null) {\n\t\t\tif (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) {\n\t\t\t\tsoapFactory = OMAbstractFactory.getSOAP12Factory();\n\t\t\t}\n\t\t}\n\n\t\t// default is SOAP1.1\n\t\tif (soapFactory == null)\n\t\t\tsoapFactory = OMAbstractFactory.getSOAP11Factory();\n\n\t\tSOAPFaultCode code = soapFactory.createSOAPFaultCode();\n\t\tSOAPFaultValue value = soapFactory.createSOAPFaultValue(code);\n\t\tvalue.setText(faultCodeStr);\n\t\tcode.setValue(value);\n\t\treturn code;\n\t}",
"@Test\n public void testStoreSaleWrongInput() {\n String responseMsg = target.path(\"service/message\").queryParam(\"messageType\", \"-1\").queryParam(\"productType\", \"ELMA\").queryParam(\"value\", \"2.0\").request().get(String.class);\n assertEquals(\"ERROR\", responseMsg);\n }",
"public static void storeMAPFaultReason(String reason, \n Message message) {\n message.put(MAP_FAULT_REASON_PROPERTY, reason);\n }",
"public interface IAeFaultMatchingStrategy {\r\n /**\r\n * Select ths catch that is the best match for the given fault.\r\n *\r\n * @param aProvider\r\n * @param aIterOfCatches\r\n * @param aFault\r\n * @return IAeCatch or null. In the case of null, the catchAll or implicit fault handler will handle the fault.\r\n */\r\n public IAeCatch selectMatchingCatch(IAeContextWSDLProvider aProvider, Iterator aIterOfCatches, IAeFaultTypeInfo aFault);\r\n}",
"@Override\n\tpublic void handlerFault(String msg) {\n\t\tSystem.out.println(\"Emailing the error \" +msg);\n\t}",
"String getFaultActor();",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType insertNewArrayOfFaultType(int i);",
"@Test\n public void testRequireAtomString_GenericType_String_1() {\n LOGGER.info(\"requireAtomString with message\");\n Atom actual = null;\n final Atom expected = null;\n boolean caught = false;\n try {\n actual = requireAtomString(null, \"Message\");\n } catch (final ClassCastException ex) {\n caught = true;\n assertEquals(\"Message\", ex.getMessage());\n }\n assertTrue(caught);\n assertEquals(expected, actual);\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource, Charset charset) {\n try {\n action.getFaultDetails().add(FileUtils.readToString(resource, charset));\n } catch (IOException e) {\n throw new CitrusRuntimeException(\"Failed to read fault detail resource\", e);\n }\n return this;\n }",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType getArrayOfFaultTypeArray(int i);",
"public AssertSoapFaultBuilder xsd(String schemaName) {\n validationContext.setSchema(schemaName);\n return this;\n }",
"public HessianRPCReplyMessage(Object value, Object fault, HessianRPCCallMessage call)\r\n\t{\r\n\t\t_value = value;\r\n\t\t_fault = (Throwable) fault;\r\n\t\t_call = call;\r\n\t}",
"void mo1332e(String str, String str2, Throwable th);",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"@Test(timeout = 4000)\n public void test11() throws Throwable {\n String string0 = \"mutSn)_E\";\n FBProcedureCall fBProcedureCall0 = new FBProcedureCall();\n // Undeclared exception!\n try { \n fBProcedureCall0.addParam((-2350), \"/h\");\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -2350\n //\n verifyException(\"java.util.Vector\", e);\n }\n }",
"private void showFaultDialog(String[] faults) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(R.string.fault_warning)\n .setItems(faults, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n }\n })\n .setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n if (mDialog != null) {\n // Dismiss the previous dialog is there is one\n mDialog.dismiss();\n mDismissed = true;\n }\n }\n });\n mDialog = builder.create();\n mDialog.setCanceledOnTouchOutside(false);\n mDialog.show();\n mDismissed = false;\n }",
"public void addSourceFaultType(Class<?> type) {\n faultTypes.add(type);\n }",
"@Test\n public void testFaultSuperTypesAndSuperset() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // DataType sourceFaultType2 = new\n // DataTypeImpl<Type>(RuntimeException.class, RuntimeException.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // sourceFaultTypes.add(1, sourceFaultType2);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"void setArrayOfFaultTypeArray(int i, com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType arrayOfFaultType);",
"@Test(timeout = 4000)\n public void test082() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"java.lang.String@0000000005\");\n Submit submit0 = new Submit(xmlEntityRef0, \"java.lang.String@0000000005\", \"java.lang.String@0000000005\");\n // Undeclared exception!\n try { \n submit0.rawText(\"java.lang.String@0000000005\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/error\")\n @RequestWrapper(localName = \"error\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericErrorType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void error(\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"public void testInsufficientDataExceptionStringThrowableAccuracy() {\r\n //Construct InsufficientDataException with a detail message and a cause\r\n InsufficientDataException exception = new InsufficientDataException(DETAIL_MESSAGE, CAUSE);\r\n\r\n //Verify that there is a detail message\r\n assertNotNull(\"Should have message.\", exception.getMessage());\r\n\r\n //altered message is the result of a modification to the BaseException component.\r\n assertEquals(\"Detailed error message with cause should be correct.\", DETAIL_MESSAGE + \", caused by null\",\r\n exception.getMessage());\r\n\r\n //Verify that there is a cause\r\n assertNotNull(\"Should have cause.\", exception.getCause());\r\n assertTrue(\"Cause should be identical.\", CAUSE == exception.getCause());\r\n }",
"public void test1194() throws Exception {\n invokeAsync(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1194\");\n //Lets see we get a response in 60 s\n SOAPMessage m = respMsgExchanger.exchange(null, TestConstants.CLIENT_MAX_TIMEOUT, TimeUnit.SECONDS);\n// System.out.println(\"****************************\");\n// m.writeTo(System.out);\n// System.out.println(\"\\n****************************\");\n SOAPFault f = m.getSOAPBody().getFault();\n assertNotNull(f);\n assertEquals(USER_FAULT_CODE, f.getFaultCodeAsQName());\n\n }",
"public ThrowUnitImpl(Context context, Unit parentActUnit, RActivity act, long branchId) {\n super(context, parentActUnit, act, branchId);\n RThrow throwAct = (RThrow) mAct;\n QName faultName = throwAct.getRFaultName();\n \n RVariable faultVariable = ((RVariableElement) throwAct).getRVariable();\n WSMessage faultData = null;\n \n if (faultVariable != null) {\n RuntimeVariable rVar = mContext.getRuntimeVariable(faultVariable);\n if ((rVar == null) && (faultVariable.getWSDLMessageType().getParts().size() == 0)) {\n rVar = mContext.createRuntimeVariable(faultVariable);\n Utility.initializeVariableValue(rVar);\n mContext.setRuntimeVariable(rVar);\n StateContext stateCtx = mContext.getStateContext();\n mContext.getProcessInstance().getPersistenctMgr().updateState(stateCtx, \n rVar, getBranchId());\n }/* else {\n Utility.verifyValue(faultVariable.getName(), rVar, false);\n }*/\n faultData = rVar.getWSMessage();\n //faultData = faultData.copy();\n }\n mFault = new FaultImpl(faultName, faultData);\n }",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"void mo1341v(String str, String str2, Throwable th);",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"OOPExpectedException expectMessage(String msg);",
"public LibraryWsFault getFaultInfo() {\n return fault;\n }",
"public TR069Exception(String message, int faultCode, DmtException e) {\n\t\tsuper(message, e);\n\t\tthis.faultCode = faultCode;\n\t\tthis.dmtException = e;\n\t}",
"public void testInsufficientDataExceptionStringAccuracy() {\r\n //Construct InsufficientDataException with a detail message\r\n InsufficientDataException exception = new InsufficientDataException(DETAIL_MESSAGE);\r\n\r\n //Verify that there is a detail message\r\n assertNotNull(\"Should have message.\", exception.getMessage());\r\n assertEquals(\"Detailed error message should be identical.\", DETAIL_MESSAGE, exception.getMessage());\r\n }",
"public void testThrowableString() {\n Throwable th = new Throwable(\"aaa\");\n assertEquals(\"incorrect message\", \"aaa\", th.getMessage());\n assertNull(\"cause should be null\", th.getCause());\n assertTrue(\"empty stack trace\", th.getStackTrace().length > 0);\n }",
"public SoapFaultInfo getFaultInfo()\r\n {\r\n return faultInfo;\r\n }",
"public void test1152() throws Exception {\n try {\n invoke(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToNoneFaultToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1152\");\n fail(\"WebServiceException must be thrown\");\n } catch (WebServiceException e) {\n assertEquals(\"No response returned.\", e.getMessage());\n }\n }",
"public void addTargetFaultType(Class<?> type) {\n targetFaultTypes.add(type);\n }",
"public VuFaultRecord(final @NonNull DataInputStream dis) throws IOException {\n\t\tsuper();\n\n\t\tthis.faultType = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultRecordPurpose = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultBeginTime = CardBlockUtil.getDate(dis);\n\t\tthis.faultEndTime = CardBlockUtil.getDate(dis);\n\t\tthis.cardNumberDriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberDriverSlotEnd = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotEnd = new CardNumber(dis);\n\t}",
"public void testThrowableStringThrowable() {\n Throwable th1 = new Throwable();\n Throwable th = new Throwable(\"aaa\", th1);\n assertEquals(\"incorrect message\", \"aaa\", th.getMessage());\n assertSame(\"incorrect cause\", th1, th.getCause());\n assertTrue(\"empty stack trace\", th.getStackTrace().length > 0);\n }"
] | [
"0.73173606",
"0.71795803",
"0.6994866",
"0.6787119",
"0.6243739",
"0.6181726",
"0.6177673",
"0.6110021",
"0.6067233",
"0.60443336",
"0.60170406",
"0.6008915",
"0.5997388",
"0.5968276",
"0.5904381",
"0.5883865",
"0.58310133",
"0.58016825",
"0.57840526",
"0.5766726",
"0.5755946",
"0.57221884",
"0.56537384",
"0.56348944",
"0.56319994",
"0.55278105",
"0.5508786",
"0.5452942",
"0.5443095",
"0.54388297",
"0.54108864",
"0.54041207",
"0.53795344",
"0.5366219",
"0.535247",
"0.5344442",
"0.52960926",
"0.5277446",
"0.5265662",
"0.5242479",
"0.52304685",
"0.5200559",
"0.51989657",
"0.51671386",
"0.5126049",
"0.50938404",
"0.50831246",
"0.5075092",
"0.5059227",
"0.5050384",
"0.5041582",
"0.5038998",
"0.5037451",
"0.50369376",
"0.50251305",
"0.5002141",
"0.49976796",
"0.49942017",
"0.49685338",
"0.49522445",
"0.4946088",
"0.49376762",
"0.49359056",
"0.49182093",
"0.4905966",
"0.48997834",
"0.48960456",
"0.48942047",
"0.48881707",
"0.48431873",
"0.48271027",
"0.48219267",
"0.4813205",
"0.48080206",
"0.48073572",
"0.47938314",
"0.4792463",
"0.47906652",
"0.4782672",
"0.4772028",
"0.4771467",
"0.47666967",
"0.47492918",
"0.47484592",
"0.4742601",
"0.4730864",
"0.47224256",
"0.4720552",
"0.47074074",
"0.4697084",
"0.46918198",
"0.4691382",
"0.46891132",
"0.46833318",
"0.46819824",
"0.46765527",
"0.46759856",
"0.46736908",
"0.46721226",
"0.46698663"
] | 0.7037373 | 2 |
Expect fault actor in SOAP fault message. | public AssertSoapFaultBuilder faultActor(String faultActor) {
action.setFaultActor(faultActor);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getFaultActor();",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"public static void serializeSOAPFault(SOAPFault fault, XMLStreamWriter writer) throws XMLStreamException {\n\n\t\tOMSerializerUtil.serializeStartpart(fault, writer);\n\t\tOMElement e = null;\n\n\t\t// based on the namespace (SOAP1.1 vs SOAP1.2) to serialize accordingly\n\t\tif (fault.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {\n\t\t\t// SOAP1.2\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\n\t\t} else {\n\t\t\t// SOAP1.1\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\t\t}\n\t}",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public FaultException raise(Throwable e);",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"public static Fault createFault(MessageExchange reply, Element part, QName type) \n throws Exception {\n Document doc = XmlUtil.newDocument();\n Element wrapper = WrapperUtil.createJBIMessageWrapper(doc, type, null);\n wrapper.appendChild(WrapperUtil.importJBIWrappedPart(doc, part));\n Fault fault = reply.createFault();\n fault.setContent(new DOMSource(doc));\n return fault;\n }",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"public FaultException raise(Throwable e, Object argument);",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"public String getFaultString() {\n return faultString;\n }",
"String getFaultStringValue();",
"public void test1194() throws Exception {\n invokeAsync(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1194\");\n //Lets see we get a response in 60 s\n SOAPMessage m = respMsgExchanger.exchange(null, TestConstants.CLIENT_MAX_TIMEOUT, TimeUnit.SECONDS);\n// System.out.println(\"****************************\");\n// m.writeTo(System.out);\n// System.out.println(\"\\n****************************\");\n SOAPFault f = m.getSOAPBody().getFault();\n assertNotNull(f);\n assertEquals(USER_FAULT_CODE, f.getFaultCodeAsQName());\n\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext arg0) {\r\n\t\treturn true;\r\n\t}",
"public interface IAeFaultMatchingStrategy {\r\n /**\r\n * Select ths catch that is the best match for the given fault.\r\n *\r\n * @param aProvider\r\n * @param aIterOfCatches\r\n * @param aFault\r\n * @return IAeCatch or null. In the case of null, the catchAll or implicit fault handler will handle the fault.\r\n */\r\n public IAeCatch selectMatchingCatch(IAeContextWSDLProvider aProvider, Iterator aIterOfCatches, IAeFaultTypeInfo aFault);\r\n}",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"protected Element getFaultMessage() {\n return mElement;\n }",
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public AssertSoapFaultBuilder faultDetail(String faultDetail) {\n action.getFaultDetails().add(faultDetail);\n return this;\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext smc) {\r\n\t\tSystem.out.println(\"Ignoring fault message...\");\r\n\t\treturn true;\r\n\t}",
"@Test\n\tpublic void testUpdatePoStatusErrorListenerFaultTest() {\n\t\ttry{\n\t\t\t //Is used in soap request preparation because value is used in reply soap header.\n\t\t\t final String callbackRefMockUri = mockOsbBusinessService(\n\t\t\t\t\t PATH_UPDATE_STATUS_CALLBACK,\n\t\t\t\t\t updatePoStatusCallbackPortMock);\t\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_ORDER_TRANSACTION_MONITORING,\n\t\t\t\t\t orderTransactionServiceFaultMock);\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_RESPONSE_RETRY_WRAPPER,\n\t\t\t\t\t responseRetryWrapperMock);\n\t\n\t\t\tfinal String requestString = new ParameterReplacer(readClasspathFile(\"Request_UpdatePOStatusErrorListener.xml\"))\n\t\t\t\t\t.replace(REPLACE_PARAM_CORRELATION_ID, randomCorrelationId)\n\t\t\t\t\t.replace(REPLACE_PARAM_PURCHASE_ORDER_NUMBER, randomPoNumber)\n\t\t\t\t\t.replace(REPLACE_PARAM_COMBOX_ID, randomCoboxId)\n\t\t\t\t\t.replace(REPLY_TO, callbackRefMockUri)\n\t\t\t\t\t.replace(MESSAGE_ID, randomMessageId).build();\n\t\t\t\t\t\n\t\t\tLOGGER.info(\"+++ request \" + requestString);\n\t\n\t\t\tinvokeOsbProxyService(PATH_SERVICE, requestString);\n\n\t\t\tassertThat(\"updatePoStatusCallbackPortMock is not invocked!\",!updatePoStatusCallbackPortMock.hasBeenInvoked());\n\t\t\t//This should be invoked\n\t\t\tassertThat(\"responseRetryWrapperMock is invocked!\",responseRetryWrapperMock.hasBeenInvoked());\n\t\t\t\n\t\t\t//Get message from process as it is\n\t\t\tString responseRetryWrapperMockMsg = responseRetryWrapperMock.getLastReceivedRequest();\n\t\t\tLOGGER.info(\"+++ responseRetryWrapperMockMsg \" + responseRetryWrapperMockMsg);\n\t\t\t\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:requestHeader/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:transactionId/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:category/text()\",\n\t\t\t\t\t\"TechnicalFault\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:payload/\"\n\t\t\t\t\t+ \"exc:exception/exc:context/exc:payload/navpom:updatePurchaseOrderStatus/navpom:header/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsDestination/text()\",\n\t\t\t\t\t\"h24jms.ERR_UpdatePOStatus_Q\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsFactory/text()\",\n\t\t\t\t\t\"h24jms.PurchaseOrder\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t} catch(ServiceException e) {\n\t\t\tfail();\t\t\t\n\t\t}\n\n\t}",
"public ThrowUnitImpl(Context context, Unit parentActUnit, RActivity act, long branchId) {\n super(context, parentActUnit, act, branchId);\n RThrow throwAct = (RThrow) mAct;\n QName faultName = throwAct.getRFaultName();\n \n RVariable faultVariable = ((RVariableElement) throwAct).getRVariable();\n WSMessage faultData = null;\n \n if (faultVariable != null) {\n RuntimeVariable rVar = mContext.getRuntimeVariable(faultVariable);\n if ((rVar == null) && (faultVariable.getWSDLMessageType().getParts().size() == 0)) {\n rVar = mContext.createRuntimeVariable(faultVariable);\n Utility.initializeVariableValue(rVar);\n mContext.setRuntimeVariable(rVar);\n StateContext stateCtx = mContext.getStateContext();\n mContext.getProcessInstance().getPersistenctMgr().updateState(stateCtx, \n rVar, getBranchId());\n }/* else {\n Utility.verifyValue(faultVariable.getName(), rVar, false);\n }*/\n faultData = rVar.getWSMessage();\n //faultData = faultData.copy();\n }\n mFault = new FaultImpl(faultName, faultData);\n }",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public AssertSoapFaultBuilder faultString(String faultString) {\n action.setFaultString(faultString);\n return this;\n }",
"private static String getActionFromServiceModel(Message message,\n Exception fault) {\n String action = null;\n BindingOperationInfo bindingOpInfo =\n message.getExchange().get(BindingOperationInfo.class);\n if (bindingOpInfo != null) {\n if (bindingOpInfo.isUnwrappedCapable()) {\n bindingOpInfo = bindingOpInfo.getUnwrappedOperation();\n }\n if (fault == null) {\n action = (String) message.get(SoapBindingConstants.SOAP_ACTION);\n if (action == null) {\n SoapOperationInfo soi = \n bindingOpInfo.getExtensor(SoapOperationInfo.class);\n if (null != soi) {\n action = soi.getAction();\n }\n\n }\n if (action == null || \"\".equals(action)) {\n MessageInfo msgInfo = \n ContextUtils.isRequestor(message)\n ? bindingOpInfo.getOperationInfo().getInput()\n : bindingOpInfo.getOperationInfo().getOutput();\n String cachedAction = (String)msgInfo.getProperty(ACTION);\n if (cachedAction == null) {\n action = getActionFromMessageAttributes(msgInfo);\n } else {\n action = cachedAction;\n }\n }\n } else {\n Throwable t = fault.getCause();\n \n // FaultAction attribute is not defined in \n // http://www.w3.org/2005/02/addressing/wsdl schema\n for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {\n FaultInfo fi = bfi.getFaultInfo();\n if (t != null && t.getClass().isAssignableFrom(fi.getMessagePart(0).getTypeClass())) {\n if (fi.getExtensionAttributes() == null) {\n continue;\n }\n String attr = (String)\n fi.getExtensionAttributes().get(Names.WSAW_ACTION_QNAME);\n if (attr == null) {\n attr = (String) \n fi.getExtensionAttributes()\n .get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,\n Names.WSAW_ACTION_NAME)); \n }\n if (attr != null) {\n action = attr;\n break;\n }\n }\n }\n }\n }\n LOG.fine(\"action determined from service model: \" + action);\n return action;\n }",
"public void test1152() throws Exception {\n try {\n invoke(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToNoneFaultToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1152\");\n fail(\"WebServiceException must be thrown\");\n } catch (WebServiceException e) {\n assertEquals(\"No response returned.\", e.getMessage());\n }\n }",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public LibraryWsException(\n final String message, final Throwable cause, final LibraryWsFault fault) {\n super(message, cause);\n this.fault = fault;\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"public String execute(SOAPMessage message) throws FIFException;",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public AssertSoapFaultBuilder faultCode(String code) {\n\t action.setFaultCode(code);\n\t return this;\n\t}",
"public void objectCompletedWithFault(IAeFault aFault) throws AeBusinessProcessException;",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"public String getFaultMessage() {\n return faultMessage;\n }",
"@Test\n public void cancelHotelTestError1() throws CancelHotelFault, DatatypeConfigurationException{ \n String input = \"hello you\";\n try {\n cancelHotel(input);\n } catch (CancelHotelFault e) {\n assertEquals(\"ERROR\",e.getMessage());\n } \n }",
"public void addTargetFaultType(Class<?> type) {\n targetFaultTypes.add(type);\n }",
"String getFaultReasonValue();",
"public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg)\n throws MessagingException;",
"public LibraryWsException(final String message, final LibraryWsFault fault) {\n super(message);\n this.fault = fault;\n }",
"public static boolean isFault(Message message) {\n return message != null\n && message.getExchange() != null\n && (message == message.getExchange().getInFaultMessage()\n || message == message.getExchange().getOutFaultMessage());\n }",
"NamespacedProperty getFaultDetailExpression();",
"@Override\n\tpublic void handlerFault(String msg) {\n\t\tSystem.out.println(\"Emailing the error \" +msg);\n\t}",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"public void setFaultCode(final String faultCode) {\n this.faultCode = faultCode;\n }",
"protected String getFaultName() {\n return mName;\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType addNewArrayOfFaultType();",
"NamespacedProperty getFaultReasonExpression();",
"public static TryExpression tryFault(Expression body, Expression fault) { throw Extensions.todo(); }",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"public void invoke(MessageContext msgContext) throws AxisFault\n {\n JMSConnector connector = null;\n try\n {\n Object destination = msgContext.getProperty(JMSConstants.DESTINATION);\n if(destination == null)\n throw new AxisFault(\"noDestination\");\n\n connector = (JMSConnector)msgContext.getProperty(JMSConstants.CONNECTOR);\n\n JMSEndpoint endpoint = null;\n if(destination instanceof String)\n endpoint = connector.createEndpoint((String)destination);\n else\n endpoint = connector.createEndpoint((Destination)destination);\n\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n msgContext.getRequestMessage().writeTo(out);\n\n HashMap props = createSendProperties(msgContext);\n\n // If the request message contains attachments, set\n // a contentType property to go in the outgoing message header\n String ret = null;\n Message message = msgContext.getRequestMessage();\n Attachments mAttachments = message.getAttachmentsImpl();\n if (mAttachments != null && 0 != mAttachments.getAttachmentCount()) \n {\n String contentType = mAttachments.getContentType();\n if(contentType != null && !contentType.trim().equals(\"\")) \n {\n props.put(\"contentType\", contentType);\n }\n }\n\n boolean waitForResponse = true;\n if(msgContext.containsProperty(JMSConstants.WAIT_FOR_RESPONSE))\n waitForResponse =\n ((Boolean)msgContext.getProperty(\n JMSConstants.WAIT_FOR_RESPONSE)).booleanValue();\n if(waitForResponse)\n {\n long timeout = (long) msgContext.getTimeout();\n byte[] response = endpoint.call(out.toByteArray(), timeout, props);\n Message msg = new Message(response);\n msgContext.setResponseMessage(msg);\n }\n else\n {\n endpoint.send(out.toByteArray(), props);\n }\n }\n catch(Exception e)\n {\n throw new AxisFault(\"failedSend\", e);\n }\n finally\n {\n if (connector != null)\n JMSConnectorManager.getInstance().release(connector);\n }\n }",
"String getFaultDetailValue();",
"NamespacedProperty getFaultStringExpression();",
"public HessianRPCReplyMessage(Object value, Object fault, HessianRPCCallMessage call)\r\n\t{\r\n\t\t_value = value;\r\n\t\t_fault = (Throwable) fault;\r\n\t\t_call = call;\r\n\t}",
"@Test\n public void cancelHotelTestError() throws CancelHotelFault, DatatypeConfigurationException{ \n try {\n cancelHotel(null);\n } catch (CancelHotelFault e) {\n assertEquals(\"Empty\",e.getMessage());\n } \n }",
"public QName getFaultDetailName() {\n\treturn this.faultDetailName;\n }",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"public org.pahospital.www.radiologyservice.RadiologyServiceStub.Appointment requestAppointment(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.Appointment appointment2)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/RequestAppointment\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n appointment2,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"requestAppointment\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"requestAppointment\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n org.pahospital.www.radiologyservice.RadiologyServiceStub.Appointment.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (org.pahospital.www.radiologyservice.RadiologyServiceStub.Appointment)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"RequestAppointment\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"RequestAppointment\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"RequestAppointment\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"public sample.ws.HelloWorldWSStub.HelloResponse hello(\n\n sample.ws.HelloWorldWSStub.Hello hello4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"hello\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n hello4,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"hello\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public LibraryWsFault() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType insertNewArrayOfFaultType(int i);",
"public SoapFaultInfo getFaultInfo()\r\n {\r\n return faultInfo;\r\n }",
"public AssertSoapFaultBuilder validator(SoapFaultValidator validator) {\n action.setValidator(validator);\n return this;\n }",
"public String getFaultCode() {\n return faultCode;\n }",
"NamespacedProperty getFaultCodeExpression();",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/error\")\n @RequestWrapper(localName = \"error\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericErrorType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void error(\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"@Override\n public <T extends Actor> void performAs(T actor) {\n actor.attemptsTo(ConsumeService.withPost(new User(data).toString(),data.get(4)));\n }",
"public void addSourceFaultType(Class<?> type) {\n faultTypes.add(type);\n }",
"boolean handleFault(FaultEvent e)\n\t{\n\t\t// lookup what we need to do\n\t\tboolean requestResume = false;\n\t\tString name = e.name();\n\t\tboolean stop = true;\n\t\tboolean print = true;\n\t\ttry\n\t\t{\n\t\t\tprint = m_faultTable.is(name, \"print\"); //$NON-NLS-1$\n\t\t\tstop = m_faultTable.is(name, \"stop\"); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\tif (Trace.error)\n\t\t\t{\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"faultName\", name); //$NON-NLS-1$\n\t\t\t\tTrace.trace(getLocalizationManager().getLocalizedTextString(\"faultHasNoTableEntry\", args)); //$NON-NLS-1$\n\t\t\t\tnpe.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (e instanceof ExceptionFault)\n\t\t{\n\t\t\tExceptionFault ef = (ExceptionFault) e;\n\t\t\tValue thrownValue = ef.getThrownValue();\n\t\t\tif (thrownValue != null)\n\t\t\t{\n\t\t\t\tif (!ef.willExceptionBeCaught())\n\t\t\t\t{\n\t\t\t\t\tstop = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstop = false;\n\n\t\t\t\t\tString typeName = thrownValue.getTypeName();\n\t\t\t\t\tint at = typeName.indexOf('@');\n\t\t\t\t\tif (at != -1)\n\t\t\t\t\t\ttypeName = typeName.substring(0, at);\n\n\t\t\t\t\tfor (int i=0; i<catchpointCount(); ++i)\n\t\t\t\t\t{\n\t\t\t\t\t\tCatchAction c = catchpointAt(i);\n\t\t\t\t\t\tString typeToCatch = c.getTypeToCatch();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (typeToCatch == null || getSession().evalIs(thrownValue, typeToCatch))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (PlayerDebugException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t} catch (PlayerFaultException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!stop)\n\t\t\t\t\t\tprint = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// should we stop?\n\t\tif (!stop)\n\t\t\trequestResume = true;\n\n\t\tif (print)\n\t\t\tdumpFaultLine(e);\n\n\t\treturn requestResume;\n\t}",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCard param, boolean optimizeContent, javax.xml.namespace.QName methodQName)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCard.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"public LibraryWsFault getFaultInfo() {\n return fault;\n }",
"@Test\n public void testFaultSuperTypesAndSuperset() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // DataType sourceFaultType2 = new\n // DataTypeImpl<Type>(RuntimeException.class, RuntimeException.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // sourceFaultTypes.add(1, sourceFaultType2);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType getArrayOfFaultTypeArray(int i);",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, net.wit.webservice.TerminalServiceXmlServiceStub.DirectQuery param, boolean optimizeContent, javax.xml.namespace.QName methodQName)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(net.wit.webservice.TerminalServiceXmlServiceStub.DirectQuery.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse getVehicleAlarmInfoPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPage getVehicleAlarmInfoPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleAlarmInfoPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleAlarmInfoPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleAlarmInfoPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\tdouble faultTimeLength = DEFAULT_FAULT_TIME_LENGTH;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tString faultTimeLength_s = faultLen.getText();\n\t\t\t\tfaultTimeLength = Double.valueOf(faultTimeLength_s);\n\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\tSystem.out.println(\"Fault time length not set - assuming default\");\n\t\t\t}\n \n\t\t\tOptional<Fault> f_o = mission.lookupFaultByName(chosenFault);\n\t\t\tif (f_o.isPresent()) {\n\t\t\t\tFault f = f_o.get();\n\t\t\t\tfaultGen.injectDynamicFault(f, faultTimeLength, Optional.empty());\n\t\t\t\t// TODO: log the dynamic fault GUI action\n\t\t\t\tSystem.out.println(\"Injecting new fault from GUI\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Could not find fault \" + chosenFault + \" in model\");\n\t\t\t}\n\t\t}",
"public AdminServiceFacadeFault() {\n }",
"public void receiveResultrayTrace(\n RayTracerStub.RayTraceResponse result\n ) {\n }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, sample.ws.HelloWorldWSStub.InitializeHelloWorldWS param, boolean optimizeContent)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(sample.ws.HelloWorldWSStub.InitializeHelloWorldWS.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardType param, boolean optimizeContent, javax.xml.namespace.QName methodQName)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardType.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"public sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse helloAuthenticated(\n\n sample.ws.HelloWorldWSStub.HelloAuthenticated helloAuthenticated8)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName());\n _operationClient.getOptions().setAction(\"helloAuthenticated\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n helloAuthenticated8,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"helloAuthenticated\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPage param, boolean optimizeContent)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPage.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"public static void storeMAPFaultName(String faultName, \n Message message) {\n message.put(MAP_FAULT_NAME_PROPERTY, faultName);\n }",
"public void addAction(AccessibilityAction action) {\n/* 312 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, net.wit.webservice.TerminalServiceXmlServiceStub.GetDirectSrvInfo param, boolean optimizeContent, javax.xml.namespace.QName methodQName)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(net.wit.webservice.TerminalServiceXmlServiceStub.GetDirectSrvInfo.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, sample.ws.HelloWorldWSStub.Hello param, boolean optimizeContent)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(sample.ws.HelloWorldWSStub.Hello.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"void setArrayOfFaultTypeArray(int i, com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType arrayOfFaultType);",
"public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String s) {\n/* 152 */ UPNPService.logger.warning(\"unable to map port for \" + port.toString());\n/* 153 */ port.addException(port.toString(), new Exception(s));\n/* */ }",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse getVehicleBookPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPage getVehicleBookPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleBookPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleBookPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleBookPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public TerminalServiceXmlServiceStub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault {\n this(null,targetEndpoint);\n }",
"private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, sample.ws.HelloWorldWSStub.HelloAuthenticated param, boolean optimizeContent)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(sample.ws.HelloWorldWSStub.HelloAuthenticated.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }",
"@Override\n\t\tpublic void process(Exchange ex) throws Exception {\n\t\t\tTraitHierarchy th = (TraitHierarchy) ex.getIn().getHeader(TRAIT_HIERARCHY);\n\t\t\tValidationError ve = ex.getIn().getBody(ValidationError.class);\n\t\t\tif ( ve != null){\n\t\t\t\tth.setErrorMessage(ve.getErrorMessage());\n\t\t\t} \n\t\t}",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] getArrayOfFaultTypeArray();",
"@Test\n public void bookHotelTestError() throws BookHotelFault{\n try {\n assertTrue(bookHotel(null));\n } catch (BookHotelFault e) {\n assertEquals(\"Empty\", e.getMessage());\n } \n }"
] | [
"0.64521074",
"0.61457384",
"0.59230494",
"0.5883457",
"0.5872841",
"0.5800333",
"0.5780089",
"0.5760588",
"0.5752922",
"0.56909496",
"0.5680712",
"0.56636995",
"0.56571543",
"0.5650301",
"0.5602497",
"0.5531012",
"0.5483746",
"0.5481273",
"0.5466813",
"0.5414746",
"0.54067594",
"0.54011995",
"0.536336",
"0.53356516",
"0.5322824",
"0.53051156",
"0.52902913",
"0.5273455",
"0.5268135",
"0.52654606",
"0.5258676",
"0.52492136",
"0.52369004",
"0.52252764",
"0.5210566",
"0.5191424",
"0.5173449",
"0.51383126",
"0.51267743",
"0.5126361",
"0.5122284",
"0.5110473",
"0.5095209",
"0.5089319",
"0.5067355",
"0.5037004",
"0.5026292",
"0.49953276",
"0.49583626",
"0.49471098",
"0.4942411",
"0.49418727",
"0.4940545",
"0.49357453",
"0.49201316",
"0.489006",
"0.48586857",
"0.4849746",
"0.4839871",
"0.48395038",
"0.48317716",
"0.4827758",
"0.48151913",
"0.48080054",
"0.48077866",
"0.47920215",
"0.47881466",
"0.47757512",
"0.47595596",
"0.4749996",
"0.47430682",
"0.47403458",
"0.47399354",
"0.47304568",
"0.4730142",
"0.47296655",
"0.47182122",
"0.47154403",
"0.47134697",
"0.4704783",
"0.4682846",
"0.4672067",
"0.4665656",
"0.46654984",
"0.4658175",
"0.46567446",
"0.46555305",
"0.4653754",
"0.46506068",
"0.4622918",
"0.46166587",
"0.46070573",
"0.46031335",
"0.46009412",
"0.4592083",
"0.45858973",
"0.4585642",
"0.45832074",
"0.45825085",
"0.45792067"
] | 0.7371539 | 0 |
Expect fault detail in SOAP fault message. | public AssertSoapFaultBuilder faultDetail(String faultDetail) {
action.getFaultDetails().add(faultDetail);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFaultString() {\n return faultString;\n }",
"String getFaultStringValue();",
"public String getFaultMessage() {\n return faultMessage;\n }",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"String getFaultReasonValue();",
"protected Element getFaultMessage() {\n return mElement;\n }",
"public static void serializeSOAPFault(SOAPFault fault, XMLStreamWriter writer) throws XMLStreamException {\n\n\t\tOMSerializerUtil.serializeStartpart(fault, writer);\n\t\tOMElement e = null;\n\n\t\t// based on the namespace (SOAP1.1 vs SOAP1.2) to serialize accordingly\n\t\tif (fault.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {\n\t\t\t// SOAP1.2\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\n\t\t} else {\n\t\t\t// SOAP1.1\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\t\t}\n\t}",
"String getFaultDetailValue();",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"NamespacedProperty getFaultDetailExpression();",
"public SoapFaultInfo getFaultInfo()\r\n {\r\n return faultInfo;\r\n }",
"public LibraryWsFault getFaultInfo() {\n return fault;\n }",
"public LibraryWsException(final String message, final LibraryWsFault fault) {\n super(message);\n this.fault = fault;\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"public QName getFaultDetailName() {\n\treturn this.faultDetailName;\n }",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"public String getFaultCode() {\n return faultCode;\n }",
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"public static Fault createFault(MessageExchange reply, Element part, QName type) \n throws Exception {\n Document doc = XmlUtil.newDocument();\n Element wrapper = WrapperUtil.createJBIMessageWrapper(doc, type, null);\n wrapper.appendChild(WrapperUtil.importJBIWrappedPart(doc, part));\n Fault fault = reply.createFault();\n fault.setContent(new DOMSource(doc));\n return fault;\n }",
"NamespacedProperty getFaultReasonExpression();",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"public AssertSoapFaultBuilder faultActor(String faultActor) {\n action.setFaultActor(faultActor);\n return this;\n }",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"protected String getFaultName() {\n return mName;\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext arg0) {\r\n\t\treturn true;\r\n\t}",
"public AssertSoapFaultBuilder faultString(String faultString) {\n action.setFaultString(faultString);\n return this;\n }",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"NamespacedProperty getFaultStringExpression();",
"public AssertSoapFaultBuilder faultCode(String code) {\n\t action.setFaultCode(code);\n\t return this;\n\t}",
"public void setFaultCode(final String faultCode) {\n this.faultCode = faultCode;\n }",
"public LibraryWsException(\n final String message, final Throwable cause, final LibraryWsFault fault) {\n super(message, cause);\n this.fault = fault;\n }",
"@Override\n public String toString() {\n return new ToStringBuilder(this)\n .append(\"faultCode\", faultCode)\n .append(\"faultString\", faultString)\n .toString();\n }",
"NamespacedProperty getFaultCodeExpression();",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext smc) {\r\n\t\tSystem.out.println(\"Ignoring fault message...\");\r\n\t\treturn true;\r\n\t}",
"private static String getActionFromServiceModel(Message message,\n Exception fault) {\n String action = null;\n BindingOperationInfo bindingOpInfo =\n message.getExchange().get(BindingOperationInfo.class);\n if (bindingOpInfo != null) {\n if (bindingOpInfo.isUnwrappedCapable()) {\n bindingOpInfo = bindingOpInfo.getUnwrappedOperation();\n }\n if (fault == null) {\n action = (String) message.get(SoapBindingConstants.SOAP_ACTION);\n if (action == null) {\n SoapOperationInfo soi = \n bindingOpInfo.getExtensor(SoapOperationInfo.class);\n if (null != soi) {\n action = soi.getAction();\n }\n\n }\n if (action == null || \"\".equals(action)) {\n MessageInfo msgInfo = \n ContextUtils.isRequestor(message)\n ? bindingOpInfo.getOperationInfo().getInput()\n : bindingOpInfo.getOperationInfo().getOutput();\n String cachedAction = (String)msgInfo.getProperty(ACTION);\n if (cachedAction == null) {\n action = getActionFromMessageAttributes(msgInfo);\n } else {\n action = cachedAction;\n }\n }\n } else {\n Throwable t = fault.getCause();\n \n // FaultAction attribute is not defined in \n // http://www.w3.org/2005/02/addressing/wsdl schema\n for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {\n FaultInfo fi = bfi.getFaultInfo();\n if (t != null && t.getClass().isAssignableFrom(fi.getMessagePart(0).getTypeClass())) {\n if (fi.getExtensionAttributes() == null) {\n continue;\n }\n String attr = (String)\n fi.getExtensionAttributes().get(Names.WSAW_ACTION_QNAME);\n if (attr == null) {\n attr = (String) \n fi.getExtensionAttributes()\n .get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,\n Names.WSAW_ACTION_NAME)); \n }\n if (attr != null) {\n action = attr;\n break;\n }\n }\n }\n }\n }\n LOG.fine(\"action determined from service model: \" + action);\n return action;\n }",
"public FaultException raise(Throwable e);",
"public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg)\n throws MessagingException;",
"@Test\n\tpublic void testUpdatePoStatusErrorListenerFaultTest() {\n\t\ttry{\n\t\t\t //Is used in soap request preparation because value is used in reply soap header.\n\t\t\t final String callbackRefMockUri = mockOsbBusinessService(\n\t\t\t\t\t PATH_UPDATE_STATUS_CALLBACK,\n\t\t\t\t\t updatePoStatusCallbackPortMock);\t\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_ORDER_TRANSACTION_MONITORING,\n\t\t\t\t\t orderTransactionServiceFaultMock);\n\t\t\t \n\t\t\t mockOsbBusinessService(\n\t\t\t\t\t PATH_RESPONSE_RETRY_WRAPPER,\n\t\t\t\t\t responseRetryWrapperMock);\n\t\n\t\t\tfinal String requestString = new ParameterReplacer(readClasspathFile(\"Request_UpdatePOStatusErrorListener.xml\"))\n\t\t\t\t\t.replace(REPLACE_PARAM_CORRELATION_ID, randomCorrelationId)\n\t\t\t\t\t.replace(REPLACE_PARAM_PURCHASE_ORDER_NUMBER, randomPoNumber)\n\t\t\t\t\t.replace(REPLACE_PARAM_COMBOX_ID, randomCoboxId)\n\t\t\t\t\t.replace(REPLY_TO, callbackRefMockUri)\n\t\t\t\t\t.replace(MESSAGE_ID, randomMessageId).build();\n\t\t\t\t\t\n\t\t\tLOGGER.info(\"+++ request \" + requestString);\n\t\n\t\t\tinvokeOsbProxyService(PATH_SERVICE, requestString);\n\n\t\t\tassertThat(\"updatePoStatusCallbackPortMock is not invocked!\",!updatePoStatusCallbackPortMock.hasBeenInvoked());\n\t\t\t//This should be invoked\n\t\t\tassertThat(\"responseRetryWrapperMock is invocked!\",responseRetryWrapperMock.hasBeenInvoked());\n\t\t\t\n\t\t\t//Get message from process as it is\n\t\t\tString responseRetryWrapperMockMsg = responseRetryWrapperMock.getLastReceivedRequest();\n\t\t\tLOGGER.info(\"+++ responseRetryWrapperMockMsg \" + responseRetryWrapperMockMsg);\n\t\t\t\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:requestHeader/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:transactionId/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:category/text()\",\n\t\t\t\t\t\"TechnicalFault\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:exception/exc:context/exc:payload/\"\n\t\t\t\t\t+ \"exc:exception/exc:context/exc:payload/navpom:updatePurchaseOrderStatus/navpom:header/mht:CorrelationID/text()\",\n\t\t\t\t\trandomCorrelationId,\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsDestination/text()\",\n\t\t\t\t\t\"h24jms.ERR_UpdatePOStatus_Q\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t\tassertXpathEvaluatesTo(\"/soapenv:Envelope/soapenv:Body/rrmess:onErrorInResponseQueueRequest/rrmess:jmsFactory/text()\",\n\t\t\t\t\t\"h24jms.PurchaseOrder\",\n\t\t\t\t\tresponseRetryWrapperMockMsg);\n\t\t\t\n\t\t} catch(ServiceException e) {\n\t\t\tfail();\t\t\t\n\t\t}\n\n\t}",
"@Override\n\tpublic void handlerFault(String msg) {\n\t\tSystem.out.println(\"Emailing the error \" +msg);\n\t}",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/error\")\n @RequestWrapper(localName = \"error\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericErrorType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void error(\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"String getFaultActor();",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType addNewArrayOfFaultType();",
"@Test\n public void cancelHotelTestError1() throws CancelHotelFault, DatatypeConfigurationException{ \n String input = \"hello you\";\n try {\n cancelHotel(input);\n } catch (CancelHotelFault e) {\n assertEquals(\"ERROR\",e.getMessage());\n } \n }",
"public void test1194() throws Exception {\n invokeAsync(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1194\");\n //Lets see we get a response in 60 s\n SOAPMessage m = respMsgExchanger.exchange(null, TestConstants.CLIENT_MAX_TIMEOUT, TimeUnit.SECONDS);\n// System.out.println(\"****************************\");\n// m.writeTo(System.out);\n// System.out.println(\"\\n****************************\");\n SOAPFault f = m.getSOAPBody().getFault();\n assertNotNull(f);\n assertEquals(USER_FAULT_CODE, f.getFaultCodeAsQName());\n\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource, Charset charset) {\n try {\n action.getFaultDetails().add(FileUtils.readToString(resource, charset));\n } catch (IOException e) {\n throw new CitrusRuntimeException(\"Failed to read fault detail resource\", e);\n }\n return this;\n }",
"public LibraryWsFault() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType insertNewArrayOfFaultType(int i);",
"public static boolean isFault(Message message) {\n return message != null\n && message.getExchange() != null\n && (message == message.getExchange().getInFaultMessage()\n || message == message.getExchange().getOutFaultMessage());\n }",
"public int getFaultCode() {\n\t\treturn faultCode;\n\t}",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType getArrayOfFaultTypeArray(int i);",
"public VuFaultRecord(final @NonNull DataInputStream dis) throws IOException {\n\t\tsuper();\n\n\t\tthis.faultType = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultRecordPurpose = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultBeginTime = CardBlockUtil.getDate(dis);\n\t\tthis.faultEndTime = CardBlockUtil.getDate(dis);\n\t\tthis.cardNumberDriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberDriverSlotEnd = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotEnd = new CardNumber(dis);\n\t}",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public FaultException raise(Throwable e, Object argument);",
"public interface IAeFaultMatchingStrategy {\r\n /**\r\n * Select ths catch that is the best match for the given fault.\r\n *\r\n * @param aProvider\r\n * @param aIterOfCatches\r\n * @param aFault\r\n * @return IAeCatch or null. In the case of null, the catchAll or implicit fault handler will handle the fault.\r\n */\r\n public IAeCatch selectMatchingCatch(IAeContextWSDLProvider aProvider, Iterator aIterOfCatches, IAeFaultTypeInfo aFault);\r\n}",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"@Test\n public void cancelHotelTestError() throws CancelHotelFault, DatatypeConfigurationException{ \n try {\n cancelHotel(null);\n } catch (CancelHotelFault e) {\n assertEquals(\"Empty\",e.getMessage());\n } \n }",
"public void objectCompletedWithFault(IAeFault aFault) throws AeBusinessProcessException;",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse getVehicleAlarmInfoPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPage getVehicleAlarmInfoPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleAlarmInfoPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleAlarmInfoPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleAlarmInfoPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleAlarmInfoPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public TR069Exception(String message, int faultCode) {\n\t\tthis(message, faultCode, null);\n\t}",
"public static TryExpression tryFault(Expression body, Expression fault) { throw Extensions.todo(); }",
"public static void storeMAPFaultName(String faultName, \n Message message) {\n message.put(MAP_FAULT_NAME_PROPERTY, faultName);\n }",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"public void test1152() throws Exception {\n try {\n invoke(createDispatchForNonAnonymousWithWSDLWithoutAddressing(),\n MESSAGES.getNonAnonymousReplyToNoneFaultToMessage(),\n S11_NS,\n getNonAnonymousEndpointAddress(),\n clientAddress,\n ECHO_IN_ACTION,\n \"fault-test1152\");\n fail(\"WebServiceException must be thrown\");\n } catch (WebServiceException e) {\n assertEquals(\"No response returned.\", e.getMessage());\n }\n }",
"public sample.ws.HelloWorldWSStub.HelloResponse hello(\n\n sample.ws.HelloWorldWSStub.Hello hello4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"hello\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n hello4,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"hello\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public ThrowUnitImpl(Context context, Unit parentActUnit, RActivity act, long branchId) {\n super(context, parentActUnit, act, branchId);\n RThrow throwAct = (RThrow) mAct;\n QName faultName = throwAct.getRFaultName();\n \n RVariable faultVariable = ((RVariableElement) throwAct).getRVariable();\n WSMessage faultData = null;\n \n if (faultVariable != null) {\n RuntimeVariable rVar = mContext.getRuntimeVariable(faultVariable);\n if ((rVar == null) && (faultVariable.getWSDLMessageType().getParts().size() == 0)) {\n rVar = mContext.createRuntimeVariable(faultVariable);\n Utility.initializeVariableValue(rVar);\n mContext.setRuntimeVariable(rVar);\n StateContext stateCtx = mContext.getStateContext();\n mContext.getProcessInstance().getPersistenctMgr().updateState(stateCtx, \n rVar, getBranchId());\n }/* else {\n Utility.verifyValue(faultVariable.getName(), rVar, false);\n }*/\n faultData = rVar.getWSMessage();\n //faultData = faultData.copy();\n }\n mFault = new FaultImpl(faultName, faultData);\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] getArrayOfFaultTypeArray();",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse getVehicleBookPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPage getVehicleBookPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleBookPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleBookPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleBookPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleBookPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public java.util.Enumeration getFaultReport() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n return ejbRef().getFaultReport();\n }",
"public void addTargetFaultType(Class<?> type) {\n targetFaultTypes.add(type);\n }",
"public TR069Exception(String message, int faultCode, DmtException e) {\n\t\tsuper(message, e);\n\t\tthis.faultCode = faultCode;\n\t\tthis.dmtException = e;\n\t}",
"public HessianRPCReplyMessage(Object value, Object fault, HessianRPCCallMessage call)\r\n\t{\r\n\t\t_value = value;\r\n\t\t_fault = (Throwable) fault;\r\n\t\t_call = call;\r\n\t}",
"public void addSourceFaultType(Class<?> type) {\n faultTypes.add(type);\n }",
"void dumpFaultLine(FaultEvent e)\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\t// use a slightly different format for ConsoleErrorFaults\n\t\tif (e instanceof ConsoleErrorFault)\n\t\t{\n\t\t\tsb.append(getLocalizationManager().getLocalizedTextString(\"linePrefixWhenDisplayingConsoleError\")); //$NON-NLS-1$\n\t\t\tsb.append(' ');\n\t\t\tsb.append(e.information);\n\n final String stackTrace = e.stackTrace();\n if (stackTrace != null && stackTrace.length() > 0) {\n sb.append(\"\\n\").append(stackTrace);\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString name = e.name();\n\t\t\tsb.append(getLocalizationManager().getLocalizedTextString(\"linePrefixWhenDisplayingFault\")); //$NON-NLS-1$\n\t\t\tsb.append(' ');\n\t\t\tsb.append(name);\n\t\t\tif (e.information != null && e.information.length() > 0)\n\t\t\t{\n\t\t\t\tsb.append(getLocalizationManager().getLocalizedTextString(\"informationAboutFault\")); //$NON-NLS-1$\n\t\t\t\tsb.append(e.information);\n\t\t\t}\n\n final String stackTrace = e.stackTrace();\n if (stackTrace != null && stackTrace.length() > 0) {\n sb.append(\"\\n\").append(stackTrace);\n }\n\t\t}\n\t\tout( sb.toString() );\n\t}",
"@Test\n public void testFaultSuperTypesAndSuperset() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // DataType sourceFaultType2 = new\n // DataTypeImpl<Type>(RuntimeException.class, RuntimeException.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // sourceFaultTypes.add(1, sourceFaultType2);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"public String getFailDetail(String response) {\n\n\t\tString detailReason=\"Reason\";\n\t\tPattern pattern = Pattern.compile(FAULT_MESSAGE);\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tdetailReason= (match.group(1));\n\t\t}\n\t\treturn detailReason;\t\n\t}",
"@Override\r\n\tpublic void archiveFault(int faultId) {\r\n\t\tString sql = \"UPDATE \" + Constants.FAULT_TABLE_NAME + \" SET \" + Constants.FAULT_TABLE_FAULT_STATUS_COLUMN + \"=? WHERE \" + Constants.FAULT_TABLE_ID_COLUMN + \"=?\";\r\n jdbcTemplate.update(sql, Constants.FAULT_TABLE_DONE_STATUS, faultId);\r\n\t}",
"public sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse helloAuthenticated(\n\n sample.ws.HelloWorldWSStub.HelloAuthenticated helloAuthenticated8)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName());\n _operationClient.getOptions().setAction(\"helloAuthenticated\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n helloAuthenticated8,\n optimizeContent(new javax.xml.namespace.QName(\"http://ws.sample/\",\n \"helloAuthenticated\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (sample.ws.HelloWorldWSStub.HelloAuthenticatedResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleInfoPageResponse getVehicleInfoPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleInfoPage getVehicleInfoPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleInfoPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleInfoPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleInfoPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleInfoPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleInfoPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"@Test\n public void bookHotelTestError() throws BookHotelFault{\n try {\n assertTrue(bookHotel(null));\n } catch (BookHotelFault e) {\n assertEquals(\"Empty\", e.getMessage());\n } \n }",
"public String execute(SOAPMessage message) throws FIFException;",
"public org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus getOrderStatus(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID radiologyOrderID6)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/GetOrderStatus\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrderID6,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"boolean handleFault(FaultEvent e)\n\t{\n\t\t// lookup what we need to do\n\t\tboolean requestResume = false;\n\t\tString name = e.name();\n\t\tboolean stop = true;\n\t\tboolean print = true;\n\t\ttry\n\t\t{\n\t\t\tprint = m_faultTable.is(name, \"print\"); //$NON-NLS-1$\n\t\t\tstop = m_faultTable.is(name, \"stop\"); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\tif (Trace.error)\n\t\t\t{\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"faultName\", name); //$NON-NLS-1$\n\t\t\t\tTrace.trace(getLocalizationManager().getLocalizedTextString(\"faultHasNoTableEntry\", args)); //$NON-NLS-1$\n\t\t\t\tnpe.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif (e instanceof ExceptionFault)\n\t\t{\n\t\t\tExceptionFault ef = (ExceptionFault) e;\n\t\t\tValue thrownValue = ef.getThrownValue();\n\t\t\tif (thrownValue != null)\n\t\t\t{\n\t\t\t\tif (!ef.willExceptionBeCaught())\n\t\t\t\t{\n\t\t\t\t\tstop = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstop = false;\n\n\t\t\t\t\tString typeName = thrownValue.getTypeName();\n\t\t\t\t\tint at = typeName.indexOf('@');\n\t\t\t\t\tif (at != -1)\n\t\t\t\t\t\ttypeName = typeName.substring(0, at);\n\n\t\t\t\t\tfor (int i=0; i<catchpointCount(); ++i)\n\t\t\t\t\t{\n\t\t\t\t\t\tCatchAction c = catchpointAt(i);\n\t\t\t\t\t\tString typeToCatch = c.getTypeToCatch();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (typeToCatch == null || getSession().evalIs(thrownValue, typeToCatch))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (PlayerDebugException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t} catch (PlayerFaultException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!stop)\n\t\t\t\t\t\tprint = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// should we stop?\n\t\tif (!stop)\n\t\t\trequestResume = true;\n\n\t\tif (print)\n\t\t\tdumpFaultLine(e);\n\n\t\treturn requestResume;\n\t}",
"public org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID orderRadiologyExamination(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrder radiologyOrder4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/OrderRadiologyExamination\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrder4,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"public static void storeMAPFaultReason(String reason, \n Message message) {\n message.put(MAP_FAULT_REASON_PROPERTY, reason);\n }",
"public net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCardResponse terminalReturnCard(\n\n net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCard terminalReturnCard4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml/TerminalServiceXml/terminalReturnCardRequest\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n terminalReturnCard4,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"terminalReturnCard\")), new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"terminalReturnCard\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCardResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (net.wit.webservice.TerminalServiceXmlServiceStub.TerminalReturnCardResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"terminalReturnCard\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"terminalReturnCard\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"terminalReturnCard\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"private static void printSOAPResponse(SOAPMessage soapResponse) throws Exception {\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n \n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n soapResponse.writeTo(stream);\n String message = new String(stream.toByteArray(), \"utf-8\");\n \n \n Source sourceContent = soapResponse.getSOAPPart().getContent();\n System.out.print(\"\\nResponse SOAP Message = \");\n StreamResult result = new StreamResult(System.out);\n transformer.transform(sourceContent, result);\n \n \n \n }",
"public net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardTypeResponse getTerminalCardType(\n\n net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardType getTerminalCardType2)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions().setAction(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml/TerminalServiceXml/getTerminalCardTypeRequest\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getTerminalCardType2,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"getTerminalCardType\")), new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"getTerminalCardType\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardTypeResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (net.wit.webservice.TerminalServiceXmlServiceStub.GetTerminalCardTypeResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"getTerminalCardType\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"getTerminalCardType\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"getTerminalCardType\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }",
"public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleRecordPageResponse getVehicleRecordPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleRecordPage getVehicleRecordPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName());\n _operationClient.getOptions().setAction(\"urn:getVehicleRecordPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getVehicleRecordPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getVehicleRecordPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleRecordPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetVehicleRecordPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }",
"private void createRejectionNotice(Order faultOrder)\n {\n\n Random rand = new Random();\n int randomNum = rand.nextInt(2);\n\n Inspection inspection = new Inspection(\"1/03/2017\", Item.TOURINGTUBE, faultOrder, workerList.get(randomNum), \"dented\");\n\n System.out.println(inspection + \"\\n\");\n }"
] | [
"0.6919421",
"0.68075776",
"0.6625023",
"0.66169035",
"0.65445304",
"0.6539107",
"0.6500426",
"0.64942205",
"0.6451822",
"0.64148426",
"0.63875014",
"0.6330147",
"0.6185244",
"0.61568296",
"0.61289966",
"0.61249864",
"0.6112877",
"0.61115295",
"0.6107125",
"0.60816944",
"0.60710615",
"0.60555536",
"0.60441977",
"0.6033561",
"0.60161674",
"0.60107535",
"0.59638095",
"0.59228677",
"0.5919981",
"0.58851135",
"0.58344185",
"0.58334744",
"0.5815535",
"0.581204",
"0.57928884",
"0.5776866",
"0.5747593",
"0.5722122",
"0.5705707",
"0.56965667",
"0.56948984",
"0.5631696",
"0.56189686",
"0.56178534",
"0.55914843",
"0.5533581",
"0.5516832",
"0.5501136",
"0.5490154",
"0.546581",
"0.5434847",
"0.54140204",
"0.540586",
"0.5386871",
"0.53654945",
"0.5358152",
"0.5321944",
"0.53172493",
"0.53138137",
"0.5313412",
"0.5312549",
"0.52899367",
"0.5259269",
"0.5255659",
"0.52042365",
"0.52028495",
"0.51994395",
"0.5185134",
"0.51844877",
"0.5182069",
"0.5165033",
"0.51635474",
"0.51546687",
"0.5154343",
"0.51369506",
"0.51208305",
"0.5100545",
"0.51002514",
"0.5095878",
"0.5083411",
"0.50802636",
"0.50735635",
"0.50731",
"0.50671047",
"0.506552",
"0.5038259",
"0.503528",
"0.503283",
"0.501655",
"0.5007495",
"0.49938694",
"0.49648777",
"0.49629357",
"0.49561757",
"0.49494627",
"0.49403137",
"0.49387795",
"0.4926991",
"0.49201673",
"0.49132642"
] | 0.63779885 | 11 |
Expect fault detail from file resource. | public AssertSoapFaultBuilder faultDetailResource(Resource resource) {
return faultDetailResource(resource, FileUtils.getDefaultCharset());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public FileWithFaultLocations getFile(final String file);",
"void fileReceiveFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"public void errorFileEscenario() {\n\t\tvisorEscenario.errorFileEscenario();\t\n\t}",
"void fileTransferFailed(IMSession session, String requestId, ReasonInfo reason);",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource, Charset charset) {\n try {\n action.getFaultDetails().add(FileUtils.readToString(resource, charset));\n } catch (IOException e) {\n throw new CitrusRuntimeException(\"Failed to read fault detail resource\", e);\n }\n return this;\n }",
"@Override\n\tpublic FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\t\tSystem.out.println(\"Error Accessing File\"+file.toAbsolutePath());\n\t\tSystem.out.println(exc.getLocalizedMessage());\n\t\t\n\t\t\n\t\t\n\t\treturn super.visitFileFailed(file, exc);\n\t}",
"boolean getFileErr();",
"@Override\n\t\t\tpublic void onFailure(int arg0, Header[] arg1, Throwable arg2, File arg3) {\n\t\t\t\t\n\t\t\t}",
"public List<FileWithFaultLocations> getFaultyFiles();",
"private static void runAndThrow(final String file) {\n String input = readResource(\"failure_\" + file + \".json\", QueryChunkResponseParserTest.class);\n // At the moment the query chunk response parser does not care about the http status code and only\n // prints it as part of the error context, so we can pick whatever we want here.\n HttpResponse header = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);\n throw QueryChunkResponseParser.errorsToThrowable(input.getBytes(StandardCharsets.UTF_8), header, null);\n }",
"@Test\n public void testFileOpen() {\n \n FileHandler fileToTest;\n \n fileToTest = new FileHandler(\"Kalle.xml\");\n \n try {\n fileToTest.openFile();\n fail(\"Should have raised a fileNotFoundException\");\n }\n catch (FileNotFoundException fnf) {\n }\n }",
"public void addFile(FileWithFaultLocations faultLocationsFile) throws UnsupportedOperationException;",
"void fileSendFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public static void printReadFileIdentificationError() {\n System.out.println(Message.READ_FILE_IDENTIFICATION_ERROR);\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"@Test(timeout = 4000)\n public void test009() throws Throwable {\n try { \n DBUtil.runScript(\"\", \"\", (Connection) null, false, (ErrorHandler) null);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(FileNotFoundException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public VuFaultRecord(final @NonNull DataInputStream dis) throws IOException {\n\t\tsuper();\n\n\t\tthis.faultType = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultRecordPurpose = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultBeginTime = CardBlockUtil.getDate(dis);\n\t\tthis.faultEndTime = CardBlockUtil.getDate(dis);\n\t\tthis.cardNumberDriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberDriverSlotEnd = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotEnd = new CardNumber(dis);\n\t}",
"String getFaultStringValue();",
"@Override\n\tprotected String getFileArress() {\n\t\treturn fileAddress;\n\t}",
"default public FaultLocations getFaultLocations(final String file) {\n \tif (hasFile(file)) {\n \t\treturn getFile(file).getFaultLocations();\n \t} else {\n \t\treturn null;\n \t}\n }",
"public String getFaultString() {\n return faultString;\n }",
"public void corruptedFileErrorMessage() {\n System.out.println(\"The file (\" + INVENTORY_FILE_PATH + \") is corrupted!\\n\"\n + \"Please exit the program and delete the corrupted file before trying to access Inventory Menu!\");\n }",
"String getFaultReasonValue();",
"@Test(priority = 1, dependsOnMethods = { \"testGetFileWithMandatoryParameters\" },\n description = \"podio {getFile} integration test with negative case.\")\n public void testGetFileWithNegativeCase() throws IOException, JSONException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:getFile\");\n \n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_getFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid\";\n \n RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, \"GET\", apiRequestHeadersMap);\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"abstract String getFileRoute() throws IOException;",
"String getFaultActor();",
"protected abstract E readFile() throws Exception;",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"@ExceptionHandler(value=FileNotFound.class)\n\tpublic void resolveException(String ex,HttpServletResponse response) {\n\t\ttry {\n\t\t\tresponse.getOutputStream().println(\"Warning: File vuoto\\nException message: \"+ex);\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t}\n\t}",
"void readFaultyRecipientsTest() {\n Assertions.assertThrows(RuntimeException.class,\n () -> Reader.readRecipients(Paths.get(\"src/test/resources/faulty_recipients.txt\")));\n }",
"public TestResult(File file)\n throws ResultFileNotFoundFault, ReloadFault {\n resultsFile = file;\n reload();\n\n testURL = desc.getRootRelativeURL();\n\n execStatus = Status.parse(PropertyArray.get(props, EXEC_STATUS));\n }",
"@Test(timeout = 4000)\n public void test369() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"J]'z8)\", \"J]'z8)\");\n // Undeclared exception!\n try { \n fileInput0.dfn((Object) \"J]'z8)\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(expected = GenieServerException.class)\n public void testGetFileMethodFailureToFetch() throws GenieException {\n Mockito.when(this.s3Client.getObject(Mockito.any(GetObjectRequest.class), Mockito.any(File.class))).thenThrow(new AmazonS3Exception(\"something\"));\n final ArgumentCaptor<GetObjectRequest> argument = ArgumentCaptor.forClass(GetObjectRequest.class);\n try {\n this.s3FileTransfer.getFile(S3FileTransferImplUnitTests.S3_PATH, S3FileTransferImplUnitTests.LOCAL_PATH);\n } finally {\n Mockito.verify(this.s3Client).getObject(argument.capture(), Mockito.any());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_BUCKET, argument.getValue().getBucketName());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_KEY, argument.getValue().getKey());\n Mockito.verify(this.downloadTimer, Mockito.times(1)).record(Mockito.anyLong(), Mockito.eq(TimeUnit.NANOSECONDS));\n Mockito.verify(this.registry, Mockito.times(1)).timer(Mockito.eq(DOWNLOAD_TIMER_NAME), this.tagsCaptor.capture());\n Assert.assertEquals(MetricsUtils.newFailureTagsSetForException(new GenieServerException(\"blah\")), this.tagsCaptor.getValue());\n }\n }",
"@Test\n\tpublic void testGetCorrectParamMatchingPii() {\n\t\tFile f = new File(FILE_DIR + FILE_NAME);\n\t\tfinal String owner = \"1\";\n\t\twhen(mPiiService.getPiiFile((long) 123456789, owner)).thenReturn(f);\n\t\t\n\t\tResponse response = piiController.getPii((long) 123456789, owner);\n\t\t\n\t\tverify(mPiiService).getPiiFile((long) 123456789, owner);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\t\n\t\tassertEquals(200, response.getStatus());\n\t\tFile fileReturned = (File) response.getEntity();\n\t\tassertEquals(f, fileReturned);\n\t}",
"@Test\n public void file() throws UnsupportedEncodingException {\n String fileName = createFile(FILE_BODY, \"/file/create/in\");\n\n // Read the file\n RestAssured\n .get(\"/file/get/in/\" + Paths.get(fileName).getFileName())\n .then()\n .statusCode(200)\n .body(equalTo(FILE_BODY));\n }",
"String getFaultDetailValue();",
"@Test(timeout = 4000)\n public void test07() throws Throwable {\n int int0 = (-1220);\n Player player0 = new Player((-1220));\n player0.getMoney();\n byte[] byteArray0 = new byte[3];\n byteArray0[0] = (byte) (-40);\n MockFile mockFile0 = new MockFile(\"kSho(d)S;w\", \"\");\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(mockFile0);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"edu.usfca.cs.dfs.StorageMessages.RetrieveFileResponse getRetrieveFileResponse();",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"public void myMethod() throws FileNotFoundException {\n\t\ttry {\n\t\tsoccer = new FileInputStream(\"soccer.txt\");\n\t\t} catch (FileNotFoundException f) {//checked exception handled here\n//\t\t\tf.printStackTrace();\n\t\tSystem.out.println(\"file not found\");//throw fnfe; //this needs to be handled or declared\n\t\t}\n\t\t}",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"@Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }",
"@Test(timeout = 4000)\n public void test02() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n fileUtil0.downloadKeywordSearchFile(\"9\", \"9\", \"9\", \"9\");\n String string0 = \"\";\n fileUtil0.downloadBlendedSearchFile(\"\", \"9\");\n fileUtil0.isAgeGood((File) null);\n fileUtil0.fetchThirdPartySearchFile(\"9\", \"9\", \"9\", \"9\");\n String string1 = \"^m1KLI\\\\nb8]!B*(2\";\n String string2 = null;\n fileUtil0.downloadBrowseNodeFile(\"^m1KLI\\nb8]!B*(2\", \"9\", (String) null, \"<X;R[f!MO\");\n String string3 = \"-tT-6\";\n fileUtil0.fetchThirdPartySearchFile(\"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"-tT-6\");\n ArrayList<Object> arrayList0 = new ArrayList<Object>();\n Object object0 = new Object();\n Object object1 = new Object();\n arrayList0.add(object1);\n arrayList0.add(object0);\n fileUtil0.downloadAccessoriesFile(\"9\", arrayList0, \"\");\n String string4 = \"associateID\";\n String string5 = null;\n // Undeclared exception!\n try { \n fileUtil0.renameFile(\"associateID\", (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.File\", e);\n }\n }",
"private void testReadFile() {\n System.out.println(\"------ TESTING : readFile(String filename) ------\");\n try{\n if(iTestFileList.readFile(sFile)){\n //throw exception if the values are not copied correctly\n if(iTestFileList.get(0) != 42175){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(5) != 45545){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(10) != 86908) {\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }\n else{\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n System.out.print(\"\\n\");\n }",
"@Test(priority = 4)\n\tpublic void inValideFileType() throws JsonProcessingException {\n\n\t\ttest.log(LogStatus.INFO, \"My test is starting.....\");\n\t\tResponse resp=given()\n\t .contentType(\"multipart/form-data\")\n\t .multiPart(\"product_line\",\"testing\")\n\t .multiPart(\"file\", new File(\"./src/test/resources/statuscode.txt\"))\n\t .post(APIPath.apiPath.POST_VALID_PATH);\n\n\t\tresp.then().body(\"message\",equalTo(\"Invalide File Type.\"));\n\t\ttest.log(LogStatus.PASS, \"Invalide File Type\");\n\t\tAssert.assertEquals(resp.getStatusCode(),400);\n\t\ttest.log(LogStatus.PASS, \"Successfully validated status code expected 400 and Actual status code is :: \" + resp.getStatusCode());\n\n\t\ttest.log(LogStatus.INFO, \"My Test Has been ended \");\n\n\t}",
"@Override\r\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\r\n\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Test(timeout = 4000)\n public void test256() throws Throwable {\n Form form0 = new Form(\"w\");\n FileInput fileInput0 = new FileInput(form0, \"w\", \"w\");\n // Undeclared exception!\n try { \n fileInput0.strong((Object) \"w\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(priority = 1, dependsOnMethods = { \"testAttachFileWithMandatoryParameters\" },\n description = \"podio {attachFile} integration test with negative case.\")\n public void testAttachFileWithNegativeCase() throws IOException, JSONException, InterruptedException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:attachFile\");\n \n Thread.sleep(timeOut);\n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_attachFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid/attach\";\n \n RestResponse<JSONObject> apiRestResponse =\n sendJsonRestRequest(apiEndPoint, \"POST\", apiRequestHeadersMap, \"api_attachFile_negative.json\");\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"@Test\n public void filesAbortTest() throws ApiException {\n String owner = null;\n String repo = null;\n String identifier = null;\n FilesAbort data = null;\n api.filesAbort(owner, repo, identifier, data);\n\n // TODO: test validations\n }",
"private void printDetails(FileDTO file) {\n\t\tif (file == null) {\n\t\t\tsafePrintln(\"The file could not be retrieved or does not exist!\");\n\t\t} else {\n\t\t\tsafePrintln(file.getName() + \"|\" + file.getPermission() + \"|\" + file.getSize().toString() + \" - \"\n\t\t\t\t\t+ file.getOwnerName());\n\t\t}\n\t}",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Test (expected = IllegalArgumentException.class)\r\n\tpublic void testInvalidConsultPatientFile() {\r\n\t\tsessionController.login(testC1Doctor1, getCampus(0));\r\n\t\tdoctorController.consultPatientFile(null);\r\n\t}",
"public interface AbstractC17167a {\n void onErrorIOFailure(Exception exc, File file, String str);\n }",
"@Test(expected = SystemObjectIdException.class)\n public void shouldThrowExceptionIfFailToGetVariable() throws IOException {\n\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n replayAll();\n\n try {\n session.identifyDevice();\n assert false : \"Should not reach\";\n } finally {\n verifyAll();\n }\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"public String getFaultCode() {\n return faultCode;\n }",
"public completeFile_result(completeFile_result other) {\n if (other.isSetSuccess()) {\n this.success = new CompleteFileTResponse(other.success);\n }\n if (other.isSetE()) {\n this.e = new alluxio.thrift.AlluxioTException(other.e);\n }\n }",
"private void resourceFailure(ReaderFailureMode mode) throws IOException {\n //Given - multiple resources\n PalisadeRecordReader<String> prr = new PalisadeRecordReader<>();\n //add more data which should succeed\n List<String> returnResources2 = Arrays.asList(\"s5\", \"s6\", \"s7\", \"s8\");\n DataRequestResponse response = new DataRequestResponse().token(\"test\")\n //set up some data which should return an error\n .resource(new StubResource(\"type_a\", \"id1\", \"format1\"),\n new StubConnectionDetail(\"con1\").setServiceToCreate(createMockDS(Collections.emptyList(), true)))\n .resource(new StubResource(\"type_b\", \"id2\", \"format2\"),\n new StubConnectionDetail(\"con2\").setServiceToCreate(createMockDS(returnResources2, false)));\n response.originalRequestId(new RequestId().id(\"test\"));\n //When\n PalisadeInputSplit split = new PalisadeInputSplit(response);\n PalisadeInputFormat.setResourceErrorBehaviour(con, mode);\n prr.initialize(split, con);\n //Then\n readValuesAndValidate(returnResources2.stream(), prr);\n verifyMocksCalled(response);\n }",
"@Override\r\n public String getMessage() {\r\n return ErrorMessage.STATUS_FORMATTING_IN_FILE_ERROR;\r\n }",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e,\n \t\t\tObject state) {\n \n \t}",
"private void checkFile() {\n \ttry {\n \t\tdata = new BufferedReader(\n \t\t\t\t new FileReader(textFile));\n \t\t\n \t}\n \tcatch(FileNotFoundException e)\n \t{\n \t\tSystem.out.println(\"The mentioned File is not found.\");\n System.out.println(\"\");\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"The following error occured while reading the file.\");\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(2);\n\t\t}\n }",
"public void readFile() throws Exception, FileNotFoundException, NumberFormatException, MalformedParameterizedTypeException {\n // my user or my file might be kind of crazy! -> will check for these exceptions!\n }",
"XfvhdlAntecedentMemFiles() {\r\n \t error = new XfvhdlError();\r\n \t }",
"@Test\n public void test051() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"<\", \"<\");\n // Undeclared exception!\n try {\n Component component0 = fileInput0.sub();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"private void showInformationAboutBrokenFile(Shell shell) {\n\t\tMessageDialog\n \t.openInformation(\n \t\t shell, \n \t\t \"Info\",\n \t\t \"There was error during test cases generation, make sure selected file is correct!\");\n\t}",
"public String getFailDetail(String response) {\n\n\t\tString detailReason=\"Reason\";\n\t\tPattern pattern = Pattern.compile(FAULT_MESSAGE);\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tdetailReason= (match.group(1));\n\t\t}\n\t\treturn detailReason;\t\n\t}",
"public static UriSchemaUtils.UtilFile getFile(Context param0, Uri param1, String param2) throws IOException {\n }",
"@Test\n public void shouldThrow400ExceptionWhenNoUuidPassed() {\n try {\n EomFile eomFile = Mockito.mock(EomFile.class);\n postContentToTransformResource.map(eomFile, IS_PREVIEW_TRUE, null /*, httpHeaders*/);\n fail(\"No exception was thrown, but expected one.\");\n } catch (WebApplicationClientException wace) {\n assertThat(\n ((ErrorEntity) wace.getResponse().getEntity()).getMessage(),\n equalTo(PostContentToTransformResource.ErrorMessage.UUID_REQUIRED.toString()));\n assertThat(wace.getResponse().getStatus(), equalTo(HttpStatus.SC_BAD_REQUEST));\n }\n }",
"public FileNotFoundException(String message) {\n super(message);\n }",
"@Test(expected=RuntimeException.class)\n public void missingPartOfHeader(){\n Header h;\n SimpleReader sr = new SimpleReader();\n String fileForLexer = sr.FileToString(\"sample_abc/invalid_for_testing.abc\");\n abcLexer lex = new abcLexer(fileForLexer);\n abcParser parser = new abcParser(lex);\n h=parser.parseHeader();}",
"public void testNonExistentFile() {\n TestWARCBatchJob job = new TestWARCBatchJob();\n boolean success =\n job.processFile(NON_EXISTENT_FILE, new ByteArrayOutputStream());\n assertEquals(\"Should record exactly one exception\",\n job.getExceptionArray().length, 1);\n assertFalse(\"Should fail on missing file\", success);\n }",
"@Test\n void test() throws Exception {\n File file = new File(\"test-data/diagram/test.vsdx\");\n\n try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) {\n handleFile(stream, file.getPath());\n }\n\n handleExtracting(file);\n }",
"void mo45684a(DownloadInfo cVar, BaseException aVar, int i) throws RemoteException;",
"RequestDetail getRequestDetail(String requestId) throws SAXException, IOException;",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public void testTraceFile02() {\n \n \t\tfinal File traceFile = OSGiTestsActivator.getContext().getDataFile(getName() + \".trace\"); //$NON-NLS-1$\n \t\tTestDebugTrace debugTrace = this.createDebugTrace(traceFile);\n \t\tTraceEntry[] traceOutput = null;\n \t\tfinal String exceptionMessage1 = \"An error 1\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage2 = \"An error 2\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage3 = \"An error 3\"; //$NON-NLS-1$\n \t\ttry {\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 1\", new Exception(exceptionMessage1)); //$NON-NLS-1$ //$NON-NLS-2$ \n \t\t\tdebugTrace.trace(\"/notset\", \"testing 2\", new Exception(exceptionMessage2)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 3\", new Exception(exceptionMessage3)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\ttraceOutput = readTraceFile(traceFile); // Note: this call will also delete the trace file\n \t\t} catch (InvalidTraceEntry invalidEx) {\n \t\t\tfail(\"Failed 'DebugTrace.trace(option, message, Throwable)' test as an invalid trace entry was found. Actual Value: '\" + invalidEx.getActualValue() + \"'.\", invalidEx); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t}\n \n \t\tfinal StringBuffer expectedThrowableText1 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText1.append(exceptionMessage1);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText1.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Wrong number of trace entries\", 2, traceOutput.length); //$NON-NLS-1$\n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[0].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[0].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[0].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[0].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[0].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 1\", traceOutput[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[0].getThrowableText().startsWith(expectedThrowableText1.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText1.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[0].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tassertEquals(\"Wrong number of trace entries for trace without an exception\", 2, traceOutput.length); //$NON-NLS-1$\n \n \t\tfinal StringBuffer expectedThrowableText2 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText2.append(exceptionMessage3);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText2.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[1].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[1].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[1].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[1].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[1].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 3\", traceOutput[1].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[1].getThrowableText().startsWith(expectedThrowableText2.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText2.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[1].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\t// delete the trace file\n \t\ttraceFile.delete();\n \t}",
"@Test\r\n public void testUnshare() {\n System.out.println(\"Test : John shares his file with Jane. Jane shares John's file with Harry. John unshares his file with Harry. Harry \" +\r\n \"cannot read John's file\");\r\n String userId = \"John\";\r\n String filePath = \"/home/John/shared/Jof1.txt\";\r\n String targetUserId = \"Jane\";\r\n String fileName = \"Jof1.txt\";\r\n File file = new File (filePath, userId, fileName);\r\n List<File> fileList = FileList.getFileList();\r\n fileList.add(file);\r\n service.shareFile(userId, targetUserId, filePath);\r\n try {\r\n assertNotNull(service.readFile(targetUserId, filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n\r\n service.shareFile(targetUserId, \"Harry\", filePath);\r\n try {\r\n assertNotNull(service.readFile(\"Harry\", filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n System.out.println();\r\n service.unshareFile(userId, \"Harry\", filePath);\r\n try {\r\n service.readFile(\"Harry\", filePath);\r\n } catch (UnauthorizedException e) {\r\n assertTrue(e instanceof UnauthorizedException);\r\n return;\r\n } catch (Throwable t){\r\n assertFalse(\"Other exception caught\", true);\r\n t.printStackTrace();\r\n }\r\n }",
"@Override\n\tpublic byte[] fetchFile(String fileName) throws RemoteException {\n return null;\n\n\t}",
"public void handleOpenFile (FileSpec fileSpec) {\n this.fileSpec = fileSpec;\n openFile (fileSpec.getFile());\n }",
"@Override\r\n\tpublic InputStream getFile(String filepath) throws FileSystemUtilException {\r\n\t\t\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\t\r\n\r\n\t}",
"@Override\n public Status getStatus() throws IOException;",
"private void checkFileStatus() throws CustomException, IOException\n\t{\n\t\t//For all .mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\n\t\t\tString resultFileName = \n\t\t\t\t\tmgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf(\".\"))+\"_Results.csv\";\n\t\t\t//TODO: Cannot write files if checking for file. \n\t\t\t/*\n\t\t\tif (isFileUnlocked(resultFileName))\n\t\t\t\tthrow new CustomException(\"Please close \"+resultFileName, null);\n\t\t\t */\n\t\t}\n\n\t}",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\tLog.d(\"arvi\", \"arvi3333\");\n\t\t}",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"@Override protected void failed(Throwable e) {\n logger.log(Level.WARNING, \"couldn't load \" + getFile(), e);\n String msg = getResourceMap().getString(\"loadFailedMessage\", getFile());\n String title = getResourceMap().getString(\"loadFailedTitle\");\n int type = JOptionPane.ERROR_MESSAGE;\n JOptionPane.showMessageDialog(app.getFrame().getFrame(), msg, title, type);\n }",
"@Test(timeout = 4000)\n public void test01() throws Throwable {\n Player player0 = new Player(4, \"\", \"\", (-437));\n player0.getPictureId();\n player0.pack();\n player0.getY();\n player0.getY();\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(\"Mv7j!OO(]HEQ2&@+n\");\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public FileFormatException() {\r\n super();\r\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"@Override\n public void onTransferIOError(TransferDiskIOErrorAlert alert) {\n }",
"public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }",
"@Test\n public void invokePathHandlerOnExistingResource2() {\n ctx.param(ParamNames.PATH, \"foo/bar.txt\");\n pathHandler.handle(ctx);\n ByteArrayOutputStream baos = (ByteArrayOutputStream)resp.outputStream();\n String s = new String(baos.toByteArray());\n ceq(\"foo/bar.txt\", s);\n }",
"public static void testResourceFile() {\n\t\tArrayList l = new ArrayList();\n\t\tl.add(\"http://www.google.it\");\n\t\tl.add(\"http://www.microsoft.com\");\n\t\t/*\n\t\tDownloader d = new Downloader(1);\n\t\tlogger\n\t\t\t\t.log(\n\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\"TEST ResourceFile implementation. Url downloaded will be temporary saved to system temp directory.\");\n\n\t\t// Listener\n\t\td.addListener(new DebugListener());\n\n\t\td.setFollowRedirect(true);\n\t\td.setMaxSize(2000);\n\t\td.addURLs(l);\n\t\td.start();\n\t\td.waitDone();\n\n\t\t// Derby DBMS should be shutdown every times application goes down\n\t\tDerbyLinkQueueDB.shutdown();\n\t\t*/\n\t}",
"public void onFileFolderOpenFailed(File file);",
"public void readTheFile() {\n \t\terrorMap.clear();\n \n \t\tBufferedReader br;\n \t\tString nextLine;\n \t\tString[] header = null;\n \t\tArrayList<String> lines = new ArrayList<String>();\n \t\ttry {\n \t\t\tlogger.debug(\"{} loading file: {} \", getName(), RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath());\n \n \t\t\tbr = new BufferedReader(new FileReader(RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath()));\n \t\t\twhile (((nextLine = br.readLine()) != null) && (nextLine.length() > 0)) {\n \t\t\t\tif (nextLine.startsWith(\"Code\")) {\n \t\t\t\t\theader = nextLine.split(\"[, \\t][, \\t]*\");\n \t\t\t\t} else if (!nextLine.startsWith(\"#\"))\n \t\t\t\t\tlines.add(nextLine);\n \t\t\t}\n \t\t\tbr.close();\n \t\t} catch (FileNotFoundException fnfe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.warn(\"caused by \" + fnfe.getMessage(), fnfe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t} catch (IOException ioe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.error(\"caused by \" + ioe.getMessage(), ioe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t}\n \n \t\tnumberOfRows = lines.size();\n \t\tlogger.debug(\"the file contained \" + numberOfRows + \" lines\");\n \t\tint nColumns = new StringTokenizer(lines.get(0), \"\\t\").countTokens();\n \t\tlogger.debug(\"each line should contain \" + nColumns + \" numbers\");\n \t\tkeys = new ArrayList<String>();\n \t\tif (header != null) {\n \t\t\tfor (int i = 1; i < nColumns; i++) {\n \t\t\t\terrorMap.put(header[0], header[i]);\n \t\t\t}\n \t\t\tkeys.add(header[0]);\n \t\t}\n \n \t\tfor (int i = 0; i < numberOfRows; i++) {\n \t\t\tnextLine = lines.get(i);\n \t\t\tString[] thisLine = nextLine.split(\"[\\t][\\t]*\");\n \t\t\tfor (int j = 0; j < thisLine.length; j++)\n \t\t\t\terrorMap.put(thisLine[0], thisLine[j]);\n \t\t\tkeys.add(thisLine[0]);\n \t\t}\n \t}",
"@Override\n\tpublic void fileDeliveryServiceError(int arg0, String arg1, Integer arg2) {\n\t\t\n\t}",
"@Test\n public void testCorrupt0LengthHFile() throws IOException {\n Path f = new Path(TestHFile.ROOT_DIR, testName.getMethodName());\n FSDataOutputStream fsos = TestHFile.fs.create(f);\n fsos.close();\n try {\n Reader r = HFile.createReader(TestHFile.fs, f, TestHFile.cacheConf, true, TestHFile.conf);\n } catch (CorruptHFileException che) {\n // Expected failure\n return;\n }\n Assert.fail(\"Should have thrown exception\");\n }",
"boolean hasRetrieveFileResponse();",
"@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }"
] | [
"0.6571318",
"0.58333874",
"0.5803207",
"0.57096803",
"0.55385387",
"0.55325675",
"0.55314606",
"0.55004245",
"0.5499129",
"0.5493624",
"0.5457347",
"0.5416177",
"0.5410847",
"0.5402986",
"0.53646696",
"0.5279853",
"0.5244353",
"0.52365345",
"0.5186679",
"0.5183676",
"0.51619494",
"0.5115241",
"0.51030767",
"0.50768787",
"0.5068341",
"0.5049006",
"0.50146896",
"0.5009032",
"0.49994498",
"0.49882954",
"0.49678537",
"0.49650005",
"0.49464226",
"0.49440455",
"0.49325967",
"0.49245998",
"0.49238542",
"0.49194184",
"0.491491",
"0.49143887",
"0.4900948",
"0.48966333",
"0.4891215",
"0.48687166",
"0.48669314",
"0.48425686",
"0.48386523",
"0.48358777",
"0.48342782",
"0.48327634",
"0.48297974",
"0.48286915",
"0.48264062",
"0.48227355",
"0.48201066",
"0.48200938",
"0.48070148",
"0.48014855",
"0.47978514",
"0.47973397",
"0.47825283",
"0.47812277",
"0.47798023",
"0.47758973",
"0.47673687",
"0.47643587",
"0.47642228",
"0.47607344",
"0.47578782",
"0.47545415",
"0.47521767",
"0.4751739",
"0.47507188",
"0.47488528",
"0.47452387",
"0.4745129",
"0.47374466",
"0.4731948",
"0.4724527",
"0.47238383",
"0.4717512",
"0.4717135",
"0.4716542",
"0.4716406",
"0.47163728",
"0.47031325",
"0.46991628",
"0.4694119",
"0.46914205",
"0.46863502",
"0.4685806",
"0.4685134",
"0.46843046",
"0.46839055",
"0.4683753",
"0.46708533",
"0.46700314",
"0.4668377",
"0.46628273",
"0.46567684"
] | 0.5427529 | 11 |
Expect fault detail from file resource. | public AssertSoapFaultBuilder faultDetailResource(Resource resource, Charset charset) {
try {
action.getFaultDetails().add(FileUtils.readToString(resource, charset));
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to read fault detail resource", e);
}
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public FileWithFaultLocations getFile(final String file);",
"void fileReceiveFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"public void errorFileEscenario() {\n\t\tvisorEscenario.errorFileEscenario();\t\n\t}",
"void fileTransferFailed(IMSession session, String requestId, ReasonInfo reason);",
"@Override\n\tpublic FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\t\tSystem.out.println(\"Error Accessing File\"+file.toAbsolutePath());\n\t\tSystem.out.println(exc.getLocalizedMessage());\n\t\t\n\t\t\n\t\t\n\t\treturn super.visitFileFailed(file, exc);\n\t}",
"boolean getFileErr();",
"@Override\n\t\t\tpublic void onFailure(int arg0, Header[] arg1, Throwable arg2, File arg3) {\n\t\t\t\t\n\t\t\t}",
"public List<FileWithFaultLocations> getFaultyFiles();",
"private static void runAndThrow(final String file) {\n String input = readResource(\"failure_\" + file + \".json\", QueryChunkResponseParserTest.class);\n // At the moment the query chunk response parser does not care about the http status code and only\n // prints it as part of the error context, so we can pick whatever we want here.\n HttpResponse header = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);\n throw QueryChunkResponseParser.errorsToThrowable(input.getBytes(StandardCharsets.UTF_8), header, null);\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"@Test\n public void testFileOpen() {\n \n FileHandler fileToTest;\n \n fileToTest = new FileHandler(\"Kalle.xml\");\n \n try {\n fileToTest.openFile();\n fail(\"Should have raised a fileNotFoundException\");\n }\n catch (FileNotFoundException fnf) {\n }\n }",
"public void addFile(FileWithFaultLocations faultLocationsFile) throws UnsupportedOperationException;",
"void fileSendFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public static void printReadFileIdentificationError() {\n System.out.println(Message.READ_FILE_IDENTIFICATION_ERROR);\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"@Test(timeout = 4000)\n public void test009() throws Throwable {\n try { \n DBUtil.runScript(\"\", \"\", (Connection) null, false, (ErrorHandler) null);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(FileNotFoundException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public VuFaultRecord(final @NonNull DataInputStream dis) throws IOException {\n\t\tsuper();\n\n\t\tthis.faultType = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultRecordPurpose = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultBeginTime = CardBlockUtil.getDate(dis);\n\t\tthis.faultEndTime = CardBlockUtil.getDate(dis);\n\t\tthis.cardNumberDriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberDriverSlotEnd = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotEnd = new CardNumber(dis);\n\t}",
"String getFaultStringValue();",
"@Override\n\tprotected String getFileArress() {\n\t\treturn fileAddress;\n\t}",
"default public FaultLocations getFaultLocations(final String file) {\n \tif (hasFile(file)) {\n \t\treturn getFile(file).getFaultLocations();\n \t} else {\n \t\treturn null;\n \t}\n }",
"public String getFaultString() {\n return faultString;\n }",
"public void corruptedFileErrorMessage() {\n System.out.println(\"The file (\" + INVENTORY_FILE_PATH + \") is corrupted!\\n\"\n + \"Please exit the program and delete the corrupted file before trying to access Inventory Menu!\");\n }",
"String getFaultReasonValue();",
"@Test(priority = 1, dependsOnMethods = { \"testGetFileWithMandatoryParameters\" },\n description = \"podio {getFile} integration test with negative case.\")\n public void testGetFileWithNegativeCase() throws IOException, JSONException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:getFile\");\n \n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_getFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid\";\n \n RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, \"GET\", apiRequestHeadersMap);\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"abstract String getFileRoute() throws IOException;",
"String getFaultActor();",
"protected abstract E readFile() throws Exception;",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"@ExceptionHandler(value=FileNotFound.class)\n\tpublic void resolveException(String ex,HttpServletResponse response) {\n\t\ttry {\n\t\t\tresponse.getOutputStream().println(\"Warning: File vuoto\\nException message: \"+ex);\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t}\n\t}",
"void readFaultyRecipientsTest() {\n Assertions.assertThrows(RuntimeException.class,\n () -> Reader.readRecipients(Paths.get(\"src/test/resources/faulty_recipients.txt\")));\n }",
"public TestResult(File file)\n throws ResultFileNotFoundFault, ReloadFault {\n resultsFile = file;\n reload();\n\n testURL = desc.getRootRelativeURL();\n\n execStatus = Status.parse(PropertyArray.get(props, EXEC_STATUS));\n }",
"@Test(timeout = 4000)\n public void test369() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"J]'z8)\", \"J]'z8)\");\n // Undeclared exception!\n try { \n fileInput0.dfn((Object) \"J]'z8)\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(expected = GenieServerException.class)\n public void testGetFileMethodFailureToFetch() throws GenieException {\n Mockito.when(this.s3Client.getObject(Mockito.any(GetObjectRequest.class), Mockito.any(File.class))).thenThrow(new AmazonS3Exception(\"something\"));\n final ArgumentCaptor<GetObjectRequest> argument = ArgumentCaptor.forClass(GetObjectRequest.class);\n try {\n this.s3FileTransfer.getFile(S3FileTransferImplUnitTests.S3_PATH, S3FileTransferImplUnitTests.LOCAL_PATH);\n } finally {\n Mockito.verify(this.s3Client).getObject(argument.capture(), Mockito.any());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_BUCKET, argument.getValue().getBucketName());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_KEY, argument.getValue().getKey());\n Mockito.verify(this.downloadTimer, Mockito.times(1)).record(Mockito.anyLong(), Mockito.eq(TimeUnit.NANOSECONDS));\n Mockito.verify(this.registry, Mockito.times(1)).timer(Mockito.eq(DOWNLOAD_TIMER_NAME), this.tagsCaptor.capture());\n Assert.assertEquals(MetricsUtils.newFailureTagsSetForException(new GenieServerException(\"blah\")), this.tagsCaptor.getValue());\n }\n }",
"@Test\n\tpublic void testGetCorrectParamMatchingPii() {\n\t\tFile f = new File(FILE_DIR + FILE_NAME);\n\t\tfinal String owner = \"1\";\n\t\twhen(mPiiService.getPiiFile((long) 123456789, owner)).thenReturn(f);\n\t\t\n\t\tResponse response = piiController.getPii((long) 123456789, owner);\n\t\t\n\t\tverify(mPiiService).getPiiFile((long) 123456789, owner);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\t\n\t\tassertEquals(200, response.getStatus());\n\t\tFile fileReturned = (File) response.getEntity();\n\t\tassertEquals(f, fileReturned);\n\t}",
"@Test\n public void file() throws UnsupportedEncodingException {\n String fileName = createFile(FILE_BODY, \"/file/create/in\");\n\n // Read the file\n RestAssured\n .get(\"/file/get/in/\" + Paths.get(fileName).getFileName())\n .then()\n .statusCode(200)\n .body(equalTo(FILE_BODY));\n }",
"String getFaultDetailValue();",
"@Test(timeout = 4000)\n public void test07() throws Throwable {\n int int0 = (-1220);\n Player player0 = new Player((-1220));\n player0.getMoney();\n byte[] byteArray0 = new byte[3];\n byteArray0[0] = (byte) (-40);\n MockFile mockFile0 = new MockFile(\"kSho(d)S;w\", \"\");\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(mockFile0);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"edu.usfca.cs.dfs.StorageMessages.RetrieveFileResponse getRetrieveFileResponse();",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"public void myMethod() throws FileNotFoundException {\n\t\ttry {\n\t\tsoccer = new FileInputStream(\"soccer.txt\");\n\t\t} catch (FileNotFoundException f) {//checked exception handled here\n//\t\t\tf.printStackTrace();\n\t\tSystem.out.println(\"file not found\");//throw fnfe; //this needs to be handled or declared\n\t\t}\n\t\t}",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"@Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }",
"@Test(timeout = 4000)\n public void test02() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n fileUtil0.downloadKeywordSearchFile(\"9\", \"9\", \"9\", \"9\");\n String string0 = \"\";\n fileUtil0.downloadBlendedSearchFile(\"\", \"9\");\n fileUtil0.isAgeGood((File) null);\n fileUtil0.fetchThirdPartySearchFile(\"9\", \"9\", \"9\", \"9\");\n String string1 = \"^m1KLI\\\\nb8]!B*(2\";\n String string2 = null;\n fileUtil0.downloadBrowseNodeFile(\"^m1KLI\\nb8]!B*(2\", \"9\", (String) null, \"<X;R[f!MO\");\n String string3 = \"-tT-6\";\n fileUtil0.fetchThirdPartySearchFile(\"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"-tT-6\");\n ArrayList<Object> arrayList0 = new ArrayList<Object>();\n Object object0 = new Object();\n Object object1 = new Object();\n arrayList0.add(object1);\n arrayList0.add(object0);\n fileUtil0.downloadAccessoriesFile(\"9\", arrayList0, \"\");\n String string4 = \"associateID\";\n String string5 = null;\n // Undeclared exception!\n try { \n fileUtil0.renameFile(\"associateID\", (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.File\", e);\n }\n }",
"private void testReadFile() {\n System.out.println(\"------ TESTING : readFile(String filename) ------\");\n try{\n if(iTestFileList.readFile(sFile)){\n //throw exception if the values are not copied correctly\n if(iTestFileList.get(0) != 42175){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(5) != 45545){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(10) != 86908) {\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }\n else{\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n System.out.print(\"\\n\");\n }",
"@Test(priority = 4)\n\tpublic void inValideFileType() throws JsonProcessingException {\n\n\t\ttest.log(LogStatus.INFO, \"My test is starting.....\");\n\t\tResponse resp=given()\n\t .contentType(\"multipart/form-data\")\n\t .multiPart(\"product_line\",\"testing\")\n\t .multiPart(\"file\", new File(\"./src/test/resources/statuscode.txt\"))\n\t .post(APIPath.apiPath.POST_VALID_PATH);\n\n\t\tresp.then().body(\"message\",equalTo(\"Invalide File Type.\"));\n\t\ttest.log(LogStatus.PASS, \"Invalide File Type\");\n\t\tAssert.assertEquals(resp.getStatusCode(),400);\n\t\ttest.log(LogStatus.PASS, \"Successfully validated status code expected 400 and Actual status code is :: \" + resp.getStatusCode());\n\n\t\ttest.log(LogStatus.INFO, \"My Test Has been ended \");\n\n\t}",
"@Override\r\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\r\n\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Test(timeout = 4000)\n public void test256() throws Throwable {\n Form form0 = new Form(\"w\");\n FileInput fileInput0 = new FileInput(form0, \"w\", \"w\");\n // Undeclared exception!\n try { \n fileInput0.strong((Object) \"w\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(priority = 1, dependsOnMethods = { \"testAttachFileWithMandatoryParameters\" },\n description = \"podio {attachFile} integration test with negative case.\")\n public void testAttachFileWithNegativeCase() throws IOException, JSONException, InterruptedException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:attachFile\");\n \n Thread.sleep(timeOut);\n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_attachFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid/attach\";\n \n RestResponse<JSONObject> apiRestResponse =\n sendJsonRestRequest(apiEndPoint, \"POST\", apiRequestHeadersMap, \"api_attachFile_negative.json\");\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"@Test\n public void filesAbortTest() throws ApiException {\n String owner = null;\n String repo = null;\n String identifier = null;\n FilesAbort data = null;\n api.filesAbort(owner, repo, identifier, data);\n\n // TODO: test validations\n }",
"private void printDetails(FileDTO file) {\n\t\tif (file == null) {\n\t\t\tsafePrintln(\"The file could not be retrieved or does not exist!\");\n\t\t} else {\n\t\t\tsafePrintln(file.getName() + \"|\" + file.getPermission() + \"|\" + file.getSize().toString() + \" - \"\n\t\t\t\t\t+ file.getOwnerName());\n\t\t}\n\t}",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Test (expected = IllegalArgumentException.class)\r\n\tpublic void testInvalidConsultPatientFile() {\r\n\t\tsessionController.login(testC1Doctor1, getCampus(0));\r\n\t\tdoctorController.consultPatientFile(null);\r\n\t}",
"public interface AbstractC17167a {\n void onErrorIOFailure(Exception exc, File file, String str);\n }",
"@Test(expected = SystemObjectIdException.class)\n public void shouldThrowExceptionIfFailToGetVariable() throws IOException {\n\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n replayAll();\n\n try {\n session.identifyDevice();\n assert false : \"Should not reach\";\n } finally {\n verifyAll();\n }\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"public String getFaultCode() {\n return faultCode;\n }",
"public completeFile_result(completeFile_result other) {\n if (other.isSetSuccess()) {\n this.success = new CompleteFileTResponse(other.success);\n }\n if (other.isSetE()) {\n this.e = new alluxio.thrift.AlluxioTException(other.e);\n }\n }",
"private void resourceFailure(ReaderFailureMode mode) throws IOException {\n //Given - multiple resources\n PalisadeRecordReader<String> prr = new PalisadeRecordReader<>();\n //add more data which should succeed\n List<String> returnResources2 = Arrays.asList(\"s5\", \"s6\", \"s7\", \"s8\");\n DataRequestResponse response = new DataRequestResponse().token(\"test\")\n //set up some data which should return an error\n .resource(new StubResource(\"type_a\", \"id1\", \"format1\"),\n new StubConnectionDetail(\"con1\").setServiceToCreate(createMockDS(Collections.emptyList(), true)))\n .resource(new StubResource(\"type_b\", \"id2\", \"format2\"),\n new StubConnectionDetail(\"con2\").setServiceToCreate(createMockDS(returnResources2, false)));\n response.originalRequestId(new RequestId().id(\"test\"));\n //When\n PalisadeInputSplit split = new PalisadeInputSplit(response);\n PalisadeInputFormat.setResourceErrorBehaviour(con, mode);\n prr.initialize(split, con);\n //Then\n readValuesAndValidate(returnResources2.stream(), prr);\n verifyMocksCalled(response);\n }",
"@Override\r\n public String getMessage() {\r\n return ErrorMessage.STATUS_FORMATTING_IN_FILE_ERROR;\r\n }",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e,\n \t\t\tObject state) {\n \n \t}",
"private void checkFile() {\n \ttry {\n \t\tdata = new BufferedReader(\n \t\t\t\t new FileReader(textFile));\n \t\t\n \t}\n \tcatch(FileNotFoundException e)\n \t{\n \t\tSystem.out.println(\"The mentioned File is not found.\");\n System.out.println(\"\");\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"The following error occured while reading the file.\");\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(2);\n\t\t}\n }",
"public void readFile() throws Exception, FileNotFoundException, NumberFormatException, MalformedParameterizedTypeException {\n // my user or my file might be kind of crazy! -> will check for these exceptions!\n }",
"XfvhdlAntecedentMemFiles() {\r\n \t error = new XfvhdlError();\r\n \t }",
"@Test\n public void test051() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"<\", \"<\");\n // Undeclared exception!\n try {\n Component component0 = fileInput0.sub();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"private void showInformationAboutBrokenFile(Shell shell) {\n\t\tMessageDialog\n \t.openInformation(\n \t\t shell, \n \t\t \"Info\",\n \t\t \"There was error during test cases generation, make sure selected file is correct!\");\n\t}",
"public String getFailDetail(String response) {\n\n\t\tString detailReason=\"Reason\";\n\t\tPattern pattern = Pattern.compile(FAULT_MESSAGE);\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tdetailReason= (match.group(1));\n\t\t}\n\t\treturn detailReason;\t\n\t}",
"public static UriSchemaUtils.UtilFile getFile(Context param0, Uri param1, String param2) throws IOException {\n }",
"@Test\n public void shouldThrow400ExceptionWhenNoUuidPassed() {\n try {\n EomFile eomFile = Mockito.mock(EomFile.class);\n postContentToTransformResource.map(eomFile, IS_PREVIEW_TRUE, null /*, httpHeaders*/);\n fail(\"No exception was thrown, but expected one.\");\n } catch (WebApplicationClientException wace) {\n assertThat(\n ((ErrorEntity) wace.getResponse().getEntity()).getMessage(),\n equalTo(PostContentToTransformResource.ErrorMessage.UUID_REQUIRED.toString()));\n assertThat(wace.getResponse().getStatus(), equalTo(HttpStatus.SC_BAD_REQUEST));\n }\n }",
"public FileNotFoundException(String message) {\n super(message);\n }",
"@Test(expected=RuntimeException.class)\n public void missingPartOfHeader(){\n Header h;\n SimpleReader sr = new SimpleReader();\n String fileForLexer = sr.FileToString(\"sample_abc/invalid_for_testing.abc\");\n abcLexer lex = new abcLexer(fileForLexer);\n abcParser parser = new abcParser(lex);\n h=parser.parseHeader();}",
"public void testNonExistentFile() {\n TestWARCBatchJob job = new TestWARCBatchJob();\n boolean success =\n job.processFile(NON_EXISTENT_FILE, new ByteArrayOutputStream());\n assertEquals(\"Should record exactly one exception\",\n job.getExceptionArray().length, 1);\n assertFalse(\"Should fail on missing file\", success);\n }",
"@Test\n void test() throws Exception {\n File file = new File(\"test-data/diagram/test.vsdx\");\n\n try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) {\n handleFile(stream, file.getPath());\n }\n\n handleExtracting(file);\n }",
"void mo45684a(DownloadInfo cVar, BaseException aVar, int i) throws RemoteException;",
"RequestDetail getRequestDetail(String requestId) throws SAXException, IOException;",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public void testTraceFile02() {\n \n \t\tfinal File traceFile = OSGiTestsActivator.getContext().getDataFile(getName() + \".trace\"); //$NON-NLS-1$\n \t\tTestDebugTrace debugTrace = this.createDebugTrace(traceFile);\n \t\tTraceEntry[] traceOutput = null;\n \t\tfinal String exceptionMessage1 = \"An error 1\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage2 = \"An error 2\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage3 = \"An error 3\"; //$NON-NLS-1$\n \t\ttry {\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 1\", new Exception(exceptionMessage1)); //$NON-NLS-1$ //$NON-NLS-2$ \n \t\t\tdebugTrace.trace(\"/notset\", \"testing 2\", new Exception(exceptionMessage2)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 3\", new Exception(exceptionMessage3)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\ttraceOutput = readTraceFile(traceFile); // Note: this call will also delete the trace file\n \t\t} catch (InvalidTraceEntry invalidEx) {\n \t\t\tfail(\"Failed 'DebugTrace.trace(option, message, Throwable)' test as an invalid trace entry was found. Actual Value: '\" + invalidEx.getActualValue() + \"'.\", invalidEx); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t}\n \n \t\tfinal StringBuffer expectedThrowableText1 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText1.append(exceptionMessage1);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText1.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Wrong number of trace entries\", 2, traceOutput.length); //$NON-NLS-1$\n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[0].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[0].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[0].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[0].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[0].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 1\", traceOutput[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[0].getThrowableText().startsWith(expectedThrowableText1.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText1.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[0].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tassertEquals(\"Wrong number of trace entries for trace without an exception\", 2, traceOutput.length); //$NON-NLS-1$\n \n \t\tfinal StringBuffer expectedThrowableText2 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText2.append(exceptionMessage3);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText2.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[1].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[1].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[1].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[1].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[1].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 3\", traceOutput[1].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[1].getThrowableText().startsWith(expectedThrowableText2.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText2.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[1].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\t// delete the trace file\n \t\ttraceFile.delete();\n \t}",
"@Test\r\n public void testUnshare() {\n System.out.println(\"Test : John shares his file with Jane. Jane shares John's file with Harry. John unshares his file with Harry. Harry \" +\r\n \"cannot read John's file\");\r\n String userId = \"John\";\r\n String filePath = \"/home/John/shared/Jof1.txt\";\r\n String targetUserId = \"Jane\";\r\n String fileName = \"Jof1.txt\";\r\n File file = new File (filePath, userId, fileName);\r\n List<File> fileList = FileList.getFileList();\r\n fileList.add(file);\r\n service.shareFile(userId, targetUserId, filePath);\r\n try {\r\n assertNotNull(service.readFile(targetUserId, filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n\r\n service.shareFile(targetUserId, \"Harry\", filePath);\r\n try {\r\n assertNotNull(service.readFile(\"Harry\", filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n System.out.println();\r\n service.unshareFile(userId, \"Harry\", filePath);\r\n try {\r\n service.readFile(\"Harry\", filePath);\r\n } catch (UnauthorizedException e) {\r\n assertTrue(e instanceof UnauthorizedException);\r\n return;\r\n } catch (Throwable t){\r\n assertFalse(\"Other exception caught\", true);\r\n t.printStackTrace();\r\n }\r\n }",
"@Override\n\tpublic byte[] fetchFile(String fileName) throws RemoteException {\n return null;\n\n\t}",
"public void handleOpenFile (FileSpec fileSpec) {\n this.fileSpec = fileSpec;\n openFile (fileSpec.getFile());\n }",
"@Override\r\n\tpublic InputStream getFile(String filepath) throws FileSystemUtilException {\r\n\t\t\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\t\r\n\r\n\t}",
"@Override\n public Status getStatus() throws IOException;",
"private void checkFileStatus() throws CustomException, IOException\n\t{\n\t\t//For all .mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\n\t\t\tString resultFileName = \n\t\t\t\t\tmgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf(\".\"))+\"_Results.csv\";\n\t\t\t//TODO: Cannot write files if checking for file. \n\t\t\t/*\n\t\t\tif (isFileUnlocked(resultFileName))\n\t\t\t\tthrow new CustomException(\"Please close \"+resultFileName, null);\n\t\t\t */\n\t\t}\n\n\t}",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\tLog.d(\"arvi\", \"arvi3333\");\n\t\t}",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"@Override protected void failed(Throwable e) {\n logger.log(Level.WARNING, \"couldn't load \" + getFile(), e);\n String msg = getResourceMap().getString(\"loadFailedMessage\", getFile());\n String title = getResourceMap().getString(\"loadFailedTitle\");\n int type = JOptionPane.ERROR_MESSAGE;\n JOptionPane.showMessageDialog(app.getFrame().getFrame(), msg, title, type);\n }",
"@Test(timeout = 4000)\n public void test01() throws Throwable {\n Player player0 = new Player(4, \"\", \"\", (-437));\n player0.getPictureId();\n player0.pack();\n player0.getY();\n player0.getY();\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(\"Mv7j!OO(]HEQ2&@+n\");\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public FileFormatException() {\r\n super();\r\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"@Override\n public void onTransferIOError(TransferDiskIOErrorAlert alert) {\n }",
"public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }",
"@Test\n public void invokePathHandlerOnExistingResource2() {\n ctx.param(ParamNames.PATH, \"foo/bar.txt\");\n pathHandler.handle(ctx);\n ByteArrayOutputStream baos = (ByteArrayOutputStream)resp.outputStream();\n String s = new String(baos.toByteArray());\n ceq(\"foo/bar.txt\", s);\n }",
"public static void testResourceFile() {\n\t\tArrayList l = new ArrayList();\n\t\tl.add(\"http://www.google.it\");\n\t\tl.add(\"http://www.microsoft.com\");\n\t\t/*\n\t\tDownloader d = new Downloader(1);\n\t\tlogger\n\t\t\t\t.log(\n\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\"TEST ResourceFile implementation. Url downloaded will be temporary saved to system temp directory.\");\n\n\t\t// Listener\n\t\td.addListener(new DebugListener());\n\n\t\td.setFollowRedirect(true);\n\t\td.setMaxSize(2000);\n\t\td.addURLs(l);\n\t\td.start();\n\t\td.waitDone();\n\n\t\t// Derby DBMS should be shutdown every times application goes down\n\t\tDerbyLinkQueueDB.shutdown();\n\t\t*/\n\t}",
"public void onFileFolderOpenFailed(File file);",
"public void readTheFile() {\n \t\terrorMap.clear();\n \n \t\tBufferedReader br;\n \t\tString nextLine;\n \t\tString[] header = null;\n \t\tArrayList<String> lines = new ArrayList<String>();\n \t\ttry {\n \t\t\tlogger.debug(\"{} loading file: {} \", getName(), RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath());\n \n \t\t\tbr = new BufferedReader(new FileReader(RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath()));\n \t\t\twhile (((nextLine = br.readLine()) != null) && (nextLine.length() > 0)) {\n \t\t\t\tif (nextLine.startsWith(\"Code\")) {\n \t\t\t\t\theader = nextLine.split(\"[, \\t][, \\t]*\");\n \t\t\t\t} else if (!nextLine.startsWith(\"#\"))\n \t\t\t\t\tlines.add(nextLine);\n \t\t\t}\n \t\t\tbr.close();\n \t\t} catch (FileNotFoundException fnfe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.warn(\"caused by \" + fnfe.getMessage(), fnfe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t} catch (IOException ioe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.error(\"caused by \" + ioe.getMessage(), ioe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t}\n \n \t\tnumberOfRows = lines.size();\n \t\tlogger.debug(\"the file contained \" + numberOfRows + \" lines\");\n \t\tint nColumns = new StringTokenizer(lines.get(0), \"\\t\").countTokens();\n \t\tlogger.debug(\"each line should contain \" + nColumns + \" numbers\");\n \t\tkeys = new ArrayList<String>();\n \t\tif (header != null) {\n \t\t\tfor (int i = 1; i < nColumns; i++) {\n \t\t\t\terrorMap.put(header[0], header[i]);\n \t\t\t}\n \t\t\tkeys.add(header[0]);\n \t\t}\n \n \t\tfor (int i = 0; i < numberOfRows; i++) {\n \t\t\tnextLine = lines.get(i);\n \t\t\tString[] thisLine = nextLine.split(\"[\\t][\\t]*\");\n \t\t\tfor (int j = 0; j < thisLine.length; j++)\n \t\t\t\terrorMap.put(thisLine[0], thisLine[j]);\n \t\t\tkeys.add(thisLine[0]);\n \t\t}\n \t}",
"@Override\n\tpublic void fileDeliveryServiceError(int arg0, String arg1, Integer arg2) {\n\t\t\n\t}",
"@Test\n public void testCorrupt0LengthHFile() throws IOException {\n Path f = new Path(TestHFile.ROOT_DIR, testName.getMethodName());\n FSDataOutputStream fsos = TestHFile.fs.create(f);\n fsos.close();\n try {\n Reader r = HFile.createReader(TestHFile.fs, f, TestHFile.cacheConf, true, TestHFile.conf);\n } catch (CorruptHFileException che) {\n // Expected failure\n return;\n }\n Assert.fail(\"Should have thrown exception\");\n }",
"boolean hasRetrieveFileResponse();",
"@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }"
] | [
"0.6571318",
"0.58333874",
"0.5803207",
"0.57096803",
"0.55385387",
"0.55314606",
"0.55004245",
"0.5499129",
"0.5493624",
"0.5457347",
"0.5427529",
"0.5416177",
"0.5410847",
"0.5402986",
"0.53646696",
"0.5279853",
"0.5244353",
"0.52365345",
"0.5186679",
"0.5183676",
"0.51619494",
"0.5115241",
"0.51030767",
"0.50768787",
"0.5068341",
"0.5049006",
"0.50146896",
"0.5009032",
"0.49994498",
"0.49882954",
"0.49678537",
"0.49650005",
"0.49464226",
"0.49440455",
"0.49325967",
"0.49245998",
"0.49238542",
"0.49194184",
"0.491491",
"0.49143887",
"0.4900948",
"0.48966333",
"0.4891215",
"0.48687166",
"0.48669314",
"0.48425686",
"0.48386523",
"0.48358777",
"0.48342782",
"0.48327634",
"0.48297974",
"0.48286915",
"0.48264062",
"0.48227355",
"0.48201066",
"0.48200938",
"0.48070148",
"0.48014855",
"0.47978514",
"0.47973397",
"0.47825283",
"0.47812277",
"0.47798023",
"0.47758973",
"0.47673687",
"0.47643587",
"0.47642228",
"0.47607344",
"0.47578782",
"0.47545415",
"0.47521767",
"0.4751739",
"0.47507188",
"0.47488528",
"0.47452387",
"0.4745129",
"0.47374466",
"0.4731948",
"0.4724527",
"0.47238383",
"0.4717512",
"0.4717135",
"0.4716542",
"0.4716406",
"0.47163728",
"0.47031325",
"0.46991628",
"0.4694119",
"0.46914205",
"0.46863502",
"0.4685806",
"0.4685134",
"0.46843046",
"0.46839055",
"0.4683753",
"0.46708533",
"0.46700314",
"0.4668377",
"0.46628273",
"0.46567684"
] | 0.55325675 | 5 |
Expect fault detail from file resource. | public AssertSoapFaultBuilder faultDetailResource(String filePath) {
action.getFaultDetailResourcePaths().add(filePath);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public FileWithFaultLocations getFile(final String file);",
"void fileReceiveFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public void errorFileEscenario() {\n\t\tvisorEscenario.errorFileEscenario();\t\n\t}",
"void fileTransferFailed(IMSession session, String requestId, ReasonInfo reason);",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource, Charset charset) {\n try {\n action.getFaultDetails().add(FileUtils.readToString(resource, charset));\n } catch (IOException e) {\n throw new CitrusRuntimeException(\"Failed to read fault detail resource\", e);\n }\n return this;\n }",
"@Override\n\tpublic FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\t\tSystem.out.println(\"Error Accessing File\"+file.toAbsolutePath());\n\t\tSystem.out.println(exc.getLocalizedMessage());\n\t\t\n\t\t\n\t\t\n\t\treturn super.visitFileFailed(file, exc);\n\t}",
"boolean getFileErr();",
"@Override\n\t\t\tpublic void onFailure(int arg0, Header[] arg1, Throwable arg2, File arg3) {\n\t\t\t\t\n\t\t\t}",
"public List<FileWithFaultLocations> getFaultyFiles();",
"private static void runAndThrow(final String file) {\n String input = readResource(\"failure_\" + file + \".json\", QueryChunkResponseParserTest.class);\n // At the moment the query chunk response parser does not care about the http status code and only\n // prints it as part of the error context, so we can pick whatever we want here.\n HttpResponse header = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST);\n throw QueryChunkResponseParser.errorsToThrowable(input.getBytes(StandardCharsets.UTF_8), header, null);\n }",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"@Test\n public void testFileOpen() {\n \n FileHandler fileToTest;\n \n fileToTest = new FileHandler(\"Kalle.xml\");\n \n try {\n fileToTest.openFile();\n fail(\"Should have raised a fileNotFoundException\");\n }\n catch (FileNotFoundException fnf) {\n }\n }",
"public void addFile(FileWithFaultLocations faultLocationsFile) throws UnsupportedOperationException;",
"void fileSendFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"public static void printReadFileIdentificationError() {\n System.out.println(Message.READ_FILE_IDENTIFICATION_ERROR);\n }",
"public void faultsFound(String description) {\n if (status == 8) {\n status = 9;\n this.faultDescription = description;\n } else if (status == 10) {\n status = 12;\n this.faultDescription = description;\n }//END IF/ELSE\n }",
"@Test(timeout = 4000)\n public void test009() throws Throwable {\n try { \n DBUtil.runScript(\"\", \"\", (Connection) null, false, (ErrorHandler) null);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(FileNotFoundException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public VuFaultRecord(final @NonNull DataInputStream dis) throws IOException {\n\t\tsuper();\n\n\t\tthis.faultType = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultRecordPurpose = CardBlockUtil.getInteger8(dis);\n\t\tthis.faultBeginTime = CardBlockUtil.getDate(dis);\n\t\tthis.faultEndTime = CardBlockUtil.getDate(dis);\n\t\tthis.cardNumberDriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotBegin = new CardNumber(dis);\n\t\tthis.cardNumberDriverSlotEnd = new CardNumber(dis);\n\t\tthis.cardNumberCodriverSlotEnd = new CardNumber(dis);\n\t}",
"String getFaultStringValue();",
"@Override\n\tprotected String getFileArress() {\n\t\treturn fileAddress;\n\t}",
"default public FaultLocations getFaultLocations(final String file) {\n \tif (hasFile(file)) {\n \t\treturn getFile(file).getFaultLocations();\n \t} else {\n \t\treturn null;\n \t}\n }",
"public String getFaultString() {\n return faultString;\n }",
"public void corruptedFileErrorMessage() {\n System.out.println(\"The file (\" + INVENTORY_FILE_PATH + \") is corrupted!\\n\"\n + \"Please exit the program and delete the corrupted file before trying to access Inventory Menu!\");\n }",
"String getFaultReasonValue();",
"@Test(priority = 1, dependsOnMethods = { \"testGetFileWithMandatoryParameters\" },\n description = \"podio {getFile} integration test with negative case.\")\n public void testGetFileWithNegativeCase() throws IOException, JSONException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:getFile\");\n \n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_getFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid\";\n \n RestResponse<JSONObject> apiRestResponse = sendJsonRestRequest(apiEndPoint, \"GET\", apiRequestHeadersMap);\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"abstract String getFileRoute() throws IOException;",
"String getFaultActor();",
"protected abstract E readFile() throws Exception;",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"@ExceptionHandler(value=FileNotFound.class)\n\tpublic void resolveException(String ex,HttpServletResponse response) {\n\t\ttry {\n\t\t\tresponse.getOutputStream().println(\"Warning: File vuoto\\nException message: \"+ex);\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t}\n\t}",
"void readFaultyRecipientsTest() {\n Assertions.assertThrows(RuntimeException.class,\n () -> Reader.readRecipients(Paths.get(\"src/test/resources/faulty_recipients.txt\")));\n }",
"public TestResult(File file)\n throws ResultFileNotFoundFault, ReloadFault {\n resultsFile = file;\n reload();\n\n testURL = desc.getRootRelativeURL();\n\n execStatus = Status.parse(PropertyArray.get(props, EXEC_STATUS));\n }",
"@Test(timeout = 4000)\n public void test369() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"J]'z8)\", \"J]'z8)\");\n // Undeclared exception!\n try { \n fileInput0.dfn((Object) \"J]'z8)\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(expected = GenieServerException.class)\n public void testGetFileMethodFailureToFetch() throws GenieException {\n Mockito.when(this.s3Client.getObject(Mockito.any(GetObjectRequest.class), Mockito.any(File.class))).thenThrow(new AmazonS3Exception(\"something\"));\n final ArgumentCaptor<GetObjectRequest> argument = ArgumentCaptor.forClass(GetObjectRequest.class);\n try {\n this.s3FileTransfer.getFile(S3FileTransferImplUnitTests.S3_PATH, S3FileTransferImplUnitTests.LOCAL_PATH);\n } finally {\n Mockito.verify(this.s3Client).getObject(argument.capture(), Mockito.any());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_BUCKET, argument.getValue().getBucketName());\n Assert.assertEquals(S3FileTransferImplUnitTests.S3_KEY, argument.getValue().getKey());\n Mockito.verify(this.downloadTimer, Mockito.times(1)).record(Mockito.anyLong(), Mockito.eq(TimeUnit.NANOSECONDS));\n Mockito.verify(this.registry, Mockito.times(1)).timer(Mockito.eq(DOWNLOAD_TIMER_NAME), this.tagsCaptor.capture());\n Assert.assertEquals(MetricsUtils.newFailureTagsSetForException(new GenieServerException(\"blah\")), this.tagsCaptor.getValue());\n }\n }",
"@Test\n\tpublic void testGetCorrectParamMatchingPii() {\n\t\tFile f = new File(FILE_DIR + FILE_NAME);\n\t\tfinal String owner = \"1\";\n\t\twhen(mPiiService.getPiiFile((long) 123456789, owner)).thenReturn(f);\n\t\t\n\t\tResponse response = piiController.getPii((long) 123456789, owner);\n\t\t\n\t\tverify(mPiiService).getPiiFile((long) 123456789, owner);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\t\n\t\tassertEquals(200, response.getStatus());\n\t\tFile fileReturned = (File) response.getEntity();\n\t\tassertEquals(f, fileReturned);\n\t}",
"@Test\n public void file() throws UnsupportedEncodingException {\n String fileName = createFile(FILE_BODY, \"/file/create/in\");\n\n // Read the file\n RestAssured\n .get(\"/file/get/in/\" + Paths.get(fileName).getFileName())\n .then()\n .statusCode(200)\n .body(equalTo(FILE_BODY));\n }",
"String getFaultDetailValue();",
"@Test(timeout = 4000)\n public void test07() throws Throwable {\n int int0 = (-1220);\n Player player0 = new Player((-1220));\n player0.getMoney();\n byte[] byteArray0 = new byte[3];\n byteArray0[0] = (byte) (-40);\n MockFile mockFile0 = new MockFile(\"kSho(d)S;w\", \"\");\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(mockFile0);\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"edu.usfca.cs.dfs.StorageMessages.RetrieveFileResponse getRetrieveFileResponse();",
"@Test\n void testGivenFaultyRequestWithFaultString_thenFail() throws Exception {\n URL u = new URL(\"http://localhost:8080/sentry-servlet/fault?fault=true\");\n HttpURLConnection conn = (HttpURLConnection)u.openConnection();\n int rc = conn.getResponseCode();\n assertThat(rc)\n .isEqualTo(500);\n }",
"public void myMethod() throws FileNotFoundException {\n\t\ttry {\n\t\tsoccer = new FileInputStream(\"soccer.txt\");\n\t\t} catch (FileNotFoundException f) {//checked exception handled here\n//\t\t\tf.printStackTrace();\n\t\tSystem.out.println(\"file not found\");//throw fnfe; //this needs to be handled or declared\n\t\t}\n\t\t}",
"public Object getFaultDetail() {\n\treturn this.faultDetail;\n }",
"@Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }",
"@Test(timeout = 4000)\n public void test02() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n fileUtil0.downloadKeywordSearchFile(\"9\", \"9\", \"9\", \"9\");\n String string0 = \"\";\n fileUtil0.downloadBlendedSearchFile(\"\", \"9\");\n fileUtil0.isAgeGood((File) null);\n fileUtil0.fetchThirdPartySearchFile(\"9\", \"9\", \"9\", \"9\");\n String string1 = \"^m1KLI\\\\nb8]!B*(2\";\n String string2 = null;\n fileUtil0.downloadBrowseNodeFile(\"^m1KLI\\nb8]!B*(2\", \"9\", (String) null, \"<X;R[f!MO\");\n String string3 = \"-tT-6\";\n fileUtil0.fetchThirdPartySearchFile(\"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"^m1KLI\\nb8]!B*(2\", \"-tT-6\");\n ArrayList<Object> arrayList0 = new ArrayList<Object>();\n Object object0 = new Object();\n Object object1 = new Object();\n arrayList0.add(object1);\n arrayList0.add(object0);\n fileUtil0.downloadAccessoriesFile(\"9\", arrayList0, \"\");\n String string4 = \"associateID\";\n String string5 = null;\n // Undeclared exception!\n try { \n fileUtil0.renameFile(\"associateID\", (String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.File\", e);\n }\n }",
"private void testReadFile() {\n System.out.println(\"------ TESTING : readFile(String filename) ------\");\n try{\n if(iTestFileList.readFile(sFile)){\n //throw exception if the values are not copied correctly\n if(iTestFileList.get(0) != 42175){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(5) != 45545){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(10) != 86908) {\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }\n else{\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n System.out.print(\"\\n\");\n }",
"@Test(priority = 4)\n\tpublic void inValideFileType() throws JsonProcessingException {\n\n\t\ttest.log(LogStatus.INFO, \"My test is starting.....\");\n\t\tResponse resp=given()\n\t .contentType(\"multipart/form-data\")\n\t .multiPart(\"product_line\",\"testing\")\n\t .multiPart(\"file\", new File(\"./src/test/resources/statuscode.txt\"))\n\t .post(APIPath.apiPath.POST_VALID_PATH);\n\n\t\tresp.then().body(\"message\",equalTo(\"Invalide File Type.\"));\n\t\ttest.log(LogStatus.PASS, \"Invalide File Type\");\n\t\tAssert.assertEquals(resp.getStatusCode(),400);\n\t\ttest.log(LogStatus.PASS, \"Successfully validated status code expected 400 and Actual status code is :: \" + resp.getStatusCode());\n\n\t\ttest.log(LogStatus.INFO, \"My Test Has been ended \");\n\n\t}",
"@Override\r\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\r\n\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Test(timeout = 4000)\n public void test256() throws Throwable {\n Form form0 = new Form(\"w\");\n FileInput fileInput0 = new FileInput(form0, \"w\", \"w\");\n // Undeclared exception!\n try { \n fileInput0.strong((Object) \"w\");\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"@Test(priority = 1, dependsOnMethods = { \"testAttachFileWithMandatoryParameters\" },\n description = \"podio {attachFile} integration test with negative case.\")\n public void testAttachFileWithNegativeCase() throws IOException, JSONException, InterruptedException {\n \n esbRequestHeadersMap.put(\"Action\", \"urn:attachFile\");\n \n Thread.sleep(timeOut);\n RestResponse<JSONObject> esbRestResponse =\n sendJsonRestRequest(proxyUrl, \"POST\", esbRequestHeadersMap, \"esb_attachFile_negative.json\");\n \n String apiEndPoint = apiUrl + \"/file/Invalid/attach\";\n \n RestResponse<JSONObject> apiRestResponse =\n sendJsonRestRequest(apiEndPoint, \"POST\", apiRequestHeadersMap, \"api_attachFile_negative.json\");\n \n Assert.assertEquals(esbRestResponse.getBody().getString(\"error\"), apiRestResponse.getBody().getString(\"error\"));\n Assert.assertEquals(esbRestResponse.getBody().getString(\"error_description\"), apiRestResponse.getBody()\n .getString(\"error_description\"));\n }",
"@Test\n public void filesAbortTest() throws ApiException {\n String owner = null;\n String repo = null;\n String identifier = null;\n FilesAbort data = null;\n api.filesAbort(owner, repo, identifier, data);\n\n // TODO: test validations\n }",
"private void printDetails(FileDTO file) {\n\t\tif (file == null) {\n\t\t\tsafePrintln(\"The file could not be retrieved or does not exist!\");\n\t\t} else {\n\t\t\tsafePrintln(file.getName() + \"|\" + file.getPermission() + \"|\" + file.getSize().toString() + \" - \"\n\t\t\t\t\t+ file.getOwnerName());\n\t\t}\n\t}",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Test (expected = IllegalArgumentException.class)\r\n\tpublic void testInvalidConsultPatientFile() {\r\n\t\tsessionController.login(testC1Doctor1, getCampus(0));\r\n\t\tdoctorController.consultPatientFile(null);\r\n\t}",
"public interface AbstractC17167a {\n void onErrorIOFailure(Exception exc, File file, String str);\n }",
"@Test(expected = SystemObjectIdException.class)\n public void shouldThrowExceptionIfFailToGetVariable() throws IOException {\n\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n replayAll();\n\n try {\n session.identifyDevice();\n assert false : \"Should not reach\";\n } finally {\n verifyAll();\n }\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"public String getFaultCode() {\n return faultCode;\n }",
"public completeFile_result(completeFile_result other) {\n if (other.isSetSuccess()) {\n this.success = new CompleteFileTResponse(other.success);\n }\n if (other.isSetE()) {\n this.e = new alluxio.thrift.AlluxioTException(other.e);\n }\n }",
"private void resourceFailure(ReaderFailureMode mode) throws IOException {\n //Given - multiple resources\n PalisadeRecordReader<String> prr = new PalisadeRecordReader<>();\n //add more data which should succeed\n List<String> returnResources2 = Arrays.asList(\"s5\", \"s6\", \"s7\", \"s8\");\n DataRequestResponse response = new DataRequestResponse().token(\"test\")\n //set up some data which should return an error\n .resource(new StubResource(\"type_a\", \"id1\", \"format1\"),\n new StubConnectionDetail(\"con1\").setServiceToCreate(createMockDS(Collections.emptyList(), true)))\n .resource(new StubResource(\"type_b\", \"id2\", \"format2\"),\n new StubConnectionDetail(\"con2\").setServiceToCreate(createMockDS(returnResources2, false)));\n response.originalRequestId(new RequestId().id(\"test\"));\n //When\n PalisadeInputSplit split = new PalisadeInputSplit(response);\n PalisadeInputFormat.setResourceErrorBehaviour(con, mode);\n prr.initialize(split, con);\n //Then\n readValuesAndValidate(returnResources2.stream(), prr);\n verifyMocksCalled(response);\n }",
"@Override\r\n public String getMessage() {\r\n return ErrorMessage.STATUS_FORMATTING_IN_FILE_ERROR;\r\n }",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e,\n \t\t\tObject state) {\n \n \t}",
"private void checkFile() {\n \ttry {\n \t\tdata = new BufferedReader(\n \t\t\t\t new FileReader(textFile));\n \t\t\n \t}\n \tcatch(FileNotFoundException e)\n \t{\n \t\tSystem.out.println(\"The mentioned File is not found.\");\n System.out.println(\"\");\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"The following error occured while reading the file.\");\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(2);\n\t\t}\n }",
"public void readFile() throws Exception, FileNotFoundException, NumberFormatException, MalformedParameterizedTypeException {\n // my user or my file might be kind of crazy! -> will check for these exceptions!\n }",
"XfvhdlAntecedentMemFiles() {\r\n \t error = new XfvhdlError();\r\n \t }",
"@Test\n public void test051() throws Throwable {\n FileInput fileInput0 = new FileInput((Component) null, \"<\", \"<\");\n // Undeclared exception!\n try {\n Component component0 = fileInput0.sub();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n }\n }",
"private void showInformationAboutBrokenFile(Shell shell) {\n\t\tMessageDialog\n \t.openInformation(\n \t\t shell, \n \t\t \"Info\",\n \t\t \"There was error during test cases generation, make sure selected file is correct!\");\n\t}",
"public String getFailDetail(String response) {\n\n\t\tString detailReason=\"Reason\";\n\t\tPattern pattern = Pattern.compile(FAULT_MESSAGE);\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tdetailReason= (match.group(1));\n\t\t}\n\t\treturn detailReason;\t\n\t}",
"public static UriSchemaUtils.UtilFile getFile(Context param0, Uri param1, String param2) throws IOException {\n }",
"@Test\n public void shouldThrow400ExceptionWhenNoUuidPassed() {\n try {\n EomFile eomFile = Mockito.mock(EomFile.class);\n postContentToTransformResource.map(eomFile, IS_PREVIEW_TRUE, null /*, httpHeaders*/);\n fail(\"No exception was thrown, but expected one.\");\n } catch (WebApplicationClientException wace) {\n assertThat(\n ((ErrorEntity) wace.getResponse().getEntity()).getMessage(),\n equalTo(PostContentToTransformResource.ErrorMessage.UUID_REQUIRED.toString()));\n assertThat(wace.getResponse().getStatus(), equalTo(HttpStatus.SC_BAD_REQUEST));\n }\n }",
"public FileNotFoundException(String message) {\n super(message);\n }",
"@Test(expected=RuntimeException.class)\n public void missingPartOfHeader(){\n Header h;\n SimpleReader sr = new SimpleReader();\n String fileForLexer = sr.FileToString(\"sample_abc/invalid_for_testing.abc\");\n abcLexer lex = new abcLexer(fileForLexer);\n abcParser parser = new abcParser(lex);\n h=parser.parseHeader();}",
"public void testNonExistentFile() {\n TestWARCBatchJob job = new TestWARCBatchJob();\n boolean success =\n job.processFile(NON_EXISTENT_FILE, new ByteArrayOutputStream());\n assertEquals(\"Should record exactly one exception\",\n job.getExceptionArray().length, 1);\n assertFalse(\"Should fail on missing file\", success);\n }",
"@Test\n void test() throws Exception {\n File file = new File(\"test-data/diagram/test.vsdx\");\n\n try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) {\n handleFile(stream, file.getPath());\n }\n\n handleExtracting(file);\n }",
"void mo45684a(DownloadInfo cVar, BaseException aVar, int i) throws RemoteException;",
"RequestDetail getRequestDetail(String requestId) throws SAXException, IOException;",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public void testTraceFile02() {\n \n \t\tfinal File traceFile = OSGiTestsActivator.getContext().getDataFile(getName() + \".trace\"); //$NON-NLS-1$\n \t\tTestDebugTrace debugTrace = this.createDebugTrace(traceFile);\n \t\tTraceEntry[] traceOutput = null;\n \t\tfinal String exceptionMessage1 = \"An error 1\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage2 = \"An error 2\"; //$NON-NLS-1$\n \t\tfinal String exceptionMessage3 = \"An error 3\"; //$NON-NLS-1$\n \t\ttry {\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 1\", new Exception(exceptionMessage1)); //$NON-NLS-1$ //$NON-NLS-2$ \n \t\t\tdebugTrace.trace(\"/notset\", \"testing 2\", new Exception(exceptionMessage2)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\tdebugTrace.trace(\"/debug\", \"testing 3\", new Exception(exceptionMessage3)); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\ttraceOutput = readTraceFile(traceFile); // Note: this call will also delete the trace file\n \t\t} catch (InvalidTraceEntry invalidEx) {\n \t\t\tfail(\"Failed 'DebugTrace.trace(option, message, Throwable)' test as an invalid trace entry was found. Actual Value: '\" + invalidEx.getActualValue() + \"'.\", invalidEx); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t}\n \n \t\tfinal StringBuffer expectedThrowableText1 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText1.append(exceptionMessage1);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText1.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText1.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Wrong number of trace entries\", 2, traceOutput.length); //$NON-NLS-1$\n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[0].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[0].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[0].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[0].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[0].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 1\", traceOutput[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[0].getThrowableText().startsWith(expectedThrowableText1.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText1.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[0].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[0].getThrowableText()); //$NON-NLS-1$\n \t\tassertEquals(\"Wrong number of trace entries for trace without an exception\", 2, traceOutput.length); //$NON-NLS-1$\n \n \t\tfinal StringBuffer expectedThrowableText2 = new StringBuffer(\"java.lang.Exception: \"); //$NON-NLS-1$\n \t\texpectedThrowableText2.append(exceptionMessage3);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\texpectedThrowableText2.append(DebugOptionsTestCase.TAB_CHARACTER);\n \t\texpectedThrowableText2.append(\"at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testTraceFile02(DebugOptionsTestCase.java:\"); //$NON-NLS-1$\t\t\n \n \t\tassertEquals(\"Thread name is incorrect\", Thread.currentThread().getName(), traceOutput[1].getThreadName()); //$NON-NLS-1$\n \t\tassertEquals(\"Bundle name is incorrect\", getName(), traceOutput[1].getBundleSymbolicName()); //$NON-NLS-1$\n \t\tassertEquals(\"option-path value is incorrect\", \"/debug\", traceOutput[1].getOptionPath()); //$NON-NLS-1$//$NON-NLS-2$\n \t\tassertEquals(\"class name value is incorrect\", DebugOptionsTestCase.class.getName(), traceOutput[1].getClassName()); //$NON-NLS-1$\n \t\tassertEquals(\"method name value is incorrect\", \"testTraceFile02\", traceOutput[1].getMethodName()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertEquals(\"trace message is incorrect\", \"testing 3\", traceOutput[1].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$\n \t\tassertNotNull(\"throwable text should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\tif (!traceOutput[1].getThrowableText().startsWith(expectedThrowableText2.toString())) {\n \t\t\tfinal StringBuffer errorMessage = new StringBuffer(\"The expected throwable text does not start with the actual throwable text.\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Expected\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(expectedThrowableText2.toString());\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"Actual\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(\"--------\"); //$NON-NLS-1$\n \t\t\terrorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);\n \t\t\terrorMessage.append(traceOutput[1].getThrowableText());\n \t\t\tfail(errorMessage.toString());\n \t\t}\n \t\tassertNotNull(\"throwable should not be null\", traceOutput[1].getThrowableText()); //$NON-NLS-1$\n \t\t// delete the trace file\n \t\ttraceFile.delete();\n \t}",
"@Test\r\n public void testUnshare() {\n System.out.println(\"Test : John shares his file with Jane. Jane shares John's file with Harry. John unshares his file with Harry. Harry \" +\r\n \"cannot read John's file\");\r\n String userId = \"John\";\r\n String filePath = \"/home/John/shared/Jof1.txt\";\r\n String targetUserId = \"Jane\";\r\n String fileName = \"Jof1.txt\";\r\n File file = new File (filePath, userId, fileName);\r\n List<File> fileList = FileList.getFileList();\r\n fileList.add(file);\r\n service.shareFile(userId, targetUserId, filePath);\r\n try {\r\n assertNotNull(service.readFile(targetUserId, filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n\r\n service.shareFile(targetUserId, \"Harry\", filePath);\r\n try {\r\n assertNotNull(service.readFile(\"Harry\", filePath));\r\n } catch (Exception e) {\r\n assertFalse(\"Should not throw any exception\", true);\r\n }\r\n System.out.println();\r\n service.unshareFile(userId, \"Harry\", filePath);\r\n try {\r\n service.readFile(\"Harry\", filePath);\r\n } catch (UnauthorizedException e) {\r\n assertTrue(e instanceof UnauthorizedException);\r\n return;\r\n } catch (Throwable t){\r\n assertFalse(\"Other exception caught\", true);\r\n t.printStackTrace();\r\n }\r\n }",
"@Override\n\tpublic byte[] fetchFile(String fileName) throws RemoteException {\n return null;\n\n\t}",
"public void handleOpenFile (FileSpec fileSpec) {\n this.fileSpec = fileSpec;\n openFile (fileSpec.getFile());\n }",
"@Override\r\n\tpublic InputStream getFile(String filepath) throws FileSystemUtilException {\r\n\t\t\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\t\r\n\r\n\t}",
"@Override\n public Status getStatus() throws IOException;",
"private void checkFileStatus() throws CustomException, IOException\n\t{\n\t\t//For all .mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\n\t\t\tString resultFileName = \n\t\t\t\t\tmgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf(\".\"))+\"_Results.csv\";\n\t\t\t//TODO: Cannot write files if checking for file. \n\t\t\t/*\n\t\t\tif (isFileUnlocked(resultFileName))\n\t\t\t\tthrow new CustomException(\"Please close \"+resultFileName, null);\n\t\t\t */\n\t\t}\n\n\t}",
"@Override\n\t\tpublic void onFileNotFoundException(FileNotFoundException e, Object state) {\n\t\t\tLog.d(\"arvi\", \"arvi3333\");\n\t\t}",
"public FaultDetailException(QName faultDetailName, \n\t\t\t\tObject faultDetail) {\n\tthis.faultDetail = faultDetail;\n\tthis.faultDetailName = faultDetailName;\n }",
"@Override protected void failed(Throwable e) {\n logger.log(Level.WARNING, \"couldn't load \" + getFile(), e);\n String msg = getResourceMap().getString(\"loadFailedMessage\", getFile());\n String title = getResourceMap().getString(\"loadFailedTitle\");\n int type = JOptionPane.ERROR_MESSAGE;\n JOptionPane.showMessageDialog(app.getFrame().getFrame(), msg, title, type);\n }",
"@Test(timeout = 4000)\n public void test01() throws Throwable {\n Player player0 = new Player(4, \"\", \"\", (-437));\n player0.getPictureId();\n player0.pack();\n player0.getY();\n player0.getY();\n MockFileInputStream mockFileInputStream0 = null;\n try {\n mockFileInputStream0 = new MockFileInputStream(\"Mv7j!OO(]HEQ2&@+n\");\n fail(\"Expecting exception: FileNotFoundException\");\n \n } catch(Throwable e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.mock.java.io.MockFileInputStream\", e);\n }\n }",
"public FileFormatException() {\r\n super();\r\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"@Override\n public void onTransferIOError(TransferDiskIOErrorAlert alert) {\n }",
"public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }",
"@Test\n public void invokePathHandlerOnExistingResource2() {\n ctx.param(ParamNames.PATH, \"foo/bar.txt\");\n pathHandler.handle(ctx);\n ByteArrayOutputStream baos = (ByteArrayOutputStream)resp.outputStream();\n String s = new String(baos.toByteArray());\n ceq(\"foo/bar.txt\", s);\n }",
"public static void testResourceFile() {\n\t\tArrayList l = new ArrayList();\n\t\tl.add(\"http://www.google.it\");\n\t\tl.add(\"http://www.microsoft.com\");\n\t\t/*\n\t\tDownloader d = new Downloader(1);\n\t\tlogger\n\t\t\t\t.log(\n\t\t\t\t\t\tLevel.INFO,\n\t\t\t\t\t\"TEST ResourceFile implementation. Url downloaded will be temporary saved to system temp directory.\");\n\n\t\t// Listener\n\t\td.addListener(new DebugListener());\n\n\t\td.setFollowRedirect(true);\n\t\td.setMaxSize(2000);\n\t\td.addURLs(l);\n\t\td.start();\n\t\td.waitDone();\n\n\t\t// Derby DBMS should be shutdown every times application goes down\n\t\tDerbyLinkQueueDB.shutdown();\n\t\t*/\n\t}",
"public void onFileFolderOpenFailed(File file);",
"public void readTheFile() {\n \t\terrorMap.clear();\n \n \t\tBufferedReader br;\n \t\tString nextLine;\n \t\tString[] header = null;\n \t\tArrayList<String> lines = new ArrayList<String>();\n \t\ttry {\n \t\t\tlogger.debug(\"{} loading file: {} \", getName(), RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath());\n \n \t\t\tbr = new BufferedReader(new FileReader(RobotNX100Controller.class.getResource(\"motoman_error_code.txt\").getPath()));\n \t\t\twhile (((nextLine = br.readLine()) != null) && (nextLine.length() > 0)) {\n \t\t\t\tif (nextLine.startsWith(\"Code\")) {\n \t\t\t\t\theader = nextLine.split(\"[, \\t][, \\t]*\");\n \t\t\t\t} else if (!nextLine.startsWith(\"#\"))\n \t\t\t\t\tlines.add(nextLine);\n \t\t\t}\n \t\t\tbr.close();\n \t\t} catch (FileNotFoundException fnfe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.warn(\"caused by \" + fnfe.getMessage(), fnfe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t} catch (IOException ioe) {\n \t\t\t// we do not want to interrupt processing because error map file not set.\n \t\t\tlogger.warn(\"Can not find the Error Message file {} for {}. Only Error code will be reported.\",\n \t\t\t\t\tgetErrorCodeFilename(), getName());\n \t\t\tlogger.error(\"caused by \" + ioe.getMessage(), ioe);\n \t\t\tbr = null;\n \t\t\treturn;\n \t\t}\n \n \t\tnumberOfRows = lines.size();\n \t\tlogger.debug(\"the file contained \" + numberOfRows + \" lines\");\n \t\tint nColumns = new StringTokenizer(lines.get(0), \"\\t\").countTokens();\n \t\tlogger.debug(\"each line should contain \" + nColumns + \" numbers\");\n \t\tkeys = new ArrayList<String>();\n \t\tif (header != null) {\n \t\t\tfor (int i = 1; i < nColumns; i++) {\n \t\t\t\terrorMap.put(header[0], header[i]);\n \t\t\t}\n \t\t\tkeys.add(header[0]);\n \t\t}\n \n \t\tfor (int i = 0; i < numberOfRows; i++) {\n \t\t\tnextLine = lines.get(i);\n \t\t\tString[] thisLine = nextLine.split(\"[\\t][\\t]*\");\n \t\t\tfor (int j = 0; j < thisLine.length; j++)\n \t\t\t\terrorMap.put(thisLine[0], thisLine[j]);\n \t\t\tkeys.add(thisLine[0]);\n \t\t}\n \t}",
"@Override\n\tpublic void fileDeliveryServiceError(int arg0, String arg1, Integer arg2) {\n\t\t\n\t}",
"@Test\n public void testCorrupt0LengthHFile() throws IOException {\n Path f = new Path(TestHFile.ROOT_DIR, testName.getMethodName());\n FSDataOutputStream fsos = TestHFile.fs.create(f);\n fsos.close();\n try {\n Reader r = HFile.createReader(TestHFile.fs, f, TestHFile.cacheConf, true, TestHFile.conf);\n } catch (CorruptHFileException che) {\n // Expected failure\n return;\n }\n Assert.fail(\"Should have thrown exception\");\n }",
"boolean hasRetrieveFileResponse();",
"@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }"
] | [
"0.6571318",
"0.58333874",
"0.57096803",
"0.55385387",
"0.55325675",
"0.55314606",
"0.55004245",
"0.5499129",
"0.5493624",
"0.5457347",
"0.5427529",
"0.5416177",
"0.5410847",
"0.5402986",
"0.53646696",
"0.5279853",
"0.5244353",
"0.52365345",
"0.5186679",
"0.5183676",
"0.51619494",
"0.5115241",
"0.51030767",
"0.50768787",
"0.5068341",
"0.5049006",
"0.50146896",
"0.5009032",
"0.49994498",
"0.49882954",
"0.49678537",
"0.49650005",
"0.49464226",
"0.49440455",
"0.49325967",
"0.49245998",
"0.49238542",
"0.49194184",
"0.491491",
"0.49143887",
"0.4900948",
"0.48966333",
"0.4891215",
"0.48687166",
"0.48669314",
"0.48425686",
"0.48386523",
"0.48358777",
"0.48342782",
"0.48327634",
"0.48297974",
"0.48286915",
"0.48264062",
"0.48227355",
"0.48201066",
"0.48200938",
"0.48070148",
"0.48014855",
"0.47978514",
"0.47973397",
"0.47825283",
"0.47812277",
"0.47798023",
"0.47758973",
"0.47673687",
"0.47643587",
"0.47642228",
"0.47607344",
"0.47578782",
"0.47545415",
"0.47521767",
"0.4751739",
"0.47507188",
"0.47488528",
"0.47452387",
"0.4745129",
"0.47374466",
"0.4731948",
"0.4724527",
"0.47238383",
"0.4717512",
"0.4717135",
"0.4716542",
"0.4716406",
"0.47163728",
"0.47031325",
"0.46991628",
"0.4694119",
"0.46914205",
"0.46863502",
"0.4685806",
"0.4685134",
"0.46843046",
"0.46839055",
"0.4683753",
"0.46708533",
"0.46700314",
"0.4668377",
"0.46628273",
"0.46567684"
] | 0.5803207 | 2 |
Set explicit SOAP fault validator implementation. | public AssertSoapFaultBuilder validator(SoapFaultValidator validator) {
action.setValidator(validator);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setValidator(Validator validator) {\n/* 603 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public AssertSoapFaultBuilder schemaValidation(boolean enabled) {\n validationContext.setSchemaValidation(enabled);\n return this;\n }",
"public AssertSoapFaultBuilder validator(String validatorName, ApplicationContext applicationContext) {\n action.setValidator(applicationContext.getBean(validatorName, SoapFaultValidator.class));\n return this;\n }",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"public interface IAeFaultMatchingStrategy {\r\n /**\r\n * Select ths catch that is the best match for the given fault.\r\n *\r\n * @param aProvider\r\n * @param aIterOfCatches\r\n * @param aFault\r\n * @return IAeCatch or null. In the case of null, the catchAll or implicit fault handler will handle the fault.\r\n */\r\n public IAeCatch selectMatchingCatch(IAeContextWSDLProvider aProvider, Iterator aIterOfCatches, IAeFaultTypeInfo aFault);\r\n}",
"public AssertSoapFaultBuilder faultActor(String faultActor) {\n action.setFaultActor(faultActor);\n return this;\n }",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"@Override\r\n\tprotected Validator setValidator() {\n\t\treturn null;\r\n\t}",
"public void setErrorHandler(ErrorHandler handler)\n {\n if (handler == null)\n {\n handler = base;\n }\n this.errorHandler = handler;\n }",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"@ManagedAttribute\n public Class<? extends ValidationErrorHandler> getErrorHandler() {\n return clazz;\n }",
"public Validator getValidator() {\n/* 613 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void setValidator(Validator<V> validator);",
"public void setValidationController(ValidationController ordemServicoValidationController)\r\n\t{\r\n\t\tvalidationController = ordemServicoValidationController;\r\n\t}",
"public void setValidator(Validator validator) {\n _validator = validator;\n }",
"public void setFaultCode(final String faultCode) {\n this.faultCode = faultCode;\n }",
"public AssertSoapFaultBuilder faultCode(String code) {\n\t action.setFaultCode(code);\n\t return this;\n\t}",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"public AssertSoapFaultBuilder withApplicationContext(ApplicationContext applicationContext) {\n if (applicationContext.containsBean(\"soapFaultValidator\")) {\n validator(applicationContext.getBean(\"soapFaultValidator\", SoapFaultValidator.class));\n }\n\n return this;\n }",
"@Override\n\tpublic void setWrongError() {\n\t\t\n\t}",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"void setCustomValidity(String error);",
"void setArrayOfFaultTypeArray(com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] arrayOfFaultTypeArray);",
"ValidatorImp() throws RemoteException {\n\t\tsuper();\n\t}",
"public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg)\n throws MessagingException;",
"public AssertSoapFaultBuilder xsd(String schemaName) {\n validationContext.setSchema(schemaName);\n return this;\n }",
"@Override\r\n\tpublic boolean handleFault(SOAPMessageContext arg0) {\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"@Override\n\t\tpublic void process(Exchange ex) throws Exception {\n\t\t\tTraitHierarchy th = (TraitHierarchy) ex.getIn().getHeader(TRAIT_HIERARCHY);\n\t\t\tValidationError ve = ex.getIn().getBody(ValidationError.class);\n\t\t\tif ( ve != null){\n\t\t\t\tth.setErrorMessage(ve.getErrorMessage());\n\t\t\t} \n\t\t}",
"ValidationError getValidationError();",
"@Override\n public void customValidation() {\n }",
"@Override\n public void customValidation() {\n }",
"@Override\n public void customValidation() {\n }",
"public SchemaValidationFeature(Class<? extends ValidationErrorHandler> clazz) {\n this(true, true, clazz);\n }",
"public JaxelValidator() {\n\t\tsuper();\n\t}",
"public ValidatorStandardSubsetBroad() {\n super();\n addErrorKey(ERROR_KEY1);\n addValidatorErrorListener(new DefaultErrorListener(), ERROR_KEY1);\n addErrorKey(ERROR_KEY2);\n addValidatorErrorListener(new DefaultErrorListener(), ERROR_KEY2); \n }",
"void setArrayOfFaultTypeArray(int i, com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType arrayOfFaultType);",
"public FaultException raise(Throwable e);",
"public interface XMLErrorHandler {\n\n /**\n * Reports a warning. Warnings are non-fatal and can be safely ignored by most\n * applications.\n *\n * @param domain The domain of the warning. The domain can be any string but\n * is suggested to be a valid URI. The domain can be used to\n * conveniently specify a web site location of the relevant\n * specification or document pertaining to this warning.\n * @param key The warning key. This key can be any string and is\n * implementation dependent.\n * @param exception Exception.\n *\n * @throws XNIException Thrown to signal that the parser should stop parsing the\n * document.\n */\n void warning(String domain, String key, XMLParseException exception) throws XNIException;\n\n /**\n * Reports an error. Errors are non-fatal and usually signify that the document\n * is invalid with respect to its grammar(s).\n *\n * @param domain The domain of the error. The domain can be any string but is\n * suggested to be a valid URI. The domain can be used to\n * conveniently specify a web site location of the relevant\n * specification or document pertaining to this error.\n * @param key The error key. This key can be any string and is\n * implementation dependent.\n * @param exception Exception.\n *\n * @throws XNIException Thrown to signal that the parser should stop parsing the\n * document.\n */\n void error(String domain, String key, XMLParseException exception) throws XNIException;\n\n /**\n * Report a fatal error. Fatal errors usually occur when the document is not\n * well-formed and signifies that the parser cannot continue normal operation.\n * <p>\n * <strong>Note:</strong> The error handler should <em>always</em> throw an\n * <code>XNIException</code> from this method. This exception can either be the\n * same exception that is passed as a parameter to the method or a new XNI\n * exception object. If the registered error handler fails to throw an\n * exception, the continuing operation of the parser is undetermined.\n *\n * @param domain The domain of the fatal error. The domain can be any string\n * but is suggested to be a valid URI. The domain can be used\n * to conveniently specify a web site location of the relevant\n * specification or document pertaining to this fatal error.\n * @param key The fatal error key. This key can be any string and is\n * implementation dependent.\n * @param exception Exception.\n *\n * @throws XNIException Thrown to signal that the parser should stop parsing the\n * document.\n */\n void fatalError(String domain, String key, XMLParseException exception) throws XNIException;\n}",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"public XMLSchemaValidatorProvider() {\n this(Optional.empty());\n }",
"public String getFaultString() {\n return faultString;\n }",
"public AssertSoapFaultBuilder faultString(String faultString) {\n action.setFaultString(faultString);\n return this;\n }",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType addNewArrayOfFaultType();",
"@Override\n public void setRfc(java.lang.String rfc) {\n _entityCustomer.setRfc(rfc);\n }",
"void setError();",
"protected Element getFaultMessage() {\n return mElement;\n }",
"String getFaultReasonValue();",
"public Wps10Validator() {\r\n super();\r\n xmlTypeValidator = XMLTypeValidator.INSTANCE;\r\n }",
"public GenericSchemaValidator() {}",
"public void setDTDHandler(DTDHandler handler)\n {\n if (handler == null)\n {\n handler = base;\n }\n this.dtdHandler = handler;\n }",
"public interface EmployeeRequestValidator {\n\n\t/**\n\t * \n\t * \n\t * @param Employee\n\t * control to be validated.\n\t * @param locale\n\t * the request locale.\n\t * @return set of ExceptionDetail.\n\t */\n\tValidateMessage validate(Employee employee);\n}",
"protected javax.wsdl.Fault getDefinedFault(ProcessInstance proc) {\n return (proc == null || getFaultName() == null) ? null \n : proc.getProcessDef().getInvocation().getOperation().getFault(getFaultName());\n }",
"public LibraryWsFault() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"public static void serializeSOAPFault(SOAPFault fault, XMLStreamWriter writer) throws XMLStreamException {\n\n\t\tOMSerializerUtil.serializeStartpart(fault, writer);\n\t\tOMElement e = null;\n\n\t\t// based on the namespace (SOAP1.1 vs SOAP1.2) to serialize accordingly\n\t\tif (fault.getNamespace().getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {\n\t\t\t// SOAP1.2\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP12Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\n\t\t} else {\n\t\t\t// SOAP1.1\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_CODE);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_REASON);\n\t\t\te.serialize(writer);\n\n\t\t\te = fault.getFirstChildWithName(SOAP11Constants.QNAME_FAULT_DETAIL);\n\t\t\tOMSerializerUtil.serializeStartpart(e, writer);\n\t\t}\n\t}",
"@Override\n public void addInterceptors(List<EndpointInterceptor> interceptors) {\n PayloadValidatingInterceptor validatingInterceptor = new CustomValidatingInterceptor();\n validatingInterceptor.setValidateRequest(true);\n validatingInterceptor.setValidateResponse(true);\n //validatingInterceptor.setXsdSchema(biblioSchema());\n CommonsXsdSchemaCollection schemaCollection = new CommonsXsdSchemaCollection(\n getSchemas()\n );\n try {\n schemaCollection.afterPropertiesSet();\n } catch (IOException e) {\n e.printStackTrace();\n }\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n try {\n validatingInterceptor.afterPropertiesSet();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n interceptors.add(validatingInterceptor);\n }",
"void populateFaultTable()\n\t{\n\t\tm_faultTable.addAction(\"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.addAction(\"print\"); //$NON-NLS-1$\n\n\t\t// the faults we support\n\t\tm_faultTable.add(InvalidTargetFault.name);\n\t\tm_faultTable.add(RecursionLimitFault.name);\n\t\tm_faultTable.add(InvalidWithFault.name);\n\t\tm_faultTable.add(ProtoLimitFault.name);\n\t\tm_faultTable.add(InvalidURLFault.name);\n\t\tm_faultTable.add(ExceptionFault.name);\n\t\tm_faultTable.add(StackUnderFlowFault.name);\n\t\tm_faultTable.add(DivideByZeroFault.name);\n\t\tm_faultTable.add(ScriptTimeoutFault.name);\n//\t\tm_faultTable.add(ConsoleErrorFault.name);\n\n\t\t// nice description of the faults\n\t\tm_faultTable.putDescription(InvalidTargetFault.name, getLocalizationManager().getLocalizedTextString(\"invalidTargetFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(RecursionLimitFault.name, getLocalizationManager().getLocalizedTextString(\"recursionLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidWithFault.name, getLocalizationManager().getLocalizedTextString(\"invalidWithFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ProtoLimitFault.name, getLocalizationManager().getLocalizedTextString(\"protoLimitFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(InvalidURLFault.name, getLocalizationManager().getLocalizedTextString(\"invalidUrlFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ExceptionFault.name, getLocalizationManager().getLocalizedTextString(\"exceptionFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(StackUnderFlowFault.name, getLocalizationManager().getLocalizedTextString(\"stackUnderflowFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(DivideByZeroFault.name, getLocalizationManager().getLocalizedTextString(\"divideByZeroFault\")); //$NON-NLS-1$\n\t\tm_faultTable.putDescription(ScriptTimeoutFault.name, getLocalizationManager().getLocalizedTextString(\"scriptTimeoutFault\")); //$NON-NLS-1$\n//\t\tm_faultTable.putDescription(ConsoleErrorFault.name, \"ActionScript recoverable error\");\n\n\t\t// default values for the faults\n\t\tm_faultTable.action(InvalidTargetFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidTargetFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(RecursionLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidWithFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ProtoLimitFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(InvalidURLFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ExceptionFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(StackUnderFlowFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(DivideByZeroFault.name, \"print\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"stop\"); //$NON-NLS-1$\n\t\tm_faultTable.action(ScriptTimeoutFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"print\"); //$NON-NLS-1$\n//\t\tm_faultTable.action(ConsoleErrorFault.name, \"stop\"); //$NON-NLS-1$\n\t}",
"@Override\n protected Validator getValidator() {\n return super.getValidator();\n }",
"public FaultException raise(Throwable e, Object argument);",
"@WebService(name = \"DocumentValidationSchemaService\", targetNamespace = \"http://schema.validation.doc.jaxws.invoice.samples.integ.softfly.pl/\")\n@XmlSeeAlso({\n pl.softfly.integ.doc.entity.ObjectFactory.class,\n pl.softfly.integ.endpoint.entity.ObjectFactory.class,\n pl.softfly.integ.entity.ObjectFactory.class,\n pl.softfly.integ.samples.invoice.jaxws.doc.validation.schema.ObjectFactory.class,\n pl.softfly.integ.shipment.entity.ObjectFactory.class\n})\npublic interface DocumentValidationSchemaService {\n\n\n /**\n * @param arg0\n * @return returns pl.softfly.integ.doc.entity.DocumentHeader\n */\n @WebMethod\n @WebResult(targetNamespace = \"\")\n @RequestWrapper(localName = \"validate\", targetNamespace = \"http://schema.validation.doc.jaxws.invoice.samples.integ.softfly.pl/\", className = \"pl.softfly.integ.samples.invoice.jaxws.doc.validation.schema.Validate\")\n @ResponseWrapper(localName = \"validateResponse\", targetNamespace = \"http://schema.validation.doc.jaxws.invoice.samples.integ.softfly.pl/\", className = \"pl.softfly.integ.samples.invoice.jaxws.doc.validation.schema.ValidateResponse\")\n public DocumentHeader validate(\n @WebParam(name = \"arg0\", targetNamespace = \"\")\n DocumentHeader arg0);\n\n}",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"NamespacedProperty getFaultCodeExpression();",
"NamespacedProperty getFaultReasonExpression();",
"public void setValidatorProperty(String property) {\n _validatorProperty = property;\n }",
"public void testTechError1() throws XRd4JException, SOAPException {\n String soapString = \"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\" xmlns:xrd=\\\"http://x-road.eu/xsd/xroad.xsd\\\"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server.ClientProxy.LoggingFailed.TimestamperFailed</faultcode><faultstring>Cannot time-stamp messages</faultstring><faultactor></faultactor><detail><xrd:faultDetail>TimestamperFailed</xrd:faultDetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\";\n SOAPMessage msg = SOAPHelper.toSOAP(soapString);\n\n ServiceResponseDeserializer deserializer = new ListServicesResponseDeserializer();\n ServiceResponse<String, String> response = deserializer.deserialize(msg);\n\n assertEquals(null, response.getConsumer());\n assertEquals(null, response.getProducer());\n assertEquals(null, response.getId());\n assertEquals(null, response.getUserId());\n assertEquals(null, response.getRequestData());\n assertEquals(null, response.getResponseData());\n assertEquals(null, response.getRequestHashAlgorithm());\n assertEquals(null, response.getRequestHash());\n assertEquals(\"4.0\", response.getProtocolVersion());\n\n assertEquals(true, response.hasError());\n assertEquals(\"Server.ClientProxy.LoggingFailed.TimestamperFailed\", response.getErrorMessage().getFaultCode());\n assertEquals(\"Cannot time-stamp messages\", response.getErrorMessage().getFaultString());\n assertEquals(\"\", response.getErrorMessage().getFaultActor());\n assertEquals(true, response.getErrorMessage().getDetail() != null);\n assertEquals(\"TimestamperFailed\", response.getErrorMessage().getDetail());\n assertEquals(ErrorMessageType.STANDARD_SOAP_ERROR_MESSAGE, response.getErrorMessage().getErrorMessageType());\n assertEquals(true, response.getSoapMessage() != null);\n }",
"protected void setFaultTypeFromRake(double rake) throws InvalidRangeException {\n\t\tFaultUtils.assertValidRake(rake);\n\t\tif (Math.abs(Math.sin(rake * Math.PI / 180)) <= 0.5) {\n\t\t\tfltTypeParam.setValue(FLT_TYPE_STRIKE_SLIP); // 0.5 = sin(30)\n\t\t}\n\t\telse if (rake >= 30 && rake <= 150) {\n\t\t\tfltTypeParam.setValue(FLT_TYPE_REVERSE);\n\t\t}\n\t\telse {\n\t\t\tfltTypeParam.setValue(FLT_TYPE_UNKNOWN);\n\t\t}\n\t}",
"void setViolations(Set<ConstraintViolation<T>> violations);",
"public String getFaultCode() {\n return faultCode;\n }",
"void setNilArrayOfFaultTypeArray(int i);",
"public AssertSoapFaultBuilder faultDetailResource(Resource resource) {\n return faultDetailResource(resource, FileUtils.getDefaultCharset());\n }",
"protected void setRenderer(@SuppressWarnings(\"unused\") Object renderer) {\n\t\tthrow new InternalWikiException(\"No longer functional - please use JSPWikiMarkupParser\");\n\t}",
"@Override\n public void setValidationMode(int validationMode) {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n switch (validationMode) {\n case XMLParser.NONVALIDATING: {\n documentBuilderFactory.setValidating(false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.DTD_VALIDATION: {\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalDTDAccess(documentBuilderFactory, \"all\", false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.SCHEMA_VALIDATION: {\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalAccess(documentBuilderFactory, \"all\", false);\n } catch (IllegalArgumentException e) {\n // This parser does not support XML Schema validation so leave it as\n // a non-validating parser.\n }\n return;\n }\n }\n }",
"protected void setSoftAssert() {\n\t\tValidationUtils mySoftAssert = new ValidationUtils();\n\t\tsoftAssert.set(mySoftAssert);\n\t}",
"public abstract void setError(String message);",
"void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public interface ConversationErrorAware {\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param conversationError\r\n\t */\r\n\tpublic void setConversationError(String conversationError);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic String getConversationError();\r\n\r\n}",
"String getFaultStringValue();",
"@Test\n public void setResolutionConfigSlot_faultCreation_nullValue() throws Exception {\n iService.setResolutionConfigSlot( getUnsavedFault(), null, HumanResourceKey.ADMIN );\n }",
"@Before\n\tpublic void addValidator() throws Exception {\n\t\tfactory.add(\"test\", TestValidator.class);\n\t}",
"public void setFeatureValidator(Validator featureValidator) {\n\t\tthis.featureValidator = featureValidator;\n\t}",
"public ErrorHandler getErrorHandler()\n {\n return (errorHandler == base) ? null : errorHandler;\n }",
"@Override\n\tpublic void setMyPhoneError() {\n\t\t\n\t}",
"public AssertSoapFaultBuilder faultDetailResource(String filePath) {\n action.getFaultDetailResourcePaths().add(filePath);\n return this;\n }",
"public void fatalError(ValidationType type, String validationName, String content);",
"public void performValidation() {\n/* 623 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"static void reportSchemaError(XMLErrorReporter errorReporter, SimpleLocator loc, String key, Object[] args) {\n/* 340 */ if (loc != null) {\n/* 341 */ errorReporter.reportError(loc, \"http://www.w3.org/TR/xml-schema-1\", key, args, (short)1);\n/* */ }\n/* */ else {\n/* */ \n/* 345 */ errorReporter.reportError(\"http://www.w3.org/TR/xml-schema-1\", key, args, (short)1);\n/* */ } \n/* */ }",
"public static Policy getFaultMessageEffectivePolicy(Definitions wsdl, QName service, String portName, String operationName, String faultName) throws PolicyException {\n Service srv = wsdl.getService(service);\n if (srv == null) {\n throw new IllegalArgumentException(\"Cannot find service with qname \" + service);\n }\n //obtain port\n Endpoint port = srv.getEndpoint(portName);\n if (port == null) {\n throw new IllegalArgumentException(\"Cannot find port with name '\" + portName + \"' in service with qname \" + service);\n }\n //obtain binding\n QName bQName = port.getBinding();\n Binding binding = wsdl.getBinding(bQName);\n AbstractOperation bOp = binding.getOperationByName(operationName);\n if (bOp == null) {\n throw new IllegalArgumentException(\"Cannot find binding operation with name '\" + operationName + \"' in binding \" + bQName);\n }\n \n QName intQName = binding.getInterface();\n Interface portType = wsdl.getInterface(intQName);\n Operation pOp = portType.getOperation(operationName);\n if (pOp == null) {\n throw new IllegalArgumentException(\"Cannot find portType operation with name '\" + operationName + \"' in portType \" + intQName);\n }\n \n Element wsdlEl = (Element) binding.getDomElement().getParentNode();\n\n try {\n ExtensionContext bOpExtCtx = bOp.getFaultExtensionContext(faultName);\n ExtensionContext pOpExtCtx = pOp.getFaultExtensionContext(faultName);\n QName msgQName = QName.valueOf(pOp.getFaultExtensionContext(faultName).getProperty(WSDL11Constants.FAULT_MESSAGE_QNAME));\n ExtensionContext msgExtCtx = wsdl.getMessageContext(msgQName); \n\n Policy bOpPolicy = ConfigurationBuilder.loadPolicies(bOpExtCtx, wsdlEl);\n Policy pOpPolicy = ConfigurationBuilder.loadPolicies(pOpExtCtx, wsdlEl);\n Policy msgPolicy = ConfigurationBuilder.loadPolicies(msgExtCtx, wsdlEl);\n \n Policy res = Policy.mergePolicies(new Policy[]{bOpPolicy, pOpPolicy, msgPolicy});\n return res;\n } catch (WSDLException wsE) {\n throw new PolicyException(wsE);\n }\n }",
"@Test\n public void testFaultSuperTypes() throws Exception {\n // InterfaceContract source = new MockContract(\"FooContract\");\n // DataType sourceFaultType = new DataTypeImpl<Type>(Exception.class,\n // Exception.class);\n // List<DataType> sourceFaultTypes = new ArrayList<DataType>();\n // sourceFaultTypes.add(0, sourceFaultType);\n // Operation opSource1 = newOperationImpl(\"op1\", null, null,\n // sourceFaultTypes, false, null);\n // Map<String, Operation> sourceOperations = new HashMap<String,\n // Operation>();\n // sourceOperations.put(\"op1\", opSource1);\n // source.getInterface().getOperations().addAll(sourceOperations.values());\n //\n // InterfaceContract target = new MockContract(\"FooContract\");\n // DataType targetFaultType = new\n // DataTypeImpl<Type>(TuscanyException.class, TuscanyException.class);\n // List<DataType> targetFaultTypes = new ArrayList<DataType>();\n // targetFaultTypes.add(0, targetFaultType);\n //\n // Operation opTarget = newOperationImpl(\"op1\", null, null,\n // targetFaultTypes, false, null);\n // Map<String, Operation> targetOperations = new HashMap<String,\n // Operation>();\n // targetOperations.put(\"op1\", opTarget);\n // target.getInterface().getOperations().addAll(targetOperations.values());\n // wireService.checkCompatibility(source, target, false);\n }",
"public void addExceptionStyle();",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"public String getFaultMessage() {\n return faultMessage;\n }",
"public void validate() throws org.exolab.castor.xml.ValidationException {\r\n\t\torg.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r\n\t\tvalidator.validate(this);\r\n\t}",
"@ExceptionHandler(value = {MethodArgumentTypeMismatchException.class})\r\n\tpublic ResponseEntity<DefaultErrorList> handleValidationExceptionC(MethodArgumentTypeMismatchException pe, HttpServletRequest request) {\r\n \tLOGGER.warn(\"Excepcion de tipo de datos de entrada, {}\", pe.getMessage());\r\n\t\treturn new ResponseEntity<DefaultErrorList>(new DefaultErrorList(new DefaultError(GeneralCatalog.GRAL002.getCode(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGeneralCatalog.GRAL002.getMessage(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGeneralCatalog.GRAL002.getLevelException().toString(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Excepcion de tipo de datos de entrada\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequest.getRequestURL().toString()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)), GeneralCatalog.GRAL002.getHtttpStatus());\r\n\t}"
] | [
"0.59437984",
"0.56054604",
"0.5513765",
"0.54995495",
"0.54423094",
"0.5344227",
"0.53051114",
"0.5264908",
"0.5172762",
"0.512993",
"0.5123767",
"0.5109485",
"0.5065881",
"0.5048283",
"0.5042648",
"0.50122166",
"0.5011215",
"0.49769667",
"0.49760103",
"0.49527216",
"0.49465004",
"0.49349675",
"0.4921313",
"0.491599",
"0.49049225",
"0.4894765",
"0.48836303",
"0.4866439",
"0.4837389",
"0.4835658",
"0.48298097",
"0.48066998",
"0.48011783",
"0.48011783",
"0.48011783",
"0.47961888",
"0.4784799",
"0.47746414",
"0.4754296",
"0.47536644",
"0.47159722",
"0.47099432",
"0.46899077",
"0.46732134",
"0.46723634",
"0.46616703",
"0.46565086",
"0.4649639",
"0.46343786",
"0.4620856",
"0.46014962",
"0.45922375",
"0.45842567",
"0.4579567",
"0.45704293",
"0.45676348",
"0.45525858",
"0.4548468",
"0.45412776",
"0.45300716",
"0.4495479",
"0.4495155",
"0.4486855",
"0.44857207",
"0.44857207",
"0.44857207",
"0.44803298",
"0.44698068",
"0.44691235",
"0.44599533",
"0.44533724",
"0.4452966",
"0.4451772",
"0.44502002",
"0.444105",
"0.44390517",
"0.44287863",
"0.4400726",
"0.43950975",
"0.4393419",
"0.43899778",
"0.43790042",
"0.43760675",
"0.4374908",
"0.43712658",
"0.4371209",
"0.43640673",
"0.43555975",
"0.4354423",
"0.43539044",
"0.43461663",
"0.43428522",
"0.43402836",
"0.433975",
"0.4337547",
"0.4328371",
"0.4328371",
"0.43260047",
"0.43236977",
"0.4316302"
] | 0.6146096 | 0 |
Set explicit SOAP fault validator implementation by bean name. | public AssertSoapFaultBuilder validator(String validatorName, ApplicationContext applicationContext) {
action.setValidator(applicationContext.getBean(validatorName, SoapFaultValidator.class));
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setValidator(Validator validator) {\n/* 603 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public AssertSoapFaultBuilder validator(SoapFaultValidator validator) {\n action.setValidator(validator);\n return this;\n }",
"public void setValidatorName(String name) {\r\n\t\t_validatorName = name;\r\n\t}",
"public interface IAeFaultMatchingStrategy {\r\n /**\r\n * Select ths catch that is the best match for the given fault.\r\n *\r\n * @param aProvider\r\n * @param aIterOfCatches\r\n * @param aFault\r\n * @return IAeCatch or null. In the case of null, the catchAll or implicit fault handler will handle the fault.\r\n */\r\n public IAeCatch selectMatchingCatch(IAeContextWSDLProvider aProvider, Iterator aIterOfCatches, IAeFaultTypeInfo aFault);\r\n}",
"public AssertSoapFaultBuilder xsd(String schemaName) {\n validationContext.setSchema(schemaName);\n return this;\n }",
"public void setValidator(Validator<V> validator);",
"public AssertSoapFaultBuilder withApplicationContext(ApplicationContext applicationContext) {\n if (applicationContext.containsBean(\"soapFaultValidator\")) {\n validator(applicationContext.getBean(\"soapFaultValidator\", SoapFaultValidator.class));\n }\n\n return this;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"UGSRuntimeServiceXfireImplHttpPort\".equals(portName)) {\n setUGSRuntimeServiceXfireImplHttpPortEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setValidator(Validator validator) {\n _validator = validator;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"WsUserServiceImpl\".equals(portName)) {\r\n setWsUserServiceImplEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"public ValidatorFactory(String bundleName) {\n this.messageResolver = new ResourceMessageResolver(bundleName);\n }",
"public AssertSoapFaultBuilder schemaValidation(boolean enabled) {\n validationContext.setSchemaValidation(enabled);\n return this;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"msgserviceHttpSoap11Endpoint\".equals(portName)) {\n setmsgserviceHttpSoap11EndpointEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public Validator getValidator() {\n/* 613 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public AssertSoapFaultBuilder faultActor(String faultActor) {\n action.setFaultActor(faultActor);\n return this;\n }",
"public void setValidationController(ValidationController ordemServicoValidationController)\r\n\t{\r\n\t\tvalidationController = ordemServicoValidationController;\r\n\t}",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"RemoteFacadeCfc\".equals(portName)) {\r\n setRemoteFacadeCfcEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"EmpleadoServiciolmpl\".equals(portName)) {\r\n setEmpleadoServiciolmplEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"public String getValidatorClassName() {\n return configurationName + \"Validator\";\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"webservice_vasmanHttpPort\".equals(portName)) {\r\n setwebservice_vasmanHttpPortEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"JobSubmission2SOAP11port_http\".equals(portName)) {\n setJobSubmission2SOAP11port_httpEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"OutboundServiceSessionEJBBeanServicePort\".equals(portName)) {\n setOutboundServiceSessionEJBBeanServicePortEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"FeeCreateSOAP\".equals(portName)) {\n setFeeCreateSOAPEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"PersonController\".equals(portName)) {\n setPersonControllerEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"WSExtensionService\".equals(portName)) {\n setWSExtensionServiceEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setValidatorProperty(String property) {\n _validatorProperty = property;\n }",
"public interface EmployeeRequestValidator {\n\n\t/**\n\t * \n\t * \n\t * @param Employee\n\t * control to be validated.\n\t * @param locale\n\t * the request locale.\n\t * @return set of ExceptionDetail.\n\t */\n\tValidateMessage validate(Employee employee);\n}",
"@Bean\n public LocalValidatorFactoryBean getValidator(){\n LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean();\n validatorFactoryBean.setValidationMessageSource(messageSource());\n return validatorFactoryBean;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"WSEmisionAgricolaPort\".equals(portName)) {\r\n setWSEmisionAgricolaPortEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"@ManagedAttribute\n public Class<? extends ValidationErrorHandler> getErrorHandler() {\n return clazz;\n }",
"public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource)\n throws MessagingException;",
"@Override\r\n\tprotected Validator setValidator() {\n\t\treturn null;\r\n\t}",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"UploaderPort\".equals(portName)) {\n setUploaderPortEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"@Before\n\tpublic void addValidator() throws Exception {\n\t\tfactory.add(\"test\", TestValidator.class);\n\t}",
"public void setName(String name) throws ValidationException {\n this.name = name;\n }",
"void addValidator(IValidator validator);",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"@Override\n\tpublic void setBeanDefinitionContext(String beanDefinitionContextName,\n\t\t\tString resource) {\n\n\t}",
"public interface ValidatorService {\n\n /**\n * Valiadtion\n *\n * @param ruleSetCode - rule set code (named set of services and rules)\n * Can only be null when validate object contains xml message then\n * data parser select module automatically based on namespace and root element name\n * @param target - object for check\n * @return result of validation\n */\n ValidationResult validate(String ruleSetCode, ValidateObject target);\n\n /**\n * Check that rule with business code can by run\n *\n * @param businessRuleCode\n * @param onDay -\n * @return\n */\n boolean canIRun(String businessRuleCode, LocalDate onDay);\n}",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"CancelIMSHuawei_pt\".equals(portName)) {\n setCancelIMSHuawei_ptEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"dipp\".equals(portName)) {\n setdippEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"private void configureBeanValidation(OpenJPAConfigurationImpl conf) {\n // Validation defines/adds the following plugins to OpenJPA Configuration\n conf.validationFactory = conf.addObject(JPAProperties.VALIDATE_FACTORY);\n conf.validator = conf.addObject(\"Validator\");\n conf.validationMode = conf.addString(JPAProperties.VALIDATE_MODE);\n conf.validationGroupPrePersist = conf.addString(JPAProperties.VALIDATE_PRE_PERSIST);\n conf.validationGroupPreUpdate = conf.addString(JPAProperties.VALIDATE_PRE_UPDATE);\n conf.validationGroupPreRemove = conf.addString(JPAProperties.VALIDATE_PRE_REMOVE);\n\n conf.validationMode.setDynamic(true);\n String[] aliases = new String[] {\n String.valueOf(ValidationMode.AUTO),\n String.valueOf(ValidationMode.AUTO).toLowerCase(Locale.ENGLISH),\n String.valueOf(ValidationMode.CALLBACK),\n String.valueOf(ValidationMode.CALLBACK).toLowerCase(Locale.ENGLISH),\n String.valueOf(ValidationMode.NONE),\n String.valueOf(ValidationMode.NONE).toLowerCase(Locale.ENGLISH)\n };\n conf.validationMode.setAliases(aliases);\n conf.validationMode.setAliasListComprehensive(true);\n conf.validationMode.setDefault(aliases[0]);\n\n conf.validationGroupPrePersist.setString(JPAProperties.VALIDATE_GROUP_DEFAULT);\n conf.validationGroupPrePersist.setDefault(\"\");\n conf.validationGroupPrePersist.setDynamic(true);\n\n conf.validationGroupPreUpdate.setString(JPAProperties.VALIDATE_GROUP_DEFAULT);\n conf.validationGroupPreUpdate.setDefault(\"\");\n conf.validationGroupPreUpdate.setDynamic(true);\n\n conf.validationGroupPreRemove.setDefault(\"\");\n conf.validationGroupPreRemove.setDynamic(true);\n\n conf.validationFactory.setInstantiatingGetter(\"getValidationFactoryInstance\");\n conf.validationFactory.setDynamic(true);\n\n conf.validator.setInstantiatingGetter(\"getValidatorInstance\");\n conf.validator.setDynamic(true);\n conf.validator.makePrivate();\n }",
"public void setFaultMessage(String faultMessage) {\n this.faultMessage = faultMessage;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"NFEServices\".equals(portName)) {\n setNFEServicesEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r\n \r\nif (\"PublishAPIServiceSoap\".equals(portName)) {\r\n setPublishAPIServiceSoapEndpointAddress(address);\r\n }\r\n else \r\n{ // Unknown Port Name\r\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\r\n }\r\n }",
"public void setErrorHandler(ErrorHandler handler)\n {\n if (handler == null)\n {\n handler = base;\n }\n this.errorHandler = handler;\n }",
"private void validateBeanName(IBean bean) {\r\n \t\tString name = bean.getName();\r\n \t\tif(name!=null && !name.startsWith(\"/\")) {\r\n \t\t\t// Collect all relations between the bean and other CDI elements.\r\n \t\t\tgetValidationContext().addVariableNameForELValidation(name);\r\n \t\t\tgetValidationContext().addLinkedCoreResource(name, bean.getSourcePath(), true);\r\n \t\t\t/*\r\n \t\t\t *\t5.3.1. Ambiguous EL names\r\n \t\t\t *\t- All unresolvable ambiguous EL names are detected by the container when the application is initialized.\r\n \t\t\t * Suppose two beans are both available for injection in a certain war, and either:\r\n \t\t\t * • the two beans have the same EL name and the name is not resolvable, or\r\n \t\t\t */\r\n \t\t\tSet<IBean> beans = cdiProject.getBeans(name, true);\r\n \t\t\tif(beans.size()>1 && beans.contains(bean)) {\r\n \t\t\t\tITextSourceReference reference = bean.getNameLocation();\r\n \t\t\t\tif(reference==null) {\r\n \t\t\t\t\treference = CDIUtil.getNamedDeclaration(bean);\r\n \t\t\t\t}\r\n \t\t\t\tStringBuffer sb = new StringBuffer(bean.getSimpleJavaName());\r\n \t\t\t\tfor (IBean iBean : beans) {\r\n \t\t\t\t\tif(bean!=iBean) {\r\n \t\t\t\t\t\tsb.append(\", \").append(iBean.getSimpleJavaName());\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\taddError(MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, sb.toString()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());\r\n \t\t\t} else {\r\n \t\t\t\t/*\r\n \t\t\t\t * • the EL name of one bean is of the form x.y, where y is a valid bean EL name, and x is the EL name of the other bean,\r\n \t\t\t\t * the container automatically detects the problem and treats it as a deployment problem. \r\n \t\t\t\t */\r\n \t\t\t\tif(name.indexOf('.')>0) {\r\n \t\t\t\t\tStringTokenizer st = new StringTokenizer(name, \".\", false);\r\n \t\t\t\t\tStringBuffer xName = new StringBuffer();\r\n \t\t\t\t\twhile(st.hasMoreTokens()) {\r\n \t\t\t\t\t\tif(xName.length()>0) {\r\n \t\t\t\t\t\t\txName.append('.');\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\txName.append(st.nextToken());\r\n \t\t\t\t\t\tif(st.hasMoreTokens()) {\r\n \t\t\t\t\t\t\tString xNameAsString = xName.toString();\r\n \t\t\t\t\t\t\tSet<IBean> xBeans = cdiProject.getBeans(xNameAsString, true);\r\n \t\t\t\t\t\t\tif(!xBeans.isEmpty()) {\r\n \t\t\t\t\t\t\t\tString yName = name.substring(xNameAsString.length()+1);\r\n \t\t\t\t\t\t\t\tIStatus status = JavaConventions.validateJavaTypeName(yName, CompilerOptions.VERSION_1_6, CompilerOptions.VERSION_1_6);\r\n \t\t\t\t\t\t\t\tif (status.getSeverity() != IStatus.ERROR) {\r\n \t\t\t\t\t\t\t\t\tITextSourceReference reference = bean.getNameLocation();\r\n \t\t\t\t\t\t\t\t\tif(reference==null) {\r\n \t\t\t\t\t\t\t\t\t\treference = CDIUtil.getNamedDeclaration(bean);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\taddError(MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, name, yName, xNameAsString, xBeans.iterator().next().getSimpleJavaName()), CDIPreferences.AMBIGUOUS_EL_NAMES, reference, bean.getResource());\r\n \t\t\t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"OrderProcessingService\".equals(portName)) {\n setOrderProcessingServiceEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"@Override\n\tpublic void register(EValidatorRegistrar registrar) {\n\t}",
"public void setValidator(IViewValidator validator, String fieldDisplayName);",
"void setCustomValidity(String error);",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"SliderSvcPort\".equals(portName)) {\n setSliderSvcPortEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public XMLSchemaValidatorProvider() {\n this(Optional.empty());\n }",
"public void xsetULEXImplementationName(org.apache.xmlbeans.XmlString ulexImplementationName)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(ULEXIMPLEMENTATIONNAME$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(ULEXIMPLEMENTATIONNAME$0);\n }\n target.set(ulexImplementationName);\n }\n }",
"private void addHibernateConstraintViolationExceptionMapper() {\n if (ClassUtils.existsClass(\"org.hibernate.exception.ConstraintViolationException\")) {\n ExceptionUtil.wrapCatchedExceptions(new Callable<Object>() {\n\n @Override\n public Object call() throws Exception {\n Class<?> mapperClass = Class.forName(\"io.crnk.data.jpa.internal.HibernateConstraintViolationExceptionMapper\");\n Constructor<?> constructor = mapperClass.getConstructor();\n ExceptionMapper<?> mapper = (ExceptionMapper<?>) constructor.newInstance();\n context.addExceptionMapper(mapper);\n return null;\n }\n });\n }\n }",
"public void setULEXImplementationName(java.lang.String ulexImplementationName)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ULEXIMPLEMENTATIONNAME$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ULEXIMPLEMENTATIONNAME$0);\n }\n target.setStringValue(ulexImplementationName);\n }\n }",
"public final void setBean(String bean) {\n this.bean = bean;\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"GarageSeller\".equals(portName)) {\n setGarageSellerEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"publicService\".equals(portName)) {\n setpublicServiceEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"@Override\n\t\tpublic void process(Exchange ex) throws Exception {\n\t\t\tTraitHierarchy th = (TraitHierarchy) ex.getIn().getHeader(TRAIT_HIERARCHY);\n\t\t\tValidationError ve = ex.getIn().getBody(ValidationError.class);\n\t\t\tif ( ve != null){\n\t\t\t\tth.setErrorMessage(ve.getErrorMessage());\n\t\t\t} \n\t\t}",
"public void setFeatureValidator(Validator featureValidator) {\n\t\tthis.featureValidator = featureValidator;\n\t}",
"@Bean\n public Validator validator() {\n return new org.springframework.validation.beanvalidation.LocalValidatorFactoryBean();\n }",
"public AssertSoapFaultBuilder xsdSchemaRepository(String schemaRepository) {\n validationContext.setSchemaRepository(schemaRepository);\n return this;\n }",
"@Override\n public void addInterceptors(List<EndpointInterceptor> interceptors) {\n PayloadValidatingInterceptor validatingInterceptor = new CustomValidatingInterceptor();\n validatingInterceptor.setValidateRequest(true);\n validatingInterceptor.setValidateResponse(true);\n //validatingInterceptor.setXsdSchema(biblioSchema());\n CommonsXsdSchemaCollection schemaCollection = new CommonsXsdSchemaCollection(\n getSchemas()\n );\n try {\n schemaCollection.afterPropertiesSet();\n } catch (IOException e) {\n e.printStackTrace();\n }\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n try {\n validatingInterceptor.afterPropertiesSet();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n interceptors.add(validatingInterceptor);\n }",
"public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\n \nif (\"CenterServerImplPort\".equals(portName)) {\n setCenterServerImplPortEndpointAddress(address);\n }\n else \n{ // Unknown Port Name\n throw new javax.xml.rpc.ServiceException(\" Cannot set Endpoint Address for Unknown Port\" + portName);\n }\n }",
"public Validator getValidator() throws InstantiationException, \r\n\t\t\tIllegalAccessException, ClassNotFoundException {\r\n\t\treturn ValidatorFactory.getValidator(getClassName());\r\n\t}",
"public FaultAccumulator checkNotNull(Object value, String name)\n {\n if(value == null)\n error(name + \" is required.\");\n \n return this;\n }",
"@Override\n protected void checkIfStandardFaultCode(String faultCode, String uri)\n throws SOAPException {\n }",
"public static Policy getFaultMessageEffectivePolicy(Definitions wsdl, QName service, String portName, String operationName, String faultName) throws PolicyException {\n Service srv = wsdl.getService(service);\n if (srv == null) {\n throw new IllegalArgumentException(\"Cannot find service with qname \" + service);\n }\n //obtain port\n Endpoint port = srv.getEndpoint(portName);\n if (port == null) {\n throw new IllegalArgumentException(\"Cannot find port with name '\" + portName + \"' in service with qname \" + service);\n }\n //obtain binding\n QName bQName = port.getBinding();\n Binding binding = wsdl.getBinding(bQName);\n AbstractOperation bOp = binding.getOperationByName(operationName);\n if (bOp == null) {\n throw new IllegalArgumentException(\"Cannot find binding operation with name '\" + operationName + \"' in binding \" + bQName);\n }\n \n QName intQName = binding.getInterface();\n Interface portType = wsdl.getInterface(intQName);\n Operation pOp = portType.getOperation(operationName);\n if (pOp == null) {\n throw new IllegalArgumentException(\"Cannot find portType operation with name '\" + operationName + \"' in portType \" + intQName);\n }\n \n Element wsdlEl = (Element) binding.getDomElement().getParentNode();\n\n try {\n ExtensionContext bOpExtCtx = bOp.getFaultExtensionContext(faultName);\n ExtensionContext pOpExtCtx = pOp.getFaultExtensionContext(faultName);\n QName msgQName = QName.valueOf(pOp.getFaultExtensionContext(faultName).getProperty(WSDL11Constants.FAULT_MESSAGE_QNAME));\n ExtensionContext msgExtCtx = wsdl.getMessageContext(msgQName); \n\n Policy bOpPolicy = ConfigurationBuilder.loadPolicies(bOpExtCtx, wsdlEl);\n Policy pOpPolicy = ConfigurationBuilder.loadPolicies(pOpExtCtx, wsdlEl);\n Policy msgPolicy = ConfigurationBuilder.loadPolicies(msgExtCtx, wsdlEl);\n \n Policy res = Policy.mergePolicies(new Policy[]{bOpPolicy, pOpPolicy, msgPolicy});\n return res;\n } catch (WSDLException wsE) {\n throw new PolicyException(wsE);\n }\n }",
"public Validator<V> getValidator();",
"ValidatorImp() throws RemoteException {\n\t\tsuper();\n\t}",
"public ValidatorFactory setMessageBuilder(MessageBuilder builder) {\n this.messageBuilder = builder == null ? MessageBuilder.DEFAULT : builder;\n return this;\n }",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }",
"public void validate() throws SpringBootBaseAppException,MessageValidationException;",
"public ValidatorFactory setMessageResolver(MessageResolver resolver) {\n this.messageResolver = resolver == null ? MessageResolver.DEFAULT : resolver;\n return this;\n }",
"public void setBeanClassName(final String beanClassName) {\n this.beanClassName = checkEmpty(beanClassName);\n if (beanClassName != null) {\n this.beanClassName = beanClassName.replace('/', '.');\n }\n }",
"public void setCustomerValidator(final Validator aCustomerValidator) {\n customerValidator = aCustomerValidator;\n }",
"void setArrayOfFaultTypeArray(com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] arrayOfFaultTypeArray);",
"@Override\n public void setRfc(java.lang.String rfc) {\n _entityCustomer.setRfc(rfc);\n }",
"@Override\n protected Validator getValidator() {\n return super.getValidator();\n }",
"public boolean getErrorOnUseBeanInvalidClassAttribute();",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public void setBeanIdentifier(java.lang.String beanIdentifier);",
"public interface Validateable {\n\n Validator validator = Validation.buildDefaultValidatorFactory().getValidator();\n\n default void validate(Validateable v) throws BeanValidationException {\n Set<ConstraintViolation<Validateable>> constraintViolations = validator.validate(v);\n if (constraintViolations.size() != 0) {\n StringBuilder sb = new StringBuilder();\n constraintViolations.forEach(cons -> sb.append(cons.getPropertyPath()).append(cons.getMessage()).append(','));\n throw new BeanValidationException(sb.toString());\n }\n }\n\n void validate();\n}",
"@Override\n\tpublic void setBeanName(String beanname) {\n\t\t\n\t\tSystem.out.println(\"Bean name is : \" + beanname);\n\t\t\n\t}",
"void setArrayOfFaultTypeArray(int i, com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType arrayOfFaultType);",
"void register(String name, Object bean);",
"void setErrorMessage(String errorMessage);",
"public void setFaultString(final String faultString) {\n this.faultString = faultString;\n }",
"public interface IValidator\n{\n /**\n * \n * @return the validator bean name\n */\n String getValidatorBeanName( );\n\n /**\n * \n * @return the validator display name\n */\n String getValidatorDisplayName( );\n\n /**\n * @param control\n * The control to build model\n * @return the HTML to display\n */\n String getDisplayHtml( Control control );\n\n /**\n * \n * @return the list of available entrytype for this validator\n */\n List<String> getListAvailableEntryType( );\n\n /**\n * @param questionResponse\n * The response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( FormQuestionResponse questionResponse, Control control );\n\n /**\n * @param questionResponse\n * The List response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( List<FormQuestionResponse> questionResponse, Control control );\n\n /**\n * Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE\n * \n * @return the javascript validation code for Conditional display control\n * \n */\n String getJavascriptValidation( );\n\n /**\n * @param control\n * The control\n * @return the control value needed for javascript\n */\n String getJavascriptControlValue( Control control );\n\n}",
"public AssertSoapFaultBuilder faultCode(String code) {\n\t action.setFaultCode(code);\n\t return this;\n\t}",
"@Autowired\n\t\n\t@Override\n\tpublic boolean isValid(String value, ConstraintValidatorContext context) {\n\t\treturn false;\n\t}",
"@Bean\n ConstraintViolationProblemModule constraintViolationProblemModule() {\n return new ConstraintViolationProblemModule();\n }",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"@Pointcut(\"target(scriptsengine.uploadengine.validations.interfaces.IWBValidator)\")\n\tpublic void WBValidatorInterface()\n\t{\n\n\t}",
"public interface IElementValidator {\n\n /**\n * This method is called by the agency to validate a user's input on a configuration form.\n * @param toValidate The string from the user's input to the component that is to be validated\n * @return Empty string if valid, error message if not valid\n */\n String validate(String toValidate);\n}",
"public interface ConversationErrorAware {\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param conversationError\r\n\t */\r\n\tpublic void setConversationError(String conversationError);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic String getConversationError();\r\n\r\n}",
"protected String getFaultName() {\n return mName;\n }"
] | [
"0.5376908",
"0.5376522",
"0.52409476",
"0.50086087",
"0.49607664",
"0.4889346",
"0.484698",
"0.47565028",
"0.47434255",
"0.47361076",
"0.4724054",
"0.47009113",
"0.46994174",
"0.46388525",
"0.461407",
"0.46134743",
"0.46005973",
"0.46005642",
"0.45922038",
"0.4578264",
"0.45768216",
"0.45764855",
"0.45565385",
"0.45561683",
"0.45322192",
"0.45292926",
"0.45233208",
"0.45166925",
"0.44990134",
"0.4487867",
"0.4460792",
"0.44537193",
"0.44428656",
"0.44416592",
"0.44222963",
"0.4408517",
"0.43996838",
"0.43855584",
"0.43842977",
"0.4377919",
"0.4360758",
"0.43554395",
"0.43460912",
"0.43409434",
"0.43298477",
"0.4329539",
"0.4320936",
"0.4291212",
"0.42887637",
"0.42672852",
"0.42661205",
"0.42588106",
"0.4248833",
"0.42330417",
"0.42013532",
"0.41808146",
"0.41715378",
"0.4167737",
"0.4167143",
"0.41500178",
"0.41393083",
"0.4138643",
"0.4134055",
"0.41308227",
"0.41299576",
"0.41182235",
"0.41164386",
"0.41124862",
"0.40958005",
"0.40829057",
"0.4080131",
"0.4078621",
"0.4070445",
"0.4070445",
"0.4070445",
"0.4065695",
"0.4062269",
"0.40555838",
"0.4051061",
"0.40491226",
"0.40478462",
"0.4041962",
"0.4038999",
"0.4035997",
"0.40332878",
"0.4032207",
"0.4027312",
"0.40223053",
"0.4021102",
"0.40149456",
"0.40100822",
"0.40025705",
"0.39985096",
"0.39953265",
"0.39946473",
"0.39793852",
"0.39583227",
"0.39543027",
"0.3951697",
"0.39511624"
] | 0.59535724 | 0 |
Sets schema validation enabled/disabled for this SOAP fault assertion. | public AssertSoapFaultBuilder schemaValidation(boolean enabled) {
validationContext.setSchemaValidation(enabled);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AssertSoapFaultBuilder xsd(String schemaName) {\n validationContext.setSchema(schemaName);\n return this;\n }",
"public void setIsValidToSchema(boolean iIsValidToSchema) {\r\n\t\tmIsValidToSchema = iIsValidToSchema;\r\n\t}",
"@Override\n public void setValidationMode(int validationMode) {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n switch (validationMode) {\n case XMLParser.NONVALIDATING: {\n documentBuilderFactory.setValidating(false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.DTD_VALIDATION: {\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalDTDAccess(documentBuilderFactory, \"all\", false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.SCHEMA_VALIDATION: {\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalAccess(documentBuilderFactory, \"all\", false);\n } catch (IllegalArgumentException e) {\n // This parser does not support XML Schema validation so leave it as\n // a non-validating parser.\n }\n return;\n }\n }\n }",
"@Override\n public void setXMLSchema(Schema schema) throws XMLPlatformException {\n documentBuilderFactory.setSchema(schema);\n }",
"public boolean getIsValidToSchema() {\r\n\t\treturn mIsValidToSchema;\r\n\t}",
"public void setValidation(boolean validate) {\n this.validate = validate;\n }",
"public void setValidationEnabled(boolean validationEnabled) {\n\t\tthis.validationEnabled = validationEnabled;\n\t}",
"public void flagOrUnflagValidationError(boolean validationMode);",
"public SELF enableValidation() {\n this.enableValidation = true;\n return self();\n }",
"public Boolean getBypassDocumentValidation() {\n return bypassDocumentValidation;\n }",
"public AssertSoapFaultBuilder validator(SoapFaultValidator validator) {\n action.setValidator(validator);\n return this;\n }",
"protected void setSoftAssert() {\n\t\tValidationUtils mySoftAssert = new ValidationUtils();\n\t\tsoftAssert.set(mySoftAssert);\n\t}",
"public void setSchema(Schema schema)\n {\n this.schema = schema;\n }",
"public boolean schemasEnabled() {\n return schemasEnabled;\n }",
"public static void setXmlEnableValidationFromGui(Boolean inputStatus)\r\n {\r\n enableValidationFromGui = inputStatus;\r\n }",
"@Test(expected = XMLValidationException.class)\n\tpublic void testValidateAgainstXSDNoXSDFound() throws XMLValidationException, XMLParseException {\n\t\tString testXML = \"<Content>\" + \n\t\t\t\t\"\t<InvalidTagName>\" + \n\t\t\t\t\"\t\t<SaveName>TestSaveName</SaveName>\" + \n\t\t\t\t\"\t\t<Seed>TestSeed</Seed>\" + \n\t\t\t\t\"\t\t<DayNumber>42</DayNumber>\" + \n\t\t\t\t\"\t</InvalidTagName>\" + \n\t\t\t\t\"</Content>\";\n\t\t\n\t\t// Convert the testXML to a byte array for the method in test\n\t\tbyte[] xmlBytes = testXML.getBytes();\n\t\t\n\t\t// Call the method in test\n\t\tDocument document = XMLUtils.convertByteArrayToDocument(xmlBytes);\n\t\t\n\t\tPropertyManager.setXSDLocation(\"InvalidPath\");\n\t\t\n\t\t// Call the method in test\n\t\tXSDValidator.validateAgainstXSD(document);\n\t}",
"@Override\n @Test\n public void testSetSchemaWithIncompatibleNestedSchema() throws Exception {\n assumeTrue(Build.VERSION.SDK_INT >= 33);\n super.testSetSchemaWithIncompatibleNestedSchema();\n }",
"@Override\n\t\tpublic boolean hasPassedXMLValidation() {\n\t\t\treturn false;\n\t\t}",
"public boolean isValidationEnabled();",
"void setSchema(S schema);",
"public void setSchema(java.lang.String schema) {\r\n this.schema = schema;\r\n }",
"@Override\n public void setXMLSchemas(Object[] schemas) throws XMLPlatformException {\n if ((null == schemas) || (schemas.length == 0)) {\n return;\n }\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, schemas);\n } catch (IllegalArgumentException e) {\n // The attribute isn't supported so do nothing\n } catch (Exception e) {\n XMLPlatformException.xmlPlatformErrorResolvingXMLSchemas(schemas, e);\n }\n }",
"public void setDocumentForValidation(Document documentForValidation) {\n this.documentForValidation = documentForValidation;\n }",
"public void setValidate(boolean validate) {\r\r\r\r\r\r\n this.validate = validate;\r\r\r\r\r\r\n }",
"@Override\n public void setXMLSchema(URL url) throws XMLPlatformException {\n if (null == url) {\n return;\n }\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString());\n } catch (IllegalArgumentException e) {\n // The attribute isn't supported so do nothing\n } catch (Exception e) {\n XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e);\n }\n }",
"public void setSchema(URI aSchemaUri) throws SAXException, MalformedURLException {\n schema = SCHEMA_FACTORY.newSchema(aSchemaUri.toURL());\n }",
"public void setValidateDTD(final boolean validate)\r\n {\r\n this.validateDTD = validate;\r\n }",
"public void setInvalid();",
"public void testSchemaNotVisible()\r\n {\r\n MockControl ehControl = newControl(ErrorHandler.class);\r\n ErrorHandler errorHandler = (ErrorHandler) ehControl.getMock();\r\n\r\n Log log = LogFactory.getLog(XmlExtensionResolver.class);\r\n\r\n SchemaImpl schema = new SchemaImpl(\"foo.bar\");\r\n schema.setId(\"Baz\");\r\n schema.setVisibility(Visibility.PRIVATE);\r\n\r\n RegistryDefinition definition = new RegistryDefinitionImpl();\r\n\r\n Location l = newLocation();\r\n\r\n errorHandler.error(\r\n log,\r\n XmlImplMessages.schemaNotVisible(\"foo.bar.Baz\", \"zip.zoop\"),\r\n l,\r\n null);\r\n\r\n replayControls();\r\n\r\n ModuleDescriptor fooBar = new ModuleDescriptor(null, errorHandler);\r\n fooBar.setModuleId(\"foo.bar\");\r\n\r\n fooBar.addSchema(schema);\r\n\r\n ModuleDescriptor zipZoop = new ModuleDescriptor(null, errorHandler);\r\n zipZoop.setModuleId(\"zip.zoop\");\r\n\r\n ConfigurationPointDescriptor cpd = new ConfigurationPointDescriptor();\r\n cpd.setId(\"Zap\");\r\n cpd.setContributionsSchemaId(\"foo.bar.Baz\");\r\n cpd.setLocation(l);\r\n\r\n zipZoop.addConfigurationPoint(cpd);\r\n\r\n XmlModuleDescriptorProcessor processor = new XmlModuleDescriptorProcessor(definition,\r\n errorHandler);\r\n processor.processModuleDescriptor(fooBar);\r\n processor.processModuleDescriptor(zipZoop);\r\n \r\n XmlExtensionResolver extensionResolver = new XmlExtensionResolver(definition, errorHandler);\r\n extensionResolver.resolveSchemas();\r\n\r\n verifyControls();\r\n }",
"protected static synchronized void setStrictParsing(final boolean enable)\n {\n EASMessage.s_strictParsing = new Boolean(enable);\n }",
"public SELF withValidation(boolean enableValidation) {\n this.enableValidation = enableValidation;\n return self();\n }",
"public void setSchema(String schema) {\n this.schema = schema;\n }",
"public void setXsd(java.lang.String xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(XSD$2);\n }\n target.setStringValue(xsd);\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (!is_set_status()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'status' is unset! Struct:\" + toString());\n }\n\n if (!is_set_data()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'data' is unset! Struct:\" + toString());\n }\n\n if (!is_set_feature()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'feature' is unset! Struct:\" + toString());\n }\n\n if (!is_set_predictResult()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'predictResult' is unset! Struct:\" + toString());\n }\n\n if (!is_set_msg()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'msg' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n if (feature != null) {\n feature.validate();\n }\n }",
"void setControlSchema(Schema controlSchema);",
"void setTransactionSchema(Schema transactionSchema);",
"public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"@objid (\"9ecad15f-7403-4692-8909-d35b3a624c86\")\n void setIsException(boolean value);",
"public void setErrors(boolean value) {\r\n this.errors = value;\r\n }",
"public AssertSoapFaultBuilder(TestRunner runner) {\n this(runner, new AssertSoapFault());\n }",
"@Override\n public int getValidationMode() {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n if (!documentBuilderFactory.isValidating()) {\n return XMLParser.NONVALIDATING;\n }\n\n try {\n if (null == documentBuilderFactory.getAttribute(SCHEMA_LANGUAGE)) {\n return XMLParser.DTD_VALIDATION;\n }\n } catch (IllegalArgumentException e) {\n return XMLParser.DTD_VALIDATION;\n }\n\n return XMLParser.SCHEMA_VALIDATION;\n }",
"protected boolean isSaveSchema() {\n\t\treturn false;\n\t}",
"public SchemaValidationFeature(Class<? extends ValidationErrorHandler> clazz) {\n this(true, true, clazz);\n }",
"void xsetRequired(org.apache.xmlbeans.XmlBoolean required);",
"public void setXmlDecl(boolean _writeXmlDecl) {\n\t\tthis.writeXmlDecl = _writeXmlDecl;\n\t}",
"void setViolations(Set<ConstraintViolation<T>> violations);",
"public AssertSoapFaultBuilder validator(String validatorName, ApplicationContext applicationContext) {\n action.setValidator(applicationContext.getBean(validatorName, SoapFaultValidator.class));\n return this;\n }",
"public void setResponseSchemaType(SchemaType responseSchemaType)\n {\n this.responseSchemaType = responseSchemaType;\n }",
"public void setXsdSchema(final File xsdFile) throws InvalidXsdException {\n\t\ttry {\n\t\t\tsetXsdSchema(new FileInputStream(xsdFile));\n\t\t} catch (final FileNotFoundException e) {\n\t\t\tthrow new InvalidXsdException(\"The specified xsd file '\" + xsdFile\n\t\t\t\t\t+ \"' could not be found.\", e);\n\t\t}\n\t}",
"public SchemaValidator(@NotNull InputStream schemaFile) throws SAXException {\r\n Schema schema = createSchema(schemaFile);\r\n validator = schema.newValidator();\r\n validator.setFeature(\r\n \"http://apache.org/xml/features/validation/schema-full-checking\",\r\n true);\r\n }",
"public void xsetXsd(org.apache.xmlbeans.XmlString xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(XSD$2);\n }\n target.set(xsd);\n }\n }",
"public FeatureTypeSchema_Impl(org.w3c.dom.Document schema) throws Exception {\r\n setSchema(schema);\r\n }",
"public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }",
"public abstract void disableErrors();",
"public LagartoDOMBuilder enableDebug() {\n\t\tconfig.collectErrors = true;\n\t\tconfig.parserConfig.setCalculatePosition(true);\n\t\treturn this;\n\t}",
"public void setContentInvalid(boolean contentInvalid) {\n/* 1170 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void setValidated(boolean validated) {\n this.validated = validated;\n }",
"@Test(expected = XMLValidationException.class)\n\tpublic void testValidateAgainstXSDInvalidXML() throws XMLParseException, XMLValidationException {\n\t\tString testXML = \"<Content>\" + \n\t\t\t\t\"\t<InvalidTagName>\" + \n\t\t\t\t\"\t\t<SaveName>TestSaveName</SaveName>\" + \n\t\t\t\t\"\t\t<Seed>TestSeed</Seed>\" + \n\t\t\t\t\"\t\t<DayNumber>42</DayNumber>\" + \n\t\t\t\t\"\t</InvalidTagName>\" + \n\t\t\t\t\"</Content>\";\n\t\t\n\t\t// Convert the testXML to a byte array for the method in test\n\t\tbyte[] xmlBytes = testXML.getBytes();\n\t\t\n\t\t// Call the method in test\n\t\tDocument document = XMLUtils.convertByteArrayToDocument(xmlBytes);\n\t\t\n\t\tPropertyManager.setXSDLocation(\"C:\\\\Users\\\\Daniel\\\\Documents\\\\Uni\\\\TeamProject\\\\GitCopy\\\\TeamProjectVirusGame\\\\Resources\\\\XSD/VirusGameXSD.xsd\");\n\t\t\n\t\t// Call the method in test\n\t\tXSDValidator.validateAgainstXSD(document);\n\t}",
"void setValidSettings(boolean valid);",
"public void setRequired(boolean required);",
"public void setValidateRecords(Boolean val) {\n\n\t\tvalidateRecords = val;\n\n\t}",
"protected void setIntrospected(boolean introspected) {\n this._introspected = introspected;\n }",
"public void setRequestSchemaType(SchemaType requestSchemaType)\n {\n this.requestSchemaType = requestSchemaType;\n }",
"public void setTokenEndpointJwtSignatureValidationConfiguration(@Nullable final SignatureSigningConfiguration config) {\n tokenEndpointJwtSignatureValidationConfig = config;\n }",
"public boolean getValidation() {\n return validate;\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"public void validate() throws org.apache.thrift.TException {\n if (options != null) {\n options.validate();\n }\n }",
"void setRequired(boolean required);",
"public void setEnabled(boolean enabled) {\n/* 960 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void validate() {\n\t\tthis.invalidated = false;\n\t}",
"@Generated\n @Selector(\"setReturnsObjectsAsFaults:\")\n public native void setReturnsObjectsAsFaults(boolean value);",
"public void setAssertAllowedType(boolean assertType) {\n _assertType = assertType;\n }",
"protected void setValidatedFlag(boolean value) {\n createFlags();\n flags[VALIDATED] = value;\n }",
"public boolean isValidating() {\n\t\ttry {\n\t\t\treturn parserImpl.getFeature(Constants.SAX_FEATURE_PREFIX\n\t\t\t\t\t\t\t\t\t\t + Constants.VALIDATION_FEATURE);\n\t\t}\n\t\t catch (SAXException x) {\n\t\t\tthrow new IllegalStateException(x.getMessage());\n\t\t}\n\t}",
"@Override\n public void addInterceptors(List<EndpointInterceptor> interceptors) {\n PayloadValidatingInterceptor validatingInterceptor = new CustomValidatingInterceptor();\n validatingInterceptor.setValidateRequest(true);\n validatingInterceptor.setValidateResponse(true);\n //validatingInterceptor.setXsdSchema(biblioSchema());\n CommonsXsdSchemaCollection schemaCollection = new CommonsXsdSchemaCollection(\n getSchemas()\n );\n try {\n schemaCollection.afterPropertiesSet();\n } catch (IOException e) {\n e.printStackTrace();\n }\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n try {\n validatingInterceptor.afterPropertiesSet();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n validatingInterceptor.setXsdSchemaCollection(schemaCollection);\n interceptors.add(validatingInterceptor);\n }",
"public void validate() throws ValidationException {\n\t}",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"public boolean isValidationErrorPending() {\n\n\t\treturn validationErrorPending;\n\t}",
"public void setConstraintReference(ValidationFailure e) {\n schemaPart = e.schemaPart;\n constraintName = e.constraintName;\n clause = e.clause;\n }",
"@Override\n public boolean handleFault(SOAPMessageContext smc) {\n return true;\n }",
"public Builder setValidateOnly(boolean value) {\n \n validateOnly_ = value;\n onChanged();\n return this;\n }",
"public AssertSoapFaultBuilder xsdSchemaRepository(String schemaRepository) {\n validationContext.setSchemaRepository(schemaRepository);\n return this;\n }",
"void setArrayOfFaultTypeArray(com.microsoft.schemas.crm._2011.contracts.ArrayOfFaultType[] arrayOfFaultTypeArray);",
"public void validate() throws org.apache.thrift.TException {\n\t}"
] | [
"0.59246457",
"0.5923469",
"0.56551397",
"0.5461057",
"0.54305696",
"0.5399773",
"0.5375032",
"0.52302927",
"0.5054054",
"0.5028343",
"0.5005237",
"0.4994806",
"0.49615902",
"0.48916006",
"0.48738304",
"0.484969",
"0.48413718",
"0.48106098",
"0.4771406",
"0.47646603",
"0.47640577",
"0.47590986",
"0.47043592",
"0.4693477",
"0.46678293",
"0.46588615",
"0.46499115",
"0.4647761",
"0.46412033",
"0.46400708",
"0.46364233",
"0.46227935",
"0.45859227",
"0.4584979",
"0.45822477",
"0.45821792",
"0.45760548",
"0.45569175",
"0.45518786",
"0.45481738",
"0.4538034",
"0.4531118",
"0.45308352",
"0.4529008",
"0.45250526",
"0.45126724",
"0.4497595",
"0.44928744",
"0.4479299",
"0.44776732",
"0.44697535",
"0.44643828",
"0.44596767",
"0.4432666",
"0.44231373",
"0.44226703",
"0.44220626",
"0.44171578",
"0.4407903",
"0.44071653",
"0.44016865",
"0.4398317",
"0.43978408",
"0.4380058",
"0.4376963",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.4370531",
"0.43681476",
"0.4364872",
"0.43546304",
"0.43439066",
"0.43433207",
"0.43343958",
"0.4328077",
"0.43262434",
"0.430947",
"0.43063194",
"0.43063194",
"0.4305538",
"0.4302213",
"0.4300983",
"0.42874405",
"0.42874083",
"0.4285454",
"0.42852482"
] | 0.79730916 | 0 |
Sets explicit schema instance name to use for schema validation. | public AssertSoapFaultBuilder xsd(String schemaName) {
validationContext.setSchema(schemaName);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setSchemaInstance(String schemaInstance) {\n\t\t\r\n\t}",
"public void setSchema(java.lang.String schema) {\r\n this.schema = schema;\r\n }",
"public void setSchema(String schema) {\n this.schema = schema;\n }",
"public String getSchemaName() { return schemaName; }",
"public void setSchema(Schema schema)\n {\n this.schema = schema;\n }",
"void setSchema(S schema);",
"public void setName(String v){\n\t\ttry{\n\t\tsetProperty(SCHEMA_ELEMENT_NAME + \"/name\",v);\n\t\t_Name=null;\n\t\t} catch (Exception e1) {logger.error(e1);}\n\t}",
"public void setSchemaName(String schemaName) {\r\n\t\tcheckIfConfigurationModificationIsAllowed();\r\n\t\tthis.tableMetaDataContext.setSchemaName(schemaName);\r\n\t}",
"public void setName(String name) throws ValidationException {\n this.name = name;\n }",
"public void setSchema(String schema)\n {\n if(this.props == null)\n {\n this.props = new Properties();\n }\n this.props.setProperty(\"db.schema\", schema);\n }",
"public String schemaName() {\n return this.schemaName;\n }",
"String getSchemaName();",
"String getSchemaName();",
"@Override\r\n\t\tpublic void setSchema(String schema) throws SQLException {\n\t\t\t\r\n\t\t}",
"public void setInstanceName(final String value)\n {\n instanceName = value;\n }",
"public T withSchema(final String schemaName) {\n requireNonNull(schemaName);\n with(Schema.class, s -> s.mutator().setName(schemaName));\n return self();\n }",
"public void setSchema(String aValue) {\n String oldValue = schema;\n schema = aValue;\n changeSupport.firePropertyChange(\"schema\", oldValue, aValue);\n }",
"public void setSchemaLocation(String iSchemaLocation) {\r\n\t\tmLogger.entering(\"ADLSCORMValidator\", \"setSchemaLocation()\");\r\n\r\n\t\tmSchemaLocation = iSchemaLocation;\r\n\r\n\t\tmLogger.finest(\"mSchemaLocation set to \" + mSchemaLocation);\r\n\t\tmLogger.exiting(\"ADLSCORMValidator\", \"setSchemaLocation()\");\r\n\t}",
"void setControlSchema(Schema controlSchema);",
"@Override\n public void setXMLSchema(Schema schema) throws XMLPlatformException {\n documentBuilderFactory.setSchema(schema);\n }",
"public String schema() {\n return schemaName;\n }",
"public String schema() {\n return schemaName;\n }",
"public boolean isSetSchema_name() {\n return this.schema_name != null;\n }",
"void schema(String schema);",
"void schema(String schema);",
"public OracleConnectOptions setInstanceName(String instanceName) {\n this.instanceName = instanceName;\n return this;\n }",
"public void setSchema(DbEntity entity, String schema) {\n }",
"public boolean isSetSchemaName() {\n return this.schemaName != null;\n }",
"public void setSchemaLocation(String schemaLocation) {\n\t\t\r\n\t}",
"public String getDatabaseSchemaName() {\n return databaseSchemaName;\n }",
"public void setSchema(URI aSchemaUri) throws SAXException, MalformedURLException {\n schema = SCHEMA_FACTORY.newSchema(aSchemaUri.toURL());\n }",
"public T withSchema(final String oldSchemaName, final String schemaName) {\n requireNonNulls(oldSchemaName, schemaName);\n with(Schema.class, oldSchemaName, s -> s.mutator().setName(schemaName));\n return self();\n }",
"public void setName(String name) {\n if (definerSet) {\n tooManyDefinitions();\n }\n definerSet = true;\n this.name = name;\n }",
"public void setXsd(java.lang.String xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(XSD$2);\n }\n target.setStringValue(xsd);\n }\n }",
"public String getDataSetSchemaName() {\n\t\treturn this.datasetSchemaName;\n\t}",
"public void setValidatorName(String name) {\r\n\t\t_validatorName = name;\r\n\t}",
"public void setName(String sName) {\n\t\t\tsRuleID = sName;\n\t\t}",
"public void setName(final String name) {\n\t\tLOGGER.debug(\"SecurityObject#setName [name=\" + name + \"]\");\n\n\t\tthis.name = name;\n\t}",
"public Constraint setName( String theString) {\n\t\tmyName = new StringDt(theString); \n\t\treturn this; \n\t}",
"public Builder setSchemaUrl(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n schemaUrl_ = value;\n onChanged();\n return this;\n }",
"public void setName(String name) {\r\n if (StringUtils.isBlank(name)) {\r\n throw new IllegalArgumentException(\"name is blank\");\r\n }\r\n this.name = name;\r\n }",
"public final void setName(String name) {_name = name;}",
"public void setName (String name) {\n this.name = name;\n NameRegistrar.register (\"server.\"+name, this);\n }",
"public void setName(String name) {\n//\t\tif((name==null) || (name.length()<2)){\n//\t\t\tthrow new RuntimeException(\"Name muss mindestens 2 Zeichen enthalten!\");\n//\t\t}\n\t\tthis.name = name;\n\t}",
"public void setName(String name)\n {\n if (name == null) {\n throw new IllegalArgumentException();\n }\n\n _name = truncateDefault(name);\n }",
"public void setName(QName name)\n {\n this.name = name;\n }",
"void setTransactionSchema(Schema transactionSchema);",
"public void setName(String nameIn) {\n name = nameIn;\n }",
"@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}",
"@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}",
"public void setName(String name) {\n\t\tName = name;\n\t}",
"public void setName(String s) {\n this.name = s;\n }",
"public void setName(String inName)\n {\n name = inName;\n }",
"@SuppressWarnings(\"unused\")\n private void setConceptPreferredName(String name) {\n if (concept == null) {\n concept = new ConceptJpa();\n }\n concept.setDefaultPreferredName(name);\n }",
"public void setSchemaVersion(int version) {\n this.SCHEMA_VERSION = version;\n }",
"protected void setName(String name) {\n this.name = name;\n }",
"public void setName(String s) {\n\t\t\n\t\tname = s;\n\t}",
"public void setDatabaseSchema(SchemaElement root) throws ModelException {\n String old = getDatabaseSchemaName();\n String newRoot = ((root != null) ? root.getName().getFullName() : null);\n\n try {\n fireVetoableChange(PROP_DATABASE_ROOT, old, newRoot);\n databaseSchemaName = newRoot;\n firePropertyChange(PROP_DATABASE_ROOT, old, newRoot);\n } catch (PropertyVetoException e) {\n throw new ModelVetoException(e);\n }\n }",
"public CreateStatementBuilder setSchema(String hiveSchema) {\n this.hiveSchema = \"(\" + hiveSchema + \")\";\n return this;\n }",
"public String getNameForm()\n {\n return schema.getNameForm();\n }",
"public void setName(String name) { this.name = name; }",
"public void setName(String name) { this.name = name; }",
"public void setName(String name) { this.name = name; }",
"public void setName(String name) { this.name = name; }",
"protected void setName(String name) {\n this._name = name;\n }",
"@Test\n public void testSetName() {\n System.out.println(\"setName\");\n String name = \"\";\n VM instance = null;\n instance.setName(name);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Model @Raw\r\n\tprivate void setName(String name) {\r\n\t\tif (isValidName(name)) {\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.name = getDefaultName();\r\n\t\t}\r\n\t}",
"public void setName(String name) {\n if (!name.isEmpty()) {\n this.name = name;\n }\n }",
"public SchemaImpl(String name, String packagePrefix) {\n \t\tif (!SCHEMA_NAME_PATTERN.matcher(name).matches()) {\n \t\t\tthrow new InvalidNameException(\n \t\t\t\t\t\"Invalid schema name '\"\n \t\t\t\t\t\t\t+ name\n \t\t\t\t\t\t\t+ \"'.\\n\"\n \t\t\t\t\t\t\t+ \"The name must not be empty.\\n\"\n \t\t\t\t\t\t\t+ \"The name must start with a capital letter.\\n\"\n \t\t\t\t\t\t\t+ \"Any following character must be alphanumeric and/or a '_' character.\\n\"\n \t\t\t\t\t\t\t+ \"The name must end with an alphanumeric character.\");\n \n \t\t}\n \t\tif (!PACKAGE_PREFIX_PATTERN.matcher(packagePrefix).matches()) {\n \t\t\tthrow new InvalidNameException(\n \t\t\t\t\t\"Invalid schema package prefix '\"\n \t\t\t\t\t\t\t+ packagePrefix\n \t\t\t\t\t\t\t+ \"'.\\n\"\n \t\t\t\t\t\t\t+ \"The packagePrefix must not be empty.\\n\"\n \t\t\t\t\t\t\t+ \"The package prefix must start with a small letter.\\n\"\n \t\t\t\t\t\t\t+ \"The first character after each '.' must be a small letter.\\n\"\n \t\t\t\t\t\t\t+ \"Following characters may be alphanumeric and/or '_' characters.\\n\"\n \t\t\t\t\t\t\t+ \"The last character before a '.' and the end of the line must be an alphanumeric character.\");\n \t\t}\n \n \t\tthis.name = name;\n \t\tthis.packagePrefix = packagePrefix;\n \t\tqualifiedName = packagePrefix + \".\" + name;\n \t\tm1ClassManager = M1ClassManager.instance(qualifiedName);\n \n \t\t// Needs to be created before any NamedElement can be created\n \t\tdefaultPackage = PackageImpl.createDefaultPackage(this);\n \n \t\t// Creation of the BasicDomains\n \t\tcreateBooleanDomain();\n \t\tcreateDoubleDomain();\n \t\tcreateIntegerDomain();\n \t\tcreateLongDomain();\n \t\tcreateStringDomain();\n \n \t\t/*\n \t\t * Needs to be created before any GraphElementClass element can be\n \t\t * created\n \t\t */\n \t\tdefaultGraphClass = GraphClassImpl.createDefaultGraphClass(this);\n \n \t\t// Creation of the default GraphElementClasses\n \t\tdefaultVertexClass = VertexClassImpl.createDefaultVertexClass(this);\n \t\tdefaultEdgeClass = EdgeClassImpl.createDefaultEdgeClass(this);\n \t\tconfig = createDefaultConfig();\n \t}",
"public void setName(org.hl7.fhir.String name)\n {\n generatedSetterHelperImpl(name, NAME$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }",
"protected void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(org.hl7.fhir.String name)\n {\n generatedSetterHelperImpl(name, NAME$8, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }",
"@Override\n\tpublic void putInstanceName(String newInstanceName) {\n\t\tthis.instanceName = newInstanceName;\n\t}",
"private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }",
"private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }",
"private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }",
"public void setFormName(String formName) throws ValidateException {\n\n this.formName = formName;\n }",
"private DefaultSchema() {\n super(\"\", null);\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }",
"public void setName ( String name ) throws InvalidUserIDException {\r\n if(name == \"\") throw new InvalidUserIDException();\r\n _name= name;\r\n }",
"public void xsetXsd(org.apache.xmlbeans.XmlString xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(XSD$2);\n }\n target.set(xsd);\n }\n }",
"public void setName(String value) {\n this.name = value;\n }",
"public SchemaDefinition isSchema(String name){\n return((SchemaDefinition)schemaDefs.get(getDefName(name)));\n }",
"public void setName(String name) {\n\t\tgetNonVisualProperties().setName(name);\n\t}",
"@Override\r\n public void setName(String name) {\n }",
"public String getSchemaName() {\r\n\t\treturn this.tableMetaDataContext.getSchemaName();\r\n\t}"
] | [
"0.7071011",
"0.6441966",
"0.6312878",
"0.6270068",
"0.6223917",
"0.6098602",
"0.59394985",
"0.5915534",
"0.5913848",
"0.5859499",
"0.5670391",
"0.5664786",
"0.5664786",
"0.56048214",
"0.5593433",
"0.5591235",
"0.55559206",
"0.5526797",
"0.54242456",
"0.54134905",
"0.5348486",
"0.5348486",
"0.53424996",
"0.5324769",
"0.5324769",
"0.53025204",
"0.525194",
"0.52178895",
"0.520787",
"0.5197184",
"0.51848775",
"0.51822037",
"0.5159947",
"0.5133417",
"0.5130009",
"0.51126987",
"0.509685",
"0.5038971",
"0.49968728",
"0.49713516",
"0.49677998",
"0.49583617",
"0.49502996",
"0.49416956",
"0.49271283",
"0.49132177",
"0.4906448",
"0.49023044",
"0.48981544",
"0.48981544",
"0.48886812",
"0.48873168",
"0.48832896",
"0.48718965",
"0.48680615",
"0.4867402",
"0.4863251",
"0.4852991",
"0.4849856",
"0.4849142",
"0.4847463",
"0.4847463",
"0.4847463",
"0.4847463",
"0.4842463",
"0.4839777",
"0.48347023",
"0.48212743",
"0.48202598",
"0.48193833",
"0.48171398",
"0.47963923",
"0.47963923",
"0.47963923",
"0.47917968",
"0.47912508",
"0.4787461",
"0.4787461",
"0.4787461",
"0.4781204",
"0.47795787",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47769925",
"0.47714338",
"0.47695377",
"0.47687715",
"0.47662735",
"0.4765015",
"0.47601694",
"0.47590005",
"0.4755602"
] | 0.49471638 | 43 |
Sets explicit xsd schema repository instance to use for validation. | public AssertSoapFaultBuilder xsdSchemaRepository(String schemaRepository) {
validationContext.setSchemaRepository(schemaRepository);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void setXMLSchema(Schema schema) throws XMLPlatformException {\n documentBuilderFactory.setSchema(schema);\n }",
"public XMLSchemaValidatorProvider() {\n this(Optional.empty());\n }",
"@Override\n public void setXMLSchema(URL url) throws XMLPlatformException {\n if (null == url) {\n return;\n }\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString());\n } catch (IllegalArgumentException e) {\n // The attribute isn't supported so do nothing\n } catch (Exception e) {\n XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e);\n }\n }",
"void setSchema(S schema);",
"public XMLSchemaValidatorProvider(Optional<String> xmlCatalog) {\n\n SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n xmlCatalog.ifPresent(xc -> schemaFactory.setResourceResolver(new XMLCatalogResolver(new String[]{xc})));\n\n schemas = Collections.synchronizedMap(new HashMap<>());\n try {\n schemas.put(DWC_META_XML, schemaFactory.newSchema(getStreamSource(DWC_META_XML_SCHEMA)));\n schemas.put(GBIF_EML, schemaFactory.newSchema(getStreamSource(GBIF_EML_SCHEMA)));\n } catch (SAXException | IOException e) {\n LOG.error(\"Can not load XML schema\", e);\n }\n }",
"public void setSchema(Schema schema)\n {\n this.schema = schema;\n }",
"public SchemaValidator(@NotNull Class<?> clz, @NotNull String schemaFile)\r\n throws SAXException {\r\n File localFile = new File(\"src\" + File.separator + \"main\"\r\n + File.separator + \"resources\" + File.separator\r\n + \"model\" + File.separator + \"xsd\"\r\n + File.separator + schemaFile);\r\n Schema schema;\r\n if (localFile.exists()) {\r\n try {\r\n schema = createSchema(new FileInputStream(localFile));\r\n } catch (FileNotFoundException e) {\r\n schema = createSchema(clz.getResourceAsStream(\r\n \"/model/xsd/\" + schemaFile));\r\n }\r\n } else {\r\n schema = createSchema(clz.getResourceAsStream(\r\n \"/model/xsd/\" + schemaFile));\r\n }\r\n validator = schema.newValidator();\r\n validator.setFeature(\r\n \"http://apache.org/xml/features/validation/schema-full-checking\",\r\n true);\r\n }",
"public void setXsd(java.lang.String xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(XSD$2);\n }\n target.setStringValue(xsd);\n }\n }",
"public void setSchema(String schema) {\n this.schema = schema;\n }",
"public void setSchema(java.lang.String schema) {\r\n this.schema = schema;\r\n }",
"public SchemaValidator(@NotNull InputStream schemaFile) throws SAXException {\r\n Schema schema = createSchema(schemaFile);\r\n validator = schema.newValidator();\r\n validator.setFeature(\r\n \"http://apache.org/xml/features/validation/schema-full-checking\",\r\n true);\r\n }",
"public void xsetXsd(org.apache.xmlbeans.XmlString xsd)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(XSD$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(XSD$2);\n }\n target.set(xsd);\n }\n }",
"@Override\n public void setXMLSchemas(Object[] schemas) throws XMLPlatformException {\n if ((null == schemas) || (schemas.length == 0)) {\n return;\n }\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, schemas);\n } catch (IllegalArgumentException e) {\n // The attribute isn't supported so do nothing\n } catch (Exception e) {\n XMLPlatformException.xmlPlatformErrorResolvingXMLSchemas(schemas, e);\n }\n }",
"@Override\n public void setCatalogManagerSchemaResolver(Object catalogManager,\n Object parserObject,\n Object environmentSetting) {\n\n }",
"void setControlSchema(Schema controlSchema);",
"public void setSchema(URI aSchemaUri) throws SAXException, MalformedURLException {\n schema = SCHEMA_FACTORY.newSchema(aSchemaUri.toURL());\n }",
"public void setXsdSchema(final String xsdClassPath)\n\t\t\tthrows InvalidXsdException {\n\t\ttry {\n\t\t\tsetXsdSchema(new ClassPathResource(xsdClassPath).getInputStream());\n\t\t} catch (final IOException e) {\n\t\t\tthrow new InvalidXsdException(\"The specified xsd at '\"\n\t\t\t\t\t+ xsdClassPath + \"' could not be accessed.\", e);\n\t\t}\n\t}",
"public void setXsdSchema(final File xsdFile) throws InvalidXsdException {\n\t\ttry {\n\t\t\tsetXsdSchema(new FileInputStream(xsdFile));\n\t\t} catch (final FileNotFoundException e) {\n\t\t\tthrow new InvalidXsdException(\"The specified xsd file '\" + xsdFile\n\t\t\t\t\t+ \"' could not be found.\", e);\n\t\t}\n\t}",
"public Builder setSchemaUrl(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n schemaUrl_ = value;\n onChanged();\n return this;\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema() {\n return null; // cause a plugin exception to get thrown\n }",
"public GenericSchemaValidator() {}",
"public void setSchemaBaseURL(String schemaBaseURL) {\n this.schemaBaseURL = schemaBaseURL;\n }",
"public void setXsdSchema(final InputStream xsdStream)\n\t\t\tthrows InvalidXsdException {\n\t\ttry {\n\t\t\tthis.xsd = Streams.copyStreamToByteArray(xsdStream);\n\t\t} catch (final IOException e) {\n\t\t\tthrow new InvalidXsdException(\"The xsd stream could not be read.\",\n\t\t\t\t\te);\n\t\t}\n\t}",
"public void setXmlSchema(Document doc) {\n\t\tString schemaUrl = \"https://raw.githubusercontent.com/biosemantics/schemas/master/semanticMarkupInput.xsd\";\n\t\tElement rootElement = doc.getRootElement();\n\t\trootElement.setNamespace(bioNamespace);\n\t\trootElement.addNamespaceDeclaration(bioNamespace);\n\t\trootElement.addNamespaceDeclaration(xsiNamespace);\n\t\trootElement.setAttribute(\"schemaLocation\", \"http://www.github.com/biosemantics \" + schemaUrl, xsiNamespace);\n\t}",
"private static void validate(String fileName, String xSchema) throws Exception {\n \t\ttry {\n\t // parse an XML document into a DOM tree\n\t DocumentBuilder parser =\n\t DocumentBuilderFactory.newInstance().newDocumentBuilder();\n\t Document document = parser.parse(new File(fileName));\n\t\n\t // create a SchemaFactory capable of understanding WXS schemas\n\t SchemaFactory factory =\n\t SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n\t\n\t // load a WXS schema, represented by a Schema instance\n\t Source schemaFile = new StreamSource(new File(xSchema));\n\t Schema schema = factory.newSchema(schemaFile);\n\t\n\t // create a Validator object, which can be used to validate\n\t // an instance document\n\t Validator validator = schema.newValidator();\n\t\n\t // validate the DOM tree\n\t\n\t validator.validate(new DOMSource(document));\n \t\t} catch(Exception e) {\n \t\t\tXMLValidate.file = fileName.substring(fileName.lastIndexOf(\"/\") + 1).replaceAll(\".xml\", \"\");\n \t\t\tthrow e;\n \t\t}\n \n }",
"@Override\n protected Object getSchemaSource() {\n String persistencexsd = \"persistence-xsd.rsrc\";\n // if the version and/or schema location is for 1.0, use the 1.0\n // schema\n if (XMLVersionParser.VERSION_2_0.equals(_persistenceVersion)\n || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_0) != -1)) {\n persistencexsd = \"persistence_2_0-xsd.rsrc\";\n }\n else if (XMLVersionParser.VERSION_2_1.equals(_persistenceVersion)\n || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_1) != -1)) {\n persistencexsd = \"persistence_2_1-xsd.rsrc\";\n }\n else if (XMLVersionParser.VERSION_2_2.equals(_persistenceVersion)\n || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_2) != -1)) {\n persistencexsd = \"persistence_2_2-xsd.rsrc\";\n }\n\n return getClass().getResourceAsStream(persistencexsd);\n }",
"LDAPDITStructureRuleSchema(\n com.github.terefang.jldap.ldap.LDAPDITStructureRuleSchema schema)\n {\n super( schema);\n this.schema = schema;\n return;\n }",
"@VisibleForTesting\n public JsonSchemaValidator(final URI baseUri) {\n this.jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);\n this.baseUri = baseUri;\n }",
"public void setSchemaInstance(String schemaInstance) {\n\t\t\r\n\t}",
"public SchemaWriterImpl() throws SchemaException {\r\n\t\tgetJaxbContext();\r\n\r\n\t\tbuilder = DocumentBuilderFactory.newInstance();\r\n\t\tbuilder.setNamespaceAware(true);\r\n\t}",
"public BooksSchema() {\n super();\n\n Managers.getManager(IBeansManager.class).inject(this);\n }",
"@Override\n public void setValidationMode(int validationMode) {\n if (null == documentBuilderFactory) {\n loadDocumentBuilderFactory();\n }\n switch (validationMode) {\n case XMLParser.NONVALIDATING: {\n documentBuilderFactory.setValidating(false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.DTD_VALIDATION: {\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalDTDAccess(documentBuilderFactory, \"all\", false);\n // documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, null);\n return;\n }\n case XMLParser.SCHEMA_VALIDATION: {\n try {\n documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA);\n documentBuilderFactory.setValidating(true);\n XMLHelper.allowExternalAccess(documentBuilderFactory, \"all\", false);\n } catch (IllegalArgumentException e) {\n // This parser does not support XML Schema validation so leave it as\n // a non-validating parser.\n }\n return;\n }\n }\n }",
"public void setSchema(String schema)\n {\n if(this.props == null)\n {\n this.props = new Properties();\n }\n this.props.setProperty(\"db.schema\", schema);\n }",
"public static void validateXMLSchema(String xsdPath, Source xml) throws IllegalArgumentException\n {\n try\n {\n SchemaFactory factory = SchemaFactory.newInstance(\"http://www.w3.org/2001/XMLSchema\");\n Schema schema = factory.newSchema(new File(xsdPath));\n Validator validator = schema.newValidator();\n validator.validate(xml);\n }\n catch (SAXException | IOException e)\n {\n throw new IllegalArgumentException(\"Invalid Entity XML\", e);\n }\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema(CachedUrl cu) {\n if (ElsevierDTD5PublishingHelper == null) {\n ElsevierDTD5PublishingHelper = new ElsevierDTD5XmlSchemaHelper();\n }\n return ElsevierDTD5PublishingHelper;\n }",
"@Test(expected = XMLValidationException.class)\n\tpublic void testValidateAgainstXSDNoXSDFound() throws XMLValidationException, XMLParseException {\n\t\tString testXML = \"<Content>\" + \n\t\t\t\t\"\t<InvalidTagName>\" + \n\t\t\t\t\"\t\t<SaveName>TestSaveName</SaveName>\" + \n\t\t\t\t\"\t\t<Seed>TestSeed</Seed>\" + \n\t\t\t\t\"\t\t<DayNumber>42</DayNumber>\" + \n\t\t\t\t\"\t</InvalidTagName>\" + \n\t\t\t\t\"</Content>\";\n\t\t\n\t\t// Convert the testXML to a byte array for the method in test\n\t\tbyte[] xmlBytes = testXML.getBytes();\n\t\t\n\t\t// Call the method in test\n\t\tDocument document = XMLUtils.convertByteArrayToDocument(xmlBytes);\n\t\t\n\t\tPropertyManager.setXSDLocation(\"InvalidPath\");\n\t\t\n\t\t// Call the method in test\n\t\tXSDValidator.validateAgainstXSD(document);\n\t}",
"public static void validateXMLSchema(Source xsd, Source xml) throws IllegalArgumentException\n {\n try\n {\n SchemaFactory factory = SchemaFactory.newInstance(\"http://www.w3.org/2001/XMLSchema\");\n Schema schema = factory.newSchema(xsd);\n Validator validator = schema.newValidator();\n validator.validate(xml);\n }\n catch (SAXException | IOException e)\n {\n throw new IllegalArgumentException(\"Invalid Entity XML\", e);\n }\n }",
"SchemaBuilder withResourceResolver(LSResourceResolver resourceResolver);",
"public FeatureTypeSchema_Impl(org.w3c.dom.Document schema) throws Exception {\r\n setSchema(schema);\r\n }",
"void setTransactionSchema(Schema transactionSchema);",
"@Override\r\n protected DfSchemaXmlReader createSchemaXmlReader() {\r\n return createSchemaXmlReaderAsCoreToGenerate();\r\n }",
"public void setSchemaLocation(String schemaLocation) {\n\t\t\r\n\t}",
"@Test\n\tpublic void testValidateAgainstXSD() throws Exception {\n\t\t// This XML is for the save event type\n\t\t\t\tString fullFilePath = System.getProperty(\"user.dir\") + \"\\\\Resources\\\\TestFiles\\\\Saves\\\\SAVE_TestSaveName.xml\";\n\n\t\t\t\t// Create the XML document\n\t\t\t\tDocument document = XMLUtils.convertByteArrayToDocument(Files.readAllBytes(new File(fullFilePath).toPath()));\n\n\t\tPropertyManager.setXSDLocation(\"C:\\\\Users\\\\Daniel\\\\Documents\\\\Uni\\\\TeamProject\\\\GitCopy\\\\TeamProjectVirusGame\\\\Resources\\\\XSD/VirusGameXSD.xsd\");\n\t\t\n\t\t// Call the method in test\n\t\tXSDValidator.validateAgainstXSD(document);\n\t}",
"@Override\n protected SourceXmlSchemaHelper setUpSchema(CachedUrl cu) {\n if (JatsPublishingHelper != null) {\n return JatsPublishingHelper;\n }\n JatsPublishingHelper = new JatsPublishingSchemaHelper();\n return JatsPublishingHelper;\n }",
"@Test(expected = XMLValidationException.class)\n\tpublic void testValidateAgainstXSDInvalidXML() throws XMLParseException, XMLValidationException {\n\t\tString testXML = \"<Content>\" + \n\t\t\t\t\"\t<InvalidTagName>\" + \n\t\t\t\t\"\t\t<SaveName>TestSaveName</SaveName>\" + \n\t\t\t\t\"\t\t<Seed>TestSeed</Seed>\" + \n\t\t\t\t\"\t\t<DayNumber>42</DayNumber>\" + \n\t\t\t\t\"\t</InvalidTagName>\" + \n\t\t\t\t\"</Content>\";\n\t\t\n\t\t// Convert the testXML to a byte array for the method in test\n\t\tbyte[] xmlBytes = testXML.getBytes();\n\t\t\n\t\t// Call the method in test\n\t\tDocument document = XMLUtils.convertByteArrayToDocument(xmlBytes);\n\t\t\n\t\tPropertyManager.setXSDLocation(\"C:\\\\Users\\\\Daniel\\\\Documents\\\\Uni\\\\TeamProject\\\\GitCopy\\\\TeamProjectVirusGame\\\\Resources\\\\XSD/VirusGameXSD.xsd\");\n\t\t\n\t\t// Call the method in test\n\t\tXSDValidator.validateAgainstXSD(document);\n\t}",
"private static XSModel loadSchema(Element schema, Definition def) {\n Map definitionNameSpaces = def.getNamespaces();\n Set nameSpaces = definitionNameSpaces.entrySet();\n Iterator nameSpacesIterator = nameSpaces.iterator();\n\n while (nameSpacesIterator.hasNext()) {\n Entry nameSpaceEntry = (Entry) nameSpacesIterator.next();\n if (!\"\".equals((String) nameSpaceEntry.getKey()) &&\n !schema.hasAttributeNS(\"http://www.w3.org/2000/xmlns/\",\n (String) nameSpaceEntry.getKey())) {\n Attr nameSpace =\n schema.getOwnerDocument().createAttributeNS(\n \"http://www.w3.org/2000/xmlns/\",\n \"xmlns:\" + nameSpaceEntry.getKey());\n nameSpace.setValue((String) nameSpaceEntry.getValue());\n schema.setAttributeNode(nameSpace);\n }\n }\n\n LSInput schemaInput = new DOMInputImpl();\n schemaInput.setStringData(\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\n + XmlUtils.getElementAsString(schema));\n log.info(\"Loading schema in types section of definition \" +\n def.getDocumentBaseURI());\n schemaInput.setSystemId(def.getDocumentBaseURI());\n XMLSchemaLoader schemaLoader = new XMLSchemaLoader();\n XSModel schemaModel = schemaLoader.load(schemaInput);\n log.info(\"Done loading\");\n return schemaModel;\n }",
"public FeatureTypeSchema_Impl() {\r\n schema = XMLTools.create();\r\n }",
"@Override\n public Schema getXMLSchema() throws XMLPlatformException {\n return documentBuilderFactory.getSchema();\n }",
"SchemaManager getSchemaManager();",
"@BeforeClass\n public static void externalSchemaCheck() {\n assumeTrue(\"can access \" + NameSpace.DC.xsd, canConnect(NameSpace.DC.xsd));\n }",
"private void validate(Document document) {\n try {\n SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n URL schemaUrl = this.getClass().getResource(\"/edu/mit/blocks/codeblocks/codeblocks.xsd\");\n Schema schema = schemaFactory.newSchema(schemaUrl);\n Validator validator = schema.newValidator();\n validator.validate(new DOMSource(document));\n }\n catch (MalformedURLException e) {\n throw new RuntimeException(e);\n }\n catch (SAXException e) {\n throw new RuntimeException(e);\n }\n catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"public void setSchemaLocation(String iSchemaLocation) {\r\n\t\tmLogger.entering(\"ADLSCORMValidator\", \"setSchemaLocation()\");\r\n\r\n\t\tmSchemaLocation = iSchemaLocation;\r\n\r\n\t\tmLogger.finest(\"mSchemaLocation set to \" + mSchemaLocation);\r\n\t\tmLogger.exiting(\"ADLSCORMValidator\", \"setSchemaLocation()\");\r\n\t}",
"private Document getModelDocument(InputStream inStream)\n throws IOException {\n assert inStream != null;\n\n try {\n // Create a document builder that validates the XML input using our schema\n SAXBuilder builder = new SAXBuilder();\n builder.setFeature(\"http://xml.org/sax/features/validation\", true);\n builder.setFeature(\n \"http://apache.org/xml/features/validation/schema\", true);\n builder.setFeature(\n \"http://apache.org/xml/features/validation/schema-full-checking\",\n true);\n builder.setProperty(\"http://apache.org/xml/properties/schema/external-\"\n + \"noNamespaceSchemaLocation\", schemaUrl.toString());\n return builder.build(inStream);\n }\n catch (JDOMException exc) {\n log.log(Level.SEVERE, \"Exception parsing input\", exc);\n throw new IOException(\"Exception parsing input: \" + exc.getMessage());\n }\n }",
"@Override\r\n\t\tpublic void setSchema(String schema) throws SQLException {\n\t\t\t\r\n\t\t}",
"public void setSchema(String aValue) {\n String oldValue = schema;\n schema = aValue;\n changeSupport.firePropertyChange(\"schema\", oldValue, aValue);\n }",
"void schema(String schema);",
"void schema(String schema);",
"@Override\n public Schema getSchema() {\n return schema$;\n }",
"@Override\n public Schema getSchema() {\n return schema$;\n }",
"@Override\n public Schema getSchema() {\n return schema$;\n }",
"@Override\n public Schema getSchema() {\n return schema$;\n }",
"protected static final SchemaFactory getSchemaFactory() {\r\n if (schemaFactory == null) {\r\n\r\n // 1. Lookup a factory for the W3C XML Schema language\r\n schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\r\n\r\n // 2. Set the custom XML catalog resolver :\r\n schemaFactory.setResourceResolver(CustomXmlCatalogResolver.getInstance());\r\n }\r\n\r\n return schemaFactory;\r\n }",
"public abstract String getSchemaURI();",
"SchemaDefinition createSchemaDefinition();",
"public abstract RepositoryLocationValidator getRepositoryLocationValidator();",
"private void configureBeanValidation(OpenJPAConfigurationImpl conf) {\n // Validation defines/adds the following plugins to OpenJPA Configuration\n conf.validationFactory = conf.addObject(JPAProperties.VALIDATE_FACTORY);\n conf.validator = conf.addObject(\"Validator\");\n conf.validationMode = conf.addString(JPAProperties.VALIDATE_MODE);\n conf.validationGroupPrePersist = conf.addString(JPAProperties.VALIDATE_PRE_PERSIST);\n conf.validationGroupPreUpdate = conf.addString(JPAProperties.VALIDATE_PRE_UPDATE);\n conf.validationGroupPreRemove = conf.addString(JPAProperties.VALIDATE_PRE_REMOVE);\n\n conf.validationMode.setDynamic(true);\n String[] aliases = new String[] {\n String.valueOf(ValidationMode.AUTO),\n String.valueOf(ValidationMode.AUTO).toLowerCase(Locale.ENGLISH),\n String.valueOf(ValidationMode.CALLBACK),\n String.valueOf(ValidationMode.CALLBACK).toLowerCase(Locale.ENGLISH),\n String.valueOf(ValidationMode.NONE),\n String.valueOf(ValidationMode.NONE).toLowerCase(Locale.ENGLISH)\n };\n conf.validationMode.setAliases(aliases);\n conf.validationMode.setAliasListComprehensive(true);\n conf.validationMode.setDefault(aliases[0]);\n\n conf.validationGroupPrePersist.setString(JPAProperties.VALIDATE_GROUP_DEFAULT);\n conf.validationGroupPrePersist.setDefault(\"\");\n conf.validationGroupPrePersist.setDynamic(true);\n\n conf.validationGroupPreUpdate.setString(JPAProperties.VALIDATE_GROUP_DEFAULT);\n conf.validationGroupPreUpdate.setDefault(\"\");\n conf.validationGroupPreUpdate.setDynamic(true);\n\n conf.validationGroupPreRemove.setDefault(\"\");\n conf.validationGroupPreRemove.setDynamic(true);\n\n conf.validationFactory.setInstantiatingGetter(\"getValidationFactoryInstance\");\n conf.validationFactory.setDynamic(true);\n\n conf.validator.setInstantiatingGetter(\"getValidatorInstance\");\n conf.validator.setDynamic(true);\n conf.validator.makePrivate();\n }",
"AstroSchema getSchema();",
"public void setDocumentForValidation(Document documentForValidation) {\n this.documentForValidation = documentForValidation;\n }",
"public void testSchemaResolving()\r\n {\r\n SchemaImpl schema = new SchemaImpl(\"module\");\r\n schema.setId(\"Baz\");\r\n\r\n DefaultErrorHandler errorHandler = new DefaultErrorHandler();\r\n RegistryDefinition definition = new RegistryDefinitionImpl();\r\n\r\n ModuleDescriptor fooBar = new ModuleDescriptor(null, errorHandler);\r\n fooBar.setModuleId(\"foo.bar\");\r\n\r\n fooBar.addSchema(schema);\r\n\r\n ModuleDescriptor zipZoop = new ModuleDescriptor(null, errorHandler);\r\n zipZoop.setModuleId(\"zip.zoop\");\r\n\r\n ConfigurationPointDescriptor cpd = new ConfigurationPointDescriptor();\r\n cpd.setId(\"Zap\");\r\n cpd.setContributionsSchemaId(\"foo.bar.Baz\");\r\n\r\n zipZoop.addConfigurationPoint(cpd);\r\n\r\n XmlModuleDescriptorProcessor processor = new XmlModuleDescriptorProcessor(definition,\r\n errorHandler);\r\n processor.processModuleDescriptor(fooBar);\r\n processor.processModuleDescriptor(zipZoop);\r\n \r\n XmlExtensionResolver extensionResolver = new XmlExtensionResolver(definition, errorHandler);\r\n extensionResolver.resolveSchemas();\r\n\r\n ConfigurationPointDefinition point = definition.getConfigurationPoint(\"zip.zoop.Zap\");\r\n \r\n ConfigurationParserDefinition parserDef = point.getParser(HiveMindSchemaParser.INPUT_FORMAT_NAME);\r\n assertNotNull(parserDef);\r\n \r\n assertEquals(parserDef.getParserConstructor().getClass(), HiveMindSchemaParserConstructor.class);\r\n\r\n HiveMindSchemaParserConstructor constructor = (HiveMindSchemaParserConstructor) parserDef.getParserConstructor();\r\n assertEquals(schema, constructor.getSchema());\r\n }",
"private Validator createValidator(URL xsdUrl) throws SAXException,\r\n\t\t\tParserConfigurationException {\r\n\t\tlogger.info(\"Entering RequestValidator.createValidator()\");\r\n\t\tSchemaFactory schemaFactory = SchemaFactory\r\n\t\t\t\t.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\r\n\t\tSchema schema = schemaFactory.newSchema(xsdUrl);\r\n\t\tlogger.info(\"Leaving RequestValidator.createValidator()\");\r\n\t\treturn schema.newValidator();\r\n\t}",
"public void setSchema(DbEntity entity, String schema) {\n }",
"public void setIsValidToSchema(boolean iIsValidToSchema) {\r\n\t\tmIsValidToSchema = iIsValidToSchema;\r\n\t}",
"public void setValidateDTD(final boolean validate)\r\n {\r\n this.validateDTD = validate;\r\n }",
"public void init() {\r\n\t\ttry {\r\n\t\t\tSAXParserFactory factory = SAXParserFactory.newInstance();\r\n\t\t\t//factory.setValidating(true);\r\n\t\t\t//factory.setFeature(\r\n\t\t\t//\t\t\"http://apache.org/xml/features/validation/schema\", true);\r\n\t\t\tfactory.setNamespaceAware(true);\r\n\t\t\t_parser = factory.newSAXParser();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tLoggerUtilsServlet.logErrors(e);\r\n\t\t}\r\n\t}",
"public Schema getSchema() {\n return schema;\n }",
"private void importXMLSchema(Import bpelImport) {\n \tString namespace = bpelImport.getNamespace();\n \tString location = bpelImport.getLocation();\n \tif (location == null) {\n mLogger.severe(\"Unable to import schema document, import location is null \" + bpelImport);\n throw new XMLParseVisitorException(\"Unable to import schema document, import location is null \" + bpelImport);\n }\n \t\n \tLazyImportVisitorService vService = (LazyImportVisitorService) getVisitorService();\n \tBPELParseContext bpelParseContext = vService.getBPELParseContext();\n \tIXSDResolver xsdResolver = bpelParseContext.getXSDResolver();\n \t\n \tif(xsdResolver == null) {\n \t\tmLogger.severe(\"Unable to import schema document, must specify XSD Resolver \" + bpelImport);\n throw new XMLParseVisitorException(\"Unable to import schema document, must specify XSD Resolver \" + bpelImport);\n \t}\n \t\n \ttry {\n\t \tXMLSchema xsdDocument = xsdResolver.resolve(namespace, location);\n\t \n\t if(xsdDocument == null) {\n\t \tmLogger.severe(\"Unable to import schema document for import \" + bpelImport);\n\t throw new XMLParseVisitorException(\"Unable to import schema document for import \" + bpelImport);\t\n\t }\n\t \n\t bpelImport.setImportedObject(xsdDocument);\n \n } catch (EInsightModelException e) {\n mLogger.log(Level.SEVERE, \"Unable to import xsd document for import \" + bpelImport, e);\n throw new XMLParseVisitorException(\"Unable to import xsd document for import \" + bpelImport, e);\n }\n \n }",
"public Builder setSchemaUrlBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n schemaUrl_ = value;\n onChanged();\n return this;\n }",
"public Schema getSchema() {\n return schema;\n }",
"@Autowired\n public void setDomainRepository(DomainRepository domainRepo) \n {\n this.domainRepo = domainRepo;\n }",
"protected DefaultSchemaComponent() {\n\t\tparameters = new SchemaParameterCollection();\n\t\tschemaports = new ArrayList<SchemaPort>();\n\t\tportrelations = new ArrayList<PortRelation>();\n\t}",
"public Schema getSchema()\n {\n return schema;\n }",
"public void setSchemaConfigLocation(String schemaConfigLoc) {\n this.schemaConfigLoc = schemaConfigLoc;\n }",
"public FeatureTypeSchema_Impl(org.w3c.dom.Element schema) throws Exception {\r\n this();\r\n setSchema(schema);\r\n }",
"public org.w3c.dom.Document getSchema() {\r\n return schema;\r\n }",
"@Autowired\n public OxmSchemaLoader(Translator translator, NodeIngestor nodeIngestor) {\n OxmSchemaLoader.translator = translator;\n OxmSchemaLoader.nodeIngestor = nodeIngestor;\n }",
"public StudentXMLRepository(Validator<Student> studentValidator,String XMLfile){\n super(studentValidator);\n this.XMLfile=XMLfile;\n try {\n loadData();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"S getSchema();",
"public void validate() throws org.exolab.castor.xml.ValidationException {\r\n\t\torg.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r\n\t\tvalidator.validate(this);\r\n\t}",
"public List validateSLD(InputSource xml, String SchemaUrl) {\n SAXParser parser = new SAXParser();\n \n try {\n // 1. tell the parser to validate the XML document vs the schema\n // 2. does not validate the schema (the GML schema is *not* valid. This is\n // \t\t\tan OGC blunder)\n // 3. tells the validator that the tags without a namespace are actually\n // \t\t\tSLD tags.\n // 4. tells the validator to 'override' the SLD schema that a user may\n // \t\t\tinclude with the one inside geoserver.\n \n parser.setFeature(\"http://xml.org/sax/features/validation\", true);\n parser.setFeature(\"http://apache.org/xml/features/validation/schema\",\n true);\n parser.setFeature(\"http://apache.org/xml/features/validation/schema-full-checking\",\n false);\n \n parser.setProperty(\"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation\",\n SchemaUrl);\n parser.setProperty(\"http://apache.org/xml/properties/schema/external-schemaLocation\",\n \"http://www.opengis.net/sld \" + SchemaUrl);\n \n //parser.setProperty(\"http://apache.org/xml/properties/schema/external-schemaLocation\",\"http://www.opengis.net/ows \"+SchemaUrl);\n Validator handler = new Validator();\n parser.setErrorHandler(handler);\n parser.parse(xml);\n \n return handler.errors;\n } catch (java.io.IOException ioe) {\n ArrayList al = new ArrayList();\n al.add(new SAXParseException(ioe.getLocalizedMessage(), null));\n \n return al;\n } catch (SAXException e) {\n ArrayList al = new ArrayList();\n al.add(new SAXParseException(e.getLocalizedMessage(), null));\n \n return al;\n }\n }",
"public void setValidator(Validator validator) {\n _validator = validator;\n }",
"public Builder clearSchemaUrl() {\n \n schemaUrl_ = getDefaultInstance().getSchemaUrl();\n onChanged();\n return this;\n }",
"public static void testValidity(File xmlFile, StreamSource schemaFileSource) throws SAXException, IOException{\n\n SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n\n\t\tSchema schema = factory.newSchema(schemaFileSource);\n\n Validator validator = schema.newValidator();\n\n Source xmlFileSource = new StreamSource(xmlFile);\n\n validator.validate(xmlFileSource);\n\n\t \n\t}",
"public SchemaTypeHandler(String serviceName,\n String serverName,\n InvalidParameterHandler invalidParameterHandler,\n RepositoryHandler repositoryHandler,\n OMRSRepositoryHelper repositoryHelper,\n LastAttachmentHandler lastAttachmentHandler)\n {\n this.serviceName = serviceName;\n this.serverName = serverName;\n this.invalidParameterHandler = invalidParameterHandler;\n this.repositoryHandler = repositoryHandler;\n this.repositoryHelper = repositoryHelper;\n this.lastAttachmentHandler = lastAttachmentHandler;\n }",
"public void validate()\r\n throws org.exolab.castor.xml.ValidationException\r\n {\r\n org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r\n validator.validate(this);\r\n }",
"public void validate()\r\n throws org.exolab.castor.xml.ValidationException\r\n {\r\n org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r\n validator.validate(this);\r\n }",
"public Schema getSchema();",
"public AssertSoapFaultBuilder schemaValidation(boolean enabled) {\n validationContext.setSchemaValidation(enabled);\n return this;\n }",
"private static boolean validate(JAXBContext jaxbCongtext, File file, URL xsdUrl) {\n SchemaFactory schemaFactory = null;\n Schema schema = null;\n Source xmlFile = new StreamSource(file);\n try {\n schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n schema = schemaFactory.newSchema(xsdUrl);\n Validator validator = schema.newValidator();\n DocumentBuilderFactory db = newSecuDocBuilderFactory();\n db.setNamespaceAware(true);\n\n DocumentBuilder builder = db.newDocumentBuilder();\n Document doc = builder.parse(file);\n\n DOMSource source = new DOMSource(doc);\n DOMResult result = new DOMResult();\n\n validator.validate(source, result);\n LOGGER.debug(xmlFile.getSystemId() + \" is valid\");\n } catch(Exception ex) {\n LOGGER.error(xmlFile.getSystemId() + \" is NOT valid\", ex);\n return false;\n }\n return true;\n }",
"@Override\n protected SourceXmlSchemaHelper setUpSchema(CachedUrl cu, Document doc) {\n // Once you have it, just keep returning the same one. It won't change.\n String system = null;\n String release = null;\n \n if (doc == null) return null;\n DocumentType doctype = doc.getDoctype();\n if (doctype != null) {\n system = doctype.getSystemId();\n log.debug3(\"DOCTYPE URI: \" + doctype.getSystemId());\n }\n Element root = doc.getDocumentElement();\n if (root != null) {\n release = root.getAttribute(\"release\");\n if (release != null) {\n log.debug3(\"releaseNum : \" + release);\n }\n }\n if( ((system != null) && system.contains(\"/onix/2\")) ||\n (( release != null) && release.startsWith(\"2\")) ) {\n if (Onix2Helper == null) {\n Onix2Helper = new Onix2BooksSchemaHelper();\n }\n return Onix2Helper;\n } else if ( ((system != null) && system.contains(\"/onix/3\")) ||\n (( release != null) && release.startsWith(\"3\")) ) {\n if (Onix3Helper == null) {\n Onix3Helper = new Onix3BooksSchemaHelper();\n }\n return Onix3Helper;\n } else {\n log.warning(\"guessing at XML schema - using ONIX2\");\n }\n if (Onix2Helper == null) {\n Onix2Helper = new Onix2BooksSchemaHelper();\n }\n return Onix2Helper;\n }"
] | [
"0.6199913",
"0.6174016",
"0.585771",
"0.57992303",
"0.5782078",
"0.5754796",
"0.5729847",
"0.55606294",
"0.5543347",
"0.549613",
"0.5345016",
"0.53339446",
"0.5313325",
"0.5303879",
"0.52807564",
"0.52592736",
"0.5238467",
"0.5224594",
"0.5212315",
"0.51832956",
"0.51832956",
"0.5165",
"0.51642036",
"0.5083104",
"0.5083038",
"0.5077435",
"0.50562245",
"0.50476575",
"0.49977836",
"0.49708152",
"0.49589938",
"0.49572238",
"0.4925783",
"0.4900057",
"0.48920143",
"0.48586422",
"0.48550037",
"0.4852201",
"0.4829721",
"0.48198688",
"0.48010483",
"0.47995245",
"0.47907522",
"0.4789958",
"0.47898713",
"0.4768161",
"0.47595865",
"0.4741368",
"0.47269812",
"0.47147226",
"0.47119159",
"0.47113907",
"0.47002283",
"0.46929348",
"0.46852967",
"0.46818528",
"0.46791187",
"0.46791187",
"0.4676624",
"0.4676624",
"0.4676624",
"0.4676624",
"0.46730196",
"0.46659636",
"0.4646874",
"0.45977545",
"0.45954132",
"0.45836207",
"0.4575422",
"0.45733598",
"0.4554763",
"0.4543795",
"0.45338792",
"0.45317313",
"0.4528604",
"0.45009845",
"0.4500261",
"0.44901255",
"0.44881168",
"0.448537",
"0.44840184",
"0.448148",
"0.44727558",
"0.44716915",
"0.44633487",
"0.4462846",
"0.4446612",
"0.44442078",
"0.4439708",
"0.44396308",
"0.4436916",
"0.4430938",
"0.44300485",
"0.44294655",
"0.442778",
"0.442778",
"0.44077757",
"0.44044408",
"0.43972853",
"0.43941444"
] | 0.6390167 | 0 |
Sets the Spring bean application context. | public AssertSoapFaultBuilder withApplicationContext(ApplicationContext applicationContext) {
if (applicationContext.containsBean("soapFaultValidator")) {
validator(applicationContext.getBean("soapFaultValidator", SoapFaultValidator.class));
}
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tcontext = (WebApplicationContext) applicationContext;\r\n\t}",
"@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tcontext=applicationContext;\n\t}",
"@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tthis.applicationContext = applicationContext;\r\n\t}",
"@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t}",
"@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tSystem.out.println(\"进入方法。。。\"+applicationContext);\r\n\t\tApplicationContextHolder.app=applicationContext;\r\n\t}",
"public void setApplicationContext(ApplicationContext context) throws BeansException {\n appContext = context;\n }",
"public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tthis.context=context;\r\n\t}",
"public void setApplicationContext(ApplicationContext applicationContext)\n/* */ throws BeansException\n/* */ {\n/* 106 */ applicationContext = applicationContext;\n/* */ }",
"public void setApplicationContext(ApplicationContext applicationContext)\n throws BeansException\n {\n this.applicationContext = applicationContext;\n }",
"@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\t\r\n\t}",
"public void setApplicationContext(ApplicationContext context) throws BeansException {\r\n CONTEXT = context;\r\n }",
"@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException\n\t{\n\t\trootApplicationContext = applicationContext;\n\t}",
"@Override\n\tpublic void setApplicationContext(ApplicationContext context) throws BeansException {\n\t\t\n\t\tthis.context = context;\n\t\t\n\t}",
"@Override\n public void setApplicationContext(ApplicationContext applicationContext) {\n super.setApplicationContext(applicationContext);\n this.applicationContext = applicationContext;\n }",
"public void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tZWUtil.applicationContext = applicationContext;\r\n\t}",
"@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\t\n\t}",
"@Override\n\tpublic void setApplicationContext(ApplicationContext context) throws BeansException {\n\t\tSystem.out.println(\"setting newly\");\n\t\tthis.context=context;\n\t\tsetContext();\n\t}",
"@Override\n public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n System.out.println(\"## setApplicationContext(appcontext) Application context has been set!\");\n }",
"void setAppCtx(ApplicationContext appCtx);",
"public void setApplicationContext(final ApplicationContext inApplicationContext)\n {\n ctx = inApplicationContext;\n }",
"@Override\n\tpublic void setApplicationContext(ApplicationContext ctx) throws BeansException {\n\t\tthis.ctx=ctx;\n\t}",
"public void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t}",
"public static void setApplicationContext( ApplicationContext context ){\n\t\t\tctx = context;\n//\t\telse{\n//\t\t\tSystem.out.println(\"Error, ApplicationContext already has been set\");\n//\t\t}\n\t}",
"@Autowired\n\tpublic void setContext(ApplicationContext context) {\n\t\tthis.context = context;\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\n\t}",
"@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}",
"@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}",
"public void setContext(ActionBeanContext context) {\r\n this.context = context;\r\n }",
"static void setActiveContext(ApplicationContext context) {\n SchemaCompilerApplicationContext.context = context;\n }",
"public void setSpringContext(ApplicationContext springContext) {\n\t\tthis.springContext = springContext;\n\t}",
"public ApplicationContextAwareProcessor(ConfigurableApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t}",
"@Override\n protected void configure() {\n bind(ApplicationContext.class).toInstance(ctxt);\n }",
"public void initContext() {\n\t\tClassLoader originalContextClassLoader =\n\t\t\t\tThread.currentThread().getContextClassLoader();\n\t\tThread.currentThread().setContextClassLoader(MY_CLASS_LOADER);\n\t\t//this.setClassLoader(MY_CLASS_LOADER);\n\n\t\tcontext = new ClassPathXmlApplicationContext(\"beans.xml\");\n\t\tsetParent(context);\n\n\n\t\t// reset the original CL, to try to prevent crashing with\n\t\t// other Java AI implementations\n\t\tThread.currentThread().setContextClassLoader(originalContextClassLoader);\n\t}",
"public ApplicationContext getApplicationContext() {\n return applicationContext;\n }",
"@Override\r\n public void init() throws Exception {\r\n context = SpringApplication.run(getClass(), savedArgs);\r\n context.getAutowireCapableBeanFactory().autowireBean(this);\r\n }",
"private AnnotationConfigWebApplicationContext getGlobalApplicationContext() {\r\n\t\tAnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();\r\n\t\t//rootContext.register(ApplicationConfig.class);\r\n\t\trootContext.register(new Class[] {ApplicationConfig.class});\r\n\t\treturn rootContext;\r\n\t}",
"public void configureContextInitializationComponents(AppConfiguration appConfig,\n\t SpringBeansXMLBuilder builder);",
"public ApplicationContext getApplicationContext()\n {\n return this.applicationContext;\n }",
"public static ApplicationContext getApplicationContext() {\n return appContext;\n }",
"public static ApplicationContext getApplicationContext() {\r\n\t\treturn applicationContext;\r\n\t}",
"public void initApplicationContext()\r\n/* 32: */ throws BeansException\r\n/* 33: */ {\r\n/* 34:103 */ super.initApplicationContext();\r\n/* 35:104 */ registerHandlers(this.urlMap);\r\n/* 36: */ }",
"public void setBeanContextBuilder(BeanContextBuilder beanContextBuilder) {\n\t\tthis.beanContextCreator = beanContextBuilder;\n\t}",
"public void setContext(Context context) {\n this.context = context;\n }",
"public void setContext(Context _context) {\n context = _context;\n }",
"public void setContext(Context context) {\n this.contextMain = context;\n }",
"@Override\r\n\tpublic void setContext(Context context) {\r\n\t\tthis.context = context;\r\n\t}",
"protected void setContext(RestContext context) throws ServletException {\n\t\tthis.context.set(context);\n\t}",
"public void setBeanFactory(BeanFactory beanFactory)\r\n/* 35: */ {\r\n/* 36: 77 */ this.beanFactory = beanFactory;\r\n/* 37: */ }",
"public static Context getApplicationContext() { return mApplicationContext; }",
"public interface ServletContextAware {\r\n\t/**\r\n\t * Set the ServletContext that this object runs in.\r\n\t * <p>Invoked after population of normal bean properties but before an init\r\n\t * callback like InitializingBean's <code>afterPropertiesSet</code> or a\r\n\t * custom init-method. Invoked after ApplicationContextAware's\r\n\t * <code>setApplicationContext</code>.\r\n\t * @param servletContext ServletContext object to be used by this object\r\n\t * @see InitializingBean#afterPropertiesSet\r\n\t * @see ApplicationContextAware#setApplicationContext\r\n\t */\r\n\tvoid setServletContext(ServletContext servletContext);\r\n\r\n}",
"@Override\n public void onStartup(ServletContext container) {\n AnnotationConfigWebApplicationContext rootContext =\n new AnnotationConfigWebApplicationContext();\n rootContext.register(ApplicationConfig.class);\n rootContext.setConfigLocation(\"example.spring\");\n\n // Manage the lifecycle of the root application context\n container.addListener(new ContextLoaderListener(rootContext));\n container.addListener(new RequestContextListener());\n\n // The following line is required to avoid having jersey-spring3 registering it's own Spring root context.\n container.setInitParameter(\"contextConfigLocation\", \"\");\n\n }",
"public Context getApplicationContext();",
"@Autowired\n public void setEnvironment(Environment environment) {\n this.environment = environment;\n }",
"public void setContext(ComponentContext ctx)\n\t{\n\t\tthis.context = ctx;\n\t}",
"@Before\n public void setUp() {\n this.context = new AnnotationConfigApplicationContext(\"com.fxyh.spring.config\");\n// this.context = new ClassPathXmlApplicationContext(\"classpath*:applicationContext-bean.xml\");\n this.user = this.context.getBean(User.class);\n this.user2 = this.context.getBean(User.class);\n this.department = this.context.getBean(Department.class);\n this.userService = (UserService) this.context.getBean(\"userService\");\n }",
"@Autowired\n\tpublic void setConfigService(ConfigService configService) {\n\t\tthis.configService = configService;\n\t}",
"public static void initApplicationContext(Context appContext) {\n // Conceding that occasionally in tests, native is loaded before the browser process is\n // started, in which case the browser process re-sets the application context.\n assert mApplicationContext == null || mApplicationContext == appContext ||\n ((ContextWrapper)mApplicationContext).getBaseContext() == appContext;\n initJavaSideApplicationContext(appContext);\n }",
"void setContext(Context context) {\n\t\tthis.context = context;\n\t}",
"@Autowired\n public void setWebApp( WebApp sysDesc ) {\n webapp = sysDesc;\n }",
"ApplicationContext getAppCtx();",
"public void setContext(final Class<?> context) {\n\t\tthis.context = context;\n\t}",
"public interface MyApplicationContextAware {\n /**\n * 20:18 2020/11/15\n * @param \n * @return\n */\n void setAapplicationContext(MyApplicationContext application);\n}",
"public void setUserContext(UserContext userContext);",
"public MyApp() {\n sContext = this;\n }",
"@Override\r\n\tpublic void setCamelContext(CamelContext ctx) {\n\t\tthis.ctx = ctx;\r\n\t}",
"public void injectContext(ComponentContext context);",
"@Autowired\n public void setGreetingService(GreetingsServiceUsingSpring greetingsServiceUsingSpring) {\n this.greetingsServiceImplUsingSpring = greetingsServiceUsingSpring;\n }",
"private SpringApplicationContext() {}",
"protected void initSpring() {\n\t\tgetComponentInstantiationListeners().add(new SpringComponentInjector(this));\n\t}",
"public void setAppServletContext(ServletContext servletContext)\n {\n if (servletContext != null)\n {\n this.servletContext = servletContext;\n }\n }",
"@Autowired\n public void setUserService(UserService userService) {\n this.userService = userService;\n }",
"public static Context getAppContext() {\n return _BaseApplication.context;\n }",
"public final void setBean(String bean) {\n this.bean = bean;\n }",
"public void setServletContext(ServletContext context) {\n this.context = context;\n }",
"public void setContext(UsersResourceContext context) {\n this._context = context;\n }",
"private static void assertContextInjected() {\n if (applicationContext == null) {\n throw new IllegalStateException(\"applicaitonContext attribute is not injected, please enter applicationContext\" +\n \"Define SpringContextHolder in .xml or register SpringContextHolder in SpringBoot startup class.\");\n }\n }",
"private SpringApplicationContextProvider() {\r\n\t}",
"ProxyMvc(ConfigurableWebApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t\tProxyServletContext servletContext = new ProxyServletContext();\n\t\tthis.applicationContext.setServletContext(servletContext);\n\t\tthis.applicationContext.refresh();\n\n\t\tif (this.applicationContext.containsBean(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)) {\n\t\t\tthis.dispatcher = this.applicationContext.getBean(DispatcherServlet.class);\n\t\t}\n\t\telse {\n\t\t\tthis.dispatcher = new DispatcherServlet(this.applicationContext);\n\t\t\tthis.dispatcher.setDetectAllHandlerMappings(false);\n\t\t\t((GenericApplicationContext) this.applicationContext).registerBean(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,\n\t\t\t\t\tDispatcherServlet.class, () -> this.dispatcher);\n\t\t}\n\n\t\tServletRegistration.Dynamic reg = servletContext.addServlet(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME, dispatcher);\n\t\treg.setLoadOnStartup(1);\n\t\tthis.servletContext = applicationContext.getServletContext();\n\t\ttry {\n\t\t\tthis.dispatcher.init(new ProxyServletConfig(this.servletContext));\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new IllegalStateException(\"Faild to create Spring MVC DispatcherServlet proxy\", e);\n\t\t}\n\t}",
"protected void init() { \n ServletContext servletContext = getServletContext();\n applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);\n\n String names[] = applicationContext.getBeanDefinitionNames();\n\n for (String name : names) {\n System.out.println(\"name:\" + name);\n }\n }",
"@PostConstruct\n public void setup() {\n this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();\n }",
"@Provides\n @Singleton\n @ApplicationScope\n public Context provideApplicationContext() {\n return mApp.getApplicationContext();\n }",
"public static ApplicationContext getInstance() {\r\n\t\tsynchronized (SpringApplicationContextProvider.class) {\r\n\t\tif (applicationContext == null) {\r\n\t\t\tapplicationContext = new ClassPathXmlApplicationContext(\r\n\t\t\t\t\tnew String[] { \"META-INF/app-context.xml\" });\r\n\t\t}\r\n\t\t}\r\n\t\treturn (ApplicationContext) applicationContext;\r\n\t}",
"void setContext(Map<String, Object> context);",
"public static Context getContext(){\n return appContext;\n }",
"public synchronized static void setContext(Context con){\n\t\tcontext = con;\n\t}",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n if(event.getApplicationContext().getDisplayName().equals(\"Root WebApplicationContext\")){\n System.out.println(\"避免spring-servlet.xml跟appicationContext.xml两次加载\");\n }\n if(event.getApplicationContext().getParent()==null){\n System.out.println(\"执行context上下文初始化\");\n ApplicationContextUtil.instance.init(event.getApplicationContext());\n }\n }",
"public static void setApplication(ApplicationBase instance)\r\n {\r\n ApplicationBase.instance = instance;\r\n }",
"@Override\n public Context getApplicationContext() {\n return mView.get().getApplicationContext();\n }",
"public void setContext(ContextRequest context) {\n\t\tthis.context = context;\n\t}",
"public void setContext(String context) {\r\n\t\tthis.context = context;\r\n\t}",
"public static void setupContext(ServletContext context) {\n \t//I don't need this dropdown list. bguo.\n// ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);\n// LookupManager mgr = (LookupManager) ctx.getBean(\"lookupManager\");\n//\n// // get list of possible roles\n// context.setAttribute(RoleConstants.AVAILABLE_ROLES, mgr.getAllRoles());\n// log.debug(\"Drop-down initialization complete [OK]\");\n }",
"@Component(modules = ApplicationModule.class)\npublic interface ApplicationComponent {\n\n Context getApplication();\n}",
"public void setAutowired(EntityTobeAutowired autowired) {\n\t\tthis.autowired = autowired;\n\t}",
"public void setContextObject(Object co) {\n context = co;\n }",
"@Override\n\tpublic void initApplication(BBApplication app) {\n\t\tthis._application = app;\n\t}",
"protected void setUpApplication() throws Exception\n {\n ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder\n .getFactory(FactoryFinder.APPLICATION_FACTORY);\n application = applicationFactory.getApplication();\n ((MockFacesContext) facesContext).setApplication(application);\n }",
"public void setContext(PageContext context) {\n this.context = context;\n }",
"public void setContext(String context) {\n\t\tthis.context = context;\n\t}",
"@Override\n\tpublic void setBeanDefinitionContext(String beanDefinitionContextName,\n\t\t\tString resource) {\n\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}",
"@Test\n\tpublic void testContextShouldInitalizeChildContexts() {\n\t\tassertThat(Foo.getInstanceCount()).isEqualTo(1);\n\t\tApplicationContext ctx = springClientFactory.getContext(\"testspec\");\n\n\t\tassertThat(Foo.getInstanceCount()).isEqualTo(1);\n\t\tFoo foo = ctx.getBean(\"foo\", Foo.class);\n\t\tassertThat(foo).isNotNull();\n\t}",
"protected abstract ApplicationContext createApplicationContextImpl(\n MarinerRequestContext requestContext);"
] | [
"0.7990539",
"0.7822849",
"0.77856714",
"0.7738964",
"0.7719056",
"0.7716051",
"0.7675699",
"0.7587523",
"0.7575889",
"0.7561347",
"0.75449556",
"0.74852145",
"0.74571884",
"0.74541",
"0.74237496",
"0.74028957",
"0.728707",
"0.72469985",
"0.7226825",
"0.71949977",
"0.7148888",
"0.7131804",
"0.7077142",
"0.69286865",
"0.69029206",
"0.69029206",
"0.6608121",
"0.65128124",
"0.64631116",
"0.6438354",
"0.6402001",
"0.63731647",
"0.6126418",
"0.6117045",
"0.6076476",
"0.60021025",
"0.5984995",
"0.59060746",
"0.59041107",
"0.5869459",
"0.58407027",
"0.58188576",
"0.58063835",
"0.5741547",
"0.57313246",
"0.5708455",
"0.5601302",
"0.5592362",
"0.55901474",
"0.55806816",
"0.5563977",
"0.5561493",
"0.55582154",
"0.55555856",
"0.5554668",
"0.55473",
"0.55373466",
"0.5496978",
"0.5486775",
"0.54809415",
"0.5460342",
"0.5452424",
"0.5451824",
"0.54490924",
"0.54134125",
"0.5391137",
"0.5361127",
"0.5359101",
"0.53389156",
"0.53362083",
"0.5331204",
"0.53276646",
"0.5301919",
"0.52978194",
"0.52938545",
"0.52598065",
"0.525444",
"0.5247139",
"0.52387506",
"0.5232322",
"0.52242196",
"0.522373",
"0.52116233",
"0.5206642",
"0.52001",
"0.5189909",
"0.51766235",
"0.51737237",
"0.51722544",
"0.515935",
"0.51552373",
"0.5154291",
"0.51469797",
"0.514104",
"0.51192087",
"0.5112055",
"0.51020473",
"0.5098659",
"0.50903505",
"0.50782883",
"0.50762767"
] | 0.0 | -1 |
Iterative approach is based on the idea that a parent of the subtree is visited just right after its right child (if it exists) is visited. Thus, whenever we are going to pop a top node from the stack we have to check 2 things: 1. if the top node has a right child 2. and its right child is not equal to previously visited node If above conditions are false, then it means that we visited both left and right subtrees of the top node and it can be popped out from the stack. If above are true, then we have to first check out the right subtree and then come back to the current top node | public List<Integer> iterativeTraversal(TreeNode root) {
List<Integer> list = new ArrayList<>();
if (root == null) {
return list;
}
Deque<TreeNode> stack = new LinkedList<>();
TreeNode curr = root;
TreeNode prev = null;
while (curr != null || !stack.isEmpty()) {
while (curr != null) {
stack.push(curr);
curr = curr.left;
}
TreeNode top = stack.peek();
// we have to check whether the top node has a right child and it is not equal to the previously visited node
// if above is true, we have to first traverse the right subtree before we pop the parent
if (top.right != null && top.right != prev) {
curr = top.right;
} else {
stack.pop(); // we can remove the node from the stack as we already processed left and right subtrees.
prev = top; // we have to remember previously visited node, as we will compare it later
list.add(top.val); // visit a node
// curr reference is null at this point
}
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void getInorderIteratively(Node node) {\n Stack<Node> stack = new Stack<Tree.Node>();\n if (node == null)\n return;\n Node current = node;\n while (!stack.isEmpty() || current != null) {\n // While the sub tree is not empty keep on adding them\n while (current != null) {\n stack.push(current);\n current = current.left;\n }\n // No more left sub tree\n Node temp = stack.pop();\n System.out.println(temp.data);\n // We now have to move to the right sub tree of the just popped out node\n current = temp.right;\n }\n\n }",
"static void postOrderIterative(BinaryTreeNode root)\n {\n // Create two stacks\n Stack<BinaryTreeNode> s1 = new Stack<BinaryTreeNode>();\n Stack<BinaryTreeNode> s2 = new Stack<BinaryTreeNode>();\n\n // push root to first stack\n s1.push(root);\n BinaryTreeNode node;\n\n // Run while first stack is not empty\n while(!s1.isEmpty()){\n // Pop an item from s1 and push it to s2\n node = s1.pop();\n s2.push(node);\n\n // Push left and right children of removed item to s1\n if(node.getLeft()!=null){\n s1.push(node.getLeft());\n }\n if(node.getRight() != null){\n s1.push(node.getRight());\n }\n }\n\n\n // Print all elements of second stack\n while (!s2.isEmpty()) {\n node = s2.pop();\n System.out.print(node.getData() + \"->\");\n }\n }",
"static void inOrderWithoutRecursion(Node root) {\n if (root == null) {\n return;\n }\n Stack<Node> stack = new Stack<>();\n Node curr = root;\n while (curr != null || !stack.isEmpty()) {\n while (curr != null) {\n stack.push(curr);\n curr = curr.left;\n }\n curr = stack.pop();\n System.out.print(curr.data + \" \");\n curr = curr.right;\n }\n\n }",
"protected void visitRightSubtree() {\n\t\tif(tree.hasRightNode()) {\n\t\t\ttree.moveToRightNode();\n\t\t\ttraverse();\n\t\t\ttree.moveToParentNode();\n\t\t}\n\t}",
"public TreeNode upSideDownBinary_Stack(TreeNode root){\n if (root == null){\n return root;\n }\n \n Deque<TreeNode> stack = new LinkedList<TreeNode>();\n \n while(root != null){\n stack.offerLast(root);\n root = root.left;\n }\n \n TreeNode newRoot = stack.pollLast();\n TreeNode cur = newRoot;\n \n while(!stack.isEmpty()){\n TreeNode oriParent = stack.pollLast();\n cur.left = oriParent.right;\n cur.right = oriParent;\n \n oriParent.left = null;\n oriParent.right = null;\n cur = oriParent;\n }\n \n return newRoot;\n }",
"@Test\n void whenPopTillStackEmptyReturnNodeShouldBeFirstNode() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n boolean isEmpty = myStack.popTillEmpty();\n\n System.out.println(isEmpty);\n boolean result = myStack.head == null && myStack.tail == null;\n }",
"void pop() {\n // -\n top = top.getNextNode();\n }",
"public boolean stackPop() {\r\n\t\t if(stackEmpty())\r\n\t\t {\r\n\t\t\t return false;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t if(top == 0)\r\n\t\t {\r\n\t\t \ttop = -1;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tarray[top] = array[top-1];\r\n\t\t \ttop--;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t\t return true;\r\n\t\t } \t\r\n\t }",
"private E[] geInOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"public void pop(){\n \n if(top==null) System.out.println(\"stack is empty\");\n else top=top.next;\n \t\n }",
"public Iteratable<IRNode> topDown(IRNode subtree);",
"public void inOrderTraversal(){\n System.out.println(\"inOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack<Node>();\n\n for(Node node = root; node!= null; node=node.getLeft()){\n stack.push(node);\n }\n while(!stack.isEmpty()){\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n for(node=node.getRight(); node!= null; node = node.getLeft()){\n stack.push(node);\n }\n }\n\n System.out.println();\n }",
"public void depthFirstSearch(){\n\t\tStack<TreeNode<T>> nodeStack = new Stack<TreeNode<T>>();\n\n\t\tif(root!=null){\n\t\t\tnodeStack.push(root);\n\t\t\tSystem.out.println(root.data);\n\t\t\tTreeNode<T> topNode = root;\n\t\t\twhile(!nodeStack.isEmpty()){\n\t\t\t\tif(topNode.left!=null){\n\t\t\t\t\tnodeStack.push(topNode.left);\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(topNode.data);\n\t\t\t\t\ttopNode = topNode.left;\n\t\t\t\t} else if(topNode.right!=null){\n\t\t\t\t\tnodeStack.push(topNode.right);\n\t\t\t\t\tSystem.out.println(topNode.data);\n\t\t\t\t\ttopNode = topNode.right;\n\t\t\t\t} else{\n\t\t\t\t\ttry{\n\t\t\t\t\t\tnodeStack.pop();\n\t\t\t\t\t}catch(Exception ex){\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public Node popRightChild() {\n if (rightChild == null) {\n return null;\n }\n else {\n Node tmp = rightChild;\n rightChild = null;\n return tmp;\n }\n }",
"static boolean dfs(TreeNode root) {\n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n while (!stack.isEmpty()) {\n TreeNode node = (TreeNode) stack.pop();\n if (node == null)\n continue;\n\n System.out.println(\"Checking node \" + node.data);\n if (isGoal(node)) {\n System.out.println(\"\\nFound goal node \" + node.data);\n return true;\n }\n stack.addAll(node.getChildren());\n // dump(stack);\n }\n return false;\n }",
"public Item popRight(){\n if(isEmpty()) throw new NoSuchElementException(\"Underflow\");\n\n Item oldLast = last.item;\n Node<Item> previous = first;\n if (first != null) {\n Node<Item> current = first;\n while (current.next != null) {\n previous = current;\n current = current.next;\n }\n last = previous;\n last.next = null;\n }\n return oldLast;\n }",
"private List<ThroughNode> popStackStackForward() {\n List<ThroughNode> popped = nodeStackStack.peek();\n nodeStackStack.push(C.tail(popped));\n return popped;\n }",
"public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}",
"private void bubbleDown() {\n int pos = 0;\n boolean done = false;\n while (!done) {\n if (rightChild(pos) < heap.size() && isBigger(rightChild(pos), pos)) {\n swapup(rightChild(pos));\n } else if (leftChild(pos) < heap.size() && isBigger(leftChild(pos), pos)) {\n swapup(leftChild(pos));\n } else {\n done = true;\n }\n }\n }",
"public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }",
"@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}",
"public void pop()\r\n\t{\r\n\t\ttop--;\r\n\t\tstack[top] = null;\r\n\t}",
"public int remove() {\n int result = peek();\n\n // move rightmost leaf to become new root\n elementData[1] = elementData[size];\n size--;\n \n // \"bubble down\" root as necessary to fix ordering\n int index = 1;\n boolean found = false; // have we found the proper place yet?\n while (!found && hasLeftChild(index)) {\n int left = leftChild(index);\n int right = rightChild(index);\n int child = left;\n if (hasRightChild(index) &&\n elementData[right] < elementData[left]) {\n child = right;\n }\n \n if (elementData[index] > elementData[child]) {\n swap(elementData, index, child);\n index = child;\n } else {\n found = true; // found proper location; stop the loop\n }\n }\n \n return result;\n }",
"@Override\n\tpublic boolean add(E e) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tStack<Node> stackForParent = new Stack<Node>();\n\t\t\n\t\t\n\t\tNode tempRoot = root;\n\t\tif(root == null) {\n\t\t\tsize += 1;\n\t\t\troot = new Node(e);\n\t\t\troot.height = max(heightOfNode(root.left) , heightOfNode(root.right)) + 1;\n\t\t} else {\n\n\t\t\tNode newNode = new Node(e);\n\n\t\t\tNode y = null;\n\n\t\t\twhile(tempRoot != null){\n\t\t\t\ty = tempRoot;\n\t\t\t\tif(e.compareTo(tempRoot.value) < 0){\n\t\t\t\t\tstack.push(tempRoot);\n\t\t\t\t\tstackForParent.push(tempRoot);\n\t\t\t\t\ttempRoot = tempRoot.left;\n\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(tempRoot);\n\t\t\t\t\tstackForParent.push(tempRoot);\n\t\t\t\t\ttempRoot = tempRoot.right;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(y == null){\n\t\t\t\ty = newNode;\n\t\t\t\tsize += 1;\n\t\t\t\ty.balanceFactor = 0;\n\t\t\t} else if(e.compareTo(y.value) < 0){\n\t\t\t\ty.left = newNode;\n\t\t\t\ty.left.balanceFactor = 0;\n\t\t\t\tsize += 1;\n\t\t\t} else if(e.compareTo(y.value) == 0) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\ty.right = newNode;\n\t\t\t\ty.right.balanceFactor = 0;\n\t\t\t\tsize += 1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tNode parent = null;\n\t\t\tNode walkBackNode;\n\t\t\tint lHeight,rHeight;\n\t\t\tif(!stackForParent.empty()) {\n\t\t\t\tstackForParent.pop();\n\t\t\t}\n\t\t\t\n//\t\t\tSystem.out.println(stack.pop().value);\n\t\t\twhile(!stack.empty()) {\n\t\t\t\twalkBackNode = stack.pop();\n//\t\t\t\twalkBackNode.height = walkBackNode.height + 1;\n\t\t\t\tif(!stackForParent.empty()) {\n\t\t\t\t\tparent = stackForParent.pop();\n\t\t\t\t}\n\t\t\t\tif(walkBackNode.left == null) {\n\t\t\t\t\tlHeight = -1;\n\t\t\t\t} else {\n\t\t\t\t\tlHeight = walkBackNode.left.height ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(walkBackNode.right == null) {\n\t\t\t\t\trHeight = -1;\n\t\t\t\t} else {\n\t\t\t\t\trHeight = walkBackNode.right.height;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twalkBackNode.balanceFactor = lHeight - rHeight;\n\t\t\t\t\n\t\t\t\twalkBackNode.height = 1 + max(lHeight,rHeight);\n\t\t\t\t\n\t\t\t\tif((walkBackNode.balanceFactor < -1) || walkBackNode.balanceFactor > 1) {\n\t\t\t\t\t// tree is violating the rules of AVL tree\n\t\t\t\t\tif(walkBackNode.balanceFactor > 1 && e.compareTo(walkBackNode.left.value) < 0) {\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = rrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.right = rrRotation(walkBackNode);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor < -1 && e.compareTo(walkBackNode.right.value) > 0) {\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = lrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.left = lrRotation(walkBackNode);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor > 1 && e.compareTo(walkBackNode.left.value) > 0) {\n\t\t\t\t\t\twalkBackNode.left = lrRotation(walkBackNode.left);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = rrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.left = rrRotation(walkBackNode);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\trrRotation(walkBackNode);\n//\t\t\t\t\t\tSystem.out.println(\"Root value:= \" + values.balanceFactor);\n//\t\t\t\t\t\tSystem.out.println(\"Left value:= \" + values.left.balanceFactor);\n//\t\t\t\t\t\tSystem.out.println(\"Right value:= \" + values.right.balanceFactor);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif(walkBackNode.balanceFactor< -1 && e.compareTo(walkBackNode.right.value) < 0) {\n\t\t\t\t\t\twalkBackNode.right = rrRotation(walkBackNode.right);\n\t\t\t\t\t\tif(walkBackNode.value == this.root.value) {\n\t\t\t\t\t\t\tthis.root = lrRotation(walkBackNode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent.right = lrRotation(walkBackNode);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tlrRotation(walkBackNode); \n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private T pop(Node topNode)\n {\n if (isEmpty())\n {\n return null;\n }\n else // not empty\n {\n T result = (T) topNode.getData();\n first = topNode.getNextNode();\n return result;\n }\n }",
"public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(4);\n root.right = new TreeNode(5);\n root.left.left = new TreeNode(1);\n root.left.right = new TreeNode(2);\n boolean result = isSubtree(root, root.left);\n System.out.println(result);\n }",
"private void shiftDown() {\n int index = 1;\n\n while (hasLeftChild(index)) {\n //compare chield Nodes\n int smallerChild = leftIndex(index);\n\n // shft down with smaller Node if any\n if (hasRightChild(index) && heap[leftIndex(index)].compareTo(heap[rightIndex(index)]) > 0) {\n smallerChild = rightIndex(index);\n }\n\n if (heap[index].compareTo(heap[smallerChild]) > 0) {\n swap(index, smallerChild);\n } else {\n //Nothing to do\n break;\n }\n index = smallerChild;\n }\n }",
"public static boolean isSameBinaryTreeIterativeApproach(Node x, Node y) {\n\t\tif (x == null && y == null) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if first tree is empty (& second tree is non-empty), return false\n\t\tif (x == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if second tree is empty (& first tree is non-empty), return false\n\t\tif (y == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// create a stack to hold Node pairs\n\t\tDeque<Pair<Node, Node>> stack = new ArrayDeque<>();\n\t\tstack.add(Pair.of(x, y));\n\n\t\t// do till stack is not empty\n\t\twhile (!stack.isEmpty()) {\n\t\t\t// pop top pair from the stack and process it\n\t\t\tx = stack.peek().first;\n\t\t\ty = stack.peek().second;\n\t\t\tstack.poll();\n\n\t\t\t// if value of their root node don't match, return false\n\t\t\tif (x.data != y.data) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// if left subtree of both x and y exists, push their addresses\n\t\t\t// to stack else return false if only one left child exists\n\t\t\tif (x.left != null && y.left != null) {\n\t\t\t\tstack.add(Pair.of(x.left, y.left));\n\t\t\t} else if (x.left != null || y.left != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// if right subtree of both x and y exists, push their addresses\n\t\t\t// to stack else return false if only one right child exists\n\t\t\tif (x.right != null && y.right != null) {\n\t\t\t\tstack.add(Pair.of(x.right, y.right));\n\t\t\t} else if (x.right != null || y.right != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if we reach here, both binary trees are identical\n\t\treturn true;\n\t}",
"public void popAllStacks(){\n // if top is lost then all elements are lost.\n top = null;\n }",
"private boolean getRightOuter() throws IOException {\n while(true) {\n if(leftTuple == nullPad) {\n found = false;\n rightTuple = rightChild.getNextTuple();\n if (rightTuple == null) {\n done = true;\n return false;\n }\n }\n leftTuple = leftChild.getNextTuple();\n if (leftTuple == null) {\n if (!found) {\n leftTuple = nullPad;\n leftChild.initialize();\n return true;\n }\n rightTuple = rightChild.getNextTuple();\n if (rightTuple == null) {\n done = true;\n return false;\n }\n found = false;\n leftChild.initialize();\n }\n else\n return true;\n }\n }",
"public static void main(String[] args) {\n\t\tBackOrderOfTree question = new BackOrderOfTree();\r\n\t\tint[] order = { 7, 4, 6, 5 };\r\n\t\tboolean flag = question.isBackOrderOfATree(order, order.length - 1);\r\n\t\tSystem.out.println(flag);\r\n\t}",
"@Override\n\tpublic T pop() {\n\t\tif(isEmpty()) {\n\t\t\tSystem.out.println(\"Stack is Empty\");\n\t\treturn null;}\n\t\ttop--;\t\t\t\t\t\t//top-- now before since we need index top-1\n\t\tT result = stack[top];\n\t\tstack[top] = null;\n\t\treturn result;\n\t\t\t\n\t}",
"public void postOrder(Node node) {\n\n if (node == null) {\n System.out.println(\"Tree is empty\");\n return;\n }\n\n Stack<Node> stack1 = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n\n stack1.push(node);\n\n while (!stack1.empty()) {\n\n node = stack1.pop();\n\n stack2.push(node);\n\n if (node.left != null) {\n stack1.push(node.left);\n }\n\n if (node.right != null) {\n stack1.push(node.right);\n }\n }\n\n while (!stack2.empty()) {\n node = stack2.pop();\n System.out.print(node.value + \" \");\n }\n }",
"public int pop() { //第二个栈为空 , 就将第一个栈的数据往第二个里面加\n if(empty()){\n throw new UnsupportedOperationException(\"栈为空\");\n }\n if(temp2.empty()){\n while(!temp1.empty()){\n temp2.push(temp1.pop());\n }\n }\n return temp2.pop(); //不管是否为空,直接pop第二个栈\n }",
"@Test\n void whenElementAddedToStackLastElementShouldTop() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n\n boolean result = myStack.head.equals(myFirstNode) && myStack.head.getNext().equals(mySecondNode)\n && myStack.tail.equals(myThirdNode);\n\n Assertions.assertTrue(result);\n }",
"@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }",
"public static <T> void inorderIterative(TreeNode<T> root)\n {\n // create an empty stack\n Stack<TreeNode> stack = new Stack();\n\n // start from root node (set current node to root node)\n TreeNode curr = root;\n\n // if current node is null and stack is also empty, we're done\n while (!stack.empty() || curr != null)\n {\n // if current node is not null, push it to the stack (defer it)\n // and move to its left child\n if (curr != null)\n {\n stack.push(curr);\n curr = curr.left;\n }\n else\n {\n // else if current node is null, we pop an element from stack,\n // print it and finally set current node to its right child\n curr = stack.pop();\n System.out.print(curr.value + \" \");\n\n curr = curr.right;\n }\n }\n }",
"TreeNode<T> getRight();",
"public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"protected void siftDown() {\r\n\t\tint parent = 0, child = (parent << 1) + 1;// preguntar porque 0 y no 1\r\n\t\t\r\n\t\twhile (child < theHeap.size()) {\r\n\t\t\tif (child < theHeap.size() - 1\r\n\t\t\t\t\t&& compare(theHeap.get(child), theHeap.get(child + 1)) > 0)\r\n\t\t\t\tchild++; // child is the right child (child = (2 * parent) + 2)\r\n\t\t\tif (compare(theHeap.get(child), theHeap.get(parent)) >= 0)\r\n\t\t\t\tbreak;\r\n\t\t\tswap(parent, child);\r\n\t\t\tparent = child;\r\n\t\t\tchild = (parent << 1) + 1; // => child = (2 * parent) + 1\r\n\t\t}\r\n\t}",
"static void postOrderTwoStacks(Node root) {\n Stack<Node> stack = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n if (root == null) {\n return;\n } else {\n stack.push(root);\n while (!stack.isEmpty()) {\n Node temp = stack.pop();\n stack2.push(temp);\n if (temp.left != null) {\n stack.push(temp.left);\n }\n if (temp.right != null) {\n stack.push(temp.right);\n }\n }\n while (!stack2.isEmpty()) {\n Node temp = stack2.pop();\n System.out.print(temp.data + \" \");\n }\n }\n }",
"public List<Integer> inorderTraversal2(TreeNode root) {\n List<Integer> result = new ArrayList<>();\n if (root == null) {\n return result;\n }\n TreeNode curr = root; // not necessary\n Deque<TreeNode> stack = new ArrayDeque<>();\n\n while (true) {\n // inorder: left, root, right\n // add all left nodes into stack\n while (curr != null) {\n stack.push(curr);\n curr = curr.left;\n } // curr == null\n // if stack is empty, then finished\n if (stack.isEmpty()) {\n break;\n }\n // all left nodes in stack\n // if right node empty, pop, else add right\n curr = stack.pop();\n // add left and root\n result.add(curr.val);\n // if right is null, then next round pop stack\n // else next round add right.left first ...\n curr = curr.right;\n }\n // stack is empty\n return result;\n }",
"private boolean inStack(int[] pushed, int left, int[] popped, int p) {\n\t\twhile (p >= 0 && pushed[left] != popped[p]) {\n\t\t\tp--;\n\t\t}\n\n\t\treturn p < 0;\n }",
"int pop()\n\t{\n // Your code here\n if(top == -1){\n return -1;\n }\n int x = arr[top];\n top--;\n return x;\n\t}",
"public boolean stackEmpty() {\r\n\t\treturn (top == -1) ? true : false;\r\n\t }",
"private static boolean helper(TreeNode left, TreeNode right) {\n \tif(left == null || right == null){\n \t\treturn left == right;\n \t}\n \tif(left.val != right.val){\n \t\treturn false;\n \t}\n\t\treturn helper(left.right,right.left) && helper(left.left,right.right);\n\t}",
"public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}",
"public GenericStack popStack(){\n if(isEmpty() == true)return null;\n GenericStack temp = top;\n // makes next item in list the tip\n top = top.next;\n return temp;\n }",
"private static boolean inOrderTraversal(Node current) {\n //Break if the node is null\n if(current == null) {\n return false;\n }\n //Recursively check the left child, then the current node, then finally the right child\n else {\n inOrderTraversal(current.getLeftChild());\n inorder.add(current);\n inOrderTraversal(current.getRightChild());\n }\n return true;\n }",
"void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }",
"private E[] getPreOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"@Override\n public void backtrack() {\n if (!stack.isEmpty()) {\n int index = (Integer) stack.pop();\n\n if (index > arr.length) {//popping the insert function unneeded push\n insert((Integer) stack.pop());\n stack.pop();\n }\n if (index < arr.length) {//popping the delete function unneeded push\n delete(index);\n stack.pop();\n stack.pop();\n }\n System.out.println(\"backtracking performed\");\n }\n }",
"public static boolean detectPalindrome_stackApproach(Node head) {\n Node slow = head;\n Node fast = head;\n\n // Initialize an Integer stack and push half of the elements\n Stack<Integer> headStack = new Stack<Integer>();\n while(fast!=null && fast.next!=null) {\n headStack.push(slow.data);\n slow = slow.next;\n fast = fast.next.next;\n }\n\n // fast!=null if the given list is ODD, then move slow ahead, so that we compare with remaining elements\n if (fast!=null) {\n slow = slow.next;\n }\n\n while(!headStack.isEmpty() && slow!=null) {\n if (headStack.pop() != slow.data) {\n return false;\n }\n slow = slow.next;\n }\n\n return (slow == null && headStack.isEmpty());\n\n }",
"static void preOrderTraversalStackOptimised(Node root) {\n Stack<Node> stack = new Stack<>();\n Node curr = root;\n while (curr != null || !stack.isEmpty()) {\n\n while (curr != null) {\n System.out.print(curr.data + \" \");\n if (curr.right != null) {\n stack.push(curr.right);\n }\n curr = curr.left;\n }\n\n if (!stack.isEmpty()) {\n curr = stack.pop();\n }\n }\n }",
"public BinarySearchTree detachRightSubTree() throws TreeException {\r\n\t\t\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new TreeException(\"Cannot remove right tree. Tree is empty.\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tBinarySearchTree rightTree = new BinarySearchTree(getRightChild());\r\n\t\t\trightTree = null;\r\n\t\t\treturn rightTree;\r\n\t\t}\r\n\t}",
"public boolean isBalanced(TreeNode root) {\n if(root == null) return true;\n \n //key is node, value is height of subtree rooted at this node\n HashMap<TreeNode, Integer> hs = new HashMap<TreeNode, Integer>();\n \n Stack<TreeNode> stack = new Stack<TreeNode>();\n stack.push(root);\n \n while(!stack.isEmpty()){\n //check next node in scope. We may have done both subtrees or only one subtree of this scope\n //so we firstly use peek() and use hashMap to decide next step, then decide whether pop it out\n TreeNode curr = stack.peek();\n \n if( (curr.left == null || hs.containsKey(curr.left)) && (curr.right == null || hs.containsKey(curr.right)) ){\n //if we have done both subtrees, then we need to check if subtree rooted at this node is balanced\n int l = curr.left == null? 0 : hs.get(curr.left);\n int r = curr.right == null? 0 : hs.get(curr.right);\n \n //if it is imbalanced, then return false directly\n if(Math.abs(l - r) > 1 ) return false;\n \n //otherwise update info in the HashMap, and pop it out\n hs.put(curr, Math.max(l, r) + 1);\n stack.pop();\n }else{\n \n if(curr.left != null && !hs.containsKey(curr.left) ){\n //if we have left subtree, but not visit it before, then start visit it\n stack.push(curr.left);\n }else{\n //if we dont have left subtree, or we have visited left subtree, then we need to start\n //visit right subtree\n stack.push(curr.right);\n }\n }\n }\n \n //all nodes are checked, return true\n return true;\n }",
"@Override\n\tpublic void moveToEnd()\n\t{\n\t\twhile (!right.isEmpty())\n\t\t{\n\t\t\tleft.push(right.pop());\n\t\t}\n\n\t}",
"private static int pop(Stack<Integer> top_ref) {\n /*If stack is empty then error */\n if (top_ref.isEmpty()) {\n System.out.println(\"Stack Underflow\");\n System.exit(0);\n }\n //pop the data from the stack\n return top_ref.pop();\n }",
"public void pop(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't pop from stack\");\n return;\n }\n // if stack is not empty\n this.arr[this.topOfStack]=Integer.MIN_VALUE;\n this.topOfStack--;\n }",
"private void removeFixUp(RBNode<T> node, RBNode<T> parent) {\r\n RBNode<T> other;\r\n\r\n while((node == null || isBlack(node)) && (node != this.root)) {\r\n if(parent.left == node) { //node is leftChild\r\n other = parent.right; //brother of node\r\n if(isRed(other)) { //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n leftRotate(parent);\r\n other = parent.right;\r\n }\r\n\r\n //case2: brother is black, both children of brother is black\r\n if((other.left == null || isBlack(other.left)) &&\r\n (other.right == null || isBlack(other.right))) {\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n //case3: brother is black, left red right black\r\n if(other.right == null || isBlack(other.right)) {\r\n setBlack(other.left);\r\n setRed(other);\r\n rightRotate(other);\r\n other = parent.right;\r\n }\r\n\r\n //case4: brother is black, right red left any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.right);\r\n leftRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n } else {\r\n other = parent.left;\r\n\r\n if (isRed(other)) {\r\n //case1: brother is red\r\n setBlack(other);\r\n setRed(parent);\r\n rightRotate(parent);\r\n other = parent.left;\r\n }\r\n\r\n if ((other.left==null || isBlack(other.left)) &&\r\n (other.right==null || isBlack(other.right))) {\r\n //case2: brother is black, both children of brother is black\r\n setRed(other);\r\n node = parent;\r\n parent = parentOf(node);\r\n } else {\r\n\r\n if (other.left==null || isBlack(other.left)) {\r\n //case3: brother is black, left red right black\r\n setBlack(other.right);\r\n setRed(other);\r\n leftRotate(other);\r\n other = parent.left;\r\n }\r\n\r\n //case4: brother is black, left red right any color\r\n setColor(other, colorOf(parent));\r\n setBlack(parent);\r\n setBlack(other.left);\r\n rightRotate(parent);\r\n node = this.root;\r\n break;\r\n }\r\n }\r\n }\r\n if (node!=null)\r\n setBlack(node);\r\n }",
"public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}",
"int pop() {\r\n\t\ttop--;\r\n\t\treturn stack[top];\r\n\t}",
"private void heapifyRemove() {\n // this is called after the item at the bottom-left has been put at the root\n // we need to see if this item should swap down\n int node = 0;\n int left = 1;\n int right = 2;\n int next;\n\n // store the item at the root in temp\n T temp = heap[node];\n\n // find out where we might want to swap root \n if ((heap[left] == null) && (heap[right] == null)) {\n next = count; // no children, so no swapping\n return;\n } else if (heap[right] == null) {\n next = left; // we will check left child\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) { // figure out which is the biggest of the two children\n next = left; // left is bigger than right, so check left child\n } else {\n next = right; // check right child\n }\n\n // compare heap[next] to item temp, if bigger, swap, and then repeat process\n while ((next < count) && (((Comparable) heap[next]).compareTo(temp) > 0)) {\n heap[node] = heap[next];\n node = next;\n left = 2 * node + 1; // left child of current node\n right = 2 * (node + 1); // right child of current node\n if ((heap[left] == null) && (heap[right] == null)) {\n next = count;\n } else if (heap[right] == null) {\n next = left;\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) {\n next = left;\n } else {\n next = right;\n }\n }\n heap[node] = temp;\n\n }",
"public boolean isValidBSTII(TreeNode node) {\n if (node == null) {\n return true;\n }\n Stack<TreeNode> stack = new Stack<>();\n \n while(node != null) {\n stack.push(node);\n node = node.left;\n }\n TreeNode prev = null;\n while(!stack.isEmpty()) {\n TreeNode curr = stack.peek();\n if (prev != null && prev.val >= curr.val) {\n return false;\n }\n prev = curr;\n if (curr.right == null) {\n curr = stack.pop();\n while(!stack.isEmpty() && stack.peek().right == curr) {\n curr = stack.pop();\n }\n } else {\n curr = curr.right;\n while(curr != null) {\n stack.push(curr);\n curr = curr.left;\n }\n }\n }\n return true;\n }",
"public void pop()\n {\n this.top = this.top.getNext();\n }",
"public void pop()\n {\n EmptyStackException ex = new EmptyStackException();\n if (top <= 0)\n {\n throw ex;\n }\n else\n {\n stack.remove(top - 1);\n top--;\n }\n }",
"static <T> List<T> implementAPostorderTraversalWithoutRecursion(BinaryTreeNode<T> tree) {\n List<T> result = new ArrayList<>();\n Deque<BinaryTreeNode<T>> stack = new ArrayDeque<>();\n BinaryTreeNode<T> previous = tree;\n\n stack.push(tree);\n\n while (!stack.isEmpty()) {\n BinaryTreeNode<T> node = stack.peek();\n\n if ((node.left == null) && (node.right == null)) { // leaf\n result.add(stack.pop().data);\n } else {\n if ((node.right != null) && (previous == node.right)) { // returning from right child\n result.add(stack.pop().data);\n } else if ((node.right == null) && (previous == node.left)) { // returning from left when right is null\n result.add(stack.pop().data);\n } else {\n if (node.right != null) stack.push(node.right);\n if (node.left != null) stack.push(node.left);\n }\n }\n\n previous = node;\n }\n\n return result;\n }",
"static void postOrderOneStack(Node root) {\n Stack<Node> stack = new Stack<>();\n while (true) {\n while (root != null) {\n stack.push(root);\n stack.push(root);\n root = root.left;\n }\n if (stack.isEmpty()) {\n return;\n }\n root = stack.pop();\n if (!stack.isEmpty() && stack.peek() == root) {\n root = root.right;\n } else {\n System.out.print(root.data + \" \");\n root = null;\n }\n }\n }",
"public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }",
"public void preOrderTraversal(){\n System.out.println(\"preOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack();\n\n if(root!=null){\n stack.push(root);\n }\n while(!stack.isEmpty()) {\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n if (node.getRight() != null) {\n stack.push(node.getRight());\n }\n if (node.getLeft() != null) {\n stack.push(node.getLeft());\n }\n }\n System.out.println();\n }",
"public BinaryTree rightTree()\n {return right;}",
"public TreeNode buildTree(int[] A, int[] B) {\n HashMap<Integer, Integer> order = new HashMap<>();\n for (int i = 0; i < B.length; i++) {\n order.put(B[i], i);\n }\n\n // build Binary Tree from Pre-order list with order of nodes\n TreeNode root = new TreeNode(A[0]);\n Deque<TreeNode> stack = new LinkedList<>();\n stack.offerLast(root);\n\n /*\n for (int i = 1; i < A.length; i++) {\n if (order.get(A[i]) < order.get(stack.peekLast().val)) {\n TreeNode parent = stack.peekLast();\n parent.left = new TreeNode(A[i]);\n stack.offerLast(parent.left);\n }\n else {\n TreeNode parent = stack.peekLast();\n while(!stack.isEmpty() &&\n (order.get(stack.peekLast().val) < order.get(A[i]))) {\n parent = stack.pollLast();\n }\n parent.right = new TreeNode(A[i]);\n stack.offerLast(parent.right);\n }\n\n }\n */\n for (int i = 1; i < A.length; i++) {\n TreeNode parent = stack.peekLast();\n TreeNode node = new TreeNode(A[i]);\n if (order.get(A[i]) < order.get(parent.val)) {\n parent.left = node;\n } else {\n while (!stack.isEmpty() && (order.get(stack.peekLast().val) < order.get(A[i]))) {\n parent = stack.pollLast();\n }\n parent.right = node;\n }\n stack.offerLast(node);\n }\n\n return root;\n }",
"public void pop() {\n\t\tif(stackTmp.isEmpty()){\n\t\t\twhile(!stack.isEmpty()){\n\t\t\t\tint tmp = stack.peek();\n\t\t\t\tstackTmp.push(tmp);\n\t\t\t\tstack.pop();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tstackTmp.pop();\n\t\t}\n\t}",
"public void popRight() {\n if (size == 0) {\n System.out.println(\"Deck is empty\");\n return;\n }\n E data = tail.data;\n Deque thead = head;\n while (thead.next != tail) {\n thead = thead.next;\n }\n thead.next = null;\n tail = thead;\n size--;\n System.out.println(print());\n }",
"public static void QtoS(){\n while(!POOR.isEmpty()){\n stack.push(POOR.remove());\n }\n while(!FAIR.isEmpty()){\n stack.push(FAIR.remove());\n }\n while(!GOOD.isEmpty()){\n stack.push(GOOD.remove());\n }\n while(!VGOOD.isEmpty()){\n stack.push(VGOOD.remove());\n }\n while(!EXCELLENT.isEmpty()){\n stack.push(EXCELLENT.remove());\n }\n \n \n}",
"public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }",
"public boolean RemoveRight(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Right()){\n\t //auxtree01 = c_node.GetRight() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetRight()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetRight() ;\n\t}\n\tntb = p_node.SetRight(my_null);\n\tntb = p_node.SetHas_Right(false);\n\treturn true ;\n }"
] | [
"0.6442197",
"0.636845",
"0.61221737",
"0.60884744",
"0.5988342",
"0.5960463",
"0.59158003",
"0.58755493",
"0.58473563",
"0.58470434",
"0.584223",
"0.57953167",
"0.5771069",
"0.57489526",
"0.57302016",
"0.5706806",
"0.5687341",
"0.5680602",
"0.5655089",
"0.56237894",
"0.56175137",
"0.56090707",
"0.55971503",
"0.55838555",
"0.5578316",
"0.55660427",
"0.55510277",
"0.55462444",
"0.5542673",
"0.5532192",
"0.55301744",
"0.55147374",
"0.5502777",
"0.54999375",
"0.5492423",
"0.5488002",
"0.5485186",
"0.54724675",
"0.5461033",
"0.54484266",
"0.54317683",
"0.5429518",
"0.54290813",
"0.54210997",
"0.5416185",
"0.5415714",
"0.5407143",
"0.5404581",
"0.5399063",
"0.5378145",
"0.53751796",
"0.53737354",
"0.5371294",
"0.53644717",
"0.5349204",
"0.53479475",
"0.53395724",
"0.5338711",
"0.5330347",
"0.53216696",
"0.5318889",
"0.531887",
"0.5313001",
"0.53118473",
"0.5300955",
"0.52877784",
"0.52862364",
"0.5284612",
"0.52811563",
"0.5280446",
"0.52750987",
"0.5272842",
"0.52646285",
"0.5261109",
"0.52570057",
"0.5253299",
"0.5251791",
"0.52438325",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976",
"0.5236976"
] | 0.527762 | 70 |
Create a new board with the given width and height. This method must return null if the given width and height are invalid. | @Override
public Board createBoard(long width, long height)
{
return new Board(width, height);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public GameBoard (int height, int width)\n {\n mHeight = height;\n mWidth = width;\n }",
"public Board(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tgrid = new boolean[width][height];\n\t\tcommitted = true;\n\t\twidths = new int[height];\n\t\theights = new int[width];\n\t\tmaxColumnHeight = 0;\n\n\t\tbackupGrid = new boolean[width][height];\n\t\tbackupHeights = new int[width];\n\t\tbackupWidths = new int [height];\n\t\tbackupMaxColumnHeight = 0;\n\t}",
"public Board(int boardHeight, int boardWidth) {\n this.boardWidth = boardHeight+1;\n this.boardHeight = boardWidth+1;\n this.board = new char[this.boardHeight][this.boardWidth];\n this.numShips = 0;\n boardInit();\n }",
"public AlphaNumericBoard(int width, int height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tinitialiseBoard();\r\n\t}",
"public Board createBoard(Square[][] grid) {Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\");assert grid != null; Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1053\"); Board board = new Board(grid); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1079\"); int width = board.getWidth(); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1115\"); int height = board.getHeight(); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1148\"); for (int x = 0; x < width; x++) {\n\t\t\tfor (int y = 0; y < height; y++) {\n\t\t\t\tSquare square = grid[x][y];\n\t\t\t\tfor (Direction dir : Direction.values()) {\n\t\t\t\t\tint dirX = (width + x + dir.getDeltaX()) % width;\n\t\t\t\t\tint dirY = (height + y + dir.getDeltaY()) % height;\n\t\t\t\t\tSquare neighbour = grid[dirX][dirY];\n\t\t\t\t\tsquare.link(neighbour, dir);\n\t\t\t\t}\n\t\t\t}\n\t\t} Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1183\"); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1552\");return board ; }",
"public Board(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tgrid = new boolean[width][height];\n\t\tcommitted = true;\n\t\t//Initialize the quick palying data attributes\n\t\twidths = new int[height];\n\t\theights = new int[width];\n\t\tmaxHeight = 0;\n\t\t//Initialize the undo data\n\t\tundoWidths = new int[height];\n\t\tundoHeights = new int[width];\n\t\tundoGrid = new boolean[width][height];\n\t\t\n\t\t// YOUR CODE HERE\n\t}",
"public Board(float width, float height) {\r\n tablero = new Array<BlockDrawable>();\r\n this.width = width;\r\n this.height = height;\r\n deletedRowsInfo.ordered = true;\r\n reset();\r\n }",
"public Board(int dimensions){\n this.dimensions = dimensions;\n createBoard(dimensions);\n this.status = Status.CREATED;\n this.hitsLeft = 15;\n }",
"public Board<?> makeBoard() throws EscapeException {\n\t\tswitch (bi.getCoordinateId()) {\n\t\t\tcase HEX:\n\t\t\t\treturn makeHexBoard();\n\t\t\tcase ORTHOSQUARE:\n\t\t\t\treturn makeOrthoBoard();\n\t\t\tcase SQUARE:\n\t\t\t\treturn makeSquareBoard();\n\t\t\tdefault:\n\t\t\t\tthrow new EscapeException(\"Board does not exist!\");\n\t\t}\n\t}",
"private void createBoard() {\n\t// An array of rows containing rows with squares are made\n\t\tfor (int i = 0; i < squares.length; i++) {\n\t \trows[i] = new Row(squares[i]);\n\t\t}\n\n\n\t// An array of columns containing columns with squares are made\n\t\tSquare[] columnArray = new Square[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t for (int row = 0; row < size; row++) {\n\t\t\t\tcolumnArray[row] = squares[row][i];\n\t\t }\n\t\t columns[i] = new Column(columnArray);\n\t\t columnArray = new Square[size];\n\t\t}\n\n\n\t\tSquare[] boxArray;\n\t\tint counter;\n\t\t// Box nr i\n\t\tfor (int i = 0; i < size; i = i + height) {\n\t\t // Box nr j\n\t\t for (int j = 0; j < size; j = j + length) {\n\t\t\t\tcounter = 0;\n\t\t\t\tboxArray = new Square[size];\n\t\t\t\tint rowIndex = (i / height) * height;\n\t\t\t\tint columnIndex = (j / length) * length;\n\t\t\t\t// Row nr k\n\t\t\t\tfor (int k = rowIndex; k < rowIndex + height; k++) {\n\t\t\t\t // Column nr l\n\t\t\t\t for (int l = columnIndex; l < columnIndex + length; l++) {\n\t\t\t\t\t\tboxArray[counter] = squares[k][l];\n\t\t\t\t\t\tcounter++;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tboxes[j/length][i/height] = new Box(boxArray);\n\t\t }\n\t\t}\t\n\t\tcreatePointers();\n }",
"public Board Board(Board board) {\n return new Board(board.size, board._board);\n }",
"Board() {\n\t\tswitch (Board.boardType) {\n\t\tcase Tiny:\n\t\t\tthis.dimensions = TinyBoard; break;\n\t\tcase Giant:\n\t\t\tthis.dimensions = GiantBoard; break;\n\t\tdefault:\n\t\t\tthis.dimensions = StandardBoard; break;\n\t\t}\n\t\tboard = new Square[dimensions.x][dimensions.y];\n\t\tinit();\n\t}",
"public PersonalBoard(int width, int height){\n super(width, height);\n this.rand = new Random();\n }",
"public OthelloBoard(int width, int height) throws IOException {\n grid = new OthelloTile[width][height];\n\n try {\n woodBorder = ImageIO.read(getClass().getResource(\"/board_wood.png\"));\n } catch (Exception e) {\n throw new IOException(\"Les images correspondant aux poins n'ont pas pu être chargées.\");\n }\n\n setLayout(new GridBagLayout());\n JPanel p = new JPanel(new GridLayout(width,height));\n\n for(int x=0; x<grid.length; x++) {\n for(int y=0; y<grid[0].length; y++) {\n grid[x][y] = new OthelloTile(50,x,y);\n p.add(grid[x][y]);\n }\n }\n\n add(p, new GridBagConstraints());\n }",
"public void createBoard() {\n\t\tboard = new Piece[8][8];\n\t\t\n\t\tfor(int i=0; i<8; i++) {\n\t\t\tfor(int j=0; j<8; j++) {\n\t\t\t\tboard[i][j] = null;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void createBoard(int width, int height, int numMines) {\n // Clamp the dimensions and mine numbers\n dims = new Point(Util.clamp(width, MIN_DIM_X, MAX_DIM_X),\n Util.clamp(height, MIN_DIM_Y, MAX_DIM_Y));\n int maxMines = (int) ((dims.getX() - 1) * (dims.getY() - 1));\n this.numMines = Util.clamp(numMines, MIN_MINES, maxMines);\n\n // Step 1\n cells = new ArrayList<>();\n for (int i = 0; i < dims.getY(); i++) {\n List<Cell> oneRow = new ArrayList<>();\n for (int j = 0; j < dims.getX(); j++) {\n oneRow.add(new CellImpl(this, new Point(j, i), false));\n }\n cells.add(oneRow);\n }\n\n // Step 2\n int minesPlaced = 0;\n while (minesPlaced < this.numMines) {\n int randX = ThreadLocalRandom.current().nextInt((int) dims.getX());\n int randY = ThreadLocalRandom.current().nextInt((int) dims.getY());\n\n if (!cells.get(randY).get(randX).isMine()) {\n cells.get(randY).get(randX).setNumber(-1);\n minesPlaced++;\n }\n }\n\n // Step 3\n updateCellNumbers();\n }",
"public static int[][] createBoard() {\r\n\r\n\t\tint[][] board = new int[9][9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tfor (int j = 0; j < 9; j++)\r\n\t\t\t\tboard[i][j] = scan.nextInt();\r\n\t\t}\r\n\t\treturn board;\r\n\r\n\t}",
"public static Board create(final Class board) {\n if (board.equals(standard)) {\n return new StandardBoard();\n } else if (board.equals(gothic)) {\n return new Gothic();\n } else if (board.equals(empty)) {\n return new EmptyBoard();\n } else {\n /* Throw exception? */\n return null;\n }\n }",
"public SquareGrid(int width, int height) {\n this.width = width;\n this.height = height;\n }",
"public Canvas(int width, int height) {\n if(width<=0) {\n throw new IllegalArgumentException(\"Width cannot be less than or equal to zero\");\n } else if(height<=0) {\n throw new IllegalArgumentException(\"Height cannot be less than or equal to zero\");\n }\n this.width = width;\n this.height = height;\n\n drawingArray = new char[height][width];\n for(int i=0; i<height; i++) {\n for(int j=0; j<width; j++) {\n drawingArray[i][j] = ' ';\n }\n }\n undoStack = new DrawingStack();\n redoStack = new DrawingStack();\n }",
"public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}",
"public abstract void createBoard();",
"public static GameBoard createGameBoard(Context context, Bitmap bitmap,\n\t\t\tTableLayout parentLayout, int width, int height, short gridSize,\n\t\t\tTextView moveTextView) {\n\n\t\tboard = new GameBoard(context, bitmap, parentLayout, width, height,\n\t\t\t\tgridSize, moveTextView);\n\n\t\treturn board;\n\t}",
"public Board(int rows, int columns) throws Exception {\n\t\tif (rows >= 8 && columns >= 8) {\n\t\t\tthis.rows = rows;\n\t\t\tthis.columns = columns;\n\t\t\tboard = new int[rows][columns];\n\t\t\tthis.bombs = (rows * columns) / 3;\n\t\t\tfillBoard();\n\t\t} else {\n\t\t\tthrow new Exception(\"Minesweeper dimensions invalid:\\nWidth: from 8 to 100\\nHeight: from 8 to 100\\nBombs: 1 to 1/3 of squares\");\n\t\t}\n\t}",
"public CheckerboardImage(int tileSize, int width, int height)\n throws IllegalArgumentException {\n if (tileSize < 0 || width < 0 || height < 0) {\n throw new IllegalArgumentException(\"Cannot have negative value.\");\n }\n this.tileSize = tileSize;\n this.width = width;\n this.height = height;\n }",
"public Board(int row, int column, int countToWin) {\n\t\tintializeBoard(row, column, countToWin);\n\t}",
"public void newBoard(LiteBoard board) {\n }",
"Board(int dimension, int height, int length, String[] board) {\n\t\tthis.dimension=dimension;\n\t\tsquares = new Square[dimension][dimension];\n\t\trows = new Row[dimension];\n\t\tcolumns = new Column[dimension];\n\t\tboxes = new Box[dimension];\n\t\t\n\t\tgenerateSquares(board);\n\t\tgenerateRows();\n\t\tgenerateColumns();\n\t\tgenerateBoxes(height, length);\n\t\t\n\t\tbuffer=new SudokuBuffer(this);\n\t}",
"private Board create4by4Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 4);\n Tile t2 = new Tile(1, 4);\n Tile t3 = new Tile(2, 4);\n Tile t4 = new Tile(3, 4);\n Tile t5 = new Tile(4, 4);\n Tile t6 = new Tile(5, 4);\n Tile t7 = new Tile(6, 4);\n Tile t8 = new Tile(7, 4);\n Tile t9 = new Tile(8, 4);\n Tile t10 = new Tile(9, 4);\n Tile t11 = new Tile(10, 4);\n Tile t12 = new Tile(11, 4);\n Tile t13 = new Tile(12, 4);\n Tile t14 = new Tile(13, 4);\n Tile t15 = new Tile(14, 4);\n Tile t16 = new Tile(15, 4);\n tiles = new Tile[4][4];\n tiles[0][0] = t5;\n tiles[0][1] = t16;\n tiles[0][2] = t1;\n tiles[0][3] = t3;\n tiles[1][0] = t13;\n tiles[1][1] = t15;\n tiles[1][2] = t9;\n tiles[1][3] = t12;\n tiles[2][0] = t2;\n tiles[2][1] = t6;\n tiles[2][2] = t7;\n tiles[2][3] = t14;\n tiles[3][0] = t10;\n tiles[3][1] = t4;\n tiles[3][2] = t8;\n tiles[3][3] = t11;\n return new Board(tiles);\n }",
"Grid(int width, int height) {\n this.width = width;\n this.height = height;\n\n // Create the grid\n grid = new Cell[width][height];\n\n // Populate with dead cells to start\n populateGrid(grid);\n }",
"private Board create3by3Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 3);\n Tile t2 = new Tile(1, 3);\n Tile t3 = new Tile(2, 3);\n Tile t4 = new Tile(3, 3);\n Tile t5 = new Tile(4, 3);\n Tile t6 = new Tile(5, 3);\n Tile t7 = new Tile(6, 3);\n Tile t8 = new Tile(7, 3);\n Tile t9 = new Tile(8, 3);\n tiles = new Tile[3][3];\n tiles[0][0] = t7;\n tiles[0][1] = t6;\n tiles[0][2] = t2;\n tiles[1][0] = t5;\n tiles[1][1] = t9;\n tiles[1][2] = t3;\n tiles[2][0] = t1;\n tiles[2][1] = t8;\n tiles[2][2] = t4;\n return new Board(tiles);\n }",
"public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}",
"public Board() {\n\t\tthis.myBoard = new BlockFor2048[4][4];\n\t\tint randomInserted = 0;\n\t\tint colInd = 0;\n\t\tint rowInd = 0;\n\t\twhile (randomInserted != 2){\n\t\t\tcolInd = (int)(Math.random() * 4);\n\t\t\trowInd = (int)(Math.random() * 4);\n\t\t\tif (this.myBoard[colInd][rowInd] == null){\n\t\t\t\tthis.myBoard[colInd][rowInd] = new BlockFor2048(2);\n\t\t\t\trandomInserted++;\n\t\t\t}\n\t\t}\t\t\n\t\tthis.ScoreValue = 0;\n\t}",
"public static String[][] createBoard() {\r\n final int ROW_LENGTH = 10;\r\n final int COL_LENGTH = 10;\r\n String[][] board = new String[ROW_LENGTH][COL_LENGTH];\r\n for (int r = 0; r < board.length; r++) {\r\n for (int c = 0; c < board[0].length; c++) {\r\n board[r][c] = \" * \";\r\n }\r\n }\r\n return board;\r\n }",
"public Board(int xLen, int yLen)\r\n {\r\n if(xLen <= 0 || yLen <= 0)\r\n xLen = yLen = 8;\r\n board = new Piece[xLen][yLen];\r\n xLength = xLen;\r\n yLength = yLen;\r\n }",
"Rectangle(int width, int height){\n area = width * height;\n }",
"public Board(int height, int width, Player... players) {\n this.players = new ArrayList<>(Arrays.asList(players));\n this.docks = new ArrayList<>();\n this.lasers = new ArrayList<>();\n this.height = height;\n this.width = width;\n\n layTiles();\n\n for (Player player : players) {\n getTile(player).setPlayer(player);\n }\n }",
"public Player(int width, int height)\n {\n this.width = width;\n this.height = height;\n createImage();\n }",
"public GameGridBuilder(int gridWidth, int gridHeight) {\n this.gridWidth = gridWidth;\n this.gridHeight = gridHeight;\n }",
"public Board(int width, int height, String title, Game game){\n\t\tJFrame frame = new JFrame(title);\n\t\t\n\t\tframe.setPreferredSize(new Dimension(width, height));\n\t\tframe.setMaximumSize(new Dimension(width, height));\n\t\tframe.setMinimumSize(new Dimension(width,height));\n\t\t\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setResizable(false);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.add(game);\n\t\tframe.setVisible(true);\n\t\tgame.start();\n\t}",
"public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] };\n }",
"public void createBoard() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n matrix[i][j] = WATER;\n }\n }\n }",
"public static BinaryMatrix fromBlank(int height, int width){\n\t\tboolean[][] array=new boolean[height][width];\n\t\treturn new BinaryMatrix(array);\n\t}",
"public City(int width, int height) {\r\n\t\tthis.size_w = width;\r\n\t\tthis.size_h = height;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}",
"public Board() {\n initialize(3, null);\n }",
"public void createBoard() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j <colls; j++) {\n if(i==0 || j == 0 || i == rows-1|| j == colls-1){\n board[i][j] = '*';\n } else {\n board[i][j] = ' ';\n }\n }\n }\n }",
"public Board()\r\n\t{\r\n\t\tfor(int x = 0; x < 9; x++)\r\n\t\t\tfor(int y = 0 ; y < 9; y++)\r\n\t\t\t{\r\n\t\t\t\tboard[x][y] = new Cell();\r\n\t\t\t\tboard[x][y].setBoxID( 3*(x/3) + (y)/3+1);\r\n\t\t\t}\r\n\t}",
"public Board(int lines, int columns, List<String> board) {\r\n\t\tif (lines == 0 || lines % 2 != 0 || lines < 2 || lines > 98) {\r\n\t\t\tthrow new IllegalArgumentException(\"Error! Line length is invalid.\");\r\n\t\t} else if (columns == 0 || columns % 2 != 0 || columns < 2 || columns > 26) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Error! Column length is invalid.\");\r\n\t\t} else if (board != null) {\r\n\r\n\t\t\tfor (String s : board) {\r\n\t\t\t\tif (!s.matches(\"[W,B,#,,-]+\")) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Invalid board parameters.\");\r\n\t\t\t\t} else if (s.length() != columns) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Board columns not equal to columns.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (board.size() != lines) {\r\n\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\"Error! Board lines not equal to lines.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.playBoard = new char[lines][columns];\r\n\t\tthis.possibleMoves = new ArrayList<PossibleMove>();\r\n\r\n\t\tif (board == null) {\r\n\t\t\tthis.init();\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\t\tplayBoard[i][j] = board.get(i).charAt(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public Grid(int width, int height)\n\t{\n\t\t\n\t\tplayer = new MainMenuController();\n\t\tw = width;\n\t\th = height;\n\t\t//String p1Score = Integer.toString(player.player1Score);\n\t\t\n\t\tsetMinSize(w * MainMenuController.block_size, h * MainMenuController.block_size);\n\t\tsetBackground(new Background(new BackgroundFill(Color.BLACK, null, null)));\n\t\tsetBorder(new Border(new BorderStroke(Color.CYAN, BorderStrokeStyle.SOLID, null, new BorderWidths(10))));\n\t\t\n\t\n\t}",
"MainBoard createMainBoard();",
"public GameOfLifeBoard(int length, int height) {\r\n this.length = length;\r\n this.height = height;\r\n board = new boolean[getLength()][getHeight()];\r\n }",
"public Screen(int width, int height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tpixels = new int[width * height];\r\n\t}",
"public Jewel[][] createGrid(int width, int height)\r\n\t{\r\n\t\tJewel[][] jewels = new Jewel[width][height];\r\n\t\tfor (int row=0; row<width; row++)\r\n\t\t{\r\n\t\t\tfor (int col=0; col<height; col++)\r\n\t\t\t{\r\n\t\t\t\tjewels[row][col] = generate(); //jewels is generated horizontally\r\n\t\t\t\tif (row >= 2 //check run two neighbors above\r\n\t\t\t\t\t&& jewels[row][col].getType() == jewels[row-1][col].getType()\r\n\t\t\t\t\t&& jewels[row][col].getType() == jewels[row-2][col].getType()\r\n\t\t\t\t\t|| (col>=2 //check run two neighbors left\r\n\t\t\t\t\t&& jewels[row][col].getType() == jewels[row][col-1].getType()\r\n\t\t\t\t\t&& jewels[row][col].getType() == jewels[row][col-1].getType()))\r\n\t\t\t\t{\r\n\t\t\t\t\tcol--;//back to previous solt and generate and chekc again\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn jewels;\r\n\t}",
"public static int[][] createBoard() {\r\n\t\t\r\n\t\tint[][] board = new int [8][8];\r\n\t\t//printing the red solduers\r\n\t\tfor (int line =0,column=0;line<3;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printing the blu solduers\r\n\t\tfor (int line =5,column=0;line<8;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = -1;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn board;\r\n\t}",
"Board createLayout();",
"public Board() {\n\t\tboard = new char[9][9];\n\t}",
"Board() {\n this(INITIAL_PIECES, BLACK);\n _countBlack = 12;\n _countWhite = 12;\n _moveHistory = new ArrayList<Move>();\n _movesMade = 0;\n }",
"public Board() {\r\n\t\tthis.size = 4;\r\n\t\tthis.gameBoard = createBoard(4);\r\n\t\tthis.openTiles = 16;\r\n\t\tthis.moves = 0;\r\n\t\tthis.xValues = new boolean[4][4];\r\n\t\tthis.yValues = new boolean[4][4];\r\n\t\tthis.complete = false;\r\n\t}",
"public Board(String gameType) {\n propertyFactory = new TileFactory(gameType);\n createBoard();\n }",
"public void createCellBoard(int rows, int cols) {\n\t\trowcount = rows;\n\t\tcolcount = cols;\n\t\tcells = new int[rows][cols];\n\t}",
"public Board() {\n\t\tdimension = 9;\n\t\tpuzzle = new int[dimension][dimension];\n\t}",
"public SquareBoard(Coordinates C, double hw, Color v)\r\n {\r\n r = new Rectangle(C.X(), C.Y(), hw, hw);\r\n r.setStroke(Color.BLACK);\r\n r.setFill(v);\r\n BoardPane.getPane().getChildren().add(r);\r\n }",
"public DrawingArea(int width, int height) {\n\t\tthis.initialize(width, height);\n\t}",
"public Board() {\n\t\tboardState = new Field[DIMENSION][DIMENSION];\n\t\tfor(int i = 0; i < DIMENSION; i++) {\n\t\t\tfor(int j = 0; j < DIMENSION; j++) {\n\t\t\t\tboardState[i][j] = new Field();\n\t\t\t}\n\t\t}\n\t}",
"Board() {\n\t\tSpace[][] temp = new Space[xDim][yDim];\n\t\tfor (int i = 0; i < xDim; i++) {\n\t\t\tfor (int j = 0; j < yDim; j++) {\n\n\t\t\t\ttemp[i][j] = new Space();\n\t\t\t}\n\t\t}\n\n\t\thead = temp[0][0];\n\n\t\tfor (int x = 0; x < xDim; x++) {\n\t\t\tfor (int y = 0; y < yDim; y++) {\n\t\t\t\tif (x != 0) {\n\t\t\t\t\t// Left\n\t\t\t\t\ttemp[x][y].join(2, temp[x - 1][y]);\n\t\t\t\t}\n\n\t\t\t\tif (y != 0) {\n\t\t\t\t\t// Top\n\t\t\t\t\ttemp[x][y].join(1, temp[x][y - 1]);\n\t\t\t\t}\n\n\t\t\t\tif (x != xDim - 1) {\n\t\t\t\t\t// Right\n\t\t\t\t\ttemp[x][y].join(0, temp[x + 1][y]);\n\t\t\t\t}\n\n\t\t\t\tif (y != yDim - 1) {\n\t\t\t\t\t// Bottom\n\t\t\t\t\ttemp[x][y].join(3, temp[x][y + 1]);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tdevs = new ArrayList<Developer>();\n\t\tmountains = new ArrayList<Coordinates>();\n\n\t\tfor (int x = 0; x < xDim; x++) {\n\t\t\tif (x == 0 || x == xDim - 1)\n\t\t\t\tfor (int y = 0; y < Math.round(yDim / 2); y++) {\n\t\t\t\t\tmountains.add(new Coordinates(x, y));\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tmountains.add(new Coordinates(x, 0));\n\t\t}\n\n\t}",
"public Board() {\n for (int row = 0; row < 9; row++) {\n for (int col = 0; col < 9; col++) {\n this.grid[row][col] = 0;\n }\n }\n }",
"public Neighborhood(int width, int height) {\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\n String.format(\n \"Neighborhood width and height must each be > 0. Received width=%d, height=%d\",\n width,\n height\n )\n );\n }\n this.width = width;\n this.height = height;\n this.neighborhoodArray = new int[width][height];\n }",
"public static SquareBoard getFullBoard() {\n\n\t\tSquareBoard fullBoard = new SquareBoard(BOARD_SIZE);\n\t\t\n\t\tfor (int ctr = 0; ctr < (BOARD_SIZE * BOARD_SIZE); ctr++) {\n\t\t\tfullBoard.getSpaceByIndex(ctr).setPiece(\n\t\t\t\t\tnew BasicPieceHelper(String.valueOf(ctr), null));\n\t\t}\n\t\t\n\t\treturn fullBoard;\n\t}",
"public TicTacToeBoard() {board = new int[rows][columns];}",
"public CellularAutomaton(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tcellMatrix = new int[width][height];\n\t}",
"public Board()\n\t{\n\t\tcols = DEFAULT_WIDTH;\n\t\trows = DEFAULT_HEIGHT;\n\t\t\n\t\tpieces = new int[rows][cols];\n\t\tif (pieces.length > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < pieces.length; i++)\n\t\t\t\tfor (int j = 0; j < pieces[0].length; j++)\n\t\t\t\t\tpieces[i][j] = -1;\n\t\t}\n\t}",
"public Board()\r\n {\r\n board = new Piece[8][8];\r\n xLength = yLength = 8;\r\n }",
"public IImage createCheckerboard() {\n List<List<Pixel>> grid = new ArrayList<>();\n for (int i = 0; i < this.height; i++) {\n List<Pixel> row;\n // alternating between making rows starting with black or white tiles\n if (i % 2 == 0) {\n // start white\n for (int j = 0; j < this.tileSize; j++) {\n row = createRow(255, 0, (i * this.tileSize) + j);\n grid.add(row);\n }\n }\n else {\n // start black\n for (int m = 0; m < this.tileSize; m++) {\n row = createRow(0, 255, (i * this.tileSize) + m);\n grid.add(row);\n }\n }\n }\n return new Image(grid, 255);\n }",
"ArrayList<ArrayList<GamePiece>> makeBoard() {\n ArrayList<ArrayList<GamePiece>> row = new ArrayList<ArrayList<GamePiece>>();\n for (int i = 0; i < this.width; i++) {\n ArrayList<GamePiece> column = new ArrayList<GamePiece>();\n for (int j = 0; j < this.height; j++) {\n GamePiece temp = new GamePiece(i, j);\n column.add(temp);\n nodes.add(temp);\n }\n row.add(column);\n }\n return row;\n }",
"public Board() {\n for (int y = 0; y < spaces.length; y++) {\n for (int x = 0; x < spaces[0].length; x++) {\n spaces[y][x] = new SubBoard();\n wonBoards[y][x] = ' ';\n }\n }\n }",
"public Board(int rows, int cols) {\n\t\t_board = new ArrayList<ArrayList<String>>();\n\t\t_rand = new Random();\n\t\t_colorFileNames = new ArrayList<String>();\n\t\tfor (int i=0; i<MAX_COLORS; i=i+1) {\n\t\t\t_colorFileNames.add(\"Images/Tile-\"+i+\".png\");\n\t\t}\n\t\tfor (int r=0; r<rows; r=r+1) {\n\t\t\tArrayList<String> row = new ArrayList<String>();\n\t\t\tfor (int c=0; c<cols; c=c+1) {\n\t\t\t\trow.add(_colorFileNames.get(_rand.nextInt(_colorFileNames.size())));\n\t\t\t}\n\t\t\t_board.add(row);\n\t\t\t\n\t\t\tif(_board.size()==rows) { //board is complete\n\t\t\t\tboolean istrue = false;\n\t\t\t\tif(match(3).size()>0 || end()){ //(1)there are match //(2)there is no valid move\n\t\t\t\t\tistrue = true;\n\t\t\t\t}\n\t\t\t\tif (istrue) {\n\t\t\t\t\t_board.clear();\t\t// if istrue clear the board\n\t\t\t\t\tr=-1;\t\t\t\t// restart; r=-1, at the end of loop will add 1\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\t\t\n\t}",
"Board() {\n this.cardFactory = new CardFactory(this);\n }",
"public Board() {\n playerNumber = 2;\n deadBlackCount = 0;\n deadWhiteCount = 0;\n deadRedCount = 0;\n deadBlueCount = 0;\n\n fields = new Field[DIMENSION][DIMENSION];\n // init fields\n for (int i = 0; i < DIMENSION; i++) {\n for (int j = 0; j < DIMENSION; j++) {\n fields[i][j] = new Field();\n fields[i][j].setX(i);\n fields[i][j].setY(j);\n }\n }\n }",
"public static SquareBoard getEmptyBoard() {\n\n\t\tSquareBoard emptyBoard = new SquareBoard(BOARD_SIZE);\n\t\t\n\t\treturn emptyBoard;\n\t}",
"public UIBoard()\r\n\t{\r\n\t\t//Creates a 10x10 \"Board\" object\r\n\t\tsuper(10,10);\r\n\t\tgrid = new int[getLength()][getWidth()];\r\n\t\t\r\n\t\t//Sets all coordinates to the value 0, which corresponds to \"not hit yet\"\r\n\t\tfor(int i=0; i<grid.length; i++)\r\n\t\t\tfor(int j=0; j<grid[i].length; j++)\r\n\t\t\t\tgrid[i][j] = 0;\t\t\r\n\t}",
"public Board() {\n\t\tboard = new int[8][8];\n\t\tbombs = 64 / 3;\n\t\tdifficulty = GlobalModel.BESTSCORE_EASY;\n\t\tfillBoard();\n\t\tsetDefaultScores();\n\t}",
"public GameBoard(){\r\n\t\tboard = new Box[boardSize];\r\n\t\tfor(int i = 0; i < boardSize; i++){\r\n\t\t\tboard[i] = Box.EMPTY;\r\n\t\t}\r\n\t}",
"public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }",
"public void run() {\n GameBoard board = new GameBoard(nrows, ncols);\n\n\n }",
"public static void createBoard() \n\t{\n\t\tfor (int i = 0; i < tictactoeBoard.length; i++) \n\t\t{\n\t\t\ttictactoeBoard[i] = '-';\n\t\t}\n\t}",
"Board(Board board) {\n copyFrom(board);\n }",
"public static Board createBoard(String boardConfigFile) throws IOException {\n BufferedReader br = null;\n\n // 101 squares, start at 1 index to make it more similar to a game board\n Square[] squares = new Square[101];\n for(int i=0; i<squares.length; i++) {\n // Fill all squares with default value\n squares[i] = new Square(i, 'N', 0);\n }\n\n // Start reading in the board config for chutes/ladders event squares\n try {\n br = new BufferedReader(new FileReader(boardConfigFile));\n String line = \"\";\n int lineCount = 0;\n while((line = br.readLine()) != null) {\n if (lineCount > 0) {\n String[] data = line.split(\",\");\n // data[0] = square # (String) * Convert to int\n // data[1] = eventType char (String) * Convert to char\n // data[2] = offset # (String) * Convert to int\n // data[3] = endSquare # (String) * Not needed.\n\n int eventSquare = Integer.parseInt(data[0]);\n char eventType = data[1].toUpperCase().charAt(0);\n int eventOffset = Integer.parseInt(data[2]);\n Square curr = new Square(eventSquare, eventType, eventOffset);\n\n squares[eventSquare] = curr;\n }\n\n lineCount++;\n }\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return new Board(squares);\n }",
"public LdpcMatrix(int width, int height) {\r\n this.width = width;\r\n this.height = height;\r\n this.matrix = new byte[height][width];\r\n populate(matrix);\r\n }",
"public static Entity createWall(float width, float height) {\n\t\tEntity wall = new Entity()\n\t\t\t.addComponent(new PhysicsComponent().setBodyType(BodyType.StaticBody))\n\t\t\t.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));\n\t\twall.setScale(width, height);\n\t\treturn wall;\n\t}",
"private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}",
"public Board(int size) {\n initialize(size, null);\n }",
"public Rectangle(int w, int h) {\n\t\tthis.width = w;\n\t\tthis.height = h;\n\t}",
"RasPiBoard createRasPiBoard();",
"public Shape(int width, int height) {\r\n\r\n\t\t// Shape width and height should not be greater than the sheet width and height\r\n\t\tif (width > Sheet.SHEET_WIDTH || height > Sheet.SHEET_HEIGHT) {\r\n\t\t\tthrow new IllegalArgumentException(\"Shape width or height is not valid\");\r\n\t\t}\r\n\r\n\t\tthis.sWidth = width;\r\n\t\tthis.sHeight = height;\r\n\t}",
"public Square(int w)\n {\n width = w;\n }",
"public GameBoard createGameBoard(int nunb_rows,int mumb_cols, int numb_players,String[] playerNames ) {\n this.squareCount = nunb_rows * mumb_cols;\n\n //counter is used to add fields\n int counter = 0;\n\n //initializes the board as an array of fields of size \"fieldcount\"\n this.mySquares = new Square[squareCount];\n mySquares[0]=new FirstSquareImpl(1, this);\n Square square;\n for (int i=1; i<(squareCount-1); i++) {\n square = new SquareImpl(i+1, this);\n mySquares[i]=square;\n }\n mySquares[(squareCount-1)]=new LastSquareImpl(squareCount, this);\n this.lastSquare=mySquares[(squareCount-1)];\n mySquares[1]=new LadderImpl(2,6, this);\n mySquares[6]=new LadderImpl(7,9, this);\n mySquares[10]=new SnakeImpl(11,5, this);\n\n\n //initialises a queue of players and add numb_players to stack\n Player player;\n for (int i=0; i<numb_players; i++) {\n player = new PlayerImpl(playerNames[i], this.mySquares[0]);\n this.myPlayers.add(player);\n\n //add Player to first Square\n this.mySquares[0].enter(player);\n\n }\n return this;\n }",
"public Grid(int h,int w)\n {\n height = h;\n\twidth = w;\n\tcases = new Case[height][width];\n }",
"private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }",
"Board(int rows, int cols, double ratio) {\n\n colCount = cols;\n rowCount = rows;\n\n isRunning = true;\n isWon = false;\n\n board = new Cell[rowCount][colCount];\n\n do {\n boolean hasMine;\n Random r = new Random();\n r.setSeed(System.currentTimeMillis());\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n hasMine = (r.nextGaussian() > ratio);\n board[i][j] = new Cell(i, j, hasMine);\n }\n }\n\n int surroundingMineCount;\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n if (!board[i][j].hasMine()) {\n surroundingMineCount = 0;\n\n // check surrounding fields\n for (int m = -1; m <= 1; m++) {\n for (int n = -1; n <= 1; n++) {\n if (m != 0 || n != 0) { // ignore same cell\n if (i + m >= 0 && i + m < rowCount\n && j + n >= 0 && j + n < colCount) {\n if (board[i + m][j + n].hasMine()) surroundingMineCount++;\n }\n }\n }\n }\n\n board[i][j].setSurroundingMines(surroundingMineCount);\n }\n }\n }\n\n } while(!hasBlanks());\n\n setRandomCellActive();\n }",
"public Rectangle(double width, double height) {\r\n this.width = width;\r\n this.height = height;\r\n }"
] | [
"0.7298967",
"0.6843327",
"0.67646486",
"0.66729236",
"0.6563533",
"0.6526634",
"0.65200955",
"0.64303994",
"0.6420366",
"0.64036727",
"0.6286826",
"0.62632215",
"0.6236135",
"0.6221917",
"0.62003326",
"0.6188771",
"0.6100175",
"0.6064774",
"0.6061499",
"0.60324544",
"0.6005965",
"0.59932166",
"0.59760445",
"0.5957833",
"0.595481",
"0.5907079",
"0.5877279",
"0.58644",
"0.58557665",
"0.58467907",
"0.58357096",
"0.582507",
"0.5823549",
"0.58068484",
"0.57955617",
"0.5782139",
"0.5766366",
"0.5749293",
"0.57472175",
"0.57383984",
"0.5732162",
"0.57311076",
"0.5724672",
"0.5711007",
"0.5710565",
"0.5703237",
"0.5700509",
"0.5695679",
"0.5684559",
"0.5660161",
"0.56545746",
"0.5650384",
"0.564242",
"0.56351954",
"0.5630214",
"0.56298876",
"0.56282216",
"0.5626359",
"0.56229854",
"0.5599365",
"0.5598489",
"0.5588039",
"0.5546956",
"0.5527904",
"0.5519129",
"0.5513076",
"0.5506052",
"0.55022043",
"0.54979616",
"0.5491183",
"0.548476",
"0.5480848",
"0.54790425",
"0.546135",
"0.5455594",
"0.5450587",
"0.544817",
"0.54408836",
"0.5440023",
"0.54398304",
"0.5438877",
"0.54321176",
"0.54223245",
"0.5418989",
"0.54166293",
"0.5416244",
"0.5402454",
"0.5391059",
"0.53884065",
"0.53856504",
"0.5383267",
"0.5382025",
"0.5376351",
"0.5368142",
"0.53661394",
"0.53651273",
"0.53640825",
"0.5361116",
"0.53560513",
"0.5355377"
] | 0.8277208 | 0 |
Merge board1 and board2. | @Override
public void merge(Board board1, Board board2)
{
try
{
board1.merge(board2);
}
catch(IllegalStateException exc)
{
System.out.println("Either this board or the other board is terminated; the boards cannot be merged.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public GridCollector merge(GridCollector other) {\n\t\t// cell-wise merge\n\t\tIntStream.range(0, cells.size())\n\t\t .forEach(i -> cells.get(i).addAll(other.cells.get(i)));\n\t\treturn this;\n\t}",
"void merge();",
"private void merge(List<Estado> states1, List<Estado> states2) {\n\t\tfor (Estado state : states2) {\n\t\t\tif (!contain(state, states1)) {\n\t\t\t\tstates1.add(state);\n\t\t\t}\n\n\t\t}\n\t}",
"void mergePiece(Piece piece);",
"private static void merge(int[] num1, int[] num2) {\n\t\tint len = num1.length + num2.length;\n\n\t\tint[] temp = new int[len];\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint count = 0;\n\t\twhile (i < num1.length && j < num2.length) {\n\t\t\tif (num1[i] < num2[j]) {\n\t\t\t\ttemp[count++] = num1[i++];\n\t\t\t \n\t\t\t} else {\n\t\t\t\ttemp[count++] = num2[j++];\n\t\t\t \n\t\t\t}\n\t\t}\n\n\t\twhile (i < num1.length) {\n\t\t\ttemp[count++] = num1[i++];\n\t\t}\n\t\twhile (j < num2.length) {\n\t\t\ttemp[count++] = num2[j++];\n\t\t}\n\t\tfor (int ind = 0; ind < temp.length; ind++) {\n\t\t\tSystem.out.print(temp[ind] + \" \");\n\t\t}\n\t}",
"void merge(ListNode curr1, ListNode curr2) {\n while (curr1 != null) {\n ListNode next1 = curr1.next, next2 = curr2.next;\n curr1.next = curr2;\n if (next1 == null)\n break;\n curr2.next = next1;\n curr1 = next1;\n curr2 = next2;\n }\n }",
"public void union(int first, int second){\n int firstId = find(first);\n int secondId = find(second);\n //Check if these are already connected\n if(firstId == secondId){\n return;\n }\n if(size[firstId] < size[secondId]){\n size[secondId]+=size[firstId];\n grid[first] = secondId;\n }\n else {\n size[firstId]+=size[secondId];\n grid[second] = firstId;\n }\n --numOfComponents;\n }",
"@Override\n\tpublic void merge(MutableAggregationBuffer buffer1, Row buffer2) {\n\t\tif (buffer1.getString(0) == null) {\n\t\t\tbuffer1.update(0, buffer2.getString(0));\n\t\t} else\n\t\t\tbuffer1.update(0, buffer1.getString(0) + \",\" + buffer2.getString(0));\n\n\t\tbuffer1.update(1, buffer1.getLong(1) + buffer2.getLong(1));\n\t\tbuffer1.update(2, buffer1.getLong(2) + buffer2.getLong(2));\n\n\t}",
"private Board swap(int row1, int col1, int row2, int col2) {\n int[][] copy = new int[N][N]; // Instantiate a new N x N tile grid to avoid mutating the instance tile grid\n for (int row = 0; row < N; row++)\n copy[row] = tiles[row].clone(); // Copy each row of the instance grid to the copy grid\n\n // Swap tiles at the row/column indeces passed to the method\n int temp = copy[row1][col1];\n copy[row1][col1] = copy[row2][col2];\n copy[row2][col2] = temp;\n\n return new Board(copy); // Return new board containing swapped tiles\n }",
"public static LinkedQueue<Object> merge(LinkedQueue<Object> q1, LinkedQueue<Object> q2) {\n if (q1.size() == 0) {\n return q2;\n } else if (q2.size() == 0) {\n return q1;\n }\n\n LinkedQueue<Object> mergeQueue = new LinkedQueue<>();\n int i = 0;\n int j = 0;\n int size1 = q1.size();\n int size2 = q2.size();\n\n while (i < size1 && j < size2) {\n int flag = q1.peek().toString().compareTo(q2.peek().toString());\n if (flag < 0) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n } else {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n }\n\n while (i < size1) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n }\n while (j < size2) {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n\n return mergeQueue;\n }",
"private void moveStack1ToStack2() \n {\n while (!stack1.isEmpty())\n stack2.push(stack1.pop());\n }",
"public void mergeRooms(Vector<Integer> roomThatWasMatched2) {\n\t\tint room = roomThatWasMatched2.get(0);\r\n\t\tfor (int m=1; m<roomThatWasMatched2.size(); m++) { //notice that index 0 is for the room we are using\r\n\t\t\tmaze.map.remove(roomsThatWereMatched.get(m));\r\n//\t\t\tstartPaths.remove(roomThatWasMatched2.get(m));\r\n//\t\t\tdestinationPaths.remove(roomThatWasMatched2.get(m));\r\n\t\t\tfor ( Map.Entry<Integer, Vector<Edge>> entry: startPaths.entrySet() ) {\r\n\t\t\t\tVector<Edge> vectorOfEdges = entry.getValue();\r\n\t\t\t\tfor (int test=0; test<vectorOfEdges.size(); test++) { \r\n\t\t\t\t\tif( roomThatWasMatched2.get(m) == vectorOfEdges.get(test).StartRoom ){\r\n\t\t\t\t\t\tlog.debug(\"room \"+roomThatWasMatched2.get(m)+\" merged with \"+room);\r\n\t\t\t\t\t\tvectorOfEdges.get(test).StartRoom = room;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif( roomThatWasMatched2.get(m) == vectorOfEdges.get(test).DestinationRoom ){\r\n\t\t\t\t\t\tlog.debug(\"room \"+roomThatWasMatched2.get(m)+\" merged with \"+room);\r\n\t\t\t\t\t\tvectorOfEdges.get(test).DestinationRoom = room;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public Tile[][] updateBoard(int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t/*String[] fileRanks = input.split(\" \");\n\t\tint startRow= 8 -Integer.parseInt(fileRanks[0].substring(1));\n\t\tint startColumn = (fileRanks[0].charAt(0)) -'a';\n\t\tint endRow = 8-Integer.parseInt(fileRanks[1].substring(1));\n\t\tint endColumn = (fileRanks[1].charAt(0))-'a'; */\n\n\t\tboard[endRow][endColumn].setOccupyingPiece(null);\n\t\tboard[endRow][endColumn].setOccupyingPiece(board[startRow][startColumn].getOccupyingPiece());\n\t\tboard[startRow][startColumn].setOccupyingPiece(null);\n\n\t\treturn board;\n\t}",
"@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}",
"private void copyBoard(Piece[][] board){\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tfor (int j = 0; j < SIZE; j++) {\r\n\t\t\t\tif (board[i][j] != null) {\r\n\t\t\t\t\tthis.board[i][j] = board[i][j].deepCopy();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (board[i][j] == null) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse if(this.board[i][j].getPlayer().color == Color.BLACK) {\r\n\t\t\t\t\tthis.black.addElement(this.board[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.white.addElement(this.board[i][j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n int[][] initState = {{1, 2, 3}, {4, 0, 6}, {7, 8, 5}};\n Board board = new Board(initState);\n\n System.out.println(\"Size: \" + board.size());\n System.out.println(\"Solvable: \" + board.solvable());\n System.out.println(\"Manhattan: \" + board.manhattan());\n System.out.println(\"Is goal: \" + board.isGoal());\n System.out.println(\"Neighbors:\");\n Iterable<Board> it = board.neighbors();\n for(Board x : it){\n System.out.println(x.toString());\n }\n System.out.println(\"\\n\\n\\n\\n\");\n\n int[][] initState2 = {{1, 2, 3}, {4, 5, 6}, {7, 0, 8}};\n Board board2 = new Board(initState2);\n\n System.out.println(\"Size: \" + board2.size());\n System.out.println(\"Solvable: \" + board2.solvable());\n System.out.println(\"Manhattan: \" + board2.manhattan());\n System.out.println(\"Is goal: \" + board2.isGoal());\n System.out.println(\"Neighbors:\");\n Iterable<Board> it2 = board2.neighbors();\n for(Board x : it2){\n System.out.println(x.toString());\n }\n }",
"Board(Board board) {\n copyFrom(board);\n }",
"public static List canMerge(GameBoard gb) {\r\n\t\tList fullCol = new ArrayList();\r\n\t\tList fullRow = new ArrayList();\r\n\t\tList direction = new ArrayList();\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tfullCol.add(gb.getColumn(i));\r\n\t\t\tfullRow.add(gb.getRow(i));\r\n\t\t} //return list of directions that can merge\r\n\t\t//check up\r\n\t\tList temp = new ArrayList();\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\ttemp.add(merge(gb.getColumn(i)));\r\n\t\t}\r\n\t\tif (!temp.equals(fullCol)) {direction.add(new Integer(1));}\r\n\t\t//check down\r\n\t\ttemp = new ArrayList();\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\t//first reverse column you receive \r\n\t\t\tList temp1 = new ArrayList();\r\n\t\t\tList temp2 = new ArrayList();\r\n\t\t\tfor (int j = 0; j < 4; j++) {temp1.add(gb.getColumn(i).get(3-j));}\r\n\t\t\ttemp1 = merge(temp1);\r\n\t\t\t//undo reverse\r\n\t\t\tfor (int k = 0; k < 4; k++) {temp2.add(temp1.get(3-k));}\r\n\t\t\ttemp.add(temp2);\r\n\t\t}\r\n\t\tif (!temp.equals(fullCol)) {direction.add(new Integer(2));}\r\n\t\t//check left\r\n\t\ttemp = new ArrayList();\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\ttemp.add(merge(gb.getRow(i)));\r\n\t\t}\r\n\t\tif (!temp.equals(fullRow)) {direction.add(new Integer(3));}\r\n\t\t//check right\r\n\t\ttemp = new ArrayList();\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\t//first reverse row you receive \r\n\t\t\tList temp1 = new ArrayList();\r\n\t\t\tList temp2 = new ArrayList();\r\n\t\t\tfor (int j = 0; j < 4; j++) {temp1.add(gb.getRow(i).get(3-j));}\r\n\t\t\ttemp1 = merge(temp1);\r\n\t\t\t//undo reverse\r\n\t\t\tfor (int k = 0; k < 4; k++) {temp2.add(temp1.get(3-k));}\r\n\t\t\ttemp.add(temp2);\r\n\t\t}\r\n\t\tif (!temp.equals(fullRow)) {direction.add(new Integer(4));}\r\n\t\treturn direction;\r\n\t}",
"private int backmerge(int[] arr, int arr1, int l1, int arr2, int l2) {\n\t\tint arr0 = arr2 + l1;\n\t\tfor (;;) {\n\t\t\tif (this.reads.compare(arr[arr1], arr[arr2]) > 0) {\n\t\t\t\tthis.writes.swap(arr, arr1--, arr0--, 1, true, false);\n\t\t\t\tif (--l1 == 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.writes.swap(arr, arr2--, arr0--, 1, true, false);\n\t\t\t\tif (--l2 == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tint res = l1;\n\t\tdo {\n\t\t\tthis.writes.swap(arr, arr1--, arr0--, 1, true, false);\n\n\t\t} while (--l1 != 0);\n\t\treturn res;\n\t}",
"public static MinBinaryheap merge (MinBinaryheap heap1, MinBinaryheap heap2) {\n\n int newSize = heap1.getHeapsize() + heap2.getHeapsize();\n MinBinaryheap mergeHeap = new MinBinaryheap(newSize);\n\n int i = 0;\n int j = 0;\n int k = 0;\n\n while (i < newSize) {\n\n if (j <= heap1.getHeapsize() - 1) {\n //System.out.println (\"i = \" + i + \" j= \" + j + \" \");\n mergeHeap.array[i] = heap1.array[j];\n mergeHeap.addHeapsize();\n i++;\n j++;\n\n } else {\n //System.out.println (\"i = \" + i + \" k= \" + k + \" \");\n\n mergeHeap.array[i] = heap2.array[k];\n mergeHeap.addHeapsize();\n i++;\n k++;\n }\n }\n\n i = newSize - 1;\n\n while (i <= 0) {\n mergeHeap.minHeapify(i);\n i--;\n }\n return mergeHeap;\n }",
"static void mergeWithoutExtraSpace(int[] arr1, int[] arr2) {\n int lastIndexOfArr1 = arr1.length - 1;\n int firstIndexOfArr2 = 0;\n\n while (lastIndexOfArr1 >= 0 && firstIndexOfArr2 < arr2.length) {\n if (arr1[lastIndexOfArr1] > arr2[firstIndexOfArr2]) {\n int temp = arr1[lastIndexOfArr1];\n arr1[lastIndexOfArr1] = arr2[firstIndexOfArr2];\n arr2[firstIndexOfArr2] = temp;\n lastIndexOfArr1--;\n firstIndexOfArr2++;\n } else\n\n /*This is the condition when arr1[lastIndexOfArr1] > arr2[firstIndexOfArr2], that means after this\n * situation, Arr1's all left to current elements would be smaller then right elements of arr2 so we are\n * breaking this loop here.\n * */\n break;\n\n }\n\n //Now arr1 has all element lower than any element of arr2 so now sort them individually and print them\n Arrays.sort(arr1);\n Arrays.sort(arr2);\n\n for (int t : arr1) {\n System.out.print(t + \" \");\n }\n System.out.println(\"*\");\n for (int t : arr2) {\n System.out.print(t + \" \");\n }\n System.out.println(\"*\");\n\n StringBuilder sb = new StringBuilder();\n for (int value : arr1) {\n sb.append(value).append(\" \");\n }\n\n for (int value : arr2) {\n sb.append(value).append(\" \");\n }\n System.out.println(sb);\n }",
"private Board twinBySwitching(int x1, int y1, int x2, int y2) {\n int value1 = blocks[x1][y1];\n int value2 = blocks[x2][y2];\n\n int[][] newBlocks = new int[dimension()][dimension()];\n for (int i = 0; i < dimension(); i++){\n for (int j = 0; j < dimension(); j++) {\n if (i == x1 && j == y1) {\n newBlocks[i][j] = value2;\n } else if (i == x2 && j == y2) {\n newBlocks[i][j] = value1;\n } else {\n newBlocks[i][j] = blocks[i][j];\n }\n }\n }\n\n return new Board(newBlocks);\n }",
"private boolean combine2DFA(DFA_State dfa1, DFA_State dfa2){\n\t\t\n\t\tif(dfa2.isFinal && !dfa1.isFinal){\n\t\t\tdfa1.isFinal=true;\n\t\t\tdfa1.value=dfa2.value;\n\t\t\tdfa1.type=dfa2.type;\n\t\t}\n\t\tSet<Character> ways_1=dfa1.dfa_edges.keySet();\n\t\tSet<Character> ways_2=dfa2.dfa_edges.keySet();\t\n\t\tfor(Character chr:ways_2){\n\t\t\tDFA_State dfa_tmp_2=dfa2.dfa_edges.get(chr);\n\t\t\tif(ways_1.contains(chr)){\t//Guarantee way_2 move on way_1 if way_1 existing \n\t\t\t\tdfa_combined.put(dfa2.dfa_edges.get(chr),dfa1.dfa_edges.get(chr));\n\t\t\t\tdfa_list_1.add(dfa1.dfa_edges.get(chr));\n\t\t\t\tdfa_list_2.add(dfa2.dfa_edges.get(chr));\n\t\t\t}else{\t\t\t\t\t\t//way_1 not existing, add new way to way_1 or connect it to old vertex\n\t\t\t\tif(dfa_combined.keySet().contains(dfa_tmp_2)){\n\t\t\t\t\tDFA_State dfa_tmp_1=dfa_combined.get(dfa_tmp_2);\n\t\t\t\t\tdfa1.dfa_edges.put(chr,dfa_tmp_1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdfa1.dfa_edges.put(chr,new DFA_State());\n\t\t\t\t\tdfa_combined.put(dfa2.dfa_edges.get(chr),dfa1.dfa_edges.get(chr));\n\t\t\t\t\tdfa_list_1.add(dfa1.dfa_edges.get(chr));\n\t\t\t\t\tdfa_list_2.add(dfa2.dfa_edges.get(chr));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}",
"private Board swapTiles1d(short[] swap1, short[] swap2) {\n short[][] arr = tempArray(arr1d, N);\n int[][] tempTiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tempTiles[i][j] = (int) arr[i][j];\n int temp = tempTiles[swap1[0]][swap1[1]];\n tempTiles[swap1[0]][swap1[1]] = tempTiles[swap2[0]][swap2[1]];\n tempTiles[swap2[0]][swap2[1]] = temp;\n return new Board(tempTiles);\n }",
"void copyFrom(Board board) {\n if (board == this) {\n return;\n }\n _moves.clear();\n _moves.addAll(board._moves);\n _turn = board._turn;\n this.initialize(board.boardArr, board._turn);\n }",
"public Node merge(Node node1, Node node2) {\n\t\tsize--;\r\n\t\t\r\n\t\tNode parent = node1.getParent();\r\n\t\tNode merged = new Node();\r\n\r\n\t\t//add all data/children from node1 into merged\r\n\t\tfor (int i = 0; i < node1.getData().size(); i++) {\r\n\t\t\tmerged.addData(node1.getData(i));\r\n\t\t\tif (!node1.isLeaf())\r\n\t\t\t\tmerged.addChild(node1.getChild(i));\r\n\t\t}\r\n\t\tif (!node1.isLeaf())\r\n\t\t\tmerged.addChild(node1.getChild(node1.getChildren().size() - 1));\r\n\r\n\t\t//add all data/children from node2 into merged\r\n\t\tfor (int i = 0; i < node2.getData().size(); i++) {\r\n\t\t\tmerged.addData(node2.getData(i));\r\n\t\t\tif (!node2.isLeaf())\r\n\t\t\t\tmerged.addChild(node2.getChild(i));\r\n\t\t}\r\n\t\tif (!node2.isLeaf())\r\n\t\t\tmerged.addChild(node2.getChild(node2.getChildren().size() - 1));\r\n\t\t\r\n\t\t//remove node1 and node2 from parent, then add merged\r\n\t\tparent.removeChild(parent.getChildNumber(node1));\r\n\t\tparent.removeChild(parent.getChildNumber(node2));\r\n\t\tparent.addChild(merged);\r\n\t\t\r\n\t\treturn merged;\r\n\t}",
"public static void merge (int[] result, int[] a1, int[] a2) {\r\n\t\tint len1 = a1.length;\r\n\t\tint len2 = a2.length;\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\t\r\n\t\twhile (i < len1 && j < len2) {\r\n\t\t\tif (a1[i] < a2[j]) {\r\n\t\t\t\tresult[k] = a1[i];\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tresult[k] = a2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (i < len1) {\r\n\t\t\tresult[k] = a1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (j < len2) {\r\n\t\t\tresult[k] = a2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}",
"private void union_Cells(int c1, int c2) {\r\n\t\twhile (cells[c1] >= 0)\r\n\t\t\tc1 = cells[c1];\r\n\t\twhile (cells[c2] >= 0)\r\n\t\t\tc2 = cells[c2];\r\n\r\n\t\t// the depth of the tree with c2 is deepper than Tc1, Tc1 attach to Tc2\r\n\t\tif (cells[c1] > cells[c2]) {\r\n\t\t\tcells[c1] = c2;\r\n\t\t} else {\r\n\t\t\tif (cells[c1] == cells[c2])\r\n\t\t\t\tcells[c1]--;\r\n\t\t\tcells[c2] = c1;\r\n\t\t}\r\n\t}",
"public void merge(ListNode head1, ListNode head2) {\n ListNode dummy = new ListNode(0);\n \n ListNode cur = dummy;\n \n while (head1 != null && head2 != null) {\n // 注意这里容易出错。head1要先指向它的下一个,再处理head2,否则cur.next=head2这里会改掉\n // head1的指向.\n cur.next = head1;\n cur = cur.next;\n head1 = head1.next;\n \n cur.next = head2;\n cur = cur.next;\n head2 = head2.next;\n }\n \n if (head1 != null) {\n cur.next = head1;\n } else {\n cur.next = head2;\n }\n }",
"public void remove2ChipsFromProjectsAndAddToPlayer(Subproject projectA, Subproject projectB) {\n\t\tcurrent.addChip(projectA.removeLastChip());\n\t\tcurrent.addChip(projectB.removeLastChip());\n\t}",
"public static void merge(int[] nums1, int m, int[] nums2, int n) {\n for (int i = 0; i < m; i++) {\n nums1[m + n - 1 - i] = nums1[m - 1 - i];\n }\n\n int index = 0;\n int indexNum1 = n;\n int indexNum2 = 0;\n\n while (indexNum2 < n) {\n // if empty num1, insert all num2\n if (indexNum1 == m + n) {\n while (indexNum2 < n) {\n nums1[index++] = nums2[indexNum2++];\n }\n\n return;\n }\n\n if (nums1[indexNum1] <= nums2[indexNum2]) {\n nums1[index] = nums1[indexNum1++];\n } else {\n nums1[index] = nums2[indexNum2++];\n\n }\n index++;\n }\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n\n\n int i = m-1,j=n-1;\n int k=m+n-1;\n\n while(i>=0 && j>=0){\n if(nums1[i]>nums2[j]){\n nums1[k] = nums1[i];\n i--;\n } else{\n nums1[k]=nums2[j];\n j--;\n }\n k--;\n }\n while(j>=0){\n nums1[k]=nums2[j];\n k--;\n j--;\n }\n }",
"public static int[] merge(int[] arr1, int[] arr2) {\n int[] merged = new int[arr1.length + arr2.length];\n\n int arr1Index = 0;\n int arr2Index = 0;\n int mergedIndex = 0;\n\n // Keep taking values from arr1 or arr2 until the merged array is full.\n while (mergedIndex < merged.length) {\n\n if (arr1Index < arr1.length && arr2Index < arr2.length) {\n /*\n * Still have values in both arr1 and arr2 that have not been\n * used, so take the smaller of the two and put it into merged.\n */\n if (arr1[arr1Index] < arr2[arr2Index]) {\n merged[mergedIndex] = arr1[arr1Index];\n arr1Index++;\n }\n else {\n merged[mergedIndex] = arr2[arr2Index];\n arr2Index++;\n }\n }\n else if (arr1Index < arr1.length) {\n /*\n * There are still values in arr1 that have not been used but\n * arr2 has been exhausted so take the next value from arr1.\n */\n merged[mergedIndex] = arr1[arr1Index];\n arr1Index++;\n }\n else {\n /*\n * There are still values in arr2 that have not been used but\n * arr1 has been exhausted so take the next value from arr2.\n */\n merged[mergedIndex] = arr2[arr2Index];\n arr2Index++;\n }\n\n mergedIndex++;\n }\n\n return merged;\n }",
"private PlainGraph mergeGraphsInternal(PlainGraph g1, PlainGraph g2) {\n // Create all nodes of g2 in g1\n // AddNode does check if the node does exist already, if so it doesn't create a new one\n for (Map.Entry<String, PlainNode> entry: graphNodeMap.get(g2).entrySet()){\n addNode(g1, entry.getKey(), null);\n }\n\n // create all edges of g2 in g1\n for (PlainEdge edge: g2.edgeSet()) {\n // check if the edge exists in g1, if so check if the variable names of the source and the target are also the same and not just the node names\n // Since the node names are numbered in each graph starting with 0, collisions could exists without the 2nd and 3rd check\n // Inverse the whole such that if this edge doesn't exist create it in g1\n if (! (g1.containsEdge(edge) && getVarName(g2, edge.source()).equals(getVarName(g1, edge.source())) && getVarName(g2, edge.target()).equals(getVarName(g1, edge.target())))) {\n addEdge(g1, getVarName(g2, edge.source()), edge.label().text(), getVarName(g2, edge.target()));\n }\n }\n return g1;\n }",
"public static int[][][] combine(int[][][] source1, int[][][] source2,\n\t\t\tdouble alpha) {\n\n\t\tint[][][] combine = new int[source1.length][source1[0].length][3]; \n\n\t\tfor (int i = 0; i < source1.length; i++) { \n\t\t\tfor (int j = 0; j < source1[0].length; j++) { \n\t\t\t\tint[] combined1 = new int[3];\n\t\t\t\tint[] combined2 = new int[3];\n\t\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t\tcombined1[k] = source1[i][j][k]; // Creating a pixel\n\t\t\t\t\tcombined2[k] = source2[i][j][k]; // Creating a pixel\n\t\t\t\t}\n\t\t\t\t// Put the grey pixel in the new Matrix\n\t\t\t\tcombine[i][j] = blend(combined1, combined2, alpha); \n\t\t\t}\n\t\t}\n\t\treturn combine;\n\n\t}",
"protected void merge(FlowGraph graph){\r\n for(FlowGraphNode node : this.from){\r\n node.addTo(graph.start);\r\n node.to.remove(this);\r\n }\r\n for(FlowGraphNode node : this.to){\r\n graph.end.addTo(node);\r\n node.from.remove(this);\r\n }\r\n }",
"public void merge2(int[] nums1, int m, int[] nums2, int n) {\n int p1 = m - 1;\n int p2 = n - 1;\n // set pointer for nums1\n int p = m + n - 1;\n\n // while there are still elements to compare\n while ((p1 >= 0) && (p2 >= 0))\n // compare two elements from nums1 and nums2\n // and add the largest one in nums1\n nums1[p--] = (nums1[p1] < nums2[p2]) ? nums2[p2--] : nums1[p1--];\n\n // add missing elements from nums2\n System.arraycopy(nums2, 0, nums1, 0, p2 + 1);\n\n }",
"private void updateBoard() throws FileNotFoundException {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Creating board image\");\r\n\t\tBufferedImage combined = new BufferedImage(GlobalVars.images.get(\"Board1\").getWidth(), GlobalVars.images.get(\"Board1\").getHeight(), BufferedImage.TYPE_INT_ARGB);\r\n\t\t\r\n\t\tGraphics g = combined.getGraphics();\r\n\t\t// Draws board template first\r\n\t\tg.drawImage(GlobalVars.images.get(\"Board1\"), 0, 0, null);\r\n\t\t\r\n\t\t// Loops through contents and adds secrets, artifacts, idols\r\n\t\tfor (int i = 0; i < mapContents.length; i++) {\r\n\t\t\tif (mapContents[i] != null && mapContents[i] != \"heart\") {\r\n\t\t\t\tint offsetX = 4;\r\n\t\t\t\tint offsetY = -1;\r\n\t\t\t\tif (mapContents[i].startsWith(\"Minor\")) {\r\n\t\t\t\t\toffsetX = 7;\r\n\t\t\t\t\toffsetY = 3;\r\n\t\t\t\t}\r\n\t\t\t\t// Specific spots to this map\r\n\t\t\t\tif (i == 18) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 206, 286, null);\r\n\t\t\t\t} else if (i == 19) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 299, 287, null);\r\n\t\t\t\t} else if (i == 25) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), 297, 352, null);\r\n\t\t\t\t} else if (i == 28) {\r\n\t\t\t\t\tint num = Integer.parseInt(mapContents[i].substring(10));\r\n\t\t\t\t\tif (num > 0) {\r\n\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 369, null);\r\n\t\t\t\t\t\tif (num > 1) {\r\n\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 395, null);\r\n\t\t\t\t\t\t\tif (num > 2) {\r\n\t\t\t\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"MonkeyIdol\"), 28, 422, null);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(mapContents[i]), GlobalVars.playerCoordsPerRoom[i][0]+offsetX, GlobalVars.playerCoordsPerRoom[i][1]+offsetY, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Draws dragons\r\n\t\tif (attackLevel == 0) g.drawImage(GlobalVars.images.get(\"Dragon\"), 395, 548, null);\r\n\t\telse if (attackLevel == 1) g.drawImage(GlobalVars.images.get(\"Dragon\"), 456, 542, null);\r\n\t\telse if (attackLevel == 2) g.drawImage(GlobalVars.images.get(\"Dragon\"), 513, 510, null);\r\n\t\telse if (attackLevel == 3) g.drawImage(GlobalVars.images.get(\"Dragon\"), 549, 462, null);\r\n\t\telse if (attackLevel == 4) g.drawImage(GlobalVars.images.get(\"Dragon\"), 561, 412, null);\r\n\t\telse if (attackLevel == 5) g.drawImage(GlobalVars.images.get(\"Dragon\"), 551, 349, null);\r\n\t\telse {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"Dragon\"), 552, 287, null);\r\n\t\t}\r\n\t\t\r\n\t\t// Draws characters\r\n\t\tg.drawImage(GlobalVars.images.get(\"RedChar\"), p1.getPiece().getX(), p1.getPiece().getY(), null);\r\n\t\tif (playerCount >= 2) {\r\n\t\t\tg.drawImage(GlobalVars.images.get(\"BlueChar\"), p2.getPiece().getX(), p2.getPiece().getY(), null);\r\n\t\t\tif (playerCount >= 3) {\r\n\t\t\t\tg.drawImage(GlobalVars.images.get(\"YellowChar\"), p3.getPiece().getX(), p3.getPiece().getY(), null);\r\n\t\t\t\tif (playerCount >= 4) {\r\n\t\t\t\t\tg.drawImage(GlobalVars.images.get(\"GreenChar\"), p4.getPiece().getX(), p4.getPiece().getY(), null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Writes the combined image into a file\r\n\t\ttry {\r\n\t\t\tImageIO.write(combined, \"PNG\", new File(\"newboard.png\"));\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t// Builds an embed and sends it to the filesChannel\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(gameChannel.getName());\r\n\t\tembed.setColor(Color.GRAY);\r\n\t\tInputStream test = new FileInputStream(\"newboard.png\");\r\n\t\tembed.setImage(\"attachment://newboard.png\");\r\n\t\tMessageBuilder m = new MessageBuilder();\r\n\t\tm.setEmbed(embed.build());\r\n\t\tGlobalVars.filesChannel.sendFile(test, \"newboard.png\", m.build()).queue();\r\n\t}",
"private boolean updateBoardToAddingOrange(){\n\t\tArrayList<Tile> tiles = null;\n\n\t\tif(Game.getInstance().getTurn().getLastPieceMoved() != null) {\n\t\t\tif(Game.getInstance().getTurn().getLastPieceMoved().getEatingCntr() > 0 || Game.getInstance().getTurn().isLastTileRed()) {\n\t\t\t\ttiles = Game.getInstance().getTurn().getLastPieceMoved().getPossibleMoves(Game.getInstance().getCurrentPlayerColor());\n\t\t\t}\n\t\t}else {\n\t\t\ttiles = Board.getInstance().getAllLegalMoves(Game.getInstance().getCurrentPlayerColor());\n\n\t\t}\n\n\n\t\tfor(Tile t:this.coloredTilesList) {\n\t\t\tif(tiles.contains(t) && !(t instanceof YellowTile)) {\n\t\t\t\t//blue transfer to regular tile\n\t\t\t\tif(t instanceof BlueTile) {\n\t\t\t\t\treplaceTileInSameTileLocation(new Tile.Builder(t.getLocation(), t.getColor1()).setPiece(t.getPiece()).build());\n\t\t\t\t}else //any other color not blue or yellow\n\t\t\t\t{\n\t\t\t\t\t//remove secondary color\n\t\t\t\t\tt.setColor2(null);\n\t\t\t\t\treplaceTileInSameTileLocation(t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n if (m == 0) {\n for (int i = 0; i < n; i++) {\n nums1[i] = nums2[i];\n }\n }\n\n for (int i = m, j = 0; i < nums1.length; i++, j++) {\n nums1[i] = nums2[j];\n }\n\n Arrays.sort(nums1);\n }",
"public abstract void merge (org.apache.spark.sql.expressions.MutableAggregationBuffer buffer1, org.apache.spark.sql.Row buffer2) ;",
"@Override\n public Image merge(Image a, Image b) {\n if (a.getCached() == null) {\n drawImage(a, 0, 0);\n }\n if (b.getCached() == null) {\n drawImage(b, 0, 0);\n }\n Object nativeImage = graphicsEnvironmentImpl.mergeImages(canvas, a, b, a.getCached(), b.getCached());\n Image merged = Image.create(getImageSource(nativeImage));\n merged.cache(nativeImage);\n return merged;\n }",
"public static void main(String[] args) {\n int[][] arr = {{1, 2, 3}, {4, 0, 5}, {6, 7, 8}};\n int[][] arr2 = {{1, 2, 3}, {5, 0, 4}, {6, 7, 8}};\n Board b = new Board(arr);\n Board b2 = new Board(arr2);\n System.out.println(b.toString());\n System.out.println(b.hamming());\n System.out.println(b.equals(b2));\n int[][] arr3 = {{8, 1, 3}, {4, 0, 2}, {7, 6, 5}};\n Board b3 = new Board(arr3);\n System.out.println(b3.manhattan());\n System.out.println(b3.hamming());\n System.out.println(\"----------original-------------------\");\n System.out.println(b3);\n System.out.println(\"----------neighbors-------------------\");\n\n\n for (Board x: b3.neighbors()) {\n System.out.println(x.toString());\n }\n\n System.out.println(\"----------twin-------------------\");\n int[][] arr4 = {{1, 0}, {3, 2}};\n Board b4 = new Board(arr4);\n System.out.println(b4.twin());\n\n\n }",
"public static int[] twoToOne(int[][] two_board){\n int[] one_board = new int[24];\n int i=0;\n for(int row=0; row<ROW; row++){\n for(int column = 0; column < COLUMN; column++){\n one_board[i] = two_board[row][column];\n i++;\n }\n }\n return one_board;\n }",
"public static void recombine(LinearFunction indiv1, LinearFunction indiv2)\n {\n int reg = indiv1.registers.size();\n \n int index1 = GPRunner.RANDOM.nextInt(reg);\n int index2 = GPRunner.RANDOM.nextInt(reg);\n \n if (index1 == index2)\n {\n return;\n }\n if (index2 < index1)\n {\n int val1 = index1;\n int val2 = index2;\n index2 = val1;\n index1 = val2;\n }\n\n // X-Over\n for (int i = index1; i < index2; i++)\n {\n /**\n * Swappe Register innerhalb in [index1, index2)\n */\n LinearRegister r1 = indiv1.registers.get(i);\n LinearRegister r2 = indiv2.registers.get(i);\n \n indiv1.registers.set(i, r2);\n indiv2.registers.set(i, r1);\n }\n \n }",
"public BufferedImage combineMapsIntoImage(int width, int height, BufferedImage kdeImage1, \n\t\t\tBufferedImage kdeImage2)\n\t\t\tthrows IOException{\n\t\tif(width <= 0 || height <= 0 || kdeImage1 == null || kdeImage2 == null)\n\t\t\treturn null;\n\t\t\n//\t\t//Get the colors in the image\n//\t\tHashMap<Integer, Integer> colors1 = new HashMap<Integer, Integer>();\n//\t\tHashMap<Integer, Integer> colors2 = new HashMap<Integer, Integer>();\n//\t\tfor(int y = 0; y < height; y++){\n//\t\t\tfor(int x = 0; x < width; x++){\n//\t\t\t\tif(!colors1.containsKey(kdeImage1.getRGB(x, y)))\n//\t\t\t\t\tcolors1.put(kdeImage1.getRGB(x, y), 0);\n//\t\t\t\tif(!colors2.containsKey(kdeImage2.getRGB(x, y)))\n//\t\t\t\t\tcolors2.put(kdeImage2.getRGB(x, y), 0);\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\t//Remove the \"blank\" color spot\n//\t\tcolors1.remove(0);\n//\t\tcolors2.remove(0);\n//\t\t\n//\t\t//Put the colors into an array\n//\t\tSet<Integer> colorsSet = colors1.keySet();\n//\t\tInteger[] orderedColors1 = new Integer [colorsSet.size()];\n//\t\tint iter = 0;\n//\t\tfor(Integer val : colorsSet){\n//\t\t\torderedColors1[iter] = val;\n//\t\t\titer++;\n//\t\t}\n//\t\t\n//\t\tcolorsSet = colors2.keySet();\n//\t\tInteger[] orderedColors2 = new Integer [colorsSet.size()];\n//\t\titer = 0;\n//\t\tfor(Integer val : colorsSet){\n//\t\t\torderedColors2[iter] = val;\n//\t\t\titer++;\n//\t\t}\t\n//\t\t\n//\t\tcolors1 = null;\n//\t\tcolors2 = null;\n//\t\t\n//\t\t//Order the colors\n//\t\tArrays.sort(orderedColors1);\n//\t\tArrays.sort(orderedColors2);\n//\t\t\n//\t\tfor(Integer val : orderedColors1)\n//\t\t\tSystem.out.println(val);\n//\t\tSystem.out.println();\n//\t\tfor(Integer val : orderedColors2)\n//\t\t\tSystem.out.println(val);\n\t\t\n\t\t//Create an image of the two images combined, discounting pixels not colored in both images\n\t\t//Coloring in the new image is done by ANDing/ORing the colors of the two inputted images\n\t\t//An AND retains the coloration of the original images, combining the colors where needed\n\t\t//OR changes the colors to another scheme but may show a better heatmap of the overlap\n\t\tBufferedImage combinedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n\t\tfor(int y = 0; y < height; y++){\n\t\t\tfor(int x = 0; x < width; x++){\n\t\t\t\tif((kdeImage1.getRGB(x, y) != 0) && (kdeImage2.getRGB(x, y) != 0)){\n\t\t\t\t\tcombinedImage.setRGB(x, y, kdeImage1.getRGB(x, y) & kdeImage2.getRGB(x, y));\n//\t\t\t\t\tcombinedImage.setRGB(x, y, kdeImage1.getRGB(x, y) | kdeImage2.getRGB(x, y));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn combinedImage;\n\t}",
"public void crossDissolve(ArrayList<Bitmap> frames1, ArrayList<Bitmap> frames2) {\n int width = view1.getWidth();\n int height = view1.getHeight();\n int factor1 = 1;\n int factor2 = frameCount-factor1;\n for(int i=0; i < frames1.size();i++) {\n Bitmap view1Background = frames1.get(i);\n Bitmap view2Background = frames2.get(i);\n Bitmap blank = Bitmap.createBitmap(400, 400, Bitmap.Config.ARGB_8888);\n for(int x=0;x<width;x++) {\n for(int y=0;y<height;y++) {\n int pixel1 = view1Background.getPixel(x, y);\n int pixel2 = view2Background.getPixel(x, y);\n int red = Color.red(pixel1)*factor2/frameCount+Color.red(pixel2)*factor1/frameCount;\n int green = Color.green(pixel1)*factor2/frameCount+Color.green(pixel2)*factor1/frameCount;\n int blue = Color.blue(pixel1)*factor2/frameCount+Color.blue(pixel2)*factor1/frameCount;\n blank.setPixel(x, y, Color.rgb(red, green, blue));\n }\n }\n pictures.add(blank);\n factor1++;\n factor2 = frameCount-factor1;\n }\n }",
"@Override\n\tpublic int board2_insert(Board2DTO dto) throws Exception {\n\t\treturn board2Mapper.board2_insert(dto);\n\t}",
"private static void merge(int[] a, int[] b) {\n\t\tint aI = a.length-1;\r\n\t\tint bI = b.length-1;\r\n\t\tint posI=a.length-b.length-1;\r\n\t\t\r\n\t\r\n\t\twhile (aI>=0 ) {\r\n\t\t\tif(a[posI]> b[bI]) {//missing the test for posI>=0 see mergeInPlace(int a[],int b[])\r\n\t\t\t\ta[aI]=a[posI];\r\n\t\t\t\tposI--;\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\ta[aI]=b[bI];\r\n\t\t\t\tbI--;\r\n\r\n\t\t\t}\r\n\t\t\taI--;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int x:a) {\r\n\t\t\tSystem.out.println(x);\r\n\t\t}\r\n\t}",
"private void merge(String folderName, ArrayList<String> loader1, ArrayList<String> loader2) throws IOException {\n LoadAndSave las =new LoadAndSave();\n las.load(folderName);\n for(int x=0;x<loader1.size();x++) {\n las.loader1.add(loader1.get(x));\n las.loader2.add(loader2.get(x*3));\n las.loader2.add(loader2.get(x*3+1));\n las.loader2.add(\"0/0\");\n }\n las.save(folderName);\n }",
"public static void main(String[] args) {\n\t\tint [] queue1 = {4,7,2,9,12,35,8,49};\r\n\t int [] queue2 = {24,53,6,19,41,71,1,68,11,32,99}; \r\n\t int[]mergeQ = new int[queue1.length + queue2.length];\r\n\r\n\t for(int i=0; i < queue1.length; i++ )\r\n\t {\r\n\r\n\t mergeQ[i*2] = queue1[i]; \r\n\t mergeQ[i*2+1] = queue2[i]; \r\n\t }\r\n\t for(int i=0; i < mergeQ.length; i++) { \r\n\t System.out.print(mergeQ[i]+\",\");\r\n\t }\r\n\t}",
"int merge(int list1, int list2) {\n\t\t\n\t\t// Get values of the lists\n\t\t\n\t\tComparable c1 = array[list1];\n\t\tComparable c2 = array[list2];\n\n\t\t// compare values\n\t\t\n\t\tint small = list1, big = list2;\n\t\tif (c1 != c2 && c1 != null && c1.compareTo(c2) > 0) {\n\n\t\t\tsmall = list2;\n\t\t\tbig = list1;\n\t\t}\n\n\t\t/*\n\t\t * If small list has no tail - set big list to be small list tail\n\t\t * If small list has tail - merge it with the big list and set result to be small list tail\n\t\t */\n\t\t\n\t\tif (next[small] == NIL)\n\t\t\tnext[small] = big;\n\t\telse\n\t\t\tnext[small] = merge(next[small], big);\n\t\t\n\t\t// return small list with new tail\n\t\t\n\t\treturn small;\n\t}",
"public QueueADT<Region> sidewaysMerge2(QueueADT<Region> regionQueue,\n\t\t\tDouble sRedT,Double sGreenT,Double sBlueT) {\n\t\t\n\t\t//Creates 2 regionqueues to return and compare values with\n\t\tQueueADT<Region> newRegionQueue=new LinkedQueue<Region>();\n\t\tQueueADT<Region> regionQueue2=new LinkedQueue<Region>();\n\t\t\n\t\t//variables r for the merging of the images, and r3 for the temporary placeholder\n\t\tRegion r, r3;\n\n\t\t// Check each region against all other regions to see if\n\t\t// any should be merged: they must be adjacent and homogenuous.\n\t\t// If 2 regions are merged only the new regions in enqueued,\n\t\t// with the two mergered regions being discarded. Each merge\n\t\t// makes the regionQueue 1 smaller.\n\t\t// Merge 2 regions is the same homogeneity critera used\n\t\t// to merge square quadtrees is true \n\t\t// Perform this regions until merging can no longer be done.\n\n\t\t// Create a copy of regionQueue in regionQueue2\n\t\tfor(int i=0;i<regionQueue.size();i++)\n\t\t{\n\t\t\tRegion r1=regionQueue.dequeue();\n\t\t\tregionQueue.enqueue(r1);\n\t\t\tregionQueue2.enqueue(r1);\n\t\t}\n\n\t\t//Prints initial number of regions\n\t\tSystem.out.println(\"\\nInitial number of regions in sideswaysMerge1:\"\n\t\t\t\t+ regionQueue.size() + \"\\n\");\n\n\t\t//Boolean to loop merging procedure\n\t\tBoolean performMerge=true;\n\t\t\n\t\t//While loop that continues until boolean is false\n\t\twhile(performMerge)\n\t\t{\n\t\t\t//Quits loop if break is executed\n\t\t\tperformMerge=false;\n\t\t\t\n\t\t\t//Breakpoint\n\t\t\trestart_loops:\n\t\t\t\t\n\t\t\t\t//Nested loop to compare every value in both queues\n\t\t\t\tfor(int i=0;i<regionQueue.size();i++)\n\t\t\t\t{\n\t\t\t\t\t//Gets the r1 variable\n\t\t\t\t\tRegion r1=regionQueue.dequeue();\n\t\t\t\t\tregionQueue.enqueue(r1);\n\n\t\t\t\t\t//Loops through second set of queues\n\t\t\t\t\tfor(int j=0;j<regionQueue2.size();j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Gets the r2 variable\n\t\t\t\t\t\tRegion r2=regionQueue2.dequeue();\n\t\t\t\t\t\tregionQueue2.enqueue(r2);\n\t\t\t\t\t\t\n\t\t\t\t\t//Executes if variables are not the same and if regions are adjacent\t\n\t\t\t\t\tif (r1 != r2 && r1.adjacent(r2, false)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Creates new region and merges regions being compared\n\t\t\t\t\t\tr = new Region();\n\t\t\t\t\t\tr.mergeRegion(r1, false);\n\t\t\t\t\t\tr.mergeRegion(r2, false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Executes if newly merged region is homogenous\n\t\t\t\t\t\tif (homogeneous(r, sRedT, sGreenT, sBlueT)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Regions r1=\" + i + \" and r2=\" + j + \" are adjacent\");\n\t\t\t\t\t\t\tSystem.out.println(\"Regions r1=\" + i + \" and r2=\" + j + \" are homogeneous\");\n\t\t\t\t\t\t\tSystem.out.println(\"sidewaysMerge1: regions \" + i + \" and \" + j + \" merged\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// delete old r1 and r2 by not putting them in newRegionQueue\n\t\t\t\t\t\t\twhile(!regionQueue.isEmpty())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tr3=regionQueue.dequeue();\n\t\t\t\t\t\t\t\tif(r3!=r1 && r3!=r2) newRegionQueue.enqueue(r3);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.println(\"Region r1 had \" + r1.getQuadQueueSize() + \" quadnodes\");\n\t\t\t\t\t\t\tSystem.out.println(\"Region r2 had \" + r2.getQuadQueueSize() + \" quadnodes\");\n\t\t\t\t\t\t\tperformMerge=true;\n\t\t\t\t\t\t\tSystem.out.println(\"Newly merged region r1 has \" + r1.getQuadQueueSize() + \n\t\t\t\t\t\t\t\t\t\" quadnodes\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Adds newly merged region to queu to be returned\n\t\t\t\t\t\t\tnewRegionQueue.enqueue(r);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"newRegionQueue.size() after 2 deletions and 1 addition: \"\n\t\t\t\t\t\t\t\t\t\t\t+ newRegionQueue.size());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// At this point old r2, which was merged into r1,\n\t\t\t\t\t\t\t// is not re-added to queue\n\t\t\t\t\t\t\t// Now empty the regionQueue and regionQueue2()\n\t\t\t\t\t\t\t// queues\n\t\t\t\t\t\t\twhile (!regionQueue.isEmpty()) {\n\t\t\t\t\t\t\t\tr3 = regionQueue.dequeue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (!regionQueue2.isEmpty()) {\n\t\t\t\t\t\t\t\tr3 = regionQueue2.dequeue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Empty newRegionQueue and add its regions to\n\t\t\t\t\t\t\t// regionQueue and regionQueue2\n\t\t\t\t\t\t\twhile (!newRegionQueue.isEmpty()) {\n\t\t\t\t\t\t\t\tr3 = newRegionQueue.dequeue();\n\t\t\t\t\t\t\t\tregionQueue.enqueue(r3);\n\t\t\t\t\t\t\t\tregionQueue2.enqueue(r3);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tSystem.out.println(\"regionQueue.size()=\"\n\t\t\t\t\t\t\t\t\t+ regionQueue.size());\n\t\t\t\t\t\t\tSystem.out.println(\"regionQueue2.size()=\"\n\t\t\t\t\t\t\t\t\t+ regionQueue2.size());\n\t\t\t\t\t\t\tSystem.out.println(\"\\nRestarting nested loops\\n\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Breaks if this point in the code is reached\n\t\t\t\t\t\t\tbreak restart_loops;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Number of regions after sideswaysMerge1: \"\n\t\t\t\t+ regionQueue.size());\n\t\t\n\t\t//Returns queue\n\t\treturn regionQueue;\n\t}",
"private void swapTiles(Tile tile1, Tile tile2) {\n\n\t\tint temp = tile2.getValue();\n\t\ttile2.setValue(tile1.getValue());\n\t\ttile1.setValue(temp);\n\t}",
"public static void main(String[] args) {\n List<Integer> list1 = new ArrayList<>();\n List<Integer> list2 = new ArrayList<>();\n list1.add(2);\n list1.add(3);\n list1.add(4);\n list2.add(1);\n list2.add(5);\n list2.add(6);\n merge(list1, list2).forEach(item -> System.out.print(item + \" \"));\n }",
"@Override\n public BoardFramework copyBoard() {\n List<List<GamePiece>> pieceCopies= new ArrayList<>();\n for(List<GamePiece> row: myGamePieces){\n List<GamePiece> rowOfPieceCopies = new ArrayList<>();\n for(GamePiece piece: row){\n rowOfPieceCopies.add(piece.copy());\n }\n pieceCopies.add(rowOfPieceCopies);\n }\n return new Board(pieceCopies,new ArrayList<>(myNeighborhoods),myEmptyState);\n }",
"public void merge(SortedList<T> list2){\n while(!list2.isEmpty()){\n this.internalInsert(list2.removeFromFront());\n }\n\n this.sort();\n }",
"public static String merge(String str1, String str2)\r\n {\r\n return (str1==null?\"\":str1)+(str2==null?\"\":str2);\r\n }",
"private Board(int[][] tiles, Position first, Position second) {\n this.dimension = tiles.length;\n this.tiles = new int[dimension][dimension];\n for (int i = 0; i < dimension; i++)\n System.arraycopy(tiles[i], 0, this.tiles[i], 0, dimension);\n\n int temp = this.tiles[first.i][first.j];\n this.tiles[first.i][first.j] = this.tiles[second.i][second.j];\n this.tiles[second.i][second.j] = temp;\n }",
"public static Deque<Integer> merge(Deque<Integer> d1, Deque<Integer> d2) {\n int size1=d1.getSize();\n int size2=d2.getSize();\n LinkedListDeque<Integer> deque=new LinkedListDeque();\n\n int count1 =0, count2=0;\n \n int length = size1+size2;\n \n \n \n int temp1=0;\n int temp2=0;\n \n \n \n for(int i=0; i<length; i++){\n \n try {\n temp1 = d1.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n try {\n temp2 = d2.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n if(count1==size1){\n deque.pushToBack(temp2);\n count2++;\n }else if(count2 == size2){\n deque.pushToBack(temp1);\n count1++;\n }\n else if(temp1<temp2){\n deque.pushToBack(temp1);\n count1++;\n d2.pushToFront(temp2);\n } else{\n deque.pushToBack(temp2);\n d1.pushToFront(temp1);\n count2++; \n }\n \n }\n \n \n\nreturn deque;\n}",
"private void copyRostersToMatch(int week){\r\n List<FantasyMatch> fMatches = fmatchBean.findByWeek(week);\r\n for(int i = 0; i < fMatches.size(); i++){\r\n FantasyMatch fm = fMatches.get(i);\r\n List<RosterPlayer> rosterA = rpBean.getActiveByTeam(fm.getTeam1());\r\n List<RosterPlayer> rosterB = rpBean.getActiveByTeam(fm.getTeam2());\r\n \r\n int WRnum = 0;\r\n int RBnum = 0;\r\n for(int j = 0; j < rosterA.size(); j++){\r\n RosterPlayer rp = rosterA.get(j);\r\n NFLPlayer nflp = rp.getNflPlayer();\r\n int pos = nflp.getPosition();\r\n \r\n switch(pos){\r\n case 1:\r\n fm.setTeam1QB(nflp);\r\n break;\r\n case 2:\r\n switch(RBnum){\r\n case 0:\r\n fm.setTeam1RB1(nflp);\r\n RBnum++;\r\n break;\r\n case 1:\r\n fm.setTeam1RB2(nflp);\r\n RBnum++;\r\n break;\r\n case 2:\r\n fm.setTeam1WRRB(nflp);\r\n RBnum++;\r\n break;\r\n }\r\n break;\r\n case 3:\r\n switch(WRnum){\r\n case 0:\r\n fm.setTeam1WR1(nflp);\r\n WRnum++;\r\n break;\r\n case 1:\r\n fm.setTeam1WR2(nflp);\r\n WRnum++;\r\n break;\r\n case 2:\r\n fm.setTeam1WRRB(nflp);\r\n WRnum++;\r\n break;\r\n }\r\n break;\r\n case 4:\r\n fm.setTeam1TE(nflp);\r\n break;\r\n case 5:\r\n fm.setTeam1K(nflp);\r\n break;\r\n case 6:\r\n fm.setTeam1DEF(nflp);\r\n break;\r\n }\r\n }\r\n WRnum = 0;\r\n RBnum = 0;\r\n for(int j = 0; j < rosterB.size(); j++){\r\n RosterPlayer rp = rosterB.get(j);\r\n NFLPlayer nflp = rp.getNflPlayer();\r\n int pos = nflp.getPosition();\r\n \r\n switch(pos){\r\n case 1:\r\n fm.setTeam2QB(nflp);\r\n break;\r\n case 2:\r\n switch(RBnum){\r\n case 0:\r\n fm.setTeam2RB1(nflp);\r\n RBnum++;\r\n break;\r\n case 1:\r\n fm.setTeam2RB2(nflp);\r\n RBnum++;\r\n break;\r\n case 2:\r\n fm.setTeam2WRRB(nflp);\r\n RBnum++;\r\n break;\r\n }\r\n break;\r\n case 3:\r\n switch(WRnum){\r\n case 0:\r\n fm.setTeam2WR1(nflp);\r\n WRnum++;\r\n break;\r\n case 1:\r\n fm.setTeam2WR2(nflp);\r\n WRnum++;\r\n break;\r\n case 2:\r\n fm.setTeam2WRRB(nflp);\r\n WRnum++;\r\n break;\r\n }\r\n break;\r\n case 4:\r\n fm.setTeam2TE(nflp);\r\n break;\r\n case 5:\r\n fm.setTeam2K(nflp);\r\n break;\r\n case 6:\r\n fm.setTeam2DEF(nflp);\r\n break;\r\n }\r\n } \r\n fmatchBean.edit(fm);\r\n }\r\n \r\n }",
"public void mergeDisjoint(UFPartition<T> p2){\r\n\t\tp2 = p2.clone();\r\n\t\tfor(Node<T> n : p2.nodes.values()) {\r\n\t\t\tassert !nodes.containsKey(n.getE());\r\n\t\t\tnodes.put(n.getE(), new Node<T>(n.getE()));\r\n\t\t}\r\n\t\tfor(Node<T> n : p2.nodes.values()) {\r\n\t\t\tNode<T> newNode = getNode(n.getE());\r\n\t\t\tNode<T> newNodeRoot = getNode(n.getRoot().getE());\r\n\t\t\tnewNode.setParent(newNodeRoot);\r\n\t\t\tnodes.put(n.getE(), new Node<T>(n.getE()));\r\n\t\t}\r\n\t\t\r\n\t}",
"public void makeBoard2d() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.board2d[i][j] = this.board[(i * 3) + j];\n }\n }\n }",
"private void swapFirstTwoTiles() {\n ((Board) boardManager.getBoard()).swapTiles(0, 0, 0, 1);\n }",
"public ListNode merge(ListNode h1, ListNode h2){\r\n if(h1 == null){\r\n return h2;\r\n }\r\n if(h2 == null){\r\n return h1;\r\n }\r\n \r\n if(h1.val < h2.val){\r\n h1.next = merge(h1.next, h2);\r\n return h1;\r\n }\r\n else{\r\n h2.next = merge(h1, h2.next);\r\n return h2;\r\n }\r\n \r\n }",
"public static void add(int[][] matrix1, int[][] matrix2) {\n\tfor(int x=0;x<matrix1.length; x++) {\r\n\t\tfor(int y=0;y<matrix2.length;y++) {\r\n\t\t\tSystem.out.print(matrix1[x][y] +matrix2[x][y] + \" \");\r\n\t\t\t}\r\n\t\tSystem.out.println();\r\n\t\t}\t\r\n\t}",
"public boolean merge(Case from, Case to)\n {\n if (from.getValue() == to.getValue() && from.getValue() != 0)\n {\n to.setValue(to.getValue()+from.getValue());\n from.setValue(0);\n return true;\n }\n return false;\n }",
"private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn concat;\r\n\t}",
"public void add2ChipsOnExistingProjects(Subproject projectA, Subproject projectB) {\n\t\tcurrent.raiseScore(projectA.setChip(current.removeChip()).getAmountSZT());\n\t\tcurrent.raiseScore(projectB.setChip(current.removeChip()).getAmountSZT());\n\t}",
"void merge(T other);",
"public static int[] merge(int[] arr1, int[] arr2) {\n int[] arr = new int[arr1.length * 2];\n int count1 = 0;\n int count2 = 0;\n while (count1 + count2 < arr.length) {\n if (count2 == arr2.length) {\n arr[count1+count2] = arr1[count1];\n count1++;\n } else if (count1 == arr1.length) {\n arr[count2+count1] = arr2[count2];\n count2++;\n } else {\n if (arr1[count1] < arr2[count2]) {\n arr[count1+count2] = arr1[count1];\n count1++;\n } else {\n arr[count1+count2] = arr2[count2];\n count2++;\n }\n }\n }\n return arr;\n }",
"public static void merge(int[] arr1, int[] arr2, int[] arr3) {\r\n\t\r\n\t\tint m = arr1.length, n = arr2.length, i = 0, j = 0, k = 0;\r\n\t \r\n // Traverse both array.\r\n while (i < m && j < n) {\r\n // Check if current element of first array is smaller than current element of second array.\r\n \t// If yes, store first array element and increment first array index. \r\n \t// Otherwise do same with second array.\r\n if (arr1[i] < arr2[j]) {\r\n arr3[k] = arr1[i];\r\n i++;\r\n } else {\r\n arr3[k] = arr2[j];\r\n j++;\r\n }\r\n \r\n k++;\r\n }\r\n \r\n // Store remaining elements of first array.\r\n while (i < m) {\r\n arr3[k] = arr1[i];\r\n i++;\r\n k++;\r\n }\r\n \r\n // Store remaining elements of second array.\r\n while (j < n) {\r\n arr3[k] = arr2[j];\r\n j++;\r\n k++;\r\n }\r\n\t}",
"public void move(Square square1, Square square2) {\n // Points the destination Square to the Piece now occupying it\n square2.setPiece(square1.getPiece());\n\n // Points the Piece that has just moved back at its Square\n square2.getPiece().setSquare(square2);\n\n // Sets the Piece reference in the now empty Square to null\n square1.setPiece(null);\n\n // Flips the current Player to the other Player\n setTurn();\n }",
"private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }",
"public static void main(String[] args) {\n\t\tint []arr1= {12,13,44};\r\n\t\tint []arr2= {44,45,47,50};\r\n\t\tint i,j;\r\n\t\tint count=0;\r\n\t\t\r\n\t\tint []merge=new int[arr1.length+arr2.length];\r\n\t\tfor(i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tmerge[i]=arr1[i];\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t\tfor(i=0;i<arr2.length;i++)\r\n\t\t\t{\r\n\t\t\t\tmerge[count++]=arr2[i];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tfor(i=0;i<merge.length;i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\" \" +merge[i]);\r\n\t\t\t}\r\n\t\t\r\n\r\n\t}",
"private void merge(int[] left, int[] right, int[] a) {\n\t\t// i - left\n\t\t// j - right\n\t\t// k - original\n\t\tint i = 0, j = 0, k = 0;\n\t\tint sL = left.length;\n\t\tint sR = right.length;\n\n\t\twhile (i < sL && j < sR) {\n\t\t\tif (left[i] < right[j]) {\n\t\t\t\ta[k] = left[i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\ta[k] = right[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\twhile (i < sL) {\n\t\t\ta[k] = left[i];\n\t\t\tk++;\n\t\t\ti++;\n\t\t}\n\t\twhile (j < sR) {\n\t\t\ta[k] = right[j];\n\t\t\tk++;\n\t\t\tj++;\n\t\t}\n\t}",
"public static ItemStack combineStacks(ItemStack stack1, ItemStack stack2) {\n\t\tif (stack1.isEmpty())\n\t\t\treturn stack2.copy();\n\n\t\treturn grow(stack1, stack2.getCount());\n\t}",
"public void merge(Tuple tup) {\n\t\t\n\t}",
"public static LinkedList.LL merge(LinkedList.LL ll1, LinkedList.LL ll2) {\n LinkedList.Node n1 = ll1.head;\n LinkedList.Node n2 = ll2.head;\n LinkedList.Node prev = null;\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n ll2.print();\n while (n1.next != null || n2 != null) {\n if (n1.data <= n2.data && n1.next != null) {\n prev = n1;\n n1 = n1.next;\n } else if (n1.data > n2.data) {\n if (prev != null) {\n prev.next = n2;\n } else {\n ll1.head = n2;\n }\n LinkedList.Node next = n2.next;\n n2.next = n1;\n prev = n2;\n n2 = next;\n } else if (n1.next == null) {\n n1.next = n2;\n break;\n }\n }\n System.out.println(\"-------------------------------------------------\");\n ll1.print();\n System.out.println(\"-------------------------------------------------\"); \n return ll1;\n }",
"static int[] merge(int[] A, int[] B){\n int m = A.length; int n = B.length;\n A = Arrays.copyOf(A, m+n);\n while(m > 0 && n > 0){\n if(A[m-1] > B[n-1]){\n A[m+n-1] = A[m-1];\n m--;\n }else{\n A[m+n-1] = B[n-1];\n n--;\n }\n }\n\n while(n > 0){\n A[m+n-1] = B[n-1];\n n--;\n }\n return A;\n }",
"private void addNewBoard(int x, int y,\n\t\t\tArrayList<ArrayList<Integer>> board) {\n\t\tif (y < 0 || y > board.size() - 1) { //expanding up/down\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tArrayList<Integer> z = new ArrayList<>();\n\t\t\t\tfor (int j = 0; j < board.get(0).size(); j++) {\n\t\t\t\t\tif ((j < x + boardSize && j >= x && x >= 0)) { //adjusts for y if it isn't 0 or negative, almost forgot about this\n\t\t\t\t\t\tz.add(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.add(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (y < 0) {\n\t\t\t\t\tboard.add(0, z);\n\t\t\t\t\ty++;\n\t\t\t\t} else {\n\t\t\t\t\tboard.add(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif (x < 0 || x > board.get(0).size() - 1) { //expanding to the left/right\n\t\t\tint loc = (x < 0) ? 0 : board.get(0).size();\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < board.size(); j++) {\n\t\t\t\t\tif (j < y + boardSize && j >= y) {\n\t\t\t\t\t\tboard.get(j).add(loc, 0); //append as opposed to add\n\t\t\t\t\t} else {\n\t\t\t\t\t\tboard.get(j).add(loc, 5); //append lack of board everywhere else\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif ((y >= 0 && y < board.size())\n\t\t\t\t&& (x >= 0 && x < board.get(0).size())\n\t\t\t\t&& getBoard(x, y) == 5) { //If within board\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t\tboard.get(y + i).set(x + j, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tupdateOffset();\n\t}",
"public void avoidOverlappingCell(Object[] cells2) {\r\n \r\n \t\toverlapping.avoidOverlappingCell(cells2);\r\n \t\tgraphRepaint();\r\n \t\tgraph.getGraphLayoutCache().reload();\r\n \t}",
"private static boolean merge(int[] a, int[] b) {\n if (b[1] < a[0] || a[1] < b[0]) {\n return false;\n }\n\n a[0] = Math.min(a[0], b[0]);\n a[1] = Math.max(a[1], b[1]);\n return true;\n }",
"public boolean Equals( AbstractBoard other )\n\t{\n\t\tif( this.getSize( ) != other.getSize( ) || this.getWidth( ) != other.getWidth( ) )\n\t\t\treturn false;\n\t\t\n\t\tfor( int i = 0; i < this.getSize( ); i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < this.getWidth( ); j++ )\n\t\t\t{\n\t\t\t\tif( this.cell( i, j ) != other.cell( i, j ) )\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n int p=m+n-1;\n int l=m-1;\n int r=n-1;\n while((r>=0)&&(l>=0)){\n if(nums1[l]>=nums2[r]){\n nums1[p]=nums1[l];\n l--;\n p--;\n }else{\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n }\n if(r<0){\n while(l>=0){\n nums1[p]=nums1[l];\n l--;\n p--;\n }\n }\n if(l<0){\n while(r>=0){\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n \n }\n \n }",
"public static int[] merge_v2(int[] arr1, int[] arr2) {\n\t\tif ((arr1 == null || arr1.length == 0) && (arr2 == null || arr2.length == 0)) {\n\t\t\treturn null;\n\t\t} else if (arr1 == null || arr1.length == 0) {\n\t\t\treturn Arrays.copyOf(arr2, arr2.length);\n\t\t} else if (arr2 == null || arr2.length == 0) {\n\t\t\treturn Arrays.copyOf(arr1, arr1.length);\n\t\t}\n\n\t\t// assuming arr1 and arr2 are null\n\t\tint pointer1 = 0;\n\t\tint pointer2 = 0;\n\t\tint[] result = new int[arr1.length + arr2.length];\n\n\t\tfor (int i = 0; i < result.length; i++) {\n\n\t\t\tif (pointer2 > arr2.length - 1) {\n\t\t\t\tresult[i] = arr1[pointer1];\n\t\t\t\tpointer1++;\n\t\t\t} else if ((pointer1 > arr1.length - 1) || (arr1[pointer1] > arr2[pointer2])) {\n\t\t\t\tresult[i] = arr2[pointer2];\n\t\t\t\tpointer2++;\n\t\t\t} else {\n\t\t\t\tresult[i] = arr1[pointer1];\n\t\t\t\tpointer1++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}",
"private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}",
"public static ListNode mergeTwoLists2(ListNode l1, ListNode l2) {\n ListNode prehead = new ListNode(-1);\n\n ListNode prev = prehead;\n while (l1 != null && l2 != null) {\n if (l1.val <= l2.val) {\n prev.next = l1;\n l1 = l1.next;\n } else {\n prev.next = l2;\n l2 = l2.next;\n }\n prev = prev.next;\n }\n\n // exactly one of l1 and l2 can be non-null at this point, so connect\n // the non-null list to the end of the merged list.\n prev.next = l1 == null ? l2 : l1;\n\n return prehead.next;\n\n }",
"public void mergeTo (WordLinkedList that){\n int j = that.getSize();\r\n for (int i=0;i<j;i++){\r\n this.insert(that.remove(0));\r\n }\r\n //System.out.println(\"----------merge-----------\");\r\n }",
"public static <KEY extends java.lang.Comparable<KEY>, ITEM> BinomialTree<KEY, ITEM> CombinePair (\n\t\tfinal BinomialTree<KEY, ITEM> binomialTree1,\n\t\tfinal BinomialTree<KEY, ITEM> binomialTree2,\n\t\tfinal boolean minHeap)\n\t{\n\t\tif (null == binomialTree1 || null == binomialTree2)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tint order = binomialTree1.order();\n\n\t\tif (order != binomialTree2.order())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tBinomialTree<KEY, ITEM> upTree = null;\n\t\tBinomialTree<KEY, ITEM> downTree = null;\n\t\tBinomialTree<KEY, ITEM> combinedTree = null;\n\n\t\tKEY key1 = binomialTree1.entry().key();\n\n\t\tKEY key2 = binomialTree2.entry().key();\n\n\t\tif (minHeap)\n\t\t{\n\t\t\tif (-1 != key1.compareTo (\n\t\t\t\tkey2\n\t\t\t))\n\t\t\t{\n\t\t\t\tupTree = binomialTree2;\n\t\t\t\tdownTree = binomialTree1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupTree = binomialTree1;\n\t\t\t\tdownTree = binomialTree2;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (-1 != key1.compareTo (\n\t\t\t\tkey2\n\t\t\t))\n\t\t\t{\n\t\t\t\tupTree = binomialTree1;\n\t\t\t\tdownTree = binomialTree2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupTree = binomialTree2;\n\t\t\t\tdownTree = binomialTree1;\n\t\t\t}\n\t\t}\n\n\t\tjava.util.List<BinomialTree<KEY, ITEM>> meldedChildren =\n\t\t\tnew java.util.ArrayList<BinomialTree<KEY, ITEM>>();\n\n\t\tjava.util.List<BinomialTree<KEY, ITEM>> upChildren = upTree.children();\n\n\t\tif (null != upChildren)\n\t\t{\n\t\t\tint upChildrenCount = upChildren.size();\n\n\t\t\tfor (int meldedChildIndex = 0;\n\t\t\t\tmeldedChildIndex < upChildrenCount;\n\t\t\t\t++meldedChildIndex)\n\t\t\t{\n\t\t\t\tmeldedChildren.add (\n\t\t\t\t\tupChildren.get (\n\t\t\t\t\t\tmeldedChildIndex\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tmeldedChildren.add (\n\t\t\tdownTree\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\tcombinedTree = new BinomialTree<KEY, ITEM> (\n\t\t\t\tnew org.drip.graph.heap.PriorityQueueEntry<KEY, ITEM> (\n\t\t\t\t\tupTree.entry().key(),\n\t\t\t\t\tupTree.entry().item()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tcatch (java.lang.Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn combinedTree.setChildren (\n\t\t\tmeldedChildren\n\t\t) && downTree.setParent (\n\t\t\tcombinedTree\n\t\t) ? combinedTree : null;\n\t}",
"private static void merge(int[] array, int[] left, int[] right) {\n\n int i;\n\n for(i = 0; i < left.length; i++) {\n\n array[i] = left[i];\n }\n\n for (int j = 0; j < right.length; j++, i++) {\n\n array[i] = right[j];\n }\n }",
"protected void swapTilesInPlace(int row1, int col1, int row2, int col2) {\r\n int temp = getTile(row1, col1);\r\n state.setTile(row1, col1, getTile(row2, col2));\r\n state.setTile(row2, col2, temp);\r\n }",
"private void moveUp()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length; column++) {\n\n // check is set to false, meaning no combinations have been made\n boolean check = false;\n for ( int row = 1; row < grid.length; row++) {\n int compare = row;\n if ( grid[compare][column] != 0 ) { \n\n // loop continues while there are still zero values above the current\n // tile\n while ( grid[compare-1][column] == 0 ) {\n\n // switches places of the current tile with the zero tile\n grid[compare-1][column] = grid[compare][column];\n grid[compare][column] = 0;\n compare --;\n\n // if you reach the top of the board, break from the loop\n if ( compare == 0 ){\n break;\n }\n }\n // if a combination was made on the previous loop, set check to false\n if ( check == true ){\n check = false;\n }\n // if a combination wasn't made on the previous loop and two tiles\n // next to each other have the same value, combine them\n else if ( compare!=0 && \n grid[compare-1][column] == grid[compare][column] ) {\n grid[compare-1][column] = 2*grid[compare-1][column];\n grid[compare][column] = 0;\n\n // sets check to true to indicate a combination was made\n check = true;\n\n // increases your score by the value of the combined tile\n score+= grid[compare-1][column];\n } \n }\n }\n } \n }",
"public static void main(String[] args){\n Board b1 = new Board(new int[][]{{1, 2, 3}, {4, 5, 6}, {7, 8, 0}});\n assert b1.dimension() == 3;\n\n assert b1.hamming() == 0 : \"b1 hamming is: \" + b1.hamming();\n assert b1.manhattan() == 0;\n assert b1.isGoal();\n\n Board b2 = new Board(new int[][]{{5, 2, 3}, {4, 1, 6}, {7, 8, 0}});\n assert b2.hamming() == 2;\n assert b2.manhattan() == 4;\n assert !b2.isGoal();\n assert !b1.equals(b2);\n\n Board b3 = new Board(new int[][]{{4, 2, 3}, {5, 1, 6}, {7, 8, 0}});\n assert b3.twin().equals(b2);\n\n Board b4 = new Board(new int[][]{{4, 2, 3}, {5, 0, 6}, {7, 8, 1}});\n for (Board board: b4.neighbors() ){\n System.out.println(board);\n }\n\n Board b5 = new Board(new int[][]{{0, 1, 3}, {4, 2, 5}, {7, 8, 6}});\n assert b5.manhattan() == 4;\n\n Board b6 = new Board(new int[][]{{5, 8, 7}, {1, 4, 6}, {3, 0, 2}});\n assert b6.manhattan() == 17;\n }",
"static int[] merge(int[] a, int[] b) {\n\t\tint m = a.length, n = b.length;\n\t\tint[] res = new int[m + n];\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < m || j < n) {\n\t\t\tif (i == m)\n\t\t\t\tres[k++] = b[j++];\n\t\t\telse if (j == n)\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse if (a[i] < b[j])\n\t\t\t\tres[k++] = a[i++];\n\t\t\telse\n\t\t\t\tres[k++] = b[j++];\n\t\t}\n\t\treturn res;\n\t}",
"public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void union(int id1, int id2) {\n\t\tint root_v1 = find(id1); // Find the representative of the first items\n\t\tint root_v2 = find(id2);\t// Find the representative of the second item\n\n\t\tif (root_v1 != root_v2) {\t// If the 2 items are not equal\n\t\t\tG.addEdge(root_v1, root_v2);\t// Add an edge from root1 --> root2 (Union)\n\t\t}\n\t}",
"public static Comparable[] merge( Comparable[] leftPart, Comparable[] rightPart ) {\n\n int cursorLeft = 0, cursorRight = 0, counter = 0;\n\n Comparable[] merged = new Comparable[leftPart.length + rightPart.length];\n\n\n\n while ( cursorLeft < leftPart.length && cursorRight < rightPart.length ) {\n\n\n if ( leftPart[cursorLeft].compareTo(rightPart[cursorRight])<0) {\n\n merged[counter] = leftPart[cursorLeft];\n\n cursorLeft++;\n\n } else {\n\n merged[counter] = rightPart[cursorRight];\n\n cursorRight++;\n\n }\n\n\n\n counter++;\n\n }\n\n\n\n if ( cursorLeft < leftPart.length ) {\n\n System.arraycopy( leftPart, cursorLeft, merged, counter, merged.length - counter );\n\n }\n\n if ( cursorRight < rightPart.length ) {\n\n System.arraycopy( rightPart, cursorRight, merged, counter, merged.length - counter );\n\n }\n\n\n\n return merged;\n\n }",
"public void reconcile(Map<DuccId, IDuccWork> left, Map<DuccId, IDuccWork> right);",
"void swapTiles(int row1, int col1, int row2, int col2) {\n Tile temp = tiles[row1][col1];\n tiles[row1][col1] = tiles[row2][col2];\n tiles[row2][col2] = temp;\n\n setChanged();\n notifyObservers();\n }"
] | [
"0.62500757",
"0.60645247",
"0.57681",
"0.57275856",
"0.5653379",
"0.56484723",
"0.5616444",
"0.5586764",
"0.55543405",
"0.552536",
"0.5469033",
"0.54607517",
"0.54100764",
"0.53834957",
"0.53739196",
"0.5359589",
"0.5352943",
"0.53419214",
"0.533029",
"0.5294518",
"0.52796984",
"0.5255008",
"0.5231911",
"0.5218757",
"0.5212735",
"0.5204504",
"0.51797724",
"0.51793706",
"0.5160631",
"0.51597697",
"0.515019",
"0.51415324",
"0.5141103",
"0.5140055",
"0.5121969",
"0.5120293",
"0.5117546",
"0.5099474",
"0.50960785",
"0.50896776",
"0.5074004",
"0.5073071",
"0.5063174",
"0.5038995",
"0.5026952",
"0.50262845",
"0.5022951",
"0.5017536",
"0.5013702",
"0.501177",
"0.49993673",
"0.49989268",
"0.49918732",
"0.49905425",
"0.49820796",
"0.4981313",
"0.4973723",
"0.49580124",
"0.49557337",
"0.49556622",
"0.4948545",
"0.49289337",
"0.4926592",
"0.491889",
"0.4917862",
"0.49178225",
"0.4917643",
"0.49165586",
"0.49139202",
"0.49102032",
"0.49056327",
"0.49052382",
"0.49046558",
"0.49024394",
"0.48992315",
"0.48981237",
"0.4897874",
"0.48940855",
"0.4892341",
"0.48904544",
"0.48833075",
"0.48796934",
"0.48611295",
"0.48586118",
"0.48491904",
"0.48490086",
"0.48419455",
"0.48416167",
"0.4839146",
"0.48329312",
"0.4827461",
"0.48236912",
"0.4821477",
"0.48188767",
"0.4815064",
"0.4812611",
"0.48111427",
"0.4808599",
"0.48071277",
"0.48002186"
] | 0.77395624 | 0 |
Create a new battery with initial energy equal to initialEnergy and weight equal to weight. This method must return null if the given parameters are invalid (e.g. negative weight). | @Override
public Battery createBattery(double initialEnergy, int weight)
{
return new Battery(initialEnergy, weight);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Battery(double initialCapacity) {\r\n capacity = initialCapacity;\r\n originalCapacity = initialCapacity;\r\n }",
"public Boat(String name, double lengthOverAll, double beam, double weightCapacity) {\n this.name = name;\n this.lengthOverAll = lengthOverAll;\n this.beam = beam;\n this.weightCapacity = weightCapacity;\n }",
"public BMI(String name, double weight, double height)\n {\n this.name = name;\n this.weight = weight;\n this.height = height;\n }",
"public ProductWarehouseWithHistory(String productName, double capacity, double initialBalance){\n super(productName, capacity);\n this.inventoryHistory = new ChangeHistory();\n this.addToWarehouse(initialBalance);\n }",
"public Salmon(String manufacturer, String productName, double price, int minimumAge,\n double weight) {\n super(PRODUCT_TYPE, manufacturer, productName, price, minimumAge, weight);\n }",
"public Battery(Context xCtx) {\n\t\tsuper(xCtx);\n\t\tcontext = xCtx;\n\n\t\tIntentFilter batteryIntentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);\n\t\tbatteryIntent = context.registerReceiver(null, batteryIntentFilter);\n\n\t\ttry {\n\t\t\tif (batteryIntent != null) {\n\t\t\t\tif (!getLevel().equals(\"0%\")) {\n\t\t\t\t\t// Load the information\n\t\t\t\t\tCategory c = new Category(\"BATTERIES\", \"batteries\");\n\t\t\t\t\tc.put(\"CHEMISTRY\", new CategoryValue(getTechnology(), \"CHEMISTRY\", \"chemistry\"));\n\t\t\t\t\tc.put(\"TEMPERATURE\", new CategoryValue(getTemperature(), \"TEMPERATURE\", \"temperature\"));\n\t\t\t\t\tc.put(\"VOLTAGE\", new CategoryValue(getVoltage(), \"VOLTAGE\", \"voltage\"));\n\t\t\t\t\tc.put(\"LEVEL\", new CategoryValue(getLevel(), \"LEVEL\", \"level\"));\n\t\t\t\t\tc.put(\"HEALTH\", new CategoryValue(getBatteryHealth(), \"HEALTH\", \"health\"));\n\t\t\t\t\tc.put(\"STATUS\", new CategoryValue(getBatteryStatus(), \"STATUS\", \"status\"));\n\t\t\t\t\tc.put(\"CAPACITY\", new CategoryValue(getCapacity(), \"CAPACITY\", \"capacity\"));\n\t\t\t\t\tthis.add(c);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tFlyveLog.e(FlyveLog.getMessage(context, CommonErrorType.BATTERY, ex.getMessage()));\n\t\t}\n\t}",
"public HumanBuilder setWeight(double weight) {\n\t\t\t/*\n\t\t\t * if weight is a minus or 0 then will assign the value 0.1 to the weight of \n\t\t\t * the Human myHumaan\n\t\t\t */\n\t\t\tif(weight<=0)\n\t\t\t\tweight=0.1;\n\t\t\tmyHuman.weight=weight;\n\t\t\treturn this;\n\t\t}",
"public Wire(double legthWire, Mobile leftMobile, Mobile rightMobile) {\n\t\tthis.lengthWire=lengthWire;\n\t\tthis.rightMobile=rightMobile;\n\t\tthis.leftMobile=leftMobile;\n\t\tbalance();\n\n\t}",
"public ProductionPower(){\n this(0, new NumberOfResources(), new NumberOfResources(), 0, 0);\n }",
"private void constructBid() {\n Bid rawBid;\n double maxDemand = elements.first().demandWatt;\n // Minimum demand is also Max Production.\n double minDemand = elements.last().demandWatt;\n\n double minPriority = 0.0;\n double maxPriority = 1.0;\n\n // First make the ideal, continuous bid, that does not care about discrete running modes.\n rawBid = Bid.create(marketBasis)\n .add(priceOf(minPriority), maxDemand)\n .add(priceOf(maxPriority), minDemand)\n .build();\n\n // Now construct actual bid\n double[] rawDemand = rawBid.getDemand();\n newBid = new UnconstrainedBidElement[rawDemand.length];\n for (int i = 0; i < rawDemand.length; i++) {\n newBid[i] = getClosest(rawDemand[i]);\n }\n }",
"public SpaceWeights(int weight)\n {\n earthWeight = weight;\n }",
"public Cucumber(float weight) {\n\t\tthis(DEFAULT_CALORIES, weight);\n\t}",
"public Warehouse(final int capacity) {\n\t\tif (capacity <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"A warehouse must have a minimum capacity of 1.\");\n\t\t}\n\t\tthis.capacity = capacity;\n\t\tnumberOfItems = 0;\n\t\t//TODO: Initialize data structures for exercises 2a and 2c\n\t}",
"public WeightingModel(){}",
"public WaterMeter(Alarm alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\taddAlarm(alarmParam);\r\n\t}",
"public Flat(double width, double length, double height, double weight, double basePrice)\r\n {\r\n this.widthCapacity = width;\r\n this.lengthCapacity = length;\r\n this.heightCapacity = height;\r\n this.weightCapacity = weight;\r\n this.price = basePrice;\r\n\r\n }",
"public Warehouse(int capacity) {\n\t\tsuper();\n\t\tthis.capacity = capacity;\n\t\twharehouseData = new Object[capacity];\n\t}",
"@Transactional\n public HttpResult createParams(String brand, String power, String color, String weight) {\n httpResultCreatParam.setMessage(\"\");\n if (!brand.isEmpty() || !power.isEmpty() || !color.isEmpty() || !weight.isEmpty()) {\n if (!checkDigids(power) || !checkDigids(weight)) {\n if (!checkDigids(power)) {\n httpResultCreatParam.setMessage(\"Power may be only numbers\");\n logger.info(\"Power may be only numbers\");\n if (logger.isDebugEnabled()) {\n logger.debug(\"Power may be only numbers\");\n }\n }\n if (!checkDigids(weight)) {\n if (httpResultCreatParam.getMessage().length() > 1) {\n httpResultCreatParam.setMessage(httpResultCreatParam.getMessage() + \"\\n\" + \"Weight may be only numbers\");\n logger.info(\"Weight may be only numbers\");\n if (logger.isDebugEnabled()) {\n logger.debug(\"Weight may be only numbers\");\n }\n } else {\n httpResultCreatParam.setMessage(\"Weight may be only numbers\");\n logger.info(\"Weight may be only numbers\");\n if (logger.isDebugEnabled()) {\n logger.debug(\"Weight may be only numbers\");\n }\n }\n }\n } else {\n int paramWeight = Integer.parseInt(weight);\n int paramPower = Integer.parseInt(power);\n params = new Params(brand, color, paramPower, paramWeight);\n httpResultCreatParam.setData(params);\n }\n } else {\n httpResultCreatParam.setMessage(\"Please don't leave empty fields\");\n logger.info(\"Please don't leave empty fields\");\n if (logger.isDebugEnabled()) {\n logger.debug(\"Please don't leave empty fields\");\n }\n }\n return httpResultCreatParam;\n }",
"@Override\n\tprotected void initLateralWeightParams(final Space extendedSpace) throws CommandLineFormatException\n\t{\n\t\thppa = command.get(CNFTCommandLine.WA);\n\t\thpA = command.get(CNFTCommandLine.IA);\n\t\taddParameters(hppa,hpA);\n\t\taddParameters(command.get(CNFTCommandLine.LEARNING_RATE));\n\t}",
"public com.vodafone.global.er.decoupling.binding.request.ChargingResourceType createChargingResourceType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ChargingResourceTypeImpl();\n }",
"public void setWeight(final double pWeight){this.aWeight = pWeight;}",
"@Override\r\n\tpublic BMW createBMW() {\n\t\treturn new BMW320();\r\n\t}",
"public static VolatilityWeightedReturnConverter.Builder builder() {\n return new VolatilityWeightedReturnConverter.Builder();\n }",
"public void setWeight(int newWeight) {\n weight = newWeight;\n }",
"public Fortress(int waterCapacityInitial, Vector2 position) {\r\n\t\tthis.position =position;\r\n\t\tthis.waterCapacity = waterCapacityInitial; \r\n\t\tthis.waterLevel = 0;\r\n\t\tthis.level = 1;\r\n\t\tthis.pumpSpeed = 1; \r\n\t\t//this.weapon = new Weapon();\r\n\t}",
"public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder setWeight(float value) {\n validate(fields()[7], value);\n this.weight = value;\n fieldSetFlags()[7] = true;\n return this;\n }",
"public void setBoreholeWaterSupplyPerDay(double w) {\n\n this.waterCapacityBorehole = w;\n }",
"public Boleto() {\n this(3.0);\n }",
"public C05_BMI(String name, int age, double weight, double height) {\n\t\tsuper();\n\t\tthis.name = name;\n\t\tthis.age = age;\n\t\tthis.weight = weight;\n\t\tthis.height = height;\n\t}",
"public LabWork(String name, Coordinates coordinates, int weight, float minimalpoint,\n Difficulty difficulty){\n this.name = name;\n this.coordinates = coordinates;\n this.weight = weight;\n this.minimalpoint = minimalpoint;\n this.difficulty = difficulty;\n creationDate = new Date();\n }",
"public IdealWeightCalculator() {\n initComponents();\n }",
"public ElectricCar(String mfr, String color, Model model, Vehicle.PowerSource power, \n\t\t double safety, int range, boolean awd, int price, int rch,String batteryType, int VIN)\n{\n\t super(mfr, color, model, Vehicle.PowerSource.ELECTRIC_MOTOR, safety, range, awd, price, VIN);\n\t rechargeTime = rch;\n\t batteryType = \"Lithium\";\n}",
"@Nonnull\n public static UBL23WriterBuilder <WeightStatementType> weightStatement ()\n {\n return UBL23WriterBuilder.create (WeightStatementType.class);\n }",
"public static BatteryFragment newInstance() {\n\n Bundle args = new Bundle();\n\n BatteryFragment fragment = new BatteryFragment();\n fragment.setArguments(args);\n return fragment;\n }",
"public Builder setBattery(int value) {\n \n battery_ = value;\n onChanged();\n return this;\n }",
"protected float clampWeight(float weigth) {\n\t\t float ret = weigth;\n\t\t if (ret < -10) ret = -10;\n\t\t if (ret > 10) ret = 10;\n\t\t return ret;\n\t\t }",
"public Knight(String name, int weight, List<Equipment> equipment) {\n this.equipment = equipment;\n this.name = name;\n this.weight = weight;\n }",
"public void setWeight(double w){\n weight = w;\n }",
"public RecipeBuilder addComponent(PreparedProduct product, long weight) {\n components.computeIfPresent(product, (key, value) -> value + weight);\n components.putIfAbsent(product, weight);\n return this;\n }",
"public Battery(Point loc, Color c){\n super.setLocation(loc);\n this.color = c;\n this.nunMissiles = 10;\n }",
"private void setWeight(float weight){\n this.weight = weight;\n }",
"public ByWeight(String name, double cost, double units)\n\t{\n\t\tsuper(name);\n\t\tprice = cost;\n\t\tweight = units;\n\t}",
"public void setWeight(float w) {\n weight = w;\n }",
"public C05_BMI() {\n\t\t\n\t}",
"@Test\r\n\tpublic void testFillChargingPlan_Linear_HighInitialSoC() {\n\t\tdouble initialSoC = 0.9;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\tdouble desiredCapacity = car.getMissingCapacity();\r\n\t\t\r\n\t\t// Linear\r\n\t\tcar.setCurrentPlan(new double[96]);\r\n\t\tschedulerLinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 95, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\tstartTimeSeconds);\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(\"DesiredCapactiy: \" + desiredCapacity);\r\n\t\t//System.out.println(\"Planned capacity: \" + schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds));\r\n\t\t//System.out.println(Arrays.toString(car.getCurrentPlan()));\r\n\t\t\r\n\r\n\t\tassertTrue(car.getCurrentPlan()[0] > 0);\r\n\t\tassertEquals(car.getMissingCapacity(), schedulerLinear.getPlannedCapacity(chargingStation, car, startTimeSeconds), 1e-6);\r\n\t}",
"public void setWeight(double weight) {\r\n this.weight = weight;\r\n }",
"public void setMinimumWaterRequirement(double w) {\n this.Minimum_Water_Requirement = w;\n }",
"public void setWeight(double weight) {\n this.weight = weight;\n }",
"public void setWeight(String weight) {\n this.weight = weight;\n }",
"private BatteryInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public com.vodafone.global.er.decoupling.binding.request.ChargingResourceFullType createChargingResourceFullType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ChargingResourceFullTypeImpl();\n }",
"public WaterMeter(List<Alarm> alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\tsetAlarms(alarmParam);\r\n\t}",
"public Informer reqInformBathWaterVolumeSetting() {\n\t\t\taddProperty(EPC_BATH_WATER_VOLUME_SETTING);\n\t\t\treturn this;\n\t\t}",
"public void setWeight(Double weight) {\n this.weight = weight;\n }",
"public void setWeight(double weight){\n\t\tthis.weight = weight;\n\t}",
"public CurvedWgThermal(\r\n\t\t\t@ParamName(name=\"Wavelength (nm)\") Wavelength inputLambda,\r\n\t\t\t@ParamName(name=\"Waveguide Properties\") WgProperties WgProp,\r\n\t\t\t@ParamName(name=\"dn/dT (1/K)\",default_= \"1.86e-4\") double dndT,\r\n\t\t\t@ParamName(name=\"Thermal Resistivity (Kcm/W)\",default_=\"0.76923077\") double Ksi,\r\n\t\t\t@ParamName(name=\"Radius Of Curvature (micron)\") double radiusOfCurvatureMicron,\r\n\t\t\t@ParamName(name=\"Angle of Curvature (degree)\") double angleOfCurvatureDegree,\r\n\t\t\t@ParamName(name=\"Input Optical Power (mW)\") double pin_mW\r\n\t\t\t){\r\n\tthis.inputLambda = inputLambda;\r\n\tthis.lambdaNm = inputLambda.getWavelengthNm() ;\r\n\tthis.wgProp = WgProp;\r\n\tthis.radiusMicron = radiusOfCurvatureMicron ;\r\n\tthis.angleDegree = angleOfCurvatureDegree ;\r\n\tthis.dndT = dndT;\r\n\tk0 = inputLambda.getK0() ; \r\n\tthis.radiusOfCurvatureMicron = radiusOfCurvatureMicron;\r\n\tthis.Ksi = Ksi ;\r\n\tthis.lengthMicron = radiusOfCurvatureMicron * angleOfCurvatureDegree * Math.PI/180 ;\r\n\tthis.wgKerr = new CurvedWgKerr(inputLambda, WgProp, 3e-18, 5e-12,radiusOfCurvatureMicron, angleOfCurvatureDegree , pin_mW);\r\n\tthis.wgTPA = new CurvedWgTPA(inputLambda, WgProp, 5e-12, radiusOfCurvatureMicron, angleOfCurvatureDegree,pin_mW, 10e-9); \r\n\tthis.pin_mW = pin_mW;\r\n\tthis.Pabs = getPowerAbsW();\r\n\tthis.Dnthermal = getDnThermal();\r\n\t}",
"@Override\n\tpublic Bmi getBmi(int weight, float height) {\n\t\t RestTemplate restTemplate = new RestTemplate();\n\t\t \n\t\t Bmi bmi = restTemplate.getForObject(BASE_URL + BMI_URL, Bmi.class, weight, height);\n\t\t logger.debug(\"BMI Info :\" + bmi);\n\t\treturn bmi;\n\t}",
"public static double calculateNewWeight(double currentWeight) {\n if(currentWeight < .25) {\n return ((infectionRate/2)*currentWeight)/10;\n }\n else if(currentWeight < .5) {\n return ((infectionRate/3)*currentWeight)/10;\n }\n else if(currentWeight < .75) {\n return ((infectionRate/4)*currentWeight)/10;\n }\n else {\n return ((infectionRate/5)*currentWeight)/10;\n }\n }",
"public int getBatteryLevel() { return batteryLevel; }",
"int getBattery();",
"public LabWork(String name, Coordinates coordinates, int weight, float minimalpoint,\n HairColor type, Difficulty difficulty, Person person){\n this.name = name;\n this.coordinates = coordinates;\n this.weight = weight;\n this.minimalpoint = minimalpoint;\n this.type = type;\n this.difficulty = difficulty;\n this.person = person;\n creationDate = new Date();\n }",
"public void setMinWeight(double inMinWeight) {\n minWeight = inMinWeight;\n }",
"public void setFuelCapacity(int newCapacity) {\r\n this.fuelCapacity = newCapacity;\r\n }",
"Item(Weight weight){\r\n\t\tthis(0, weight, new DukatAmount(0));\r\n\t}",
"public void setWeight(Integer weight) {\n this.weight = weight;\n }",
"public void setWeight(int weight){\n\t\tthis.weight = weight;\n\t}",
"public static FrequentFlyer withInitialBalanceOf(int b) {\n\t\tFrequentFlyer f = new FrequentFlyer();\n\t\tf.balance = b;\n\t\tif(f.balance < 10000) f.status = \"Bronze\";\n\t\telse if(f.balance >= 10000) f.status = \"Silver\";\n\t\treturn f;\n\t}",
"public static double bmi(int weight, int height) {\n\t\t\n\t\tif(height == 0) {\n\t\t\tthrow new IllegalArgumentException(\"Die Werte fuer height muss ungleich 0 sein.\");\n\t\t\t\n\t\t} else {\n\t\t\tdouble bmiValue = (double)weight / (height * height);\n\t\t\treturn 1000*bmiValue;\n\t\t}\n\n\t}",
"@Override\n public void setWeight(double w) {\n this.weight = w;\n\n }",
"public void setWeight(int w){\n\t\tweight = w;\n\t}",
"private void recordWeight(double weight) {\r\n\r\n\t\tthis.weight = weight;\r\n\t\tif (weight <= 3) {\r\n\t\t\tcategory = \"N/A\";\r\n\t\t} else if ((weight >= 3.1) && (weight <= 4.5)) {\r\n\t\t\tcategory = \"LIGHT\";\r\n\t\t} else if ((weight >= 4.51) && (weight <= 8.0)) {\r\n\t\t\tcategory = \"MEDIUM\";\r\n\t\t} else if (weight > 8.0) {\r\n\t\t\tcategory = \"HEAVY\";\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic void setWeight(final double weight) {\n\n\t}",
"public WaterMeter(Radio radio, Alarm alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\tsetRadio(radio);\r\n\t\taddAlarm(alarmParam);\r\n\t}",
"public void setWeight(final int weight) {\n this.weight = weight;\n }",
"public Byte getBattery() {\n return battery;\n }",
"@Override\n\tpublic BLEDriverInstance createBLEDriverInstance(BLENetwork bleNetwork,\n\t\t\tControllableDevice device, String gwMacAddress,\n\t\t\tint pollingTimeMillis, BundleContext context)\n\t{\n\t\treturn new HealthThermometerDriverInstance(bleNetwork, device, gwMacAddress, pollingTimeMillis, context);\n\t}",
"public void setWeight(double weight){\n\t\tthis._weight = weight;\n\t}",
"public void setWeight(double weight) {\n\t\tthis.weight = weight;\n\t}",
"public void setMaxWeight(String newValue);",
"public Weight getWeight();",
"public void setWeight(int w) {\n\t\tweight = w;\n\t}",
"@Override\r\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\r\n\t\t\t\tif(capacity.getText()!=null && current.getText()!=null){\r\n\t\t\t\t\tint batteryCapacity = Integer.parseInt(capacity.getText().toString());\r\n\t\t\t\t\tfloat chargeEC = Float.parseFloat(current.getText().toString());\r\n\t\t\t\t\t\r\n\t\t\t\t\tIntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);\r\n\t\t\t\t Intent BSintent = MainActivity.this.registerReceiver(null, ifilter);\r\n\t\t\t\t \r\n\t\t\t \tint level = BSintent.getIntExtra(\"level\", 0);\r\n\t\t\t \tint scale = BSintent.getIntExtra(\"scale\", 100);\r\n\t\t\t \t\r\n\t\t\t\t\tSharedPreferences settings = getSharedPreferences(PREFS_NAME,0);\r\n\t\t\t\t\tSharedPreferences.Editor editor = settings.edit();\r\n\t\t\t\t\t\r\n\t\t\t\t\tfloat firstQuantity = batteryCapacity * ((float)level / scale) * 3600;\r\n\t\t\t\t\t\r\n\t\t\t\t\teditor.putInt(CAPACITY, batteryCapacity);\r\n\t\t\t\t\teditor.putFloat(BATTERY_EC, chargeEC);\r\n\t\t\t\t\teditor.putFloat(BATTERY_MAX, firstQuantity);\r\n\t\t\t\t\teditor.commit();\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t}",
"public Building(int yearOfCreation, double cost, double landSpace, String material) {\n super(yearOfCreation, cost);\n this.landSpace = landSpace;\n this.material = material;\n }",
"public ColorWeight()\n {\n weight = 0;\n }",
"public double getWeight()\r\n {\r\n return this.weightCapacity;\r\n }",
"public ConditionTargetWeight(int weight)\n\t{\n\t\t_weight = weight;\n\t}",
"public void testSetWeight()\n {\n WeightedKernel<Vector> instance = new WeightedKernel<Vector>();\n assertEquals(WeightedKernel.DEFAULT_WEIGHT, instance.getWeight());\n \n double weight = RANDOM.nextDouble();\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n weight = 0.0;\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n weight = 4.7;\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n boolean exceptionThrown = false;\n try\n {\n instance.setWeight(-1.0);\n }\n catch ( IllegalArgumentException ex )\n {\n exceptionThrown = true;\n }\n finally\n {\n assertTrue(exceptionThrown);\n }\n \n }",
"public double getBMI(){\n bmi = weight * KG_PER_POUND / (height * METERS_PER_INCH *height * METERS_PER_INCH);\n return (bmi);\n}",
"public void setCargoWeight(int cargoWeight) { // set the cargo weight\n\t\tthis.cargoWeight = cargoWeight;\n\t}",
"@Override\r\n\tpublic void setWeight(double weight) {\n\t\t\r\n\t}",
"public abstract double getWeight ();",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundMonetaryRequest createCustcareFullRefundMonetaryRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundMonetaryRequestImpl();\n }",
"public float batteryLevel() {\n return 1;\n }",
"public Item(String description, double weight, String name)\n {\n this.description = description;\n this.weight = weight;\n this.name = name;\n }",
"public void setCurrentWeight(double newWeight) throws Exception {\n\t\tthis.currentWeight = new Weight(currentWeight.getWeightType(), newWeight);\n\t}",
"public WeightedInventory(int weightLimit) {\n\t\tthis.weightLimit = weightLimit;\n\t\tthis.items = new LinkedList<>();\n\t}",
"@Override\r\n\tpublic RepairKit createRepairKit(double repairAmount, int weight)\r\n\t{\r\n\t\treturn new RepairKit(repairAmount, weight);\r\n\t}",
"@Test\r\n\tpublic void testFillChargingNonlinear_HighInitialSoC_ExhaustiveDesiredCapacity() {\n\t\tSimulation.verbosity = 0;\r\n\t\tint startTimeSeconds = 0;\r\n\t\t\r\n\t\t// Charge until soc=0.9\r\n\t\tdouble initialSoC = 0.9;\r\n\t\twhile (car.carBattery.getSoC() < initialSoC) {\r\n\t\t\tcar.addChargedCapacity(1, 32);\r\n\t\t}\r\n\t\t\r\n\t\tdouble desiredCapacity = 0.1;\r\n\t\twhile (desiredCapacity <= car.getMissingCapacity()) {\r\n\t\t\t\r\n\t\t\tcar.setCurrentPlan(new double[96]);\r\n\t\t\tschedulerNonlinear.fillChargingPlan(car, chargingStation, desiredCapacity, \r\n\t\t\t\t\tTimeslotSorter.getSortedTimeslots(null, 0, 96, TimeslotSortingCriteria.INDEX), \r\n\t\t\t\t\tstartTimeSeconds);\r\n\t\t\t\r\n\r\n\t\t\tdouble plannedCapacity = schedulerNonlinear.getPlannedCapacity(chargingStation, car, startTimeSeconds);\r\n\t\t\t//System.out.println(\"desiredCapacity=\" + desiredCapacity + \"Ah, plannedCapacity=\" + plannedCapacity);\r\n\t\t\t\r\n\t\t\tassertEquals(desiredCapacity, plannedCapacity, 1e-2);\r\n\t\t\tdesiredCapacity+=0.1;\r\n\t\t}\r\n\t\t\r\n\t}",
"public static void main(String[] args)\n {\n int[] costList = {50,60,160,60,80,100,100,120,150,150,150,200,40,240,220,220,200,200,180,180,140,100,80,60};\n \n BatteryCharger charger = new BatteryCharger(costList);\n \n System.out.println(charger.getChargeStartTime(1));\n System.out.println(charger.getChargeStartTime(2));\n System.out.println(charger.getChargeStartTime(3));\n System.out.println(charger.getChargeStartTime(4));\n System.out.println(charger.getChargeStartTime(5));\n System.out.println(charger.getChargeStartTime(6));\n System.out.println(charger.getChargeStartTime(7));\n System.out.println(charger.getChargeStartTime(8));\n System.out.println(charger.getChargeStartTime(9));\n System.out.println(charger.getChargeStartTime(10));\n }",
"public float getWeight();"
] | [
"0.64713985",
"0.5658764",
"0.55789375",
"0.5573179",
"0.54318047",
"0.52133304",
"0.5134086",
"0.5105794",
"0.5078952",
"0.5022043",
"0.49815282",
"0.497666",
"0.49530086",
"0.49266472",
"0.49223864",
"0.48976716",
"0.4860719",
"0.48392874",
"0.482889",
"0.48244348",
"0.48197392",
"0.48194963",
"0.48137495",
"0.47933048",
"0.47924787",
"0.4784019",
"0.4735499",
"0.47321478",
"0.4721886",
"0.47188374",
"0.47174057",
"0.47080424",
"0.46926045",
"0.46899796",
"0.46861047",
"0.46670422",
"0.46640724",
"0.46613753",
"0.46595877",
"0.46537066",
"0.46522352",
"0.46484298",
"0.46333587",
"0.4620554",
"0.4620064",
"0.46127236",
"0.4610163",
"0.46070173",
"0.4605114",
"0.45857245",
"0.45773423",
"0.4573674",
"0.45654824",
"0.45606962",
"0.45580527",
"0.45482206",
"0.45460975",
"0.45433453",
"0.45371047",
"0.45228443",
"0.45221415",
"0.4520621",
"0.45195037",
"0.4518152",
"0.45112866",
"0.45106888",
"0.45032203",
"0.45010862",
"0.44951704",
"0.44863155",
"0.4480567",
"0.44783288",
"0.44658157",
"0.4465388",
"0.44631836",
"0.44629207",
"0.44541368",
"0.44525176",
"0.44480196",
"0.4439435",
"0.4433641",
"0.44321242",
"0.44311237",
"0.44305184",
"0.44275358",
"0.44255382",
"0.44196516",
"0.44095463",
"0.44045368",
"0.44022286",
"0.43986753",
"0.43913198",
"0.4386097",
"0.43860483",
"0.43834376",
"0.43821326",
"0.43804976",
"0.4379922",
"0.43792415",
"0.43754107"
] | 0.8309855 | 0 |
Put battery at position (x, y) on board (if possible). | @Override
public void putBattery(Board board, long x, long y, Battery battery)
{
try
{
battery.setPosition(new Position(x,y));
battery.setBoard(board);
}
catch(IllegalStateException exc)
{
System.out.println("Either this battery or this board is terminated; the battery cannot be placed on the board.");
}
catch(IllegalPositionException exc)
{
System.out.println("This is not a valid position on the board to place an element.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void place(Piece p, int x, int y) {\n\t\tif (x >= 8 || y >= 8 || p == null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (pieceAt(x, y) != null) {\n\t\t\t\tremove(x, y);\n\t\t\t}\n\t\t\tb[x][y] = p;\n\t\t\tif (p.isFire()) {\n\t\t\t\tnumFire += 1;\n\t\t\t} else {\n\t\t\t\tnumWater += 1;\n\t\t\t}\n\t\t}\n\t}",
"private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }",
"public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}",
"void placePowerStation() {\n this.board.get(powerRow).get(powerCol).placePowerStation();\n }",
"public void putPiece(Piece piece, int x, int y)\r\n {\r\n if(isValidSqr(x, y))\r\n {\r\n board[x][y] = piece;\r\n if(piece != null) piece.setLocation(x, y);\r\n }\r\n }",
"public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}",
"public void horizontal_right_bp(int x, int y) {\n if (x == 7)\n return;\n\n if (chessBoard[x + 1][y] == status.WHITE) {\n // i e zoodtarin khaneye meshki ke mibinad\n int i_black_cell = -1;\n boolean change = false;\n for (int k = x + 1; k <= 7; k++) {\n if (chessBoard[k][y] == status.EMPTY)\n break;\n if (chessBoard[k][y] == status.BLACK) {\n i_black_cell = k;\n change = true;\n break;\n }\n }\n if (change) {\n for (int k = x + 1; k < i_black_cell; k++) {\n chessBoard[k][y] = status.BLACK;\n }\n }\n }\n }",
"public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }",
"public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}",
"public void teleportTo(int y, int x){\n\t\tthis.position[y][x] = 1;//makes the position here, used for other object room\n\t}",
"public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }",
"public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }",
"public void setLoc(int x, int y)\n {\n powerUp.setBounds(x,y,65,29);\n text.setBounds(x,y,65,29);\n }",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public Battery(Point loc, Color c){\n super.setLocation(loc);\n this.color = c;\n this.nunMissiles = 10;\n }",
"private synchronized void updateBattery(){\n \tdouble battery = MathUtils.round(Battery.getVoltage(),1);\n \tstore(new DisplayableData(\"battery\", battery+\"V\", battery));\n }",
"@Override\r\n\tpublic void putRobot(Board board, long x, long y, Robot robot)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.setPosition(new Position(x,y));\r\n\t\t\trobot.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this board is terminated; the robot cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"private void addNewBoard(int x, int y,\n\t\t\tArrayList<ArrayList<Integer>> board) {\n\t\tif (y < 0 || y > board.size() - 1) { //expanding up/down\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tArrayList<Integer> z = new ArrayList<>();\n\t\t\t\tfor (int j = 0; j < board.get(0).size(); j++) {\n\t\t\t\t\tif ((j < x + boardSize && j >= x && x >= 0)) { //adjusts for y if it isn't 0 or negative, almost forgot about this\n\t\t\t\t\t\tz.add(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.add(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (y < 0) {\n\t\t\t\t\tboard.add(0, z);\n\t\t\t\t\ty++;\n\t\t\t\t} else {\n\t\t\t\t\tboard.add(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif (x < 0 || x > board.get(0).size() - 1) { //expanding to the left/right\n\t\t\tint loc = (x < 0) ? 0 : board.get(0).size();\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < board.size(); j++) {\n\t\t\t\t\tif (j < y + boardSize && j >= y) {\n\t\t\t\t\t\tboard.get(j).add(loc, 0); //append as opposed to add\n\t\t\t\t\t} else {\n\t\t\t\t\t\tboard.get(j).add(loc, 5); //append lack of board everywhere else\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif ((y >= 0 && y < board.size())\n\t\t\t\t&& (x >= 0 && x < board.get(0).size())\n\t\t\t\t&& getBoard(x, y) == 5) { //If within board\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t\tboard.get(y + i).set(x + j, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tupdateOffset();\n\t}",
"private void setOnBoard(Ship currentShip) {\n\t\tchar letter;\n\t\tboolean validInput = false;\n\t\tint letterValue;\n\t\tint num;\n\t\tString coord;\n\t\tString orient;\n//\t\tString[][] backup = radar.clone();\n\t\tString[][] loopBackup = new String[10][10];\n\t\t//System.out.println(\"loop backup: \" + loopBackup.toString());\n\t\t\n\t\twhile(!validInput) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(this);\n\t\t\t\tSystem.out.println(\"Where would you like the \" + currentShip.getShipType() + \" of size \" + currentShip.getSize() + \"?\");\n\t\t\t\tSystem.out.println(\"Give a coordinate. Ex: A2, F6, d9, etc...\");\n\t\t\t\tSystem.out.println(\">\");\n\t\t\t\tcoord = input.nextLine();\n\t\t\t\tSystem.out.println(\"Would you like to set it vertical (V) or horizontal (H)?\");\n\t\t\t\tSystem.out.println(\"(input V or H for the respective orientation, lowercase is fine)\");\n\t\t\t\tSystem.out.println(\">\");\n\t\t\t\t\n\t\t\t\twhile(!validInput) {\n\t\t\t\t\torient = input.nextLine();\n\t\t\t\t\t\n\t\t\t\t\tletter = coord.toUpperCase().charAt(0);\n\t\t\t\t\tletterValue = (int) letter;\n\t\t\t\t\tletterValue -= 65;\n\t\t\t\t\tnum = Integer.parseInt(coord.substring(1));\n\t\t\t\t\tnum -= 1;\n\t\t\t\t\tString tempCoor;\n\t\t\t\t\tloopBackup = backup(radar);\n\t\t\t\t\t\n\t\t\t\t\tif(orient.toUpperCase().equals(\"H\")) {\n\t\t\t\t\t\tfor(int i = 0; i <= currentShip.getSize() - 1; i++) {\n\t\t\t\t\t\t\tif(radar[letterValue][num].equals(\"X \"))\n\t\t\t\t\t\t\t\tradar[100][0].toString();\n\t\t\t\t\t\t\ttempCoor = radar[letterValue][num];\n\t\t\t\t\t\t\tcurrentShip.addCoordinate(tempCoor);\n\t\t\t\t\t\t\tradar[letterValue][num] = \"X \";\n\n\t\t\t\t\t\t\tnum++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidInput = true;\n\t\t\t\t\t\t//loopBackup = radar.clone();\n\t\t\t\t\t} else if(orient.toUpperCase().equals(\"V\")){\n\t\t\t\t\t\tfor(int i = 0; i <= currentShip.getSize() - 1; i++) {\n\t\t\t\t\t\t\tif(radar[letterValue][num].equals(\"X \"))\n\t\t\t\t\t\t\t\tradar[100][0].toString();\n\t\t\t\t\t\t\ttempCoor = radar[letterValue][num];\n\t\t\t\t\t\t\tcurrentShip.addCoordinate(tempCoor);\n\t\t\t\t\t\t\tradar[letterValue][num] = \"X \";\n\n\t\t\t\t\t\t\tletterValue++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidInput = true;\n\t\t\t\t\t\t//loopBackup = radar.clone();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Ship is out of bounds. Try again.\");\n\t\t\t\tcurrentShip.getCoordinates().clear();\n\t\t\t\tradar = backup(loopBackup);\n\t\t\t}\n\t\t}\n\n\t\t\n\t}",
"public void pushCell(int x, int y) {\n\n if (fieldManager.isCellMined(x, y)) {\n fieldInerface.putLethalMineToButton(x, y);\n death(x, y);\n return;\n }\n\n fieldManager.openCell(x, y);\n fieldInerface.putEnvToButton(x, y, (int) fieldManager.getEnv(x, y));\n if (fieldManager.getEnv(x, y) == 0)\n for (int i = x - 1; i < x + 2; i++)\n for (int j = y - 1; j < y + 2; j++)\n if ((i >= 0) && (i < widthOfField) && (j >= 0)\n && (j < heightOfField))\n if (fieldManager.isCellOpenable(i, j))\n pushCell(i, j);\n }",
"public void setUnitOnBoard(Unit unit, int x, int y) {\n\t\tPosition pos = new Position(x, y);\n\t\tunitsOnBoard.put(pos, unit);\n\t\tunitPossitions.put(unit.getId(), pos);\n\t}",
"public void activateNearby(int x, int y)\r\n {\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n if (row != y || col != x)\r\n {\r\n try\r\n {\r\n if (gameBoard.gameCells[row][col].isBomb() == false && gameBoard.gameCells[row][col].isDisable() == false)\r\n {\r\n updateCell(gameBoard.gameCells[row][col]);\r\n }\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }\r\n }",
"public static int getBukkitPosition(int x,int y){\n return ((y-1)*9)+x-1;\n }",
"public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}",
"public void drawCell(int x, int y) {\n \n //Sets cell to occupied\n gameBoard[x][y] = 1;\n }",
"@Override\r\n\tpublic void putWall(Board board, long x, long y, Wall wall) throws UnsupportedOperationException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\twall.setPosition(new Position(x,y));\r\n\t\t\twall.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this wall or this board is terminated; the wall cannot be placed on the board.\");\r\n\t\t}\r\n\t}",
"public abstract Piece setLocation(int row, int column);",
"public void ApplyMovement() {\n long currTime = SystemClock.uptimeMillis();\n if(currTime - lastUpdateTime < 16){\n return;\n }\n lastUpdateTime = currTime;\n\n\n double tl_power_raw = movement_y-movement_turn+movement_x*1.5;\n double bl_power_raw = movement_y-movement_turn- movement_x*1.5;\n double br_power_raw = -movement_y-movement_turn-movement_x*1.5;\n double tr_power_raw = -movement_y-movement_turn+movement_x*1.5;\n\n\n\n\n //find the maximum of the powers\n double maxRawPower = Math.abs(tl_power_raw);\n if(Math.abs(bl_power_raw) > maxRawPower){ maxRawPower = Math.abs(bl_power_raw);}\n if(Math.abs(br_power_raw) > maxRawPower){ maxRawPower = Math.abs(br_power_raw);}\n if(Math.abs(tr_power_raw) > maxRawPower){ maxRawPower = Math.abs(tr_power_raw);}\n\n //if the maximum is greater than 1, scale all the powers down to preserve the shape\n double scaleDownAmount = 1.0;\n if(maxRawPower > 1.0){\n //when max power is multiplied by this ratio, it will be 1.0, and others less\n scaleDownAmount = 1.0/maxRawPower;\n }\n tl_power_raw *= scaleDownAmount;\n bl_power_raw *= scaleDownAmount;\n br_power_raw *= scaleDownAmount;\n tr_power_raw *= scaleDownAmount;\n\n\n //now we can set the powers ONLY IF THEY HAVE CHANGED TO AVOID SPAMMING USB COMMUNICATIONS\n topLeft.setPower(tl_power_raw);\n bottomLeft.setPower(bl_power_raw);\n bottomRight.setPower(br_power_raw);\n topRight.setPower(tr_power_raw);\n }",
"private void setBack(int y, int x, Piece savePiece, int saveX, int saveY) {\r\n\t\tthis.board[saveY][saveX] = this.board[y][x];\r\n\t\tthis.board[saveY][saveX].setXY(saveX, saveY);\r\n\t\tthis.board[y][x] = savePiece;\r\n\t\tinsertPiece(savePiece);\r\n\t}",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"private void placePiece() {\r\n pieces[numPieces] = getRandomPoint();\r\n Game.movePiece(new PositionData(-1,-1,Constants.PLAYER_A_ID), pieces[numPieces]);\r\n numPieces++;\r\n }",
"void setLocation(int x, int y);",
"public void tellNearby(int x, int y)\r\n {\r\n // checks for nearby bombs\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n try\r\n {\r\n gameBoard.gameCells[row][col].addBombNearby();\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }",
"void getBlowUp(int x, int y) {\n //YOUR CODE HERE\n\t whichBoard.remove(x, y);\n }",
"public static void placeShipVertMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length - (ship.getLength() - 1) || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n if (!board[r][indexC].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n r = indexR - 1;\r\n }\r\n }\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n board[r][indexC] = symbol;\r\n } \r\n \r\n }",
"public void setBattery(Byte battery) {\n this.battery = battery;\n }",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}",
"public void setPosition(double x, double y, double z) {\n super.setPosition(x, y, z);\n if (this.dataManager != null && this.ticksExisted != 0) {\n Optional<BlockPos> optional = this.dataManager.get(ATTACHED_BLOCK_POS);\n if (this.isAddedToWorld() && this.world instanceof net.minecraft.world.server.ServerWorld) ((net.minecraft.world.server.ServerWorld)this.world).chunkCheck(this); // Forge - Process chunk registration after moving.\n Optional<BlockPos> optional1 = Optional.of(new BlockPos(x, y, z));\n if (!optional1.equals(optional)) {\n this.dataManager.set(ATTACHED_BLOCK_POS, optional1);\n this.dataManager.set(PEEK_TICK, (byte)0);\n this.isAirBorne = true;\n }\n\n }\n }",
"public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }",
"public void setLocation(float x, float y);",
"public void boom() {\n\t\tboom.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = boom;\n\t}",
"public void drawMushroom(int x, int y, Color r) {\n\n\t\tPixelController px = PixelController.getInstance(Screen.MEDEA_3);\n\t\t\n\t\ttry {\n\t\t\tThread.sleep(3000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t/* Colors in the array */ \n\t\tColor b = Color.BLACK;\n\t\tColor w = Color.WHITE;\n\t\tColor n = null;\n\t\t\n\t\tColor[][] superMushroom = {\n\t\t\t\t{n,n,n,n,n,b,b,b,b,b,b,n,n,n,n,n},\n\t\t\t\t{n,n,n,b,b,r,r,r,r,w,w,b,b,n,n,n},\n\t\t\t\t{n,n,b,w,w,r,r,r,r,w,w,w,w,b,n,n},\n\t\t\t\t{n,b,w,w,r,r,r,r,r,r,w,w,w,w,b,n},\n\t\t\t\t{n,b,w,r,r,w,w,w,w,r,r,w,w,w,b,n},\n\t\t\t\t{b,r,r,r,w,w,w,w,w,w,r,r,r,r,r,b},\n\t\t\t\t{b,r,r,r,w,w,w,w,w,w,r,r,w,w,r,b},\n\t\t\t\t{b,w,r,r,w,w,w,w,w,w,r,w,w,w,w,b},\n\t\t\t\t{b,w,w,r,r,w,w,w,w,r,r,w,w,w,w,b},\n\t\t\t\t{b,w,w,r,r,r,r,r,r,r,r,r,w,w,r,b},\n\t\t\t\t{b,w,r,r,b,b,b,b,b,b,b,b,r,r,r,b},\n\t\t\t\t{n,b,b,b,w,w,b,w,w,b,w,w,b,b,b,n},\n\t\t\t\t{n,n,b,w,w,w,b,w,w,b,w,w,w,b,n,n},\n\t\t\t\t{n,n,b,w,w,w,w,w,w,w,w,w,w,b,n,n},\n\t\t\t\t{n,n,n,b,w,w,w,w,w,w,w,w,b,n,n,n},\n\t\t\t\t{n,n,n,n,b,b,b,b,b,b,b,b,n,n,n,n}\n\t\t}; \n\t\t/* loops out the color of the mushroom from the array */\n\t\tfor(int i = 15; i >= 0; i --) {\n\t\t\tfor(int j = 0; j < 16; j ++) {\n\t\t\t\tif(superMushroom[i][j] != null ){\n\t\t\t\t\tpx.setPixel(x + i, y + j, superMushroom[i][j]);\n\t\t\t\t\t//System.out.print(superMushroom[y][x].toString());\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t\n\t\t\n\t}",
"public Cell(int x, int y){\n\t\tif((x<0 || x>7) || (y<0 || y>7)){\n\t\t\tSystem.out.println(\"The provided coordinates for the cell are out of range.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.placedPiece = null;\n\t}",
"public void setPosition(float x, float y);",
"public static void placeShipHorzMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length - (ship.getLength() - 1) || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n if (!board[indexR][c].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n c = indexC - 1;\r\n }\r\n }\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n board[indexR][c] = symbol;\r\n } \r\n }",
"@Override\r\n\tpublic long getBatteryX(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public void turnToLiving(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = true;\n }",
"public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }",
"private void setBrush(int a_x, int a_y, char a_data)\n {\n int xStart = a_x - m_brush;\n int xEnd = a_x + m_brush;\n int yStart = a_y - m_brush;\n int yEnd = a_y + m_brush;\n\n for(int i = xStart; i <= xEnd; ++i)\n for(int j = yStart; j <= yEnd; ++j)\n {\n if(i > 0 && j > 0 && i < m_grid.length && j < m_grid[i].length)\n m_grid[i][j] = a_data;\n }\n }",
"@Override\r\n\tpublic void pickUpBattery(Robot robot, Battery battery)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot pick up the battery.\");\r\n\t\t}\r\n\t}",
"public void putInCell (int x, int y, Sprite object){\n\t\tif (object instanceof Tile) {\n\t\t\tgameMap[x][y].setTile((Tile)object);\n\t\t\treturn;\n\t\t}\n\t\telse if(gameMap[x][y].getTile() instanceof Target && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\tdecrementOnTarget();\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\tincrementOnTarget();\n\t\t\t}\n\t\t}\n\t\telse if (gameMap[x][y].getTile() instanceof Switch && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t}\n\t\tgameMap[x][y].setObject((GameObject)object);\n\t}",
"void setPos(float x, float y);",
"@Test\n void RookMoveToFriendlyOccupied() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 4, 3, 1);\n Piece rook2 = new Rook(board, 4, 6, 1);\n\n board.getBoard()[4][3] = rook1;\n board.getBoard()[4][6] = rook2;\n\n board.movePiece(rook1, 4, 6);\n\n Assertions.assertEquals(rook1, board.getBoard()[4][3]);\n Assertions.assertEquals(rook2, board.getBoard()[4][6]);\n }",
"@Override\n public void batteryStatus(int value) {\n }",
"@Override\n\tpublic void setByteAtPos(int x, int y, byte byteP) {\n\t\tmapGrid[x][y] = byteP;\n\t}",
"public void place(Chip chip, int row, int column) {\n ImmutablePair<Integer, Integer> from = new ImmutablePair<Integer, Integer>(row, column);\n // Step 2. Generating appropriate processing event\n PlaceChipAction action = new PlaceChipAction(getPlayer(), chip, from);\n // Step 3. Actually performing action\n perform(action);\n }",
"public void place(float x,float y){\n\t\tz=0.2f+Main.world.land.getHigh(Main.world.timeline.getTerra(),(int)x, (int)y);\r\n\t\tMain.world.contacts(this);\r\n\t\tz+=getTopObjects();\r\n\t\tplace(x,y,z);\r\n\t}",
"public void movePiece(int xStart, int yStart, int xEnd, int yEnd) {\n board[xEnd][yEnd] = board[xStart][yStart];\n board[xStart][yStart] = null;\n board[xEnd][yEnd].moveTo(xEnd, yEnd);\n if (board[xEnd][yEnd] instanceof ChessPieceKing) {\n if (board[xEnd][yEnd].isBlack()) {\n locationBlackKing = new Point(xEnd, yEnd);\n } else {\n locationWhiteKing = new Point(xEnd, yEnd);\n }\n }\n\n drawScreen();\n }",
"public void setPosition(int x, int y){\n\t\t\n\t\tif(x>=ColumnNumber.firstColumn.ordinal() && x<=ColumnNumber.eightColumn.ordinal()){\n\t\t\txPosition=x;\n\t\t}\n\t\tif(y>=RowNumber.firstRow.ordinal() && y<=RowNumber.eightRow.ordinal()){\n\t\t\tyPosition=y;\n\t\t}\n\t\t\n\t}",
"public void setCardPos(double x, double y ){\r\n setX(x);\r\n setY(y);\r\n }",
"public void updateBoard() {\n notifyBoardUpdate(board);\n }",
"public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }",
"private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}",
"public void setLocation(int x, int y){\n if(x < 0 || x > 19 || y < 0 || y > 19){\n // The user has tried to move outside the bounds of the world, so\n // we call the die() method which causes the Player to die.\n die();\n } else {\n // The user is trying to move within the bounds of the world. Run\n // the Actor class' own setLocation() method to move the Player.\n super.setLocation(x, y);\n }\n }",
"public void placePiece(Piece piece, Position position) {\n\t\tif(thereIsAPiece(position)) {\n\t\t\tthrow new BoardException(\"There is already a piece on position \" + position);\n\t\t}\n\t\tpieces[position.getRow()][position.getColumn()] = piece;\n\t\tpiece.position = position;\n\t}",
"void updateBoard(@TTTConstants.Sign int sign, int row, int column) {\n board[row][column] = sign;\n depth++;\n }",
"public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }",
"public void setBallLocation(int x, int y, int level){\n rect.left = x ;\n rect.top = y-200;\n rect.right = x + width;\n rect.bottom = y - 100 - height;\n\n this.setRandomVelocity(level);\n this.xVelocity = 0;\n }",
"boolean place (int x, int y) {\n\t\tint row = x;\n\t\tint col = y;\n\t\tmoleGrid[row][col] = 'M';\n\t\tmolesLeft++;\n\n\t\tif (moleGrid[row][col] == 'M') {\n\t\t\t// System.out.println(\"You have successfully placed a mole at coordinates.\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// System.out.println(\"Error: A mole was NOT placed at the coordinates.\");\n\t\t\treturn false;\n\n\t\t}\n\t\t\n\t}",
"void setPosition(double xPos, double yPos);",
"public void playOn(int x, int y)\r\n\t{\r\n\t\t//Converts x positions to array indices.\r\n\t\tx--;\r\n\t\ty--;\r\n\t\t//The x and y inputs need to be within the board boundaries.\r\n\t\tif(x>=0 && x<grid.length && y>=0 && y<grid.length)\r\n\t\t{\r\n\t\t\t//The UI grid will be updated.\r\n\t\t\t/*This method will have to be resolved.\r\n\t\t\tif(ships.hitsShipOn(x, y))\r\n\t\t\t\t\tgrid[x][y] = 1;\r\n\t\t\telse\r\n\t\t\t\t\tgrid[x][y] = -1;*/\r\n\t\t}\r\n\t\t\t\r\n\t}",
"public void CaptuePiece(int i , int j , int k , int l){\r\n if(GameBoard.get(i,j).getColour() != GameBoard.get(k,l).getColour()){\r\n pos.setPosition(k,l);\r\n GameBoard.get(i,j).capture(pos);\r\n GameBoard.get(k,l).captured();\r\n \r\n\r\n //We need a method to null the (k,l) cell in GameBoard\r\n pos.setPosition(k,l);\r\n GameBoard.setNull(pos);\r\n GameBoard.get(i,j).move(pos); //to move the killer in new cell\r\n\r\n\r\n\r\n }\r\n }",
"public void putChessOnBoard(int x, int y, int color) {\n \tif (this.board.put(x, y, color) == true) {\n System.out.println(\"Move played: \" + intToChar(x) + y);\n\n this.switchPlayer();\n\n if (this.board.checkGameOver(x, y, color) == true) {\n this.printResult(color);\n System.out.println(\"Game Over!\");\n System.exit(0);\n } else if (this.board.checkDraw() == true) {\n System.out.println(\"Draw!\");\n System.out.println(\"Game Over!\");\n System.exit(0); \n }\n }\n }",
"GamePiece(int x, int y) {\n this.row = x;\n this.col = y;\n this.left = false;\n this.right = false;\n this.down = false;\n this.up = false;\n this.neighbors = new HashMap<String, GamePiece>();\n this.powerStation = false;\n }",
"public void pos90() throws InterruptedException {\r\n bucketOverSweeper();\r\n sleep(2500);\r\n\r\n posElbow = 2200;\r\n posShoulder = 0;\r\n posBucket = 1.0;\r\n motorElbow.setTargetPosition(posElbow);\r\n motorShoulder.setTargetPosition(posShoulder);\r\n servoBucket.setPosition(posBucket);\r\n motorElbow.setPower(POWER_ELBOW_FAST);\r\n motorShoulder.setPower(POWER_SHOULDER_SLOW);\r\n\r\n posBucket = 0.2;\r\n servoBucket.setPosition(posBucket);\r\n sleep(1000);\r\n\r\n posBucket = 0.4;\r\n servoBucket.setPosition(posBucket);\r\n sleep(1000);\r\n\r\n posBucket = 0.5;\r\n servoBucket.setPosition(posBucket);\r\n sleep(200);\r\n\r\n posBucket = 0.4;\r\n servoBucket.setPosition(posBucket);\r\n sleep(200);\r\n\r\n posBucket = 0.3;\r\n servoBucket.setPosition(posBucket);\r\n sleep(200);\r\n\r\n posBucket = 0.2;\r\n servoBucket.setPosition(posBucket);\r\n sleep(200);\r\n\r\n posBucket = 0.15;\r\n servoBucket.setPosition(posBucket);\r\n sleep(2500);\r\n\r\n returnBucket();\r\n }",
"public void move() {\n\t\t\tRandom rand = new Random();//random number generator\n\t\t\tint value = rand.nextInt(500000);//there is a 1 in 500000 chance there will be a new powerup every frame.\n\t\t\tif (value==0) {//if the value is 0\n\t\t\t\tRandom ran = new Random();//make a random number generator and a power up vairable\n\t\t\t\tPowerUp currentPowerUp = null;\n\t\t\t\tint type = ran.nextInt(3);//switch the 1 for the amount of types made.\n\t\t\t\tif (type==0) {//add the powerup depending on the random number. There are 3 types\n\t\t\t\t\tcurrentPowerUp = new PowerUp(healthPowerUp, 0);//this adds a life\n\t\t\t\t}\n\t\t\t\telse if (type==1) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(longPowerUp, 1);//this makes the slider wider\n\t\t\t\t} else if (type==2) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(bonusPointsPowerUp, 2);//this just adds points\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//set x and y\n\t\t\t\t//make a random x\n\t\t\t\tint newX = ran.nextInt(401) - 201 + GamePlay.getScreenWidth()/2; //-200 to 200 variance from center\n\t\t\t\tint newY = ran.nextInt(201) - 101 + GamePlay.getScreenHeight()/4;//-100 to 100 variance from the 25% of top distance line.\n\t\t\t\tif (currentPowerUp!=null) {\n\t\t\t\t\tcurrentPowerUp.setX(newX);\n\t\t\t\t\tcurrentPowerUp.setY(newY);\n\t\t\t\t\tpowerUps.add(currentPowerUp);//add the powerups to an array list\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"PowerUp error.\");//if the variable is null, something went wrong.\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//move all powerUps down by ball speed\n\t\t\tfor (PowerUp power: powerUps) {\n\t\t\t\tpower.setY(power.getY() + ballSpeed);\n\t\t\t}\n\t\t\t\n\t\t\t//check if the powerups are off the screen. remove if they are. \n\t\t\tfor (int r = powerUps.size()-1; r>=0; r--) {\n\t\t\t\tif (powerUps.get(r).getY() > GamePlay.getScreenHeight()-h) {\n\t\t\t\t\tpowerUps.remove(r);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//death of a ball\n\t\t\tif (ball.getY()>GamePlay.getScreenHeight() && pause==false) {\n\t\t\t\tdeath();\n\t\t\t}\n\t\t\t\n\t\t\t//no bricks left\n\t\t\tif (blocks.size()==0) {\n\t\t\t\t//you leveled up!\n\t\t\t\tlevelUp();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//wall collision check for ball\n\t\t\t//right wall\n\t\t\tif (ball.rightCollide(GamePlay.getScreenWidth())) {//seperated for later use if wanted.\n\t\t\t\tballVX*=-1;\n\t\t\t} else if (ball.leftCollide(0)) {//left wall\n\t\t\t\tballVX*=-1;\n\t\t\t}\n\t\t\t\n\t\t\tif (ball.topCollide(0)) {//top wall\n\t\t\t\tballVY*=-1;\n\t\t\t} //dont check bottom wall because that is the death of a ball.\n\t\t\t\n\t\t\t//collision with the slider.\n\t\t\tif (ball.getRect().intersects(slider.getRect()) && ball.getY()+ball.getHeight() <= slider.getY()+ballSpeed) {//intersected bool needed\n\t\t\t\tballVY*=-1;\n\t\t\t\tballVX+=sliderVX;//add the slider velocity to the ball velocity, giving user some control over angle. \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//collision with the powerups\n\t\t\t\n\t\t\tfor (int a = powerUps.size()-1; a>=0; a--) {//iterate thrpough the powerups\n\t\t\t\tPowerUp power = powerUps.get(a);\n\t\t\t\tif (power.getRect().intersects(slider.getRect())) {//if the powerups rect intersects, the slider caught it. Remove from screen\n\t\t\t\t\t//THIS MEANS THEY CAUGHT THE POWERUP\n\t\t\t\t\tif (power.getType()==\"HEALTH\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tif (lives<5)\n\t\t\t\t\t\t\tlives+=1;//add a life up to 5\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"LONG\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\textended = true;//extended flag to say the slider is extended. extend the slider's width by the adjust amount preset globally\n\t\t\t\t\t\tslider.resize(slider.getWidth()+adjust, slider.getHeight());\n\t\t\t\t\t\tslider.setX(slider.getX()-adjust/2);\n\t\t\t\t\t\textendTimer.restart();//restart the entend timer\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"BONUS\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tscore+=100;//add a 100 points.\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//collision with blocks\n\t\t\t\n\t\t\tboolean changed = false;//this is a flag to see if any collisions occured this frame\n\t\t\tfor (Block block:blocks) {\n\t\t\t\tRectangle r = block.getRect();\t\t\n\t\t\t\tif (r.intersects(ball.getRect())) {//if the rects intersected, something hit something. However, we don't know from what direction\n\t\t\t\t\t//since the vy is always going to be by 1, we can check if it is equal. There is no multiples to deal with. \n\t\t\t\t\t\n\t\t\t\t\t//this checks if it was colliding from the bottom. Check the bottom edge of block and top of the ball\n\t\t\t\t\tif (ball.getY() + 2 >= block.getBottom() && ball.getY() -2 <= block.getBottom() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//bottom collision\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (ball.getY() + ball.getHeight() + 2 >=block.getTop() && ball.getY() + ball.getHeight() -2 <=block.getTop() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this checks if it was colliding on the top. Check bottom edge of ball and top of block.\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (changed==false && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this must mean it is on the left or right\n\t\t\t\t\t\t//it doesn't matter which one, the change is the exact same!\n\t\t\t\t\t\tballVX*=-1;//flip the x direction\n\t\t\t\t\t\tscore+=block.downColor();//change color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag\n\t\t\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\t\t\tchanged=true;//set the changed flag\n\t\t\t\t\t\thitSound.play();//play the sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}//end the for.\n\t\t\tif (changed==false) {//if no changes, reset the flag.\n\t\t\t\tball.setIntersected(false);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//move everything as per velocity\n\t\t\tif (slider.getX() > 10 && sliderVX<0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);//the slider can move twice as fast as the ball.\n\t\t\t} else if ((slider.getX()+slider.getWidth()) < GamePlay.getScreenWidth()-10 && sliderVX>0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);\n\t\t\t}\n\t\t\tif (ready) {\n\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\tball.setY(ball.getY() + ballVY);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"public Coordinates shiftCoordinates(int x, int y) throws OutOfBoardException{\n if(this.x + x < 0 || this.y + y < 0){\n throw new OutOfBoardException();\n }\n return new Coordinates(this.x + x, this.y + y);\n }",
"void storeValues(int posx, int posy, int piece) {\n\t\tprevPosX = posx;\n\t\tprevPosY = posy;\n\t\tprevName = \"\" + prevPosX + \"\" + prevPosY;\n\t\tprevComp = (JLabel) curComp;\n\t\tprevPiece = piece;\n\t\tpiece = Logic.arr[posx][posy];\n\t}",
"public static void paintPixelOnWhiteboard(int drawingTool, int x, int y, int col){\n\t\t\n\t\tif(drawingTool == 1){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t} else if(drawingTool == 2){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 2, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y + 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 2, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y - 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 2, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 2, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y + 1, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y + 1, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y - 1, col);\n\t\t\t\n\t\t} else if(drawingTool == 3){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y - 1, col);\n\t\t\twhiteboardBi.setRGB(x + 2, y - 2, col);\n\t\t\twhiteboardBi.setRGB(x + 3, y - 3, col);\n\t\t\twhiteboardBi.setRGB(x + 4, y - 4, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y - 1, col);\n\t\t\twhiteboardBi.setRGB(x + 2, y - 2, col);\n\t\t\twhiteboardBi.setRGB(x + 3, y - 3, col);\n\t\t\twhiteboardBi.setRGB(x + 4, y - 4, col);\n\t\t} else if(drawingTool == 4){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 2, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 3, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 4, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 1, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 2, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 3, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 4, col);\n\t\t} else if(drawingTool == 5){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 2, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 3, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 4, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 2, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 3, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x - 4, y + 0, col);\n\t\t} else if(drawingTool == 6){\n\t\t\twhiteboardBi.setRGB(x, y, col);\n\t\t\twhiteboardBi.setRGB(x - 4, y + 4, col);\n\t\t\twhiteboardBi.setRGB(x - 3, y + 3, col);\n\t\t\twhiteboardBi.setRGB(x - 3, y - 2, col);\n\t\t\twhiteboardBi.setRGB(x - 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y + 3, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 3, col);\n\t\t\twhiteboardBi.setRGB(x + 0, y - 4, col);\n\t\t\twhiteboardBi.setRGB(x + 1, y + 0, col);\n\t\t\twhiteboardBi.setRGB(x + 3, y - 3, col);\n\t\t\twhiteboardBi.setRGB(x + 3, y + 3, col);\n\t\t\twhiteboardBi.setRGB(x + 4, y + 2, col);\n\t\t}\n\t\twhiteboardPanel.repaint();\n\t}",
"public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }",
"public void shootBabyInto(int x, int y) {\n home.world.cells[x][y].resident\n = new Omnivore(home.world.cells[x][y]);\n }",
"public void moveTo(int a, int b, Pieces board)\n {\n int[][] board_state = board.getState();\n ArrayList<Pair> available = availableMove(board);\n Pair temp = new Pair(a, b);\n //if (a,b) is in available, move\n for (int i = 0; i < available.size(); ++i)\n {\n if (temp.equals(available.get(i)) == true)\n {\n //a opponent's piece is at (a,b), remove it\n if (board_state[a][b] == getOpponent(player))\n {\n board.removePiece(a, b, getOpponent(player));\n }\n x = a;\n y = b;\n }\n }\n System.out.println(\"Invaild Move\");\n }",
"public void setSpawn (int x, int y) {\n xCord = x;\n yCord = y;\n }",
"public void place(GamePiece teil, QPosition pos) { // old German method name: platziere\n for (int x = teil.getMinX(); x <= teil.getMaxX(); x++) {\n for (int y = teil.getMinY(); y <= teil.getMaxY(); y++) {\n if (teil.filled(x, y)) {\n int ax = pos.getX() + x - teil.getMinX();\n int ay = pos.getY() + y - teil.getMinY();\n set(ax, ay, teil.getBlockType(x, y));\n }\n }\n }\n view.draw();\n }",
"public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}",
"public void placeBombs(int difficulty){\r\n int randomRow;\r\n int randomCol;\r\n int maxBombs;\r\n if(difficulty == 1){\r\n maxBombs = 12;\r\n bombDifficulty(maxBombs);\r\n\r\n }\r\n if(difficulty == 2){\r\n maxBombs = 41;\r\n bombDifficulty(maxBombs);\r\n }\r\n if(difficulty == 3){\r\n maxBombs = 102;\r\n bombDifficulty(maxBombs);\r\n }\r\n\r\n }",
"public void MoveTileOpponent(Integer position){\n Integer position_inverted = revertTile(position);\n String position_inverted_str = String.valueOf(position_inverted);\n\n ImageView player2 = findImageButton(\"square_\"+position_inverted_str);\n ImageView player2_old = findImageButton(\"square_\"+opponentTile.toString());\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n player2_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n\n opponentTile = position_inverted;\n myTurn = true;\n canPlaceBomb = true;\n turnNumber = turnNumber + 1;\n\n if(ShotsCaller){\n placePowerup(null);\n }\n }",
"private void updateGridWithPosition(Pair<Integer, Integer> position) {\n int x = position.getValue0();\n int y = position.getValue1();\n int ox = origin.getValue0();\n int oy = origin.getValue1();\n while (ox + Math.abs(x) >= grid[0].length || oy + Math.abs(y) >= grid.length) {\n reallocateGrid();\n }\n if (x >= 0 && y >= 0) {\n grid[oy + y][ox + x] = '#';\n } else if (x >= 0) {\n grid[oy - Math.abs(y)][ox + x] = '#';\n } else if (y >= 0) {\n grid[oy + y][ox - Math.abs(x)] = '#';\n } else {\n grid[oy - Math.abs(y)][ox - Math.abs(x)] = '#';\n }\n }",
"public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }",
"public void moveBoat(int pos)\n\t{\n\t\tif(pos == GameConstants.LEFT)\n\t\t{\n\t\t\t// Remove panels from river.\n\t\t\tthis.removeAll();\n\t\t\t\n\t\t\t// Add boats to panel.\n\t\t\tthis.add(rightBoat);\n\t\t\tthis.add(leftBoat); // This boat contains the characters.\n\t\t\t\n\t\t\t// Update GUI.\n\t\t\tthis.validate();\n\t\t\tthis.repaint();\n\t\t}\n\t\t// If the boat is moving to the right\n\t\telse if(pos == GameConstants.RIGHT)\n\t\t{\n\t\t\t// Remove panels from the river.\n\t\t\tthis.removeAll();\n\t\t\t\n\t\t\t// Add boats to panel.\n\t\t\tthis.add(leftBoat); // This boat contains the characters.\n\t\t\tthis.add(rightBoat);\n\t\t\t\n\t\t\t// Update GUI.\n\t\t\tthis.validate();\n\t\t\tthis.repaint();\n\t\t}\n\t}",
"void placePiece(Piece piece, Position position) {\n positionToPieceMap.put(position, piece);\n }",
"public static void setBatteryOffset(float battery_offset) {\r\n\t\tBATTERY_OFFSET = battery_offset;\r\n\t}",
"public void updateFloor(Position pos, Board board) {\n\t\t\tFloor_c curr = (Floor_c)board.get(pos);\n\t\t\t\n\t\t\tif(curr.isFull()) {\n\t\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setText(board.get(pos).toString());\n\t\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setBackground(Color.blue);\n\t\t\t}else {\n\t\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setText(\"\");\n\t\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setBackground(Color.gray);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"private void fillBoardWithCells(){\n double posx = MyValues.HORIZONTAL_VALUE*0.5*MyValues.HEX_SCALE + MyValues.DIAGONAL_VALUE*MyValues.HEX_SCALE;\n double posy = 2*MyValues.DIAGONAL_VALUE*MyValues.HEX_SCALE ;\n HexCell startCell = new HexCell(0,0, this);\n startCell.changePosition(posx, posy);\n boardCells[0][0] = startCell;\n for (int i = 0; i< x-1; i++) {\n HexCell currentCell = new HexCell(i+1, 0, this);\n boardCells[i+1][0] = currentCell;\n //i mod 2 = 0: Bottom\n if (i % 2 == 0) {\n boardCells[i][0].placeHexCell(currentCell, MyValues.HEX_POSITION.BOT_RIGHT );\n } else {\n //i mod 2 =1: Top\n boardCells[i][0].placeHexCell(currentCell, MyValues.HEX_POSITION.TOP_RIGHT );\n }\n }\n for(int i = 0; i < x; i++){\n for(int j = 0; j < y-1; j++){\n HexCell currentCell = new HexCell(i, j+1, this);\n //System.out.println(Integer.toString(i) + Integer.toString(j));\n boardCells[i][j+1] = currentCell;\n boardCells[i][j].placeHexCell(currentCell, MyValues.HEX_POSITION.BOT);\n }\n }\n }",
"public void teleportPlayer(int x, int y){\n hero.setX(x);\n hero.setY(y);\n }",
"public Cow(int _pos_x , int _pos_y)\n {\n pos_x = _pos_x;\n pos_y = _pos_y;\n availableProduct = false;\n hunger_countdown = 5;\n allowed_tiles = \"Grassland\";\n }",
"protected void registerTile(int x, int y) {}",
"private void setFixedTile(FixedTile tile, int x, int y) {\r\n\t\tGridSquare.Type type = tile.getType();\r\n\t\tfor(int i = x; i < x+3; i++) {\r\n\t\t\tfor(int j = y; j < y+3; j++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(type) , i, j);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected abstract void position(int[][] gameboard, int col, int row);"
] | [
"0.64339226",
"0.62941164",
"0.6242769",
"0.61671305",
"0.6071843",
"0.58891106",
"0.58585405",
"0.58523303",
"0.5851702",
"0.5779188",
"0.5769622",
"0.5768049",
"0.5670234",
"0.56487274",
"0.56241846",
"0.56124866",
"0.5590459",
"0.55826855",
"0.553541",
"0.55279577",
"0.55163765",
"0.5493994",
"0.54925567",
"0.5491433",
"0.548657",
"0.547277",
"0.5466797",
"0.5428547",
"0.5424254",
"0.5422017",
"0.54194725",
"0.5414042",
"0.5393182",
"0.53837556",
"0.5372616",
"0.5354346",
"0.5354075",
"0.5343483",
"0.53413284",
"0.5333183",
"0.5331605",
"0.53296477",
"0.5323536",
"0.5320816",
"0.5312376",
"0.5308489",
"0.5305138",
"0.5305106",
"0.52670026",
"0.525548",
"0.5252582",
"0.52488655",
"0.52466965",
"0.524594",
"0.52430755",
"0.523484",
"0.52325165",
"0.52272207",
"0.5225351",
"0.5223757",
"0.5211569",
"0.52016574",
"0.520056",
"0.51965266",
"0.5195276",
"0.51931703",
"0.5189466",
"0.5180082",
"0.51782304",
"0.51746446",
"0.51668096",
"0.51660794",
"0.5164701",
"0.5164587",
"0.51583636",
"0.51567143",
"0.5155742",
"0.5150335",
"0.51397777",
"0.5129521",
"0.51251644",
"0.5120466",
"0.5116661",
"0.5108184",
"0.5107207",
"0.5106125",
"0.5101303",
"0.5100713",
"0.509818",
"0.50963765",
"0.50960195",
"0.5090041",
"0.5088803",
"0.508752",
"0.5085161",
"0.5078983",
"0.50782853",
"0.50760853",
"0.5072339",
"0.5067367"
] | 0.8147061 | 0 |
Return the xcoordinate of battery. This method must throw IllegalStateException if battery is not placed on a board. | @Override
public long getBatteryX(Battery battery) throws IllegalStateException
{
if (battery.getBoard() != null)
{
return battery.getPosition().getCoordX();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic long getRobotX(Robot robot) throws IllegalStateException\r\n\t{\r\n\t\tif (robot.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn robot.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public double getX() {\n return position.getX();\n }",
"public final int getPositionX() {\r\n return (int) position.x();\r\n }",
"public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"@Override\r\n\tpublic long getRepairKitX(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getX() {\r\n\t\treturn xcoord;\r\n\t}",
"public double getLocationX() {\r\n\t\treturn location.getX();\r\n\t}",
"public int getXPosition() {\n return xPosition;\n }",
"public int getXPosition() {\n\t\treturn this.position.x;\n\t}",
"public int getLocationX() {\r\n\t\treturn x;\r\n\t}",
"public int getxPosition() {\n\t\treturn xPosition;\n\t}",
"public int getX() {\n synchronized (this.xLock) {\n return (int) this.movementComposer.getXPosition();\n }\n }",
"public int getxCoordinate() {\n\t\treturn xCoordinate;\n\t}",
"public int getX() {\n return this.coordinate.x;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getX() {\n return xCoord;\n }",
"public int getXPosition() {\n return this.xPosition;\n }",
"public int getX() {\n return (int) xPos;\n }",
"public final int getX()\n\t{\n\t\treturn pos.x;\n\t}",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}",
"protected int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public double getXPosition()\n\t{\n\t\treturn xPosition;\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int get_X_Coordinate()\n {\n return currentBallX;\n }",
"public int x() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getX(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(0)/ AvesAblazeHardware.mmPerInch);\n\t}",
"protected Number getX() {\n return this.xCoordinate;\n }",
"public int getCoordX() \r\n {\r\n \treturn this.coordX;\r\n }",
"public int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getX(){\n\t\treturn this.x_location;\n\t}",
"public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}",
"public int getXPosition(){\n\t\treturn xPosition;\n\t}",
"public int getLocX() {\n return locX;\n }",
"public int getX() {\n return pos_x;\n }",
"public int getPositionX() {\n return positionX;\n }",
"public int getPositionX() {\r\n\t\treturn positionX;\r\n\t}",
"public int getX()\r\n {\r\n return xCoord;\r\n }",
"public double getxCoordinate() {\n return xCoordinate;\n }",
"public int getX() {\n return (int) Math.round(x);\n }",
"@Override\r\n\tpublic long getWallX(Wall wall) throws IllegalStateException, UnsupportedOperationException\r\n\t{\r\n\t\tif (wall.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn wall.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public double getXCoordinate() {\n return xCoordinate;\n }",
"public int getX() { return position.x; }",
"public final double getX() { return location.getX(); }",
"public int getLocationX( )\n\t{\n\t\treturn locationX;\n\t}",
"public int getBattery() {\n return battery_;\n }",
"public int getXCoordinate ()\n {\n return xCoordinate;\n }",
"public int getxPos() {\n return xPos;\n }",
"public float getxPosition() {\n return xPosition;\n }",
"public double getPositionX() {\n\t\treturn this.tilePositionX;\n\t}",
"public int getPositionX(){\n\t\treturn positionx;\n\t}",
"public int getBattery() {\n return battery_;\n }",
"public int getxPos() {\n\t\treturn xPos;\n\t}",
"public int getX()\r\n {\r\n return xLoc;\r\n }",
"public int getxPos() \n\t{\n\t\treturn xPos;\n\t}",
"public int getPos_x(){\n\t\treturn pos_x;\n\t}",
"@Override\r\n\tpublic void putBattery(Board board, long x, long y, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbattery.setPosition(new Position(x,y));\r\n\t\t\tbattery.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this battery or this board is terminated; the battery cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public int getX() {\n return posX;\n }",
"public float getX() { return xCoordinate;}",
"public int getLocX() {\n return locX;\n }",
"public double getX() {\n\t\treturn bassX;\n\t}",
"public int getScreenX()\r\n\t{\r\n\t\treturn mScreen.getX();\r\n\t}",
"@Override\r\n\tpublic long getBatteryY(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getX() {\n return positionX;\n }",
"int getX() {\n return xPos;\n }",
"public int getXPos() {\n\t\treturn xPos;\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public final int getXOffset() {\n return xOffset;\n }",
"@Basic\n\tpublic double getXCoordinate() {\n\t\treturn this.x;\n\t}",
"public int getX()\r\n {\r\n \treturn xPos;\r\n }",
"public float getX() {\n return pos.x;\n }",
"public int getXcoord(){\n\t\treturn this.coordinates[0];\n\t}",
"public double getUserFriendlyXPos(){\n return xPos - myGrid.getWidth()/ HALF;\n }",
"public Object getCurrentCellX() {\n\t\treturn x;\n\t}",
"public double getXPos() {\n\t\treturn this.position[0];\n\t}",
"public int getPosicaoX() {\r\n\t\treturn posicaoX;\r\n\t}",
"public double getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getX() {\n\t\t\tint lastRobot = (state[2 * k] + k - 1) % k;\n\t\t\treturn state[lastRobot];\n\t\t}",
"public final double getScreenX() {\n return screenX;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public double getX() {\r\n\t\t return this.xCoord;\r\n\t }",
"public double getXCoordinates() { return xCoordinates; }",
"public double getX_location() {\n return x_location;\n }",
"public float getPositionX() {return this.position.getX();}",
"public int getX()\n\t{\n\t\treturn m_nPosX;\n\t}"
] | [
"0.6384352",
"0.6369745",
"0.6349201",
"0.63018084",
"0.62543684",
"0.62543684",
"0.6248805",
"0.62190855",
"0.62178373",
"0.61987704",
"0.6197342",
"0.6188697",
"0.6175418",
"0.61743045",
"0.61664027",
"0.61446774",
"0.61324304",
"0.61324304",
"0.61317027",
"0.612306",
"0.61221266",
"0.612063",
"0.6113541",
"0.6113541",
"0.6112439",
"0.6107975",
"0.61062497",
"0.610419",
"0.61013824",
"0.61013824",
"0.60924184",
"0.60924184",
"0.60919136",
"0.6088151",
"0.60870445",
"0.6085969",
"0.6081574",
"0.60779226",
"0.60765034",
"0.60761565",
"0.6063671",
"0.6053771",
"0.60360247",
"0.60348773",
"0.60250914",
"0.6019833",
"0.6018054",
"0.60125005",
"0.6010372",
"0.6008363",
"0.6006372",
"0.60050464",
"0.6004513",
"0.60036355",
"0.59982157",
"0.5990747",
"0.5989624",
"0.5980807",
"0.59777164",
"0.597665",
"0.5973454",
"0.597258",
"0.59631765",
"0.5961813",
"0.5961752",
"0.5956208",
"0.594358",
"0.59375745",
"0.59353626",
"0.5932785",
"0.5932715",
"0.59272915",
"0.5926756",
"0.592163",
"0.591619",
"0.5912027",
"0.5912027",
"0.5903815",
"0.5897403",
"0.5886471",
"0.5882659",
"0.58780766",
"0.5867783",
"0.5860298",
"0.58568716",
"0.5848437",
"0.584654",
"0.58438236",
"0.58307046",
"0.58242536",
"0.58242536",
"0.58242536",
"0.58242536",
"0.58242536",
"0.58242536",
"0.5818534",
"0.5815337",
"0.5812465",
"0.5803249",
"0.57613057"
] | 0.840943 | 0 |
Return the ycoordinate of battery. This method must throw IllegalStateException if battery is not placed on a board. | @Override
public long getBatteryY(Battery battery) throws IllegalStateException
{
if (battery.getBoard() != null)
{
return battery.getPosition().getCoordY();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getY() {\n return position.getY();\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getLocationY() {\r\n\t\treturn y;\r\n\t}",
"public int getBattery() {\n return battery_;\n }",
"public int getY() {\n synchronized (this.yLock) {\n return (int) this.movementComposer.getYPosition();\n }\n }",
"public int y() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getBattery() {\n return battery_;\n }",
"public int getyCoord() {\n\t\treturn yCoord;\n\t}",
"public int getY() {\r\n\t\treturn ycoord;\r\n\t}",
"public final double getY() { return location.getY(); }",
"protected Number getY() {\n return this.yCoordinate;\n }",
"public int getY() {\n return yCoord;\n }",
"public int getLocationY( )\n\t{\n\t\treturn locationY;\n\t}",
"public int getY()\r\n {\r\n return yLoc;\r\n }",
"public int getLocY() {\n return locY;\n }",
"public int getY() {\n return (int) yPos;\n }",
"public double getLocationY() {\r\n\t\treturn location.getY();\r\n\t}",
"public int getY() {\n return this.coordinate.y;\n }",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"public double getyCoordinate() {\n return yCoordinate;\n }",
"public final int getY()\n\t{\n\t\treturn pos.y;\n\t}",
"public double getY() {\n\t\treturn bassY;\n\t}",
"public int get_Y_Coordinate()\n {\n return currentBallY;\n }",
"public int getY() {\n\t\t\n\t\treturn yPosition;\t\t// Gets the y integer\n\t}",
"public int getY()\r\n {\r\n return yCoord;\r\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"@Override\r\n\tpublic int getY() {\n\t\treturn (int)y;\r\n\t}",
"public int getY(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(1)/ AvesAblazeHardware.mmPerInch);\n\t}",
"public int getY() {\n return (int) Math.round(y);\n }",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getCoordY() \r\n {\r\n \treturn this.coordY;\r\n }",
"public double getyCoord() {\n\t\treturn yCoord;\n\t}",
"@Override\r\n\tpublic long getRepairKitY(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getLocY() {\n return locY;\n }",
"public int getyPosition() {\n\t\treturn yPosition;\n\t}",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return y;\r\n }",
"@Override\r\n\tpublic long getBatteryX(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\r\n }",
"public int getY()\r\n\t{\r\n\t\treturn (int)y;\r\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\r\n\t\treturn this.y;\r\n\t}",
"public int getYcoord(){\n\t\treturn this.coordinates[1];\n\t}",
"public final int getPositionY() {\r\n return (int) position.y();\r\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"@Override\n\tpublic double getYLoc() {\n\t\treturn y;\n\t}",
"public int getY() {\r\n return this.y;\r\n }",
"public int getYPosition() {\n return yPosition;\n }",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getCurrentY() {\n return currentY;\n }",
"public final double getScreenY() {\n return screenY;\n }",
"public int getY()\n\t{\n\t\treturn mY;\n\t}",
"public int getTheYPosition(int y){\n\t\tif(y>=1 && y<=4){\n\t\t\treturn 7;\n\t\t}\n\t\telse if(y>=5 && y<=8){\n\t\t\treturn 6;\n\t\t}\n\t\telse if(y>=9 && y<=12){\n\t\t\treturn 5;\n\t\t}\n\t\telse if(y>=13 && y<=16){\n\t\t\treturn 4;\n\t\t}\n\t\telse if(y>=17 && y<=20){\n\t\t\treturn 3;\n\t\t}\n\t\telse if(y>=21 && y<=24){\n\t\t\treturn 2;\n\t\t}\n\t\telse if(y>=25 && y<=28){\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\treturn 0;\n\t\t}\n\t}",
"public int getY() {\n return positionY;\n }",
"public int getYPosition() {\n return this.yPosition;\n }",
"public int getYCoordinate()\n\t{\n\t\treturn yCoordinate;\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn this.Y;\r\n\t}",
"public int getY()\n {\n return this.y;\n }",
"public Object getCurrentCellY() {\n\t\treturn y;\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}",
"public int getY() {\n return posY;\n }"
] | [
"0.64576167",
"0.6451278",
"0.6451278",
"0.64230627",
"0.6415611",
"0.6408193",
"0.6405778",
"0.640314",
"0.640156",
"0.63643444",
"0.63489604",
"0.6332679",
"0.6330822",
"0.6317109",
"0.63058627",
"0.6294216",
"0.6281967",
"0.6270134",
"0.62593114",
"0.62571824",
"0.6254692",
"0.62515503",
"0.6250052",
"0.62467897",
"0.6236328",
"0.6234017",
"0.6219312",
"0.62089074",
"0.62089074",
"0.62089074",
"0.62089074",
"0.62089074",
"0.6199984",
"0.61958957",
"0.61927855",
"0.61903167",
"0.61903167",
"0.61903167",
"0.6189941",
"0.61888427",
"0.61879355",
"0.6187758",
"0.618093",
"0.6174502",
"0.6174502",
"0.617157",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61687124",
"0.61610806",
"0.61510754",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.6149952",
"0.614691",
"0.6143641",
"0.61409354",
"0.61349463",
"0.61349463",
"0.61349463",
"0.61349463",
"0.61349463",
"0.6134027",
"0.61320883",
"0.61280584",
"0.6127529",
"0.6127529",
"0.6127529",
"0.6122376",
"0.61223114",
"0.6120429",
"0.6117569",
"0.61071014",
"0.6097659",
"0.60974526",
"0.6090004",
"0.6084887",
"0.608055",
"0.6074845",
"0.6072731"
] | 0.8243283 | 0 |
Create a new repair kit that repairs repairAmount. This method must return null if the given parameters are invalid (e.g. negative repairAmount). | @Override
public RepairKit createRepairKit(double repairAmount, int weight)
{
return new RepairKit(repairAmount, weight);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RecoveryLinear(int recoveryAmount)\n\t{\n\t\tthis.recoveryAmount = recoveryAmount; \n\t}",
"QualityRisk createQualityRisk();",
"public IResourceDepot createResourceDepot() {\n\n /*\n * Defining a ResourceDepot \"JackTruckDepot\" that can store DeliverGood and PickupGood.\n *\n */\n\n // We can store a maximum of 10 DeliverGood on our track (assuming that no other load is\n // present)\n // Further, we start with an initial load of 5 DeliverGoods.\n ILoadCapacity deliverGoodCapacity = new SimpleLoadCapacity(\"DeliverGood\", 10, 5);\n\n // We can store a maximum of 5 PickupGood on our track (assuming that no other load is present)\n ILoadCapacity pickupGoodCapacity = new SimpleLoadCapacity(\"PickupGood\", 5, 0);\n\n // Our depot can store a maximum of 10 total items. For example, 7 DeliverGoods\n // and 3 PickupGoods.\n IResourceDepot depot = new SimpleResourceDepot(\"JackTruckDepot\", 10);\n\n // Adding the capacities to our depot\n depot.add(deliverGoodCapacity);\n depot.add(pickupGoodCapacity);\n\n return depot;\n }",
"public com.vodafone.global.er.decoupling.binding.request.RefundMonetaryRequest createRefundMonetaryRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundMonetaryRequestImpl();\n }",
"public suiluppo_equip_allocation create(long equip_allocat_id);",
"public com.vodafone.global.er.decoupling.binding.request.ModifyTariffRequest createModifyTariffRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifyTariffRequestImpl();\n }",
"@Override\n\tpublic int create(Proveedor r) {\n\t\treturn 0;\n\t}",
"public MaintenanceRequestTask createVehicleRentalFeeLine(MaintenanceRequest mrq, String username){\n\t\tBigDecimal vehicleRentalFee = new BigDecimal(0.00); \n\t\tMaintenanceRequestTask task;\n\t\tMaintenanceRequestTask newFeeTask = new MaintenanceRequestTask();\n\t\tString defaultVehicleRentalFeeCategoryCode = willowConfigService.getConfigValue(\"MAINT_RENTAL_CAT_CODE\");\n\t\tString defaultVehicleRentalFeeRechargeCode = willowConfigService.getConfigValue(\"MAINT_RENTAL_RECH_CODE\");\n\t\tString defaultVehicleRentalFeeCode = willowConfigService.getConfigValue(\"MAINT_RENTAL_FEE_CODE\");\n\t\t\n\t\tLong maxLineNumber = nextMRTLineNumber(mrq);\n\t\n\t\tfor(Iterator<MaintenanceRequestTask> iter = mrq.getMaintenanceRequestTasks().iterator(); iter.hasNext();){\n\t\t\ttask = (MaintenanceRequestTask)iter.next();\n\t\t\tif(!MALUtilities.isEmpty(task.getMaintCatCode()) && task.getMaintCatCode().equals(defaultVehicleRentalFeeCategoryCode) &&\n\t\t\t\t\ttask.getMaintenanceCode().getCode().equals(defaultVehicleRentalFeeCode)){\t\t\t\t\n\t\t\t\titer.remove();\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tvehicleRentalFee = calculateVehicleRentalFee(mrq);\n\t\t\n \tif(vehicleRentalFee.compareTo(new BigDecimal(0.00)) != 0){\t\n \t\tnewFeeTask.setMaintenanceRequest(mrq);\n \t\tnewFeeTask.setMaintCatCode(defaultVehicleRentalFeeCategoryCode);\n \t\tnewFeeTask.setMaintenanceCode(convertMaintenanceCode(defaultVehicleRentalFeeCode));\n \t\tnewFeeTask.setMaintenanceCodeDesc(convertMaintenanceCode(defaultVehicleRentalFeeCode).getDescription()); \n \t\tnewFeeTask.setWorkToBeDone(newFeeTask.getMaintenanceCodeDesc());\n \t\tnewFeeTask.setTaskQty(new BigDecimal(1));\n \t\tnewFeeTask.setUnitCost(new BigDecimal(0.00));\n \t\tnewFeeTask.setTotalCost(new BigDecimal(0.00));\n \t\tnewFeeTask.setRechargeFlag(MalConstants.FLAG_Y);\n \t\tnewFeeTask.setRechargeCode(defaultVehicleRentalFeeRechargeCode);\n \t\tnewFeeTask.setRechargeQty(new BigDecimal(1));\n \t\tnewFeeTask.setRechargeUnitCost(vehicleRentalFee);\n \t\tnewFeeTask.setRechargeTotalCost(newFeeTask.getRechargeUnitCost().multiply(newFeeTask.getRechargeQty()));\n \t\tnewFeeTask.setActualRechargeCost(newFeeTask.getRechargeTotalCost());\n \t\tnewFeeTask.setDiscountFlag(MalConstants.FLAG_N);\n \t\tnewFeeTask.setOutstanding(DataConstants.DEFAULT_N);\n \t\tnewFeeTask.setWasOutstanding(DataConstants.DEFAULT_N); \n \t\tnewFeeTask.setAuthorizePerson(username);\n \t\tnewFeeTask.setAuthorizeDate(Calendar.getInstance().getTime());\n \t\tnewFeeTask.setLineNumber(maxLineNumber+=1);\n \t}\t\n\n\t\treturn newFeeTask;\n \n\t}",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundMonetaryRequest createCustcareFullRefundMonetaryRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundMonetaryRequestImpl();\n }",
"public ReturnInfo createRemind(Integer serviceId,Integer caseId);",
"protected void repair(int amountRepaired)\n\t{\n\t\tcurrentRepair-=amountRepaired;\n\t\tif(currentRepair<0)\n\t\t{\n\t\t\tcurrentRepair=0;\n\t\t}\n\t\tif(currentRepair<getMaxRepair())\n\t\t{\n\t\t\ttimeDisrepair=3155692597470L;//Year 2070, default starting value\n\t\t}\n\t}",
"public com.vodafone.global.er.decoupling.binding.request.GoodwillCreditRequest createGoodwillCreditRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GoodwillCreditRequestImpl();\n }",
"public com.vodafone.global.er.decoupling.binding.request.RatePackageRequest createRatePackageRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RatePackageRequestImpl();\n }",
"public com.vodafone.global.er.decoupling.binding.request.RenewPurchasePackageRequest createRenewPurchasePackageRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RenewPurchasePackageRequestImpl();\n }",
"Rental createRental();",
"public PublicCashPenaltyRowImpl() {\n }",
"public void muteerVanCentrale(int RekeningNR,Money saldo) throws RemoteException,NumberDoesntExistException;",
"static public Thief createThief () {\n System.out.println(\"Enter the name of your thief : \");\n Scanner sc = new Scanner(System.in);\n String nameCharacter = sc.next();\n\n // enter and get the HP value of the character\n System.out.println(\"Enter the healpoint of your thief : \");\n Scanner scan = new Scanner(System.in);\n String healPointCharacter = scan.next();\n int hpCharacter = Integer.parseInt(healPointCharacter);\n\n // get the power value\n System.out.println(\"Enter the power of your thief : \");\n Scanner sca = new Scanner(System.in);\n String powerCharacter = sca.next();\n int pcCharacter = Integer.parseInt(powerCharacter);\n\n\n // get the initiative (turn order)\n System.out.println(\"Enter the initiative of your thief : \");\n Scanner scann = new Scanner(System.in);\n String initiativeCharacter = scann.next();\n int iniCharacter = Integer.parseInt(initiativeCharacter);\n\n System.out.println(\"Enter the critical hit probability of your thief : \");\n Scanner scanS = new Scanner(System.in);\n String criticalDamage = scann.next();\n int ccDmg = Integer.parseInt(criticalDamage);\n\n Thief createThief = new Thief(nameCharacter, pcCharacter, hpCharacter, iniCharacter, ccDmg);\n System.out.println(\"Your thief has been created with success!\");\n\n return createThief;\n\n }",
"static public Warrior createWarrior (){\n System.out.println(\"Enter the name of your warrior : \");\n Scanner sc = new Scanner(System.in);\n String nameCharacter = sc.next();\n\n // enter and get the HP value of the character\n System.out.println(\"Enter the healpoint of your warrior : \");\n Scanner scan = new Scanner(System.in);\n String healPointCharacter = scan.next();\n int hpCharacter = Integer.parseInt(healPointCharacter);\n\n // get the power value\n System.out.println(\"Enter the power of your warrior : \");\n Scanner sca = new Scanner(System.in);\n String powerCharacter = sca.next();\n int pcCharacter = Integer.parseInt(powerCharacter);\n\n\n // get the initiative (turn order)\n System.out.println(\"Enter the initiative of your warrior : \");\n Scanner scann = new Scanner(System.in);\n String initiativeCharacter = scann.next();\n int iniCharacter = Integer.parseInt(initiativeCharacter);\n\n System.out.println(\"Enter the shield value of your warrior : \");\n Scanner scanS = new Scanner(System.in);\n String shieldCharacter = scann.next();\n int shieldWarrior = Integer.parseInt(shieldCharacter);\n\n Warrior createWarrior = new Warrior(nameCharacter, pcCharacter, hpCharacter, iniCharacter, shieldWarrior);\n System.out.println(\"Your warrior has been created with success!\");\n\n return createWarrior;\n }",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundEnlargementRequest createCustcareFullRefundEnlargementRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundEnlargementRequestImpl();\n }",
"public void createResident(Resident resident);",
"public Object creditEarningsAndPayTaxes()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 144 */ \tgetPriceFromWorld();\r\n/* 145 */ \tgetDividendFromWorld();\r\n/* */ \r\n/* */ \r\n/* 148 */ \tthis.cash -= (this.price * this.intrate - this.dividend) * this.position;\r\n/* 149 */ \tif (this.cash < this.mincash) {\r\n/* 150 */ \tthis.cash = this.mincash;\r\n/* */ }\t\r\n/* */ \r\n/* 153 */ \tthis.wealth = (this.cash + this.price * this.position);\r\n/* */ \r\n/* 155 */ \treturn this;\r\n/* */ }",
"public com.vodafone.global.er.decoupling.binding.request.RefundEnlargementRequest createRefundEnlargementRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundEnlargementRequestImpl();\n }",
"public MaintenanceRequest createGoodwillMaintenanceRequest(MaintenanceRequest mrq, String username) throws MalBusinessException{\n\t\tMaintenanceRequest goodwillMaintenanceRequest = new MaintenanceRequest();\n\t\tMaintenanceRequestTask goodwillMaintenanceRequestTask = null;\n\t\tint numChildren = maintenanceRequestDAO.getMaintRequestByMrqMrqIdCount(mrq.getMrqId());\n\t\tmrq = maintenanceRequestDAO.findById(mrq.getMrqId()).orElse(null);\t\n\t\tdefaultMarkUpMaintCode = willowConfigService.getConfigValue(\"MAINT_NON_NETWORK_CODE\");\n\t\tdefaultVehicleRentalFeeCode = willowConfigService.getConfigValue(\"MAINT_RENTAL_FEE_CODE\");\n\t\tdefaultVehicleERSFeeCode = willowConfigService.getConfigValue(\"MAINT_ERS_FEE_CODE\");\n\t\t\n\t\t//Copy\n\t\tBeanUtils.copyProperties(mrq, goodwillMaintenanceRequest, \n\t\t\t\tnew String[]{\"mrqId\", \"maintenanceRequestTasks\", \"accessoryMaintJobActivations\", \"diaries\", \"fleetNotes\", \n\t\t\t\t\"maintRequestUsers\", \"odometerReadings\", \"servicesDues\", \"versionts\"});\n\t\t\n\t\t//Changes to the Maintenance Request\n\t\tgoodwillMaintenanceRequest.setJobNo(mrq.getJobNo().concat(\"CR\" + (numChildren + 1)));\n\t\tgoodwillMaintenanceRequest.setMrqMrqId(mrq.getMrqId());\n\t\tgoodwillMaintenanceRequest.setMaintReqStatus(MaintenanceRequestStatusEnum.MAINT_REQUEST_STATUS_GOODWILL_PENDING.getCode());\n\t\t\n\t\t//Changes to the Maintenance Request Tasks\n\t\tgoodwillMaintenanceRequest.setMaintenanceRequestTasks(new ArrayList<MaintenanceRequestTask>());\n\t\t\n\t\tfor(MaintenanceRequestTask task : mrq.getMaintenanceRequestTasks()){\n\t\t\tif (!task.getMaintenanceCode().getCode().equals(defaultMarkUpMaintCode)){\n\t\t\t\tif(!task.getMaintenanceCode().getCode().equals(defaultVehicleRentalFeeCode)){\n\t\t\t\t\tif(!task.getMaintenanceCode().getCode().equals(defaultVehicleERSFeeCode)){\t\t\t\t\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask = new MaintenanceRequestTask();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tBeanUtils.copyProperties(task, goodwillMaintenanceRequestTask, new String[]{\"mrtId\", \"maintenanceRequest\", \"maintenanceCategoryPropertyValues\", \"versionts\"});\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setUnitCost(new BigDecimal(0));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setTotalCost(new BigDecimal(0));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setMarkUpAmount(new BigDecimal(0));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setRechargeUnitCost(new BigDecimal(0));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setRechargeTotalCost(new BigDecimal(0));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setMaintenanceRequest(goodwillMaintenanceRequest);\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setGoodwillPercent(new BigDecimal(100));\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setGoodwillCost(null);\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setGoodwillReason(null);\n\t\t\t\t\t\t goodwillMaintenanceRequestTask.setCostAvoidanceAmount(null);\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setCostAvoidanceCode(null);\n\t\t\t\t\t\t\tgoodwillMaintenanceRequestTask.setCostAvoidanceDescription(null);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgoodwillMaintenanceRequest.getMaintenanceRequestTasks().add(goodwillMaintenanceRequestTask);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tgoodwillMaintenanceRequest = initializeCostAvoidanceIndicators(goodwillMaintenanceRequest);\n\t\t\n\t\tgoodwillMaintenanceRequest = saveOrUpdateMaintnenacePO(goodwillMaintenanceRequest, username);\n\t\t\n\t\treturn goodwillMaintenanceRequest;\n\t}",
"TradeItem createTradeItem(Account proposer, Flippo proposerFlippo, Account receiver, Flippo receiverFlippo);",
"ShipmentCostEstimate createShipmentCostEstimate();",
"public com.vodafone.global.er.decoupling.binding.request.ModifySpendLimitsRequest createModifySpendLimitsRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifySpendLimitsRequestImpl();\n }",
"public equipment createNewPayment(String equipment_id, equipment equipment) {\n\n\n if ( !equipmentValidator.CheckEquipmentExistforCreation(equipment_id)) {\n throw new equipmentAlreadyExist(equipment_id);\n }\n\n return this.equiomentResprositery.save(equipment);\n }",
"private MaskedWalletRequest createStripeMaskedWalletRequest() {\n List<LineItem> lineItems = ((HomeActivity)getActivity()).buildLineItems();\n\n // Calculate the cart total by iterating over the line items.\n String cartTotal = ((HomeActivity)getActivity()).calculateCartTotal(lineItems);\n\n MaskedWalletRequest.Builder builder = MaskedWalletRequest.newBuilder()\n .setMerchantName(\"Merchant Name\")\n .setPhoneNumberRequired(true)\n .setShippingAddressRequired(true)\n .setCurrencyCode(\"USD\")\n .setEstimatedTotalPrice(cartTotal)\n .setCart(Cart.newBuilder()\n .setCurrencyCode(\"USD\")\n .setTotalPrice(cartTotal)\n .setLineItems(lineItems)\n .build());\n\n builder.setPaymentMethodTokenizationParameters(mPaymentMethodParameters);\n\n return builder.build();\n }",
"public Refillable(int initialAmount) {\n myAmount = initialAmount;\n }",
"public FeeRefund create(Map<String, Object> params) throws StripeException {\n return create(params, (RequestOptions) null);\n }",
"private TransactionRequest initTransactionRequest() {\n TransactionRequest transactionRequestNew = new\n TransactionRequest(System.currentTimeMillis() + \"\", 20000);\n\n //set customer details\n transactionRequestNew.setCustomerDetails(initCustomerDetails());\n\n\n // set item details\n ItemDetails itemDetails = new ItemDetails(\"1\", 20000, 1, \"Trekking Shoes\");\n\n // Add item details into item detail list.\n ArrayList<ItemDetails> itemDetailsArrayList = new ArrayList<>();\n itemDetailsArrayList.add(itemDetails);\n transactionRequestNew.setItemDetails(itemDetailsArrayList);\n\n\n // Create creditcard options for payment\n CreditCard creditCard = new CreditCard();\n\n creditCard.setSaveCard(false); // when using one/two click set to true and if normal set to false\n\n// this methode deprecated use setAuthentication instead\n// creditCard.setSecure(true); // when using one click must be true, for normal and two click (optional)\n\n creditCard.setAuthentication(CreditCard.AUTHENTICATION_TYPE_3DS);\n\n // noted !! : channel migs is needed if bank type is BCA, BRI or MyBank\n// creditCard.setChannel(CreditCard.MIGS); //set channel migs\n creditCard.setBank(BankType.BCA); //set spesific acquiring bank\n\n transactionRequestNew.setCreditCard(creditCard);\n\n return transactionRequestNew;\n }",
"public TransactionReceipt makeWithdrawal(TransactionTicket transactionTicket) {\r\n try {\r\n if (getBalance(transactionTicket).getPostTransactionBalance() < transactionTicket.getAmountOfTransaction()) {\r\n throw new InsufficientFundsException(\"Error: Insufficient Funds - Transaction Voided\");\r\n } else if (transactionTicket.getAmountOfTransaction() < 0) {\r\n throw new InvalidAmountException(transactionTicket.getAmountOfTransaction());\r\n } else if (this.getAccountStatus().equals(\"Closed\")) {\r\n throw new AccountClosedException(transactionTicket.getAcctNumber());\r\n } else {\r\n //subtracts the transaction amount\r\n return new TransactionReceipt(transactionTicket, true, null, getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPreTransactionBalance() - transactionTicket.getAmountOfTransaction(), null);\r\n }\r\n } catch(InsufficientFundsException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPostTransactionBalance(), null);\r\n } catch(InvalidAmountException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPostTransactionBalance(), null);\r\n } catch(AccountClosedException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPreTransactionBalance(), null);\r\n }\r\n }",
"Quantity createQuantity();",
"@RequestMapping(value = \"/pgmsAppRetirmntPens\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<PgmsAppRetirmntPen> createPgmsAppRetirmntPen(@Valid @RequestBody PgmsAppRetirmntPen pgmsAppRetirmntPen) throws URISyntaxException {\n log.debug(\"REST request to save PgmsAppRetirmntPen : {}\", pgmsAppRetirmntPen);\n if (pgmsAppRetirmntPen.getId() != null) {\n return ResponseEntity.badRequest().header(\"Failure\", \"A new pgmsAppRetirmntPen cannot already have an ID\").body(null);\n }\n PgmsAppRetirmntPen result = pgmsAppRetirmntPenRepository.save(pgmsAppRetirmntPen);\n pgmsAppRetirmntPenSearchRepository.save(result);\n return ResponseEntity.created(new URI(\"/api/pgmsAppRetirmntPens/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"pgmsAppRetirmntPen\", result.getId().toString()))\n .body(result);\n }",
"public JSONResponse pay(HashMap<String, String> parameters) {\n\t\tString pos = parameters.get(\"pos\"); \t\t\t\t\t\t// the point of sale code.\n\t\tString reservationid = parameters.get(\"reservationid\");\t\t// the ID of the reservation.\n\t\tString date = parameters.get(\"date\"); \t\t\t\t\t\t// the date of the payment.\n\t\tString emailaddress = parameters.get(\"emailaddress\"); \t\t// the email address of the payer.\n\t\tString cardholder = parameters.get(\"cardholder\");\t\t\t// the card holder name.\n\t\tString cardnumber = parameters.get(\"cardnumber\");\t\t\t// the card number.\n\t\tString cardmonth = parameters.get(\"cardmonth\");\t\t\t\t// the card expiry month.\n\t\tString cardyear = parameters.get(\"cardyear\");\t\t\t\t// the card expiry year.\n\t\tString cardcode = parameters.get(\"cardcode\");\t\t\t\t// the card CCV code.\n\t\tString amount = parameters.get(\"amount\");\t\t\t\t\t// the amount to be charged to the card.\n\t\tString remote_host = parameters.get(\"remote_host\");\t\t\t// the remote host URL.\n\n\t\tDouble value = Double.valueOf(amount);\n\t\tif (pos == null || pos.isEmpty() || Model.decrypt(pos).length() > 10) {throw new ServiceException(Error.pos_invalid, pos);}\n\t\tif (reservationid == null || reservationid.isEmpty() || reservationid.length() > 10) {throw new ServiceException(Error.reservation_id, reservationid);}\n\t\tif (emailaddress == null || emailaddress.isEmpty() || !Party.isEmailAddress(emailaddress)) {throw new ServiceException(Error.party_emailaddress, emailaddress);}\n\t\tif (cardholder == null || cardholder.isEmpty() || cardholder.length() > 100) {throw new ServiceException(Error.card_holder, cardholder);}\n\t\tif (cardnumber == null || cardnumber.isEmpty() || cardnumber.length() > 20) {throw new ServiceException(Error.card_number, cardnumber);}\n\t\tif (cardmonth == null || cardmonth.isEmpty() || cardmonth.length() != 2) {throw new ServiceException(Error.card_month, cardmonth);}\n\t\tif (cardyear == null || cardyear.isEmpty() || cardyear.length() != 4) {throw new ServiceException(Error.card_year, cardyear);}\n\t\tif (cardcode == null || cardcode.isEmpty() || cardcode.length() < 3) {throw new ServiceException(Error.card_code, cardcode);}\n\t\tif (value == null || value <= 0.0) {throw new ServiceException(Error.card_amount, amount);}\n\n\t\tSqlSession sqlSession = RazorServer.openSession();\n\t\tPayWidgetItem result = new PayWidgetItem();\n\t\ttry {\n\t\t\tJSONService.getParty(sqlSession, pos);\n\t\t\tReservation reservation = sqlSession.getMapper(ReservationMapper.class).read(reservationid);\n//\t\t\tParty customer = JSONService.getCustomer (sqlSession, emailaddress, familyname, firstname, reservation.getOrganizationid(), agent.getId());\n//\t\t\treservation.setCustomerid(customer.getId());\n//\t\t\tFinance finance = JSONService.getFinance(sqlSession, customer.getId(), cardholder, cardnumber, cardmonth, cardyear,\tcardcode);\n//\t\t\treservation.setFinanceid(finance.getId());\n//\t\t\treservation.setNotes(notes);\n//\t\t\tsqlSession.getMapper(ReservationMapper.class).update(reservation);\n\n\t\t\tElement element = PaygateHandler.getXML(reservation.getName(), cardholder, cardnumber, cardmonth + cardyear, value, reservation.getCurrency(), cardcode, emailaddress, remote_host);\n\n\t\t\tEvent<Journal> event = JSONService.cardReceipt(sqlSession, reservation, element, cardholder, value);\n\t\t\tresult.setId(reservation.getOrganizationid());\n\t\t\tresult.setName(event.getName());\n\t\t\tresult.setState(RazorWidget.State.SUCCESS.name());\n\t\t\tresult.setAmount(value);\n\t\t\tresult.setCurrency(reservation.getCurrency());\n\t\t\tresult.setMessage(JSONService.getNotes(element));\n\t\t\tsqlSession.commit();\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tresult.setId(null);\n\t\t\tresult.setName(null);\n\t\t\tresult.setState(RazorWidget.State.FAILURE.name());\n\t\t\tresult.setAmount(value == null ? 0.0 : value);\n\t\t\tresult.setCurrency(Currency.Code.USD.name());\n\t\t\tresult.setMessage(x.getMessage());\n\t\t}\n\t\tfinally {sqlSession.close();}\n\t\treturn result;\n\t}",
"public ServiceResponse<ProductInner> putNonRetry201Creating400() throws CloudException, IOException, InterruptedException {\n final ProductInner product = null;\n Response<ResponseBody> result = service.putNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()).execute();\n return client.getAzureClient().getPutOrPatchResult(result, new TypeToken<ProductInner>() { }.getType());\n }",
"public Integer create(Caseresultparameters newInstance) throws ServiceException;",
"public com.vodafone.global.er.decoupling.binding.request.ModifyTariffRequestType createModifyTariffRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifyTariffRequestTypeImpl();\n }",
"public java.lang.Integer ejbCreate(String templCd, String templDesc, String crcdReimbTypeCd, String currencyType, int cntRod, int cntPrepaid, int cntPoa, int cntOther, int disabTempl, int cntGrnd, int cntCod, int cntFtc)\n throws CreateException {\n setTemplCd(templCd);\n setTemplDesc(templDesc);\n setCrcdReimbTypeCd(crcdReimbTypeCd);\n setCurrencyType(currencyType);\n setCntRod(cntRod);\n setCntPrepaid(cntPrepaid);\n setCntPoa(cntPoa);\n setCntOther(cntOther);\n setDisabTempl(disabTempl);\n setCntGrnd(cntGrnd);\n return null;\n }",
"@Override\n\tpublic MaintenanceRequestTask createERSFeeLine(\n\t\t\tMaintenanceRequest mrq, String username) {\n\t\t\n\t\tList<String> listSupplierCodes = new ArrayList<String>();\n\t\tBigDecimal miscERSFee = new BigDecimal(0.00); \t\t\n\t\tMaintenanceRequestTask task;\n\t\tMaintenanceRequestTask newFeeTask = new MaintenanceRequestTask();\n\t\tString defaultMaintERSFeeCategoryCode = willowConfigService.getConfigValue(\"MAINT_ERS_CAT_CODE\");\n\t\tString defaultMaintERSFeeRechargeCode = willowConfigService.getConfigValue(\"MAINT_ERS_RECH_CODE\");\n\t\tString defaultMaintERSFeeCode = willowConfigService.getConfigValue(\"MAINT_ERS_FEE_CODE\");\t\t\n\t\tString defualtERSSupplierCodes = willowConfigService.getConfigValue(\"MAINT_ERS_VENDOR_CODE\");\n\t\tList<String> selectedRechargeFlagList = new ArrayList<String>(); \n\t\t\n\t\tLong maxLineNumber = nextMRTLineNumber(mrq);\n\t\t\n\t\tif(defualtERSSupplierCodes != null)\n\t\t{\n\t\t\tlistSupplierCodes = new ArrayList<String>(Arrays.asList(defualtERSSupplierCodes.split(\",\")));\n\t\t}\n\t\t\n\t\tfor(Iterator<MaintenanceRequestTask> iter = mrq.getMaintenanceRequestTasks().iterator(); iter.hasNext();){\n\t\t\ttask = (MaintenanceRequestTask)iter.next();\n\t\t\tif(!MALUtilities.isEmpty(task.getMaintCatCode()) && task.getMaintCatCode().equals(defaultMaintERSFeeCategoryCode) &&\n\t\t\t\t\ttask.getMaintenanceCode().getCode().equals(defaultMaintERSFeeCode)){\t\t\t\t\n\t\t\t\titer.remove();\n\t\t\t}\n\t\t\tif(!MALUtilities.isEmpty(task.getMaintCatCode()) && task.getMaintCatCode().equals(defaultMaintERSFeeCategoryCode)&&\n\t\t\t\t\t!task.getMaintenanceCode().getCode().equals(defaultMaintERSFeeCode) ){\n\t\t\t\tselectedRechargeFlagList.add(task.getRechargeFlag());\n\t\t\t}\n\t\t}\t\n\t\t\n\t\tmiscERSFee = calculateVehicleRentalFee(mrq);\n\t\t\n \tif(miscERSFee.compareTo(new BigDecimal(0.00)) != 0 && listSupplierCodes.contains(mrq.getServiceProvider().getServiceProviderNumber()) ){\t\n \t\tnewFeeTask.setMaintenanceRequest(mrq);\n \t\tnewFeeTask.setMaintCatCode(defaultMaintERSFeeCategoryCode);\n \t\tnewFeeTask.setMaintenanceCode(convertMaintenanceCode(defaultMaintERSFeeCode));\n \t\tnewFeeTask.setMaintenanceCodeDesc(convertMaintenanceCode(defaultMaintERSFeeCode).getDescription()); \n \t\tnewFeeTask.setWorkToBeDone(newFeeTask.getMaintenanceCodeDesc());\n \t\tnewFeeTask.setTaskQty(new BigDecimal(1));\n \t\tnewFeeTask.setUnitCost(new BigDecimal(0.00));\n \t\tnewFeeTask.setTotalCost(new BigDecimal(0.00));\n \t\tif(selectedRechargeFlagList!= null && selectedRechargeFlagList.size()>0){\n\t \t\tif(selectedRechargeFlagList.contains(\"Y\")){\n\t \t\t\tnewFeeTask.setRechargeFlag(MalConstants.FLAG_Y); \n\t \t\t}else{\n\t \t\t\tnewFeeTask.setRechargeFlag(MalConstants.FLAG_N);}\n \t\t}\n \t\tnewFeeTask.setRechargeCode(defaultMaintERSFeeRechargeCode);\n \t\tnewFeeTask.setRechargeQty(new BigDecimal(1));\n \t\tnewFeeTask.setRechargeUnitCost(miscERSFee);\n \t\tnewFeeTask.setRechargeTotalCost(newFeeTask.getRechargeUnitCost().multiply(newFeeTask.getRechargeQty()));\n \t\tnewFeeTask.setActualRechargeCost(newFeeTask.getRechargeTotalCost());\n \t\tnewFeeTask.setDiscountFlag(MalConstants.FLAG_N);\n \t\tnewFeeTask.setOutstanding(DataConstants.DEFAULT_N);\n \t\tnewFeeTask.setWasOutstanding(DataConstants.DEFAULT_N); \n \t\tnewFeeTask.setAuthorizePerson(username);\n \t\tnewFeeTask.setAuthorizeDate(Calendar.getInstance().getTime());\n \t\tnewFeeTask.setLineNumber(maxLineNumber+=1);\n \t}\t\n\n\t\treturn newFeeTask;\n\t}",
"public ContestPayment createContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n return null;\r\n }",
"public ContestPayment createContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n return null;\r\n }",
"public Object setInitialHoldings()\r\n/* */ {\r\n\t\t\t\tlogger.info (count++ + \" About to setInitialHoldings : \" + \"Agent\");\r\n/* 98 */ \tthis.profit = 0.0D;\r\n/* 99 */ \tthis.wealth = 0.0D;\r\n/* 100 */ \tthis.cash = this.initialcash;\r\n/* 101 */ \tthis.position = 0.0D;\r\n/* */ \r\n/* 103 */ return this;\r\n/* */ }",
"public CancerRisk() { this(\"None\", 1.0); }",
"private static void createRecipe(int code, String name, int quantity ) {\n\t\tString sqlTotalkcal=\"select sum(kcal) from ingredient where code in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\tString sqlTotalcarb=\"select sum(carbohidrates) from ingredient where code in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\tString sqlTotalProt=\"select sum(Proteines) from ingredient where code in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\tString sqlTotalFat=\"select sum(Fat) from ingredient where code in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\tString sqlTotalSalt=\"select sum(Salt) from ingredient where code in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\tString sqltotalAllergen=\"select codeAllergen from allergenxingredients where codeIngredient in (select code_ingredient from ingredientxrecipe where code_recipe=\"+code+\")\";\r\n\t\t\r\n\t\t//recuperar datos\r\n\t\t\r\n\t\ttry {\r\n\t\t\tdouble kcal = dataRecovery(sqlTotalkcal);\r\n\t\t\tdouble carb = dataRecovery(sqlTotalcarb);\r\n\t\t\tdouble prot = dataRecovery(sqlTotalProt);\r\n\t\t\tdouble fat = dataRecovery(sqlTotalFat);\r\n\t\t\tdouble salt = dataRecovery(sqlTotalSalt);\r\n\t\t\tString aler = dataRecoveryAllergenList(sqltotalAllergen);\r\n\t\t\tcreateRecipeData(code, name, quantity, kcal, carb, prot, fat, salt, aler);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Hubo un error al crear la receta\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public VoucherRedeemResult(long serialNumber) {\r\n\t\tthis.redeemVoucherResultStatus = ResultStatusCode.SUCCESS;\r\n\t\tthis.serialNumber = serialNumber;\r\n\t}",
"public String clerkRentVehicle(RentalsModel rentmodel, ReservationsModel reservemodel){\n\t\tString receipt = \"\";\n\n\t\ttry{\n\n\t\t\tint check = insertReservation(reservemodel);\t//Do a reservation first to check all the things such as carmodel etc...\n\t\t\tif (check == 0){\n\t\t\t\treturn \"sorry no cars available to rent\";\n\t\t\t}\n\n\n\t\t\tPreparedStatement ps = connection.prepareStatement(\"INSERT INTO rentals VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\");\n\n\t\t\t//VERY NOT SURE WHICH ONES ARE AVAIBLE ATM ESPECIALLY ODOMETER\n\t\t\tps.setInt(1,rentmodel.getRid());\n\t\t\tps.setString(2, rentmodel.getVlicense());\n\t\t\tps.setInt(3, rentmodel.getDlicense());\n\t\t\tps.setDate(4, rentmodel.getFromDate());\n\t\t\tps.setTime(5, rentmodel.getFromTime());\n\t\t\tps.setDate(6, rentmodel.getToDate());\n\t\t\tps.setTime(7, rentmodel.getToTime());\n\t\t\tps.setInt(8, rentmodel.getOdometer());\n\t\t\tps.setString(9, rentmodel.getCardName());\n\t\t\tps.setInt(10, rentmodel.getCardNo());\n\t\t\tps.setDate(11, rentmodel.getExpDate());\n\t\t\tps.setInt(12, rentmodel.getConfNo());\n\n\t\t\tps.executeUpdate();\n\t\t\tconnection.commit();\n\n\t\t\tps.close();\n\n\t\t\t//builds receipt string\n\t\t\treceipt = receipt + \"Confirmation Number: \" + rentmodel.getConfNo()\n\t\t\t\t\t + \"\\nReserve date: \" + java.time.LocalDateTime.now()\n\t\t\t\t\t\t\t + \"\\nType of car: \" + reservemodel.getVtname()\n\t\t\t\t\t + \"\\nAt: \" + \"\"//TODO location\n\t\t\t\t\t + \"\\nFrom \" + rentmodel.getFromDate() + \" To \" + rentmodel.getToDate()\n\t\t\t\t\t\t\t + \"\\n\" + rentmodel.getFromTime() + \" To \" + rentmodel.getToTime();\n\n\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(EXCEPTION_TAG + \" \" + e.getMessage());\n\t\t\trollbackConnection();\n\t\t}\n\n\t\treturn receipt;\n\n\n\t}",
"private String createReversalVoucher() throws ParseException {\n\n final String appConfigKey = \"GJV_FOR_RCPT_CHQ_DISHON\";\n final AppConfigValues appConfigValues = appConfigValuesService.getConfigValuesByModuleAndKey(\n FinancialConstants.MODULE_NAME_APPCONFIG, appConfigKey).get(0);\n appConfigValues.getValue();\n CVoucherHeader voucherHeader = null;\n // DishonoredEntriesDelegate delegat e = new DishonoredEntriesDelegate();\n\n // Create bank charges\n if (dishonorChequeView.getBankChargesAmt().compareTo(BigDecimal.ZERO) > 0)\n try {\n bankChargesReversalVoucher = createBankReversalVoucher();\n } catch (final HibernateException e) {\n LOGGER.error(e.getMessage(), e);\n final List<ValidationError> errors = new ArrayList<ValidationError>();\n errors.add(new ValidationError(\"exception\", e.getMessage()));\n throw new ValidationException(errors);\n } catch (final TaskFailedException e) {\n LOGGER.error(e.getMessage(), e);\n final List<ValidationError> errors = new ArrayList<ValidationError>();\n errors.add(new ValidationError(\"exception\", e.getMessage()));\n throw new ValidationException(errors);\n } catch (final SQLException e) {\n LOGGER.error(e.getMessage(), e);\n final List<ValidationError> errors = new ArrayList<ValidationError>();\n errors.add(new ValidationError(\"exception\", e.getMessage()));\n throw new ValidationException(errors);\n }\n // Create bank charges receipt reversal voucher\n if (null != dishonorChequeView.getOriginalVoucherHeader().getType()\n && dishonorChequeView.getOriginalVoucherHeader().getType().equalsIgnoreCase(RECEIPT)\n || JOURNAL_VOUCHER.equalsIgnoreCase(dishonorChequeView.getOriginalVoucherHeader().getType())) {\n if (LOGGER.isDebugEnabled())\n LOGGER.debug(\"CREATING RECEIPT Reversal >>>>>>>>>>\");\n\n voucherHeader = createVoucherHeader(FinancialConstants.STANDARD_VOUCHER_TYPE_JOURNAL,\n dishonorChequeView.getInstrumentDishonorReason());\n /*\n * //If reversal for receipt, then according to appconfig value get the prefix for voucher. if\n * (dishonorChequeView.getOriginalVoucherHeader().getType().equalsIgnoreCase(RECEIPT) &&\n * gjvForRcpt.equalsIgnoreCase(\"Y\")){ voucherHeader =\n * createVoucherHeader(FinancialConstants.STANDARD_VOUCHER_TYPE_JOURNAL\n * ,dishonorChequeView.getInstrumentDishonorReason()); } else { voucherHeader =\n * createVoucherHeader(FinancialConstants.\n * STANDARD_VOUCHER_TYPE_PAYMENT,dishonorChequeView.getInstrumentDishonorReason()); }\n */\n if (!(null == dishonorChequeView.getInstrumentDishonorReason() && dishonorChequeView.getInstrumentDishonorReason()\n .equals(\"\"))) {\n final String narration = \"Reversal Voucher Entry for receipt number \"\n + dishonorChequeView.getOriginalVoucherHeader().getVoucherNumber() +\n \", Cheque Number \" + dishonorChequeView.getInstrumentHeader().getInstrumentNumber() + \" Cheque Dated :\"\n + getFormattedDate(dishonorChequeView.getInstrumentHeader().getInstrumentDate());\n voucherHeader.setDescription(narration);\n } else\n voucherHeader.setDescription(dishonorChequeView.getInstrumentDishonorReason());\n final List<InstrumentHeader> instrument = instrumentService.addToInstrument(createInstruments(\"1\", getTotalAmount(),\n FinancialConstants.INSTRUMENT_TYPE_BANK_TO_BANK));\n instrument.get(0).setStatusId(getReconciledStatus());\n instrumentHeaderService.persist(instrument.get(0));\n // if(LOGGER.isInfoEnabled()) LOGGER.info(\"---------------------------\"+debitAmount.toString());\n instrumentService.updateInstrumentOtherDetailsStatus(instrument.get(0), dishonorChequeView.getTransactionDate(),\n getTotalAmount());\n voucherHeader.setName(\"Receipt Reversal\");\n // voucherHeader.setDescription(dishonorChequeView.getInstrumentDishonorReason());\n final HashMap<String, Object> headerDetails = createHeaderAndMisDetails(voucherHeader);\n paymentVoucher = createVoucher(voucherHeader, headerDetails, \"Receipt Reversal\");\n // String reversalVhIdValue = paymentVoucher.getId().toString();\n instrumentService.addToBankReconcilation(voucherHeader, instrument.get(0));\n updateInstrumentVoucherReference(instrument, paymentVoucher);\n\n }\n\n return \"view\";\n }",
"OwnDesire.Reasoning formOwnDesireWithReasoningCommand(DesireKey desireKey);",
"@Override\r\n\tpublic AbstractBoxGift createBoxGift() {\n\t\treturn new HardPlastic();\r\n\t}",
"public ConvectionMirage(){\n super(ID, COST, TYPE, RARITY, TARGET);\n block = baseBlock = 11;\n magicNumber = baseMagicNumber = 1;\n }",
"DenialReasonDto create(DenialReasonDto denialReason);",
"public Patron issueCard(String nameOfPatron){\n //Check whether the patron has already had a card!\n if (!this.patron.containsKey(nameOfPatron)){\n Patron newPatron = new Patron(nameOfPatron,this);\n this.patron.put(nameOfPatron, newPatron);\n this.println(\"OK! A card has beed issued to \"+ nameOfPatron);\n return newPatron;\n }\n else{\n this.println(\"No two cards! This Patron has already had a Library Card!!!\");\n return null;\n }\n\n }",
"private ManufactureProcess createNewManufactureProcess() {\n\t\tManufactureProcess result = null;\n\n\t\tif (workshop.getTotalProcessNumber() < workshop.getSupportingProcesses()) {\n\n\t\t\tint skillLevel = getEffectiveSkillLevel();\n\t\t\tint techLevel = workshop.getTechLevel();\n\n\t\t\t// Determine all manufacturing processes that are possible and profitable.\n\t\t\tMap<ManufactureProcessInfo, Double> processProbMap = new HashMap<ManufactureProcessInfo, Double>();\n\t\t\tIterator<ManufactureProcessInfo> i = ManufactureUtil\n\t\t\t\t\t.getManufactureProcessesForTechSkillLevel(techLevel, skillLevel).iterator();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tManufactureProcessInfo processInfo = i.next();\n\t\t\t\tif (ManufactureUtil.canProcessBeStarted(processInfo, workshop)) {\n\t\t\t\t\tdouble processValue = 0;\n\t\t\t\t\tif (person != null)\n\t\t\t\t\t\tprocessValue = ManufactureUtil.getManufactureProcessValue(processInfo, person.getSettlement());\n\t\t\t\t\telse if (robot != null)\n\t\t\t\t\t\tprocessValue = ManufactureUtil.getManufactureProcessValue(processInfo, robot.getSettlement());\n\n\t\t\t\t\tif (processValue > 0D) {\n\t\t\t\t\t\tprocessProbMap.put(processInfo, processValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Randomly choose among possible manufacturing processes based on their\n\t\t\t// relative profitability.\n\t\t\tManufactureProcessInfo chosenProcess = null;\n\t\t\tif (!processProbMap.isEmpty()) {\n\t\t\t\tchosenProcess = RandomUtil.getWeightedRandomObject(processProbMap);\n\t\t\t}\n\n\t\t\t// Create chosen manufacturing process.\n\t\t\tif (chosenProcess != null) {\n\t\t\t\tresult = new ManufactureProcess(chosenProcess, workshop);\n\t\t\t\tworkshop.addProcess(result);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}",
"public void setRepairTime(Date repairTime) {\n this.repairTime = repairTime;\n }",
"private void addToRent(){\r\n\r\n try{\r\n String description = fieldRent_Description.getText().trim();\r\n String man = fieldRent_Manufacturer.getText().trim();\r\n double rate = Double.parseDouble(fieldRent_dailyRate.getText().trim());\r\n\r\n HardwareDeviceToRent device = new HardwareDeviceToRent(rate, description, man);\r\n hardwares.add(device);\r\n\r\n JOptionPane.showMessageDialog(frame, \"Your hardware has been added.\", \"Information message\", (JOptionPane.INFORMATION_MESSAGE));\r\n\r\n\r\n }\r\n catch(NumberFormatException exc){\r\n\r\n JOptionPane.showMessageDialog(frame, \"Invalid Rate\", \"Error message\", (JOptionPane.ERROR_MESSAGE));\r\n\r\n }\r\n\r\n }",
"public static Scrivania create(\n\t\tautorizzazione.dir.mef.service.persistence.ScrivaniaPK scrivaniaPK) {\n\t\treturn getPersistence().create(scrivaniaPK);\n\t}",
"private MerchantRecipe createMerchantRecipe(ItemStack item, ItemStack sellingItem, ItemStack item2) {\r\n MerchantRecipe recipe = new MerchantRecipe(sellingItem, 10000);\r\n recipe.setExperienceReward(false);\r\n recipe.addIngredient(item);\r\n recipe.addIngredient(item2);\r\n return recipe;\r\n }",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundMonetaryRequestType createCustcareFullRefundMonetaryRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundMonetaryRequestTypeImpl();\n }",
"OwnDesire.Reasoning formOwnDesireWithReasoningCommand(DesireKey desireKey,\n DesireKey parentDesireKey,\n DesireParameters parentsDesireParameters);",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public JSONResponse set(HashMap<String, String> parameters) {\n\t\tString pos = parameters.get(\"pos\"); \t\t\t\t\t\t// the point of sale code.\n\t\tString reservationid = parameters.get(\"reservationid\");\t\t// the ID of the reservation.\n\t\tString arrivaltime = parameters.get(\"arrivaltime\"); \t\t// the email address of the payer.\n\t\tString departuretime = parameters.get(\"departuretime\"); \t// the departure time.\n\t\tString emailaddress = parameters.get(\"emailaddress\"); \t\t// the guest's emailaddress.\n\t\tString servicefrom = parameters.get(\"servicefrom\");\t\t\t// the preferred service time.\n\t\tString mobilephone = parameters.get(\"mobilephone\");\t\t\t// the guest's mobile phone number.\n\t\tString notes = parameters.get(\"notes\"); \t\t\t\t\t// the reservation notes.\n\t\tString termsaccepted = parameters.get(\"termsaccepted\");\t\t// reservation terms accepted\n\n\t\tif (pos == null || pos.isEmpty() || Model.decrypt(pos).length() > 10) {throw new ServiceException(Error.pos_invalid, pos);}\n\t\tif (reservationid == null || reservationid.isEmpty() || reservationid.length() > 10) {throw new ServiceException(Error.reservation_id, reservationid);}\n//\t\tif (emailaddress == null || emailaddress.isEmpty() || !Party.isEmailAddress(emailaddress)) {throw new ServiceException(Error.party_emailaddress, emailaddress);}\n\n\t\tSqlSession sqlSession = RazorServer.openSession();\n\t\tPayWidgetItem result = new PayWidgetItem();\n\t\ttry {\n\t\t\tParty agent = JSONService.getParty(sqlSession, pos);\n\t\t\tReservation reservation = sqlSession.getMapper(ReservationMapper.class).read(reservationid);\n//\t\t\tParty customer = sqlSession.getMapper(PartyMapper.class).read(reservation.getCustomerid());\n\t\t\treservation.setArrivaltime(arrivaltime);\n\t\t\treservation.setDeparturetime(departuretime);\n\t\t\treservation.setServicefrom(servicefrom);\n\t\t\treservation.setTermsaccepted(termsaccepted == null ? null : Boolean.valueOf(termsaccepted));\n\t\t\treservation.setNotes(notes);\n\t\t\tsqlSession.getMapper(ReservationMapper.class).update(reservation);\n\t\t\tMonitorService.update(sqlSession, Data.Origin.JQUERY, NameId.Type.Reservation, reservation);\n\t\t\tsqlSession.commit();\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tresult.setId(null);\n\t\t\tresult.setName(null);\n\t\t\tresult.setState(RazorWidget.State.FAILURE.name());\n\t\t\tresult.setCurrency(Currency.Code.USD.name());\n\t\t\tresult.setMessage(x.getMessage());\n\t\t}\n\t\tfinally {sqlSession.close();}\n\t\treturn result;\n\t}",
"public Pit initializePit(int pitId) {\n Pit pit = new Pit();\n pit.setPitId(pitId);\n if (pitId <= P1_STORE_PIT) {\n pit.setOwner(new Player(Player.PlayerId.PLAYER_ONE, P1_STORE_PIT));\n if (pitId < P1_STORE_PIT) {\n pit.setNumberOfStones(BEGINNING_STONE_AMOUNT);\n pit.setPitType(PitType.NORMAL);\n } else {\n pit.setNumberOfStones(0);\n pit.setPitType(PitType.STORE);\n }\n } else {\n pit.setOwner(new Player(Player.PlayerId.PLAYER_TWO, P2_STORE_PIT));\n if (pitId < P2_STORE_PIT) {\n pit.setNumberOfStones(BEGINNING_STONE_AMOUNT);\n pit.setPitType(PitType.NORMAL);\n } else {\n pit.setNumberOfStones(0);\n pit.setPitType(PitType.STORE);\n }\n }\n return pit;\n }",
"public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Chassis createChassis();",
"public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundDiscountRequest createCustcareFullRefundDiscountRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundDiscountRequestImpl();\n }",
"public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }",
"public TransactionResponse sell() {\r\n \t\ttry {\r\n \t\t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tint id = hyperObject.getId();\r\n \t\t\tint data = hyperObject.getData();\r\n \t\t\tString name = hyperObject.getName();\r\n \t\t\tif (giveInventory == null) {\r\n \t\t\t\tgiveInventory = hp.getPlayer().getInventory();\r\n \t\t\t}\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tif (id >= 0) {\r\n \t\t\t\t\tint totalitems = im.countItems(id, data, giveInventory);\r\n \t\t\t\t\tif (totalitems < amount) {\r\n \t\t\t\t\t\tboolean sellRemaining = hc.getYaml().getConfig().getBoolean(\"config.sell-remaining-if-less-than-requested-amount\");\r\n \t\t\t\t\t\tif (sellRemaining) {\r\n \t\t\t\t\t\t\tamount = totalitems;\r\n \t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (amount > 0) {\r\n \t\t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tboolean isstatic = false;\r\n \t\t\t\t\t\t\tboolean isinitial = false;\r\n \t\t\t\t\t\t\tisinitial = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\t\tisstatic = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\tif ((amount > maxi) && !isstatic && isinitial) {\r\n \t\t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tim.removeItems(id, data, amount, giveInventory);\r\n \t\t\t\t\t\t\t\tdouble shopstock = 0;\r\n \t\t\t\t\t\t\t\tshopstock = hyperObject.getStock();\r\n \t\t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setStock(shopstock + amount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), name, calc.twoDecimals(salestax)), price - salestax, hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", name, (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(name, null, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t\treturn response;\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), hyperObject.getStock(), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"CANNOT_BE_SOLD_WITH\"), name), hyperObject);\r\n \t\t\t\t\treturn response;\t\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), name), hyperObject);\r\n \t\t\t\treturn response;\t\r\n \t\t\t}\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sell() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', id='\" + hyperObject.getId() + \"', data='\" + hyperObject.getData() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}",
"public void createInventoryReward() {\n if (inventoryEntityToRetrieve == null) {\n try {\n inventoryEntityToRetrieve = RandomBenefitModel.getInventoryRewards(application, encounter, characterVM.getDistance());\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }",
"SpaceInvaderTest_test_VaisseauImmobile_DeplacerVaisseauVersLaDroite createSpaceInvaderTest_test_VaisseauImmobile_DeplacerVaisseauVersLaDroite();",
"public RecoveryInfo generateRecoveryCode() throws GenericCryptoException, CryptoProviderException, InvalidKeyException {\n final SecretKey secretKey = keyGenerator.generateRandomSecretKey();\n return generateRecoveryCode(secretKey, 1, false);\n }",
"Object CreateRateheightlockruleForDeploy(String fromPubkey, String prikey, String assetHash, BigDecimal onetimedepositmultiple, int withdrawperiodheight, String withdrawrate, String dest, boolean isSend, Node node);",
"public com.vodafone.global.er.decoupling.binding.request.GetBasePricesRequest createGetBasePricesRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetBasePricesRequestImpl();\n }",
"public void newFund(int year, int order, long yourCoins, long partnerCoins) {\n /* Do nothing */\n }",
"void createMaterial(Material material) throws CreateException;",
"public static ItemStack createItemStack()\r\n \t{\r\n \t\treturn new ItemStack(0);\r\n \t}",
"public MiniSquirrel createMiniSquirrel(int energy) {\n if (this.getEnergy() <= energy) {\n System.out.println(\"Gewünschte Energie für das MiniSquirrel ist zu groß\");\n return null;\n }\n\n MiniSquirrel miniSquirrel = new MiniSquirrel(this.getId(), this.getPos().getX(), this.getPos().getY());\n miniSquirrel.updateEnergy(-(1000 - energy));\n return miniSquirrel;\n }",
"public com.vodafone.global.er.decoupling.binding.request.RatePackageRequestType createRatePackageRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RatePackageRequestTypeImpl();\n }",
"protected Workman(String name, double salary, String department, double experience, int shiftsAmount) {\n super(name, salary, department, experience);\n if(salary < 0 || experience < 0 || shiftsAmount < 0) {\n throw new IllegalArgumentException();\n }\n this.shiftsAmount = shiftsAmount;\n }",
"public com.vodafone.global.er.decoupling.binding.request.RefundMonetaryRequestType createRefundMonetaryRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundMonetaryRequestTypeImpl();\n }",
"public com.vodafone.global.er.decoupling.binding.request.ModifyPrepayFlag createModifyPrepayFlag()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.ModifyPrepayFlagImpl();\n }",
"public void createESECard(String farmerId, String farmerCardId, Date txnTime, int type);",
"void setNumberPaymentReceipt(int nRicevuta);",
"@RequestMapping(value = \"createEWalletPayment\", method = RequestMethod.POST)\n public Invoice addEWalletPayment(@RequestParam(value = \"jobIdList\") ArrayList<Integer> jobIdList,\n @RequestParam(value = \"jobseekerId\") int jobseekerId,\n @RequestParam(value = \"referralCode\") String referralCode) {\n Invoice invoice = null;\n ArrayList<Job> jobs = new ArrayList<>();\n for (Integer integer : jobIdList) {\n jobs.add(DatabaseJobPostgre.getJobById(integer));\n }\n try {\n invoice = new EwalletPayment(DatabaseInvoicePostgre.getLastId() + 1, jobs, DatabaseJobseekerPostgre.getJobseekerById(jobseekerId), DatabaseBonusPostgre.getBonusByReferralCode(referralCode));\n invoice.setTotalFee();\n } catch (Exception e) {\n e.printStackTrace();\n }\n boolean status = false;\n try {\n status = DatabaseInvoicePostgre.insertInvoice(invoice);\n } catch (OngoingInvoiceAlreadyExistsException e) {\n e.printStackTrace();\n }\n if (status) {\n return invoice;\n } else {\n return null;\n }\n }",
"protected abstract T create(final double idealStartTime);",
"public Builder setReault(\n int index, com.lesen.rpc.protobuf.LesenRPCProto.LesenRPCResult value) {\n if (reaultBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureReaultIsMutable();\n reault_.set(index, value);\n onChanged();\n } else {\n reaultBuilder_.setMessage(index, value);\n }\n return this;\n }",
"SpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche();",
"public com.vodafone.global.er.decoupling.binding.request.CustcareFullRefundCreditRequest createCustcareFullRefundCreditRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustcareFullRefundCreditRequestImpl();\n }",
"public com.vodafone.global.er.decoupling.binding.request.GetNextPaymentAmountRequest createGetNextPaymentAmountRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetNextPaymentAmountRequestImpl();\n }",
"public Receipt(Purchase p) {\r\n this.purch=p;\r\n totalPurch=0;\r\n totalDisc=0;\r\n \r\n db= new FakeDataBase();\r\n c= new Customer(db.getCustomerDbItem(purch.getCustIdx()));\r\n //System.out.println(c.toString());\r\n lineItem = new LineItem[0];\r\n generateLineItems();\r\n }",
"@Action\r\n public String proceed() {\n ServiceFunctions.clearCache();\r\n\r\n // Validation in the controller, because custom validators\r\n // for the complex UI would be an overhead\r\n\r\n // If nothing is chosen, return to the results page\r\n if (selectedEntry == null) {\r\n addError(\"mustSelectEntry\");\r\n return null;\r\n }\r\n\r\n if (TWO_WAY.equals(travelType) && selectedReturnEntry == null) {\r\n addError(\"mustSelectReturnEntry\");\r\n return null;\r\n }\r\n\r\n // Creating many ticket instances\r\n List<Seat> selectedSeats = seatController.getSeatHandler()\r\n .getSelectedSeats();\r\n List<Seat> selectedReturnSeats = null;\r\n\r\n if (seatController.getReturnSeatHandler() != null) {\r\n selectedReturnSeats = seatController.getReturnSeatHandler()\r\n .getSelectedSeats();\r\n }\r\n\r\n try {\r\n ticket = getTicketToAlter();\r\n if (ticket == null) {\r\n ticket = ticketService.createTicket(selectedEntry, selectedReturnEntry,\r\n ticketCountsHolder, selectedSeats, selectedReturnSeats);\r\n } else {\r\n\r\n ticketService.alterTicket(ticket, selectedEntry, selectedReturnEntry,\r\n ticketCountsHolder, selectedSeats, selectedReturnSeats);\r\n\r\n if (ticket.getAlterationPriceDifference().compareTo(BigDecimal.ZERO) < 0) {\r\n addMessage(\"priceDiffereceIsSubstracted\");\r\n }\r\n }\r\n } catch (TicketCreationException ex) {\r\n addError(ex.getMessageKey(), ex.getArguments());\r\n if (ex.isRedoSearch()) {\r\n return search();\r\n }\r\n return null;\r\n }\r\n\r\n purchaseController.getTickets().add(ticket);\r\n\r\n // If the user is staff-member, i.e. this is admin panel,\r\n // set the customer name, and mark the tickets as sold\r\n User user = loggedUserHolder.getLoggedUser();\r\n if (user != null && user.isStaff() && isAdmin()) {\r\n ticket.setCustomerInformation(new Customer());\r\n ticket.getCustomerInformation().setName(customerName);\r\n // setting to empty values in order to bypass validation on cascade\r\n ticket.getCustomerInformation().setEmail(\"\");\r\n ticket.getCustomerInformation().setContactPhone(\"\");\r\n\r\n purchaseController.finalizePurchase(user);\r\n // redo the search\r\n adminSearch();\r\n return null; // returning null, because the action is\r\n // called from modal window with ajax\r\n }\r\n\r\n if (ticket.isAltered() && ticket.getAlterationPriceDifference().compareTo(BigDecimal.ZERO) == 0) {\r\n purchaseController.finalizePurchase(user);\r\n return navigateToSearch();\r\n }\r\n\r\n // before redirecting to the payments page, reset the selections\r\n // in order to have a fresh page if a back button is pressed\r\n resetSelectionsPartial();\r\n purchaseController.setCurrentStep(Step.PAYMENT);\r\n return Screen.PAYMENT_SCREEN.getOutcome();\r\n\r\n }",
"private static List<Integer> packDPInit(PackageDTO packageDTO) {\n // Declare the table dynamically\n Integer itemsSize = packageDTO.getItems().size();\n Integer capacityGrams = packageDTO.getCapacity() * GRAMS_IN_KILO;\n Integer mem[][] = new Integer[itemsSize + 1][capacityGrams + 1];\n\n //I need to re-instance my list as an Integer List to use The values on my memoization structure\n List<Integer> weights = new ArrayList<>();\n for(ItemDTO item : packageDTO.getItems()){\n Double weightGrams = item.getWeight() * GRAMS_IN_KILO;\n weights.add(weightGrams.intValue());\n }\n\n // Loop to initially filled the\n // table with -1\n for(int i = 0; i < itemsSize + 1; i++)\n for(int j = 0; j < capacityGrams + 1; j++)\n mem[i][j] = -1;\n\n List<Integer> optimalChoice = new ArrayList<>();\n packDPRec(capacityGrams, weights, packageDTO.getItems(), weights.size(), mem, optimalChoice);\n return optimalChoice;\n }",
"void create(Product product) throws IllegalArgumentException;",
"@Override\r\n\tpublic void pickUpRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot pick up the repair kit.\");\r\n\t\t}\r\n\t}",
"Document newWithdrawal(String reason, String expenseCategory,\n double amount, String effectiveDate);",
"public Inventory(String kodeWh,String kodeProd,double hargaProd,int jumlahProd){\n this.kodeWh=kodeWh;\n this.kodeProd=kodeProd;\n this.hargaProd=hargaProd;\n this.jumlahProd=jumlahProd;\n }",
"public TransactionReceipt makeDeposit(TransactionTicket transactionTicket) throws InvalidAccountException, InvalidAmountException, AccountClosedException {\r\n try {\r\n //searches for the account\r\n int index = Bank.findAcct(transactionTicket.getAcctNumber());\r\n if (index == -1) {\r\n throw new InvalidAccountException(transactionTicket.getAcctNumber());\r\n } else if (transactionTicket.getAmountOfTransaction() < 0) {\r\n throw new InvalidAmountException(transactionTicket.getAmountOfTransaction());\r\n } else if (this.getAccountStatus().equals(\"Closed\")) {\r\n throw new AccountClosedException(transactionTicket.getAcctNumber());\r\n } else {\r\n //adds the transaction amount\r\n return new TransactionReceipt(transactionTicket, true, null, getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPreTransactionBalance() + transactionTicket.getAmountOfTransaction(), null);\r\n }\r\n } catch (InvalidAccountException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPostTransactionBalance(), null);\r\n } catch (InvalidAmountException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPostTransactionBalance(), null);\r\n } catch (AccountClosedException ex) {\r\n return new TransactionReceipt(transactionTicket, false, ex.getMessage(), getBalance(transactionTicket).getPreTransactionBalance(), getBalance(transactionTicket).getPostTransactionBalance(), null);\r\n }\r\n }",
"RentalObject createRentalObject();",
"public com.vodafone.global.er.decoupling.binding.request.RefundCreditRequest createRefundCreditRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.RefundCreditRequestImpl();\n }"
] | [
"0.49994195",
"0.48074654",
"0.4782288",
"0.46757942",
"0.46541268",
"0.4648134",
"0.46117812",
"0.46050376",
"0.45789245",
"0.45406353",
"0.45313743",
"0.44942814",
"0.44882238",
"0.44655895",
"0.44634506",
"0.44547653",
"0.4446816",
"0.44373393",
"0.4428319",
"0.44177356",
"0.44166738",
"0.4413878",
"0.4412772",
"0.43900234",
"0.43734604",
"0.4367477",
"0.43667015",
"0.4347553",
"0.43398568",
"0.43325424",
"0.4331787",
"0.43255258",
"0.43107244",
"0.4309947",
"0.43057266",
"0.42999905",
"0.42893758",
"0.42759612",
"0.42745978",
"0.42714208",
"0.4261578",
"0.42600125",
"0.42600125",
"0.4259668",
"0.42419943",
"0.4238049",
"0.42230457",
"0.42144608",
"0.42093635",
"0.4201163",
"0.42005518",
"0.41934747",
"0.41883177",
"0.41869086",
"0.41854188",
"0.41832525",
"0.41772267",
"0.4175495",
"0.41749278",
"0.41714454",
"0.41485283",
"0.41480616",
"0.4147385",
"0.41419387",
"0.41355866",
"0.4135145",
"0.41319397",
"0.41263315",
"0.41259128",
"0.41256613",
"0.41218525",
"0.41210473",
"0.41164836",
"0.41094893",
"0.41085485",
"0.4105592",
"0.4104923",
"0.410465",
"0.41032147",
"0.40957516",
"0.4095292",
"0.40905166",
"0.40818155",
"0.40802628",
"0.40749946",
"0.40743554",
"0.40728006",
"0.40681648",
"0.40680608",
"0.40676326",
"0.40664643",
"0.40664023",
"0.40658277",
"0.4063785",
"0.40595138",
"0.40587392",
"0.40536028",
"0.4050496",
"0.40502796",
"0.40485546"
] | 0.68017024 | 0 |
Put repairKit at position (x, y) on board (if possible). | @Override
public void putRepairKit(Board board, long x, long y, RepairKit repairKit)
{
try
{
repairKit.setPosition(new Position(x,y));
repairKit.setBoard(board);
}
catch(IllegalStateException exc)
{
System.out.println("Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.");
}
catch(IllegalPositionException exc)
{
System.out.println("This is not a valid position on the board to place an element.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }",
"public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}",
"public abstract Piece setLocation(int row, int column);",
"public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}",
"public void putPiece(Piece piece, int x, int y)\r\n {\r\n if(isValidSqr(x, y))\r\n {\r\n board[x][y] = piece;\r\n if(piece != null) piece.setLocation(x, y);\r\n }\r\n }",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }",
"public void place(Chip chip, int row, int column) {\n ImmutablePair<Integer, Integer> from = new ImmutablePair<Integer, Integer>(row, column);\n // Step 2. Generating appropriate processing event\n PlaceChipAction action = new PlaceChipAction(getPlayer(), chip, from);\n // Step 3. Actually performing action\n perform(action);\n }",
"public void place(Piece p, int x, int y) {\n\t\tif (x >= 8 || y >= 8 || p == null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (pieceAt(x, y) != null) {\n\t\t\t\tremove(x, y);\n\t\t\t}\n\t\t\tb[x][y] = p;\n\t\t\tif (p.isFire()) {\n\t\t\t\tnumFire += 1;\n\t\t\t} else {\n\t\t\t\tnumWater += 1;\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void putSurpriseBox(Board board, long x, long y, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tsurpriseBox.setPosition(new Position(x,y));\r\n\t\t\tsurpriseBox.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this surprise box or this board is terminated; the surprise box cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }",
"public void putInCell (int x, int y, Sprite object){\n\t\tif (object instanceof Tile) {\n\t\t\tgameMap[x][y].setTile((Tile)object);\n\t\t\treturn;\n\t\t}\n\t\telse if(gameMap[x][y].getTile() instanceof Target && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\tdecrementOnTarget();\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\tincrementOnTarget();\n\t\t\t}\n\t\t}\n\t\telse if (gameMap[x][y].getTile() instanceof Switch && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t}\n\t\tgameMap[x][y].setObject((GameObject)object);\n\t}",
"public abstract ChessPiece attack(int newXPosition, int newYPosition, PiecePosition position) throws BoardException;",
"@Test\n void RookMoveToFriendlyOccupied() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 4, 3, 1);\n Piece rook2 = new Rook(board, 4, 6, 1);\n\n board.getBoard()[4][3] = rook1;\n board.getBoard()[4][6] = rook2;\n\n board.movePiece(rook1, 4, 6);\n\n Assertions.assertEquals(rook1, board.getBoard()[4][3]);\n Assertions.assertEquals(rook2, board.getBoard()[4][6]);\n }",
"private void prepareBoard(){\n gameBoard.arrangeShips();\n }",
"public static void placeShipVertMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length - (ship.getLength() - 1) || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n if (!board[r][indexC].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n r = indexR - 1;\r\n }\r\n }\r\n for (int r = indexR; r < indexR + ship.getLength(); r++) {\r\n board[r][indexC] = symbol;\r\n } \r\n \r\n }",
"public void setTile(int x, int y) {\n/* 748 */ this.e.setTile(x, y);\n/* 749 */ this.k = getTileIdx();\n/* */ \n/* */ \n/* 752 */ String str = (String)this.f.f(this.k);\n/* 753 */ if (str.equals(\"none\")) {\n/* 754 */ this.h = 0;\n/* */ }\n/* 756 */ else if (str.equals(\"rct\")) {\n/* 757 */ this.h = 1;\n/* 758 */ c();\n/* */ }\n/* 760 */ else if (str.equals(\"ict\")) {\n/* 761 */ this.h = 2;\n/* 762 */ d();\n/* */ } else {\n/* */ \n/* 765 */ throw new IllegalArgumentException(\"Component transformation not recognized\");\n/* */ } \n/* */ }",
"public static void placeShipHorzMan(String[][] board, Ship ship, String symbol, int x, int y) {\r\n int indexC = x; //limited to length - 1\r\n while (indexC >= board[0].length - (ship.getLength() - 1) || indexC < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n }\r\n \r\n int indexR = y;\r\n while (indexR >= board.length || indexR < 0) {\r\n System.out.println(\"\\nThere is an out of bounds.\");\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n }\r\n\r\n\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n if (!board[indexR][c].equals(\" * \")) {\r\n System.out.println(\"Coordinates caused overlap.\");\r\n System.out.print(\"Pick a new x-coordinate: \");\r\n indexC = scan.nextInt();\r\n System.out.print(\"Pick a new y-coordinate: \");\r\n indexR = scan.nextInt();\r\n \r\n c = indexC - 1;\r\n }\r\n }\r\n for (int c = indexC; c < indexC + ship.getLength(); c++) {\r\n board[indexR][c] = symbol;\r\n } \r\n }",
"private void setFixedTile(FixedTile tile, int x, int y) {\r\n\t\tGridSquare.Type type = tile.getType();\r\n\t\tfor(int i = x; i < x+3; i++) {\r\n\t\t\tfor(int j = y; j < y+3; j++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(type) , i, j);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }",
"public static void placePlayerPiece(PlayerMovesHandler player) {\n\t\t// char piece = player.getPiece();\n\t\tScanner in = new Scanner(System.in);\n\t\tboolean invalidInput = true;\n\n\t\twhile (invalidInput) {\n\t\t\tSystem.out.println(\"Enter row and column no. where you want to place your mark (Top left is [1,1])\");\n\n\t\t\tint row = in.nextInt() - 1;\n\t\t\tint col = in.nextInt() - 1;\n\t\t\tinvalidInput = !(player.setPiece(row, col));\t// callee returns true if success \n\t\t}\n\t}",
"protected abstract void position(int[][] gameboard, int col, int row);",
"void prepareBoardBeforePlacement( Board board );",
"public abstract void move(int newXPosition, int newYPosition, PiecePosition position) throws BoardException;",
"public void CaptuePiece(int i , int j , int k , int l){\r\n if(GameBoard.get(i,j).getColour() != GameBoard.get(k,l).getColour()){\r\n pos.setPosition(k,l);\r\n GameBoard.get(i,j).capture(pos);\r\n GameBoard.get(k,l).captured();\r\n \r\n\r\n //We need a method to null the (k,l) cell in GameBoard\r\n pos.setPosition(k,l);\r\n GameBoard.setNull(pos);\r\n GameBoard.get(i,j).move(pos); //to move the killer in new cell\r\n\r\n\r\n\r\n }\r\n }",
"private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}",
"void placePowerStation() {\n this.board.get(powerRow).get(powerCol).placePowerStation();\n }",
"public void movePiece(int xStart, int yStart, int xEnd, int yEnd) {\n board[xEnd][yEnd] = board[xStart][yStart];\n board[xStart][yStart] = null;\n board[xEnd][yEnd].moveTo(xEnd, yEnd);\n if (board[xEnd][yEnd] instanceof ChessPieceKing) {\n if (board[xEnd][yEnd].isBlack()) {\n locationBlackKing = new Point(xEnd, yEnd);\n } else {\n locationWhiteKing = new Point(xEnd, yEnd);\n }\n }\n\n drawScreen();\n }",
"private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }",
"public void pushCell(int x, int y) {\n\n if (fieldManager.isCellMined(x, y)) {\n fieldInerface.putLethalMineToButton(x, y);\n death(x, y);\n return;\n }\n\n fieldManager.openCell(x, y);\n fieldInerface.putEnvToButton(x, y, (int) fieldManager.getEnv(x, y));\n if (fieldManager.getEnv(x, y) == 0)\n for (int i = x - 1; i < x + 2; i++)\n for (int j = y - 1; j < y + 2; j++)\n if ((i >= 0) && (i < widthOfField) && (j >= 0)\n && (j < heightOfField))\n if (fieldManager.isCellOpenable(i, j))\n pushCell(i, j);\n }",
"@Override\r\n\tpublic void putRobot(Board board, long x, long y, Robot robot)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.setPosition(new Position(x,y));\r\n\t\t\trobot.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this board is terminated; the robot cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }",
"private void process(int x, int y, int val){\n\t\t//if topology at position x,y is not explored\n\t\t// enqueue the cell\n\t\t// and give the cell a new score\n\t\tif(topology[x][y]==-1){\n\t\t\tqCells.enQueue(new Point(x,y));\n\t\t\ttopology[x][y] = val +1;\n\t\t}\n\t}",
"void positionToStart () {\n currentRow = 0 - currentPiece.getOffset();\n currentColumn = board.columns / 2 - currentPiece.width / 2;\n }",
"public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }",
"private void setOnBoard(Ship currentShip) {\n\t\tchar letter;\n\t\tboolean validInput = false;\n\t\tint letterValue;\n\t\tint num;\n\t\tString coord;\n\t\tString orient;\n//\t\tString[][] backup = radar.clone();\n\t\tString[][] loopBackup = new String[10][10];\n\t\t//System.out.println(\"loop backup: \" + loopBackup.toString());\n\t\t\n\t\twhile(!validInput) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(this);\n\t\t\t\tSystem.out.println(\"Where would you like the \" + currentShip.getShipType() + \" of size \" + currentShip.getSize() + \"?\");\n\t\t\t\tSystem.out.println(\"Give a coordinate. Ex: A2, F6, d9, etc...\");\n\t\t\t\tSystem.out.println(\">\");\n\t\t\t\tcoord = input.nextLine();\n\t\t\t\tSystem.out.println(\"Would you like to set it vertical (V) or horizontal (H)?\");\n\t\t\t\tSystem.out.println(\"(input V or H for the respective orientation, lowercase is fine)\");\n\t\t\t\tSystem.out.println(\">\");\n\t\t\t\t\n\t\t\t\twhile(!validInput) {\n\t\t\t\t\torient = input.nextLine();\n\t\t\t\t\t\n\t\t\t\t\tletter = coord.toUpperCase().charAt(0);\n\t\t\t\t\tletterValue = (int) letter;\n\t\t\t\t\tletterValue -= 65;\n\t\t\t\t\tnum = Integer.parseInt(coord.substring(1));\n\t\t\t\t\tnum -= 1;\n\t\t\t\t\tString tempCoor;\n\t\t\t\t\tloopBackup = backup(radar);\n\t\t\t\t\t\n\t\t\t\t\tif(orient.toUpperCase().equals(\"H\")) {\n\t\t\t\t\t\tfor(int i = 0; i <= currentShip.getSize() - 1; i++) {\n\t\t\t\t\t\t\tif(radar[letterValue][num].equals(\"X \"))\n\t\t\t\t\t\t\t\tradar[100][0].toString();\n\t\t\t\t\t\t\ttempCoor = radar[letterValue][num];\n\t\t\t\t\t\t\tcurrentShip.addCoordinate(tempCoor);\n\t\t\t\t\t\t\tradar[letterValue][num] = \"X \";\n\n\t\t\t\t\t\t\tnum++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidInput = true;\n\t\t\t\t\t\t//loopBackup = radar.clone();\n\t\t\t\t\t} else if(orient.toUpperCase().equals(\"V\")){\n\t\t\t\t\t\tfor(int i = 0; i <= currentShip.getSize() - 1; i++) {\n\t\t\t\t\t\t\tif(radar[letterValue][num].equals(\"X \"))\n\t\t\t\t\t\t\t\tradar[100][0].toString();\n\t\t\t\t\t\t\ttempCoor = radar[letterValue][num];\n\t\t\t\t\t\t\tcurrentShip.addCoordinate(tempCoor);\n\t\t\t\t\t\t\tradar[letterValue][num] = \"X \";\n\n\t\t\t\t\t\t\tletterValue++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidInput = true;\n\t\t\t\t\t\t//loopBackup = radar.clone();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Ship is out of bounds. Try again.\");\n\t\t\t\tcurrentShip.getCoordinates().clear();\n\t\t\t\tradar = backup(loopBackup);\n\t\t\t}\n\t\t}\n\n\t\t\n\t}",
"public void putCellInGoodPlace(JmtCell cell, int x, int y, boolean flag) {\n \t\tif (sp > 9) {\r\n \t\t\tsp = 0;\r\n \t\t}\r\n \t\tint oldPointX = 0;\r\n \t\tint oldPointY = 0;\r\n \t\tboolean inGroup = false;\r\n \t\t// Il flag stato creato per capire sapere se e' una block regione e\r\n \t\t// quindi utilizzare\r\n \t\t// il vecchio metodo oppure se e' una cella quindi flag=true allora uso\r\n \t\t// il nuovo\r\n \t\t// System.out.println(\"------------PUT CELL IN GOOD PLACE\r\n \t\t// ----------------------\");\r\n \r\n \t\tif (flag) {\r\n \t\t\tRectangle bounds = GraphConstants.getBounds(cell.getAttributes()).getBounds();\r\n \t\t\tRectangle bounds2 = new Rectangle((int) bounds.getX() - 20, (int) bounds.getY(), (int) bounds.getWidth() + 38, (int) bounds.getHeight());\r\n \r\n \t\t\toldPointX = x;\r\n \t\t\toldPointY = y;\r\n \t\t\t// ---------inzio\r\n \t\t\t// Object[] cells=(graph).getDescendants(graph.getRoots());\r\n \t\t\t// for(int j=0;j<cells.length;j++){\r\n \t\t\t// if((cells[j] instanceof JmtCell) &&(cells[j]!=cell)){\r\n \t\t\t// Rectangle\r\n \t\t\t// boundcell=GraphConstants.getBounds(((JmtCell)cells[j]).getAttributes()).getBounds();\r\n \t\t\t// if(boundcell.intersects(bounds2)){\r\n \t\t\t// System.out.println(\"true\");\r\n \t\t\t// }\r\n \t\t\t// }\r\n \t\t\t// }\r\n \r\n \t\t\t// ---------------fine\r\n \t\t\t// check if a cell isInGroup\r\n \t\t\tif (isInGroup(cell)) {\r\n \r\n \t\t\t\tinGroup = true;\r\n \t\t\t}\r\n \r\n \t\t\t// Avoids negative starting point\r\n \t\t\tif (bounds.getX() < 20) {\r\n \t\t\t\tbounds.setLocation(20, (int) bounds.getY());\r\n \t\t\t}\r\n \t\t\tif (bounds.getY() < 0) {\r\n \t\t\t\tbounds.setLocation((int) bounds.getX(), 0);\r\n \t\t\t}\r\n \r\n \t\t\t// Qua ho le celle e archi che intersecano la mia cella\r\n \t\t\t// selezionata..bounds (molto efficente dal punto di vista della\r\n \t\t\t// pesantezza)\r\n \t\t\tObject[] overlapping = graph.getDescendants(graph.getRoots(bounds2));\r\n \r\n \t\t\tPoint2D zero = new Point(20, 0);\r\n \t\t\tresetOverLapping = 0;\r\n \t\t\twhile (overlapping.length > 0) {\r\n \r\n \t\t\t\t// Moves bounds until it doesn't overlap with anything\r\n \t\t\t\tPoint2D last = (Point2D) zero.clone();\r\n \t\t\t\tfor (int j = 0; j < overlapping.length; j++) {\r\n \r\n \t\t\t\t\tresetOverLapping++;\r\n \t\t\t\t\t// resetOverLapping is inserted for an anormall behavior of\r\n \t\t\t\t\t// Tool\r\n \t\t\t\t\t// in fact, if you disable this variable you can see that\r\n \t\t\t\t\t// the tools\r\n \t\t\t\t\t// stop and \"for cycle\" will be repeated infinite times\r\n \t\t\t\t\tif (resetOverLapping > 50) {\r\n \t\t\t\t\t\tbounds.setLocation(new Point(oldPointX, oldPointY));\r\n \t\t\t\t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \t\t\t\t\t\tresetOverLapping = 0;\r\n \t\t\t\t\t\treturn;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// System.out.println(\"---flag in for---\");\r\n \t\t\t\t\t// if(overlapping[j] instanceof JmtEdge\r\n \t\t\t\t\t// &&((JmtEdge)overlapping[j]).intersects((EdgeView)(graph.getGraphLayoutCache()).getMapping(overlapping[j],\r\n \t\t\t\t\t// false),\r\n \t\t\t\t\t// GraphConstants.getBounds(((JmtCell)cell).getAttributes())))\r\n \t\t\t\t\t// System.out.println(\"Intersect TRUE\");\r\n \r\n \t\t\t\t\t// Puts last to last corner of overlapping cells\r\n \t\t\t\t\tif (overlapping[j] instanceof JmtCell && overlapping[j] != cell && inGroup) {\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\tif (b2.getMaxX() > last.getX()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(b2.getMaxX(), last.getY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tif (b2.getMaxY() > last.getY()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(last.getX(), b2.getMaxY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t\tint numberOfChild = cell.getChildCount();\r\n \r\n \t\t\t\t\tif (!inGroup && overlapping[j] instanceof JmtCell && overlapping[j] != cell) {\r\n \r\n \t\t\t\t\t\tRectangle2D b = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());\r\n \t\t\t\t\t\t// Consider only rectangles that intersects with given\r\n \t\t\t\t\t\t// bound\r\n \t\t\t\t\t\tif (b.intersects(bounds2)) {\r\n \t\t\t\t\t\t\tlast.setLocation(new Point(oldPointX, oldPointY));\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// inizio a controllare se l intersezione e' un lato\r\n \t\t\t\t\tif (overlapping[j] instanceof JmtEdge\r\n \t\t\t\t\t\t\t&& overlapping[j] != cell\r\n \t\t\t\t\t\t\t&& !isInGroup(overlapping[j])\r\n \t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\tGraphConstants.getBounds(cell.getAttributes())) && ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)) {\r\n \t\t\t\t\t\tboolean access = false;\r\n \t\t\t\t\t\tboolean access2 = false;\r\n \r\n \t\t\t\t\t\t// Nonostatne SourceCell e SinkCell estendano JMTCell\r\n \t\t\t\t\t\t// avevo problemi di nullPointerException per questo\r\n \t\t\t\t\t\t// verifico di che\r\n \t\t\t\t\t\t// tipo sono\r\n \r\n \t\t\t\t\t\tif (cell instanceof SourceCell\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\t\tGraphConstants.getBounds(((SourceCell) cell).getAttributes()))) {\r\n \t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)) {\r\n \t\t\t\t\t\t\t\t// _______INIZIO_____\r\n \t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(((SourceCell) cell).getAttributes());\r\n \t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\tsp = sp + 2;\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, false, true);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \r\n \t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, true, false);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, false, true);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, true, false);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\taccess = true;\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (cell instanceof SinkCell) {\r\n \r\n \t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(0)) {\r\n \r\n \t\t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\t\tGraphConstants.getBounds(((SinkCell) cell).getAttributes()))) {\r\n \r\n \t\t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \t\t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(((SinkCell) cell).getAttributes());\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\t\tsp = sp + 3;\r\n \t\t\t\t\t\t\t\t\t\t\t// bounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\taccess2 = true;\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!isInGroup(overlapping[j]) && !access && !access2 && overlapping[j] instanceof JmtEdge) {\r\n \t\t\t\t\t\t\tif ((numberOfChild == 2)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j],\r\n \t\t\t\t\t\t\t\t\t\t\tfalse), GraphConstants.getBounds(cell.getAttributes()))) {\r\n \r\n \t\t\t\t\t\t\t\taccess = access2 = false;\r\n \r\n \t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\tif ((intersectionPoints == null) || intersectionPoints.size() <= 0) {\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(new Point(oldPointX, oldPointY));\r\n \t\t\t\t\t\t\t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \t\t\t\t\t\t\t\t\tresetOverLapping = 0;\r\n \t\t\t\t\t\t\t\t\treturn;\r\n \t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \r\n \t\t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(cell.getAttributes());\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\t;\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\t\tsp = sp + 3;\r\n \t\t\t\t\t\t\t\t\t\t\t// bounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} // end if of edge\r\n \t\t\t\t}\r\n \r\n \t\t\t\tif (last.equals(zero)) {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \r\n \t\t\t\tbounds.setLocation(new Point((int) (last.getX()), (int) (last.getY())));\r\n \r\n \t\t\t\toverlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \t\t\t}\r\n \r\n \t\t\t// Puts this cell in found position\r\n \t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \r\n \t\t} else {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(cell.getAttributes()).getBounds();\r\n \t\t\tif (isInGroup(cell)) {\r\n \t\t\t\tinGroup = true;\r\n \t\t\t}\r\n \r\n \t\t\t// Avoids negative starting point\r\n \t\t\tif (bounds.getX() < 20) {\r\n \t\t\t\tbounds.setLocation(20, (int) bounds.getY());\r\n \t\t\t}\r\n \t\t\tif (bounds.getY() < 0) {\r\n \t\t\t\tbounds.setLocation((int) bounds.getX(), 0);\r\n \t\t\t}\r\n \t\t\tObject[] overlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \r\n \t\t\tif (overlapping == null) {\r\n \r\n \t\t\t\treturn;\r\n \t\t\t}\r\n \r\n \t\t\tPoint2D zero = new Point(20, 0);\r\n \t\t\twhile (overlapping.length > 0) {\r\n \t\t\t\tPoint2D last = (Point2D) zero.clone();\r\n \t\t\t\tfor (Object element : overlapping) {\r\n \t\t\t\t\tif (element instanceof JmtCell && element != cell && inGroup) {\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtCell) element).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\tif (b2.getMaxX() > last.getX()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(b2.getMaxX(), last.getY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tif (b2.getMaxY() > last.getY()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(last.getX(), b2.getMaxY());\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!inGroup && element instanceof JmtCell && element != cell) {\r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \t\t\t\t\tint numberOfChild = cell.getChildCount();\r\n \t\t\t\t\tif (isInGroup(element) && element instanceof JmtEdge) {\r\n \t\t\t\t\t\tif ((numberOfChild == 2)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getSource() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getSource() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getTarget() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getTarget() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(element, false), GraphConstants\r\n \t\t\t\t\t\t\t\t\t\t.getBounds(cell.getAttributes()))) {\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtEdge) element).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\t// ___\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t}\r\n \t\t\t\tif (last.equals(zero)) {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\tbounds.setLocation(new Point((int) (last.getX()), (int) (last.getY())));\r\n \t\t\t\toverlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \t\t\t}\r\n \t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \r\n \t\t}\r\n \r\n \t}",
"private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }",
"private void overwritePosition(int oldRow, int oldCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[oldRow][oldCol];\n gameBoard[oldRow][oldCol] = new EmptyPiece();\n }",
"@Override\n\tpublic void setByteAtPos(int x, int y, byte byteP) {\n\t\tmapGrid[x][y] = byteP;\n\t}",
"public void setUnitOnBoard(Unit unit, int x, int y) {\n\t\tPosition pos = new Position(x, y);\n\t\tunitsOnBoard.put(pos, unit);\n\t\tunitPossitions.put(unit.getId(), pos);\n\t}",
"public void placePiece(Piece piece, Position position) {\n\t\tif(thereIsAPiece(position)) {\n\t\t\tthrow new BoardException(\"There is already a piece on position \" + position);\n\t\t}\n\t\tpieces[position.getRow()][position.getColumn()] = piece;\n\t\tpiece.position = position;\n\t}",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}",
"@Override\r\n\tpublic long getRepairKitX(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public boolean placePiece(Piece piece,String side, int row, int col)\n {\n\tboolean placed = true;\n\tint[][] shape = piece.getShape(); //shape of the piece\n\tString[][] fBoard = new String[rows][cols]; //temp front board\n\tString[][] bBoard = new String[rows][cols]; //temp back board\n\tfor(int i=0;i<rows;i++)\n\t {\n\t\tfor(int j=0;j<cols;j++)\n\t\t {\n\t\t\tfBoard[i][j] = frontBoard[i][j];\n\t\t\tbBoard[i][j] = backBoard[i][j];\n\t\t }\n\t }\n\tint insertRow = row; //row on the board being altered\n\tint insertCol = col; //column on the board being altered\n\tfor(int i=0;i<piece.getPieceRows();i++)\n\t {\n\t\tfor(int j=0;j<piece.getPieceCols();j++)\n\t\t {\n\t\t\tif(insertRow<0 || insertRow>rows-1 || insertCol<0 || insertCol>cols-1) //checks that the row and column numbers are valid\n\t\t\t {\n\t\t\t\tplaced = false;\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tif(side==\"front\") //places the piece relative to the front of the board\n\t\t\t\t {\n\t\t\t\t\tif(fBoard[insertRow][insertCol].equals(\"0\") || fBoard[insertRow][insertCol].charAt(1)=='0') \n\t\t\t\t\t //if the front board has a 0\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)//if the piece does not have a 0 in the spot\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tfBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2; //front gets a color and a 2\n\t\t\t\t\t\t\tbBoard[insertRow][rows-insertCol] = piece.getColor().charAt(0) + \"\" + shape[i][j]; //back gets a color and a 1\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse if(fBoard[insertRow][insertCol].charAt(1)=='1')\n\t\t\t\t\t //if the front board has a 1\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=2) //if the piece does not have a 2\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tfBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2; //front of the board gets a 2\n\t\t\t\t\t\t }\n\t\t\t\t\t\telse\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse\n\t\t\t\t\t //if the front of the board has a 2, only a piece with a 0 can be placed there\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t placed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\telse //places the piece relative to the back of the board (same rules as above only reversed)\n\t\t\t\t {\n\t\t\t\t\tif(bBoard[insertRow][insertCol].equals(\"0\") || bBoard[insertRow][insertCol].charAt(1)=='0')\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tbBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2;\n\t\t\t\t\t\t\tfBoard[insertRow][rows-insertCol] = piece.getColor().charAt(0) + \"\" + shape[i][j];\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse if(bBoard[insertRow][insertCol].charAt(1)=='1')\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=2)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tbBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2;\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\telse\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse\n\t\t\t\t\t {\n\t\t\t\t\t if(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t placed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\tinsertCol++;\n\t\t }\n\t\tinsertRow++;\n\t\tinsertCol = col;\n\t }\n\tif(placed) //if the piece did not encounter a collision, change the actual front and back of the board\n\t{\n\t\tfrontBoard = fBoard;\n\t\tbackBoard = bBoard;\n\t\tString color = piece.getColor();\n\t\tint index = 0;\n\t\twhile(!unused[index].getColor().equals(color))\n\t\t{\n\t\t\tindex++;\n\t\t}\n\t\tfor(int j=index;j<unused.length-1;j++)\n\t {\n\t\t\tunused[j] = unused[j+1];\n\t }\n\t\tunused[unused.length-1] = null;\n\t\tindex = 0;\n\t\tif(onBoard.length>0)\n\t\t{\n\t\t\twhile(onBoard[index]!=null && index<10)\n\t\t\t{\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\tif(index<10)\n\t\t{\n\t\t\tonBoard[index] = color;\n\t\t}\n\t}\n\treturn placed;\n }",
"public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }",
"private void overwritePositionWithEmpty(int row, int col){\n gameBoard[row][col] = new EmptyPiece();\n }",
"@Test\n\tpublic void moveToOccupiedSpace() throws Exception {\n\t\tKing obstruction1 = new King(PieceColor.WHITE, 1, 5);\n\t\tKing obstruction2 = new King(PieceColor.BLACK, 5, 1);\n\t\tRook obstruction3 = new Rook(PieceColor.WHITE, 1, 1);\n\t\tQueen obstruction4 = new Queen(PieceColor.BLACK, 6, 5);\n\t\tgame.board.addPiece(obstruction1);\n\t\tgame.board.addPiece(obstruction2);\n\t\tgame.board.addPiece(obstruction3);\n\t\tgame.board.addPiece(obstruction4);\n\t\t\n\t\tgame.board.movePiece(knightCorner1White, 1, 5);\n\t\tgame.board.movePiece(knightCorner2Black, 5, 1);\n\t\tgame.board.movePiece(knightSide1White, 1, 1);\n\t\tgame.board.movePiece(knightSide2Black, 6, 5);\n\t\tassertEquals(knightCorner1White, game.board.getPiece(0, 7));\n\t\tassertEquals(knightCorner2Black, game.board.getPiece(7, 0));\n\t\tassertEquals(knightSide1White, game.board.getPiece(3, 0));\n\t\tassertEquals(knightSide2Black, game.board.getPiece(7, 3));\n\t}",
"protected abstract void setTile( int tile, int x, int y );",
"private void setCell(int x, int y, int newValue) {\n hiddenGrid[x][y] = newValue;\n }",
"public void putChessOnBoard(int x, int y, int color) {\n \tif (this.board.put(x, y, color) == true) {\n System.out.println(\"Move played: \" + intToChar(x) + y);\n\n this.switchPlayer();\n\n if (this.board.checkGameOver(x, y, color) == true) {\n this.printResult(color);\n System.out.println(\"Game Over!\");\n System.exit(0);\n } else if (this.board.checkDraw() == true) {\n System.out.println(\"Draw!\");\n System.out.println(\"Game Over!\");\n System.exit(0); \n }\n }\n }",
"public boolean placeComputerShipsSmart(int pattern) {\n if(cpuHasPlaced){\n return false;\n }\n switch(pattern) {\n case 1:\n computerShips[0].setShip(1, 2, 1);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n computerShips[1].setShip(3, 4, 1);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[j][3] = board.ship.ordinal();\n }\n computerShips[2].setShip(5, 3, 0);\n for (int i = 3; i < 6; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n computerShips[3].setShip(4, 1, 0);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(8, 5, 1);\n for (int i = 5; i < 7; i++){\n computerPlayerBoard[i][8] = board.ship.ordinal();\n }\n\n break;\n case 2:\n computerShips[0].setShip(4, 2, 1);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[1].setShip( 6, 3, 1);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[j][6] = board.ship.ordinal();\n }\n computerShips[2].setShip( 6, 0, 0);\n for (int i = 6; i < 9; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 1, 8, 0);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[4].setShip( 1, 2, 1);\n for (int i = 2; i < 4; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n\n break;\n case 4:\n computerShips[0].setShip( 0, 2, 1);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[1].setShip( 8, 3, 1);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[j][8] = board.ship.ordinal();\n }\n computerShips[2].setShip( 5, 2, 1);\n for (int i = 2; i < 5; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n computerShips[3].setShip( 3, 8, 0);\n for (int i = 3; i < 6; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(0, 9, 0);\n for (int i = 0; i < 2; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n\n break;\n case 5:\n computerShips[0].setShip( 7, 5, 1);\n for (int i = 5; i < 10; i++) {\n computerPlayerBoard[i][7] = board.ship.ordinal();\n }\n computerShips[1].setShip( 1, 1, 1);\n for (int j = 1; j < 5; j++){\n computerPlayerBoard[j][1] = board.ship.ordinal();\n }\n computerShips[2].setShip( 4, 2, 0);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 1, 8, 0);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[4].setShip( 3, 6, 0);\n for (int i = 3; i < 5; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n\n break;\n case 6:\n computerShips[0].setShip( 3, 3, 0);\n for (int i = 3; i < 8; i++) {\n computerPlayerBoard[3][i] = board.ship.ordinal();\n }\n computerShips[1].setShip( 3, 7, 0);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[7][j] = board.ship.ordinal();\n }\n computerShips[2].setShip( 7, 4, 0);\n for (int i =7; i < 10; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 2, 5, 0);\n for (int i = 2; i < 5; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(8, 8, 0);\n for (int i = 8; i < 10; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n\n break;\n case 7:\n computerShips[0].setShip( 3, 6, 0);\n for (int i = 3; i < 8; i++) {\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(1, 2, 1);\n for (int j = 2; j < 6; j++){\n computerPlayerBoard[j][1] = board.ship.ordinal();\n }\n computerShips[2].setShip( 7, 4, 1);\n for (int i =7; i < 10; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 2, 5, 0);\n for (int i = 2; i < 5; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[4].setShip( 8, 8, 0);\n for (int i = 8; i < 10; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n\n break;\n case 8:\n computerShips[0].setShip(5, 1, 0);\n for (int i = 5; i < 10; i++) {\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[1].setShip( 7, 4, 1);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[j][7] = board.ship.ordinal();\n }\n computerShips[2].setShip( 4, 6, 1);\n for (int i =6; i < 9; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[3].setShip( 2, 4, 1);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[4].setShip( 0, 1, 1);\n for (int i = 1; i < 3; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n\n break;\n case 9:\n computerShips[0].setShip( 5, 1, 0);\n for (int i = 5; i < 10; i++) {\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[1].setShip( 7, 4, 1);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[j][7] = board.ship.ordinal();\n }\n computerShips[2].setShip( 6, 3, 1);\n for (int i =3; i < 6; i++){\n computerPlayerBoard[i][6] = board.ship.ordinal();\n }\n computerShips[3].setShip( 0, 1, 0);\n for (int i = 0; i < 3; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[4].setShip( 5, 8, 1);\n for (int i = 8; i < 10; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n\n break;\n case 10:\n computerShips[0].setShip( 9, 3, 1);\n for (int i = 3; i < 8; i++) {\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[1].setShip( 7, 4, 1);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[j][7] = board.ship.ordinal();\n }\n computerShips[2].setShip( 4, 6, 1);\n for (int i =6; i < 9; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 2, 4, 1);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[4].setShip( 0, 1, 1);\n for (int i = 1; i < 3; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n\n break;\n case 11:\n //carrier\n computerShips[0].setShip( 1, 3, 0);\n for(int i = 1; i < 6; i++){\n computerPlayerBoard[3][i] = board.ship.ordinal();\n }\n //battleship\n computerShips[1].setShip(1, 6, 0);\n for(int i = 1; i < 5; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n //submarine\n computerShips[2].setShip( 5, 6, 1);\n for(int i = 6; i < 8; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n //cruiser\n computerShips[3].setShip( 1, 0, 0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n //destroyer\n computerShips[4].setShip( 7, 0, 1);\n for(int i = 0; i < 2; i++){\n computerPlayerBoard[i][7] = board.ship.ordinal();\n }\n\n break;\n case 12:\n //carrier (5)\n computerShips[0].setShip( 2, 1, 0);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n //battleship (4)\n computerShips[1].setShip( 4, 3, 1);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[j][4] = board.ship.ordinal();\n }\n //submarine (3)\n computerShips[2].setShip( 7, 3, 1);\n for (int i = 3; i < 6; i++){\n computerPlayerBoard[i][7] = board.ship.ordinal();\n }\n //cruiser (3)\n computerShips[3].setShip( 2, 9, 0);\n for (int i = 2; i < 5; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n //destroyer (2)\n computerShips[4].setShip( 1, 3, 1);\n for (int i = 3; i < 5; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n break;\n case 13:\n //carrier (5)\n computerShips[0].setShip( 9, 2, 1);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n //battleship (4)\n computerShips[1].setShip( 6, 0, 1);\n for (int j = 0; j < 4; j++){\n computerPlayerBoard[j][6] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 4, 9, 0);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 1, 1, 0);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 3, 5, 1);\n for (int i = 5; i < 7; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n break;\n case 14:\n //carrier (5)\n\n computerShips[0].setShip( 0, 5, 1);\n for (int i = 5; i < 10; i++) {\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 7, 3, 1);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[j][7] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 3, 3, 1);\n for (int i = 3; i < 6; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 4, 5, 1);\n for (int i = 5; i < 8; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 5, 1, 0);\n for (int i = 5; i < 7; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n break;\n case 15:\n //carrier (5)\n\n computerShips[0].setShip( 1, 8, 0);\n for (int i = 1; i < 6; i++) {\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 7, 3, 1);\n for (int j = 3; j < 7; j++){\n computerPlayerBoard[j][7] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 6, 1, 0);\n for (int i = 6; i < 9; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 1, 5, 0);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 2, 1, 1);\n for (int i = 1; i < 3; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n break;\n case 16:\n //carrier (5)\n\n computerShips[0].setShip( 0, 1, 1);\n for (int i = 1; i < 6; i++) {\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 1, 9, 0);\n for (int j = 1; j < 5; j++){\n computerPlayerBoard[9][j] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 9, 5, 1);\n for (int i = 5; i < 8; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 9, 1, 1);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 4, 0, 0);\n for (int i = 4; i < 6; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n break;\n case 17:\n //carrier (5)\n\n computerShips[0].setShip( 4, 2, 1);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 1, 5, 1);\n for (int j = 5; j < 9; j++){\n computerPlayerBoard[j][1] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 7, 4, 1);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[i][7] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 6, 1, 0);\n for (int i = 6; i < 9; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 1, 1, 0);\n for (int i = 1; i < 3; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n break;\n case 18:\n //carrier (5)\n\n computerShips[0].setShip( 2, 3, 1);\n for (int i = 3; i < 8; i++) {\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 6, 4, 1);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[j][6] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 8, 1, 1);\n for (int i = 1; i < 4; i++){\n computerPlayerBoard[i][8] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 3, 2, 0);\n for (int i = 3; i < 6; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 4, 9, 0);\n for (int i = 4; i < 6; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n break;\n case 19:\n //carrier (5)\n\n computerShips[0].setShip( 8, 5, 1);\n for (int i = 5; i < 10; i++) {\n computerPlayerBoard[i][8] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 0, 0, 0);\n for (int j = 0; j < 4; j++){\n computerPlayerBoard[0][j] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 7, 0, 1);\n for (int i = 0; i < 3; i++){\n computerPlayerBoard[i][7] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 5, 4, 1);\n for (int i = 4; i < 7; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 3, 8, 0);\n for (int i = 3; i < 5; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n break;\n case 20:\n //carrier (5)\n\n computerShips[0].setShip( 2, 5, 0);\n for (int i = 2; i < 7; i++) {\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n //battleship (4)\n\n computerShips[1].setShip( 2, 1, 0);\n for (int j = 2; j < 6; j++){\n computerPlayerBoard[1][j] = board.ship.ordinal();\n }\n //submarine (3)\n\n computerShips[2].setShip( 3, 7, 1);\n for (int i = 7; i < 10; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n //cruiser (3)\n\n computerShips[3].setShip( 6, 8, 0);\n for (int i = 6; i < 9; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n //destroyer (2)\n\n computerShips[4].setShip( 8, 0, 0);\n for (int i = 8; i < 10; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n break;\n\n }\n return true;\n }",
"public void setPosition(int x, int y){\n\t\t\n\t\tif(x>=ColumnNumber.firstColumn.ordinal() && x<=ColumnNumber.eightColumn.ordinal()){\n\t\t\txPosition=x;\n\t\t}\n\t\tif(y>=RowNumber.firstRow.ordinal() && y<=RowNumber.eightRow.ordinal()){\n\t\t\tyPosition=y;\n\t\t}\n\t\t\n\t}",
"public void setSpaceAt(int x, int y, int val){\n grids[x][y].setValue(val);\n }",
"public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }",
"public void setCardPos(double x, double y ){\r\n setX(x);\r\n setY(y);\r\n }",
"private void placePiece() {\r\n pieces[numPieces] = getRandomPoint();\r\n Game.movePiece(new PositionData(-1,-1,Constants.PLAYER_A_ID), pieces[numPieces]);\r\n numPieces++;\r\n }",
"void placePiece(Piece piece, Position position) {\n positionToPieceMap.put(position, piece);\n }",
"@Override\r\n\tpublic void putBattery(Board board, long x, long y, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbattery.setPosition(new Position(x,y));\r\n\t\t\tbattery.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this battery or this board is terminated; the battery cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public void teleportTo(int y, int x){\n\t\tthis.position[y][x] = 1;//makes the position here, used for other object room\n\t}",
"void setLocation(int x, int y);",
"public Cell(int x, int y){\n\t\tif((x<0 || x>7) || (y<0 || y>7)){\n\t\t\tSystem.out.println(\"The provided coordinates for the cell are out of range.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.placedPiece = null;\n\t}",
"private void placeKitOnInspection(MyKit mk)\n\t{\n\t\tmyStand.setSlotThreeTaken();\n\t\tif(guiEnable){\n\t\t\tthis.kitRobotGUI.DoMoveKitToCameraInspection(mk.kit.guikit, mk.kit.position);\n\t\t\tprint(\"Moving Kit to Inspection Slot\");\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Camera Inspection. Finished moving. Telling Agent.\");\n\n\n\t\tmyStand.setSlotAvilable(mk.slot);\n\t\tmk.kit.position = KitPosition.POSITION3;\n\t\tprint(\"Kit Slot number : \"+mk.slot+\" is Available but slot 3 is taken\");\n\t\tmk.status = KitStatus.On_CameraInspection;\n\t\tkitCamera.msgInspectKit(mk.kit);\n\t\tstateChanged();\n\t}",
"protected abstract void fixChassis();",
"public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}",
"public void turnToLiving(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = true;\n }",
"public static void changepieces(int row, int column, String piecevalue){\n\t\tString oppositepiece;\n\t\tif(piecevalue.equals(\"x\")){\n\t\t\toppositepiece=\"o\";\n\t\t}\n\t\telse if(piecevalue.equals(\"o\")){\n\t\t\toppositepiece=\"x\";\n\t\t}\n\t\telse{\n\t\t\toppositepiece=\"-\";\n\t\t}\n\t\t//R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left.\n\t\tboolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false;\n\t\tint checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1;\n\t\twhile(board[row][column+checkfurtherR].equals(oppositepiece)){\n\t\t\tcheckfurtherR++;\n\t\t}\n\t\tif(board[row][column+checkfurtherR].equals(piecevalue)){\n\t\t\tfoundR=true;\n\t\t}\n\t\t//The board changes the board if a 'connection' has been found in the [right] direction. It makes the connection following the game rules.\n\t\tif(foundR==true){\n\t\tfor(int i=column;i<column+checkfurtherR;i++){\n\t\t\t\tboard[row][i]=(piecevalue);\n\t\t\t}\n\t\t}\n\t\twhile(board[row][column-checkfurtherL].equals(oppositepiece)){\n\t\t\tcheckfurtherL++;\n\t\t}\n\t\tif(board[row][column-checkfurtherL].equals(piecevalue)){\n\t\t\tfoundL=true;\n\t\t}\n\t\t//Again, if something is found in the [left] direction, this block of code will be initialized to change to board array (making that 'connection' on the board).\n\t\tif(foundL==true){\n\t\tfor(int i=column;i>column-checkfurtherL;i--){\n\t\t\t\tboard[row][i]=(piecevalue);\n\t\t\t}\n\t\t}\n\t\twhile(board[row+checkfurtherB][column].equals(oppositepiece)){\n\t\t\tcheckfurtherB++;\n\t\t}\n\t\tif(board[row+checkfurtherB][column].equals(piecevalue)){\n\t\t\tfoundB=true;\n\t\t}\n\t\tif(foundB==true){\n\t\tfor(int i=row;i<row+checkfurtherB;i++){\n\t\t\t\tboard[i][column]=(piecevalue);\n\t\t\t}\n\t\t}\n\t\twhile(board[row-checkfurtherT][column].equals(oppositepiece)){\n\t\t\tcheckfurtherT++;\n\t\t}\n\t\tif(board[row-checkfurtherT][column].equals(piecevalue)){\n\t\t\tfoundT=true;\n\t\t}\n\t\tif(foundT==true){\n\t\tfor(int i=row;i>row-checkfurtherT;i--){\n\t\t\t\tboard[i][column]=(piecevalue);\n\t\t\t}\n\t\t}\n\t\t//Diagonal directions are harder and different from the 4 basic directions\n\t\t//It must use dynamic board to 'mark' the coordinates that it must convert to make a proper 'connection'\n\t\twhile(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){\n\t\t\t//each coordinate that is reached will be recorded on the dynamic board\n\t\t\tdynamicboard[row-checkfurtherTR][column+checkfurtherTR]=1;\n\t\t\tcheckfurtherTR++;\n\t\t}\n\t\tif(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)){\n\t\t\tfoundTR=true;\n\t\t}\n\t\t//Now the board will be changed if an available move has been found\n\t\tif(foundTR==true){\n\t\t\tfor(int x=row;x>row-checkfurtherTR;x--){\n\t\t\t\tfor(int i=column;i<column+checkfurtherTR;i++){\n\t\t\t\t\t//without the use of the dynamic board, some units of the board that should not be converted, will be converted.\n\t\t\t\t\t//(hard to explain)Example, if coordinate places a piece on the Top right of an available move, the connection and change on the board will be performed but [down] and [right] directions will also be inconveniently converted \n\t\t\t\t\tif(dynamicboard[x][i]==1){\n\t\t\t\t\t\tboard[x][i]=(piecevalue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//dynamicboard must be cleared each time for its next job in 'marking' units in the array to be converted.\n\t\tcleandynamicboard();\n\t\twhile(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){\n\t\t\tdynamicboard[row-checkfurtherTL][column-checkfurtherTL]=1;\n\t\t\tcheckfurtherTL++;\n\t\t}\n\t\tif(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)){\n\t\t\tfoundTL=true;\n\t\t}\n\t\tif(foundTL==true){\n\t\t\tfor(int x=row;x>row-checkfurtherTL;x--){\n\t\t\t\tfor(int i=column;i>column-checkfurtherTL;i--){\n\t\t\t\t\tif(dynamicboard[x][i]==1){\n\t\t\t\t\t\tboard[x][i]=(piecevalue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcleandynamicboard();\n\t\twhile(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){\n\t\t\tdynamicboard[row+checkfurtherBL][column-checkfurtherBL]=1;\n\t\t\tcheckfurtherBL++;\n\t\t}\n\t\tif(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)){\n\t\t\tfoundBL=true;\n\t\t}\n\t\tif(foundBL==true){\n\t\t\tfor(int x=row;x<row+checkfurtherBL;x++){\n\t\t\t\tfor(int i=column;i>column-checkfurtherBL;i--){\n\t\t\t\t\tif(dynamicboard[x][i]==1){\n\t\t\t\t\t\tboard[x][i]=(piecevalue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcleandynamicboard();\n\t\twhile(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){\n\t\t\tdynamicboard[row+checkfurtherBR][column+checkfurtherBR]=1;\n\t\t\tcheckfurtherBR++;\n\t\t}\n\t\tif(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)){\n\t\t\tfoundBR=true;\n\t\t}\n\t\tif(foundBR==true){\n\t\t\tfor(int x=row;x<row+checkfurtherBR;x++){\n\t\t\t\tfor(int i=column;i<column+checkfurtherBR;i++){\n\t\t\t\t\tif(dynamicboard[x][i]==1){\n\t\t\t\t\t\tboard[x][i]=(piecevalue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void solve() {\n \tsquares[0][0].fillInRemainingOfBoard();\n }",
"public boolean setFlag(int x, int y) {\t\n\t\tif (util.wrongPosition(x, y)){\n\t\t\tSystem.out.println(\"Not a valid position\");\n\t\t\treturn false;\n\t\t}\n\t\tgameBoard[x][y] = flagLogic(x, y);\n\t\treturn true;\n\t}",
"public void respawn(int x, int y) {\n if (x % getPixelSize() != 0 || y % getPixelSize() != 0) {\n throw new IllegalArgumentException();\n }\n\n this.direction = RIGHTKEY;\n this.alive = true;\n this.speed = DEFAULT_SPEED;\n this.playerLocations = new ArrayList();\n this.playerLocations.add(new Location(x, y, this.col, LocationType.PLAYER));\n }",
"boolean place (int x, int y) {\n\t\tint row = x;\n\t\tint col = y;\n\t\tmoleGrid[row][col] = 'M';\n\t\tmolesLeft++;\n\n\t\tif (moleGrid[row][col] == 'M') {\n\t\t\t// System.out.println(\"You have successfully placed a mole at coordinates.\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// System.out.println(\"Error: A mole was NOT placed at the coordinates.\");\n\t\t\treturn false;\n\n\t\t}\n\t\t\n\t}",
"public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}",
"public void deployComputerShips() {\r\n\r\n\t\ttry {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tint carrierX = rand.nextInt(9);\r\n\t\t\tint carrierY = rand.nextInt(11);\r\n\r\n\t\t\tHashMap<Integer, Integer> Carrier = new HashMap<>();\r\n\t\t\tBoolean placed = false;\r\n\r\n\t\t\twhile (!placed) {\r\n\t\t\t\tif (check(carrierX, carrierY, \"horizontal\", 5)) {\r\n\t\t\t\t\tif ((carrierY + 5) <= 11) {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\t\t\t\t\tCarrier.put((carrierY + i), carrierX);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\t\t\t\t\tCarrier.put((carrierY - i), carrierX);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplaced = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcarrierX = rand.nextInt(9);\r\n\t\t\t\t\tcarrierY = rand.nextInt(11);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : Carrier.entrySet()) {\r\n\t\t\t\trandomGrid[entry.getValue()][entry.getKey()] = 1;\r\n\t\t\t}\r\n\r\n\t\t\tint battleShipX = rand.nextInt(9);\r\n\t\t\tint battleShipY = rand.nextInt(11);\r\n\r\n\t\t\tHashMap<Integer, Integer> BattleShip = new HashMap<>();\r\n\r\n\t\t\tplaced = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\tif (check(battleShipX, battleShipY, \"vertical\", 4)) {\r\n\t\t\t\t\tif ((battleShipX + 4) < 9) {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\t\t\t\t\tBattleShip.put((battleShipX + i), battleShipY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\t\t\t\t\tBattleShip.put((battleShipX - i), battleShipY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplaced = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbattleShipX = rand.nextInt(9);\r\n\t\t\t\t\tbattleShipY = rand.nextInt(11);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : BattleShip.entrySet()) {\r\n\r\n\t\t\t\trandomGrid[entry.getKey()][entry.getValue()] = 1;\r\n\t\t\r\n\t\t\t}\r\n\r\n\t\t\tint cruiserX = rand.nextInt(9);\r\n\t\t\tint cruiserY = rand.nextInt(11);\r\n\r\n\t\t\tHashMap<Integer, Integer> Cruiser = new HashMap<>();\r\n\t\t\tplaced = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\tif (check(cruiserX, cruiserY, \"vertical\", 3)) {\r\n\t\t\t\t\tif ((cruiserX + 3) < 9) {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\t\t\t\t\tCruiser.put((cruiserX + i), cruiserY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\t\t\t\t\tCruiser.put((cruiserX - i), cruiserY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplaced = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcruiserX = rand.nextInt(9);\r\n\t\t\t\t\tcruiserY = rand.nextInt(11);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : Cruiser.entrySet()) {\r\n\r\n\t\t\t\trandomGrid[entry.getKey()][entry.getValue()] = 1;\r\n\t\t\r\n\t\t\t}\r\n\r\n\t\t\tint subX = rand.nextInt(9);\r\n\t\t\tint subY = rand.nextInt(11);\r\n\t\t\tHashMap<Integer, Integer> Submarine = new HashMap<>();\r\n\r\n\t\t\tplaced = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\tif (check(subX, subY, \"vertical\", 3)) {\r\n\t\t\t\t\tif ((subX + 3) < 9) {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\t\t\t\t\tSubmarine.put((subX + i), subY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\t\t\t\t\tSubmarine.put((subX - i), subY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplaced = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsubX = rand.nextInt(9);\r\n\t\t\t\t\tsubY = rand.nextInt(11);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : Submarine.entrySet()) {\r\n\r\n\t\t\t\trandomGrid[entry.getKey()][entry.getValue()] = 1;\r\n\t\t\r\n\t\t\t}\r\n\r\n\t\t\tint destroyerX = rand.nextInt(9);\r\n\t\t\tint destroyerY = rand.nextInt(11);\r\n\r\n\t\t\tHashMap<Integer, Integer> Destroyer = new HashMap<>();\r\n\r\n\t\t\tplaced = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\tif (check(destroyerX, destroyerY, \"horizontal\", 2)) {\r\n\t\t\t\t\tif ((destroyerY + 2) < 11) {\r\n\r\n\t\t\t\t\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\t\t\t\t\tDestroyer.put((destroyerY + i), destroyerX);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\t\t\t\t\tDestroyer.put((destroyerY - i), destroyerX);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplaced = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdestroyerX = rand.nextInt(9);\r\n\t\t\t\t\tdestroyerY = rand.nextInt(11);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : Destroyer.entrySet()) {\r\n\r\n\t\t\t\trandomGrid[entry.getValue()][entry.getKey()] = 1;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t}\r\n\r\n\t}",
"public void moveTo(int a, int b, Pieces board)\n {\n int[][] board_state = board.getState();\n ArrayList<Pair> available = availableMove(board);\n Pair temp = new Pair(a, b);\n //if (a,b) is in available, move\n for (int i = 0; i < available.size(); ++i)\n {\n if (temp.equals(available.get(i)) == true)\n {\n //a opponent's piece is at (a,b), remove it\n if (board_state[a][b] == getOpponent(player))\n {\n board.removePiece(a, b, getOpponent(player));\n }\n x = a;\n y = b;\n }\n }\n System.out.println(\"Invaild Move\");\n }",
"@Override\r\n public void onMove(int blockId, int offset) {\n currentChallenge.moveBlock(blockId, offset);\r\n if( currentChallenge.isSolved() ){\r\n puzzlesDbAdapter.updatePuzzleSolved(currentChallenge.getId(), true);\r\n Toast.makeText(getApplicationContext(), \"PUZZLE SOLVED\", Toast.LENGTH_SHORT).show();\r\n }\r\n gameBoard.invalidate();\r\n }",
"private void setShips(int x, int y) {\n\t\t// Mausi innerhalb des 1. Spielfeldes?\n\t\tif (x > 450 && x < 750 && y > 90 && y < 390) {\n\t\t\t// Position auf dem Spielfeld ermitteln\n\t\t\tint posX = Math.floorDiv(x - 450, 30);\n\t\t\tint posY = Math.floorDiv(y - 90, 30);\n\t\t\t// Wie \"lang\" ist das Schiff\n\t\t\tint anzahl = ships[anzahlschiffe - 1];\n\t\t\t// kontrolle ob der Punkt wo das Schiff gesetzt wird\n\t\t\t// nicht bereits in Liste ist. Ansonsten funktion beeneden.\n\t\t\t// Einmal fuer die drehung (vertikal) und einmal ohne (horizontal)\n\t\t\tif (drehen) {\n\t\t\t\tif (posX + anzahl <= 10) {\n\t\t\t\t\tfor (int l = 0; l < anzahl; l++) {\n\t\t\t\t\t\t// kontrolle ob nicht bereits in Liste\n\t\t\t\t\t\tif (gesetzeSchiffe.contains(new Point(posX + l, posY)))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (posY + anzahl <= 10) {\n\t\t\t\t\tfor (int l = 0; l < anzahl; l++) {\n\t\t\t\t\t\t// kontrolle ob nicht bereits in Liste\n\t\t\t\t\t\tif (gesetzeSchiffe.contains(new Point(posX, posY + l)))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Wenn das Schiff gesetzt werden kann setze es.\n\t\t\tif (drehen) {\n\t\t\t\tif (posX + anzahl <= 10) {\n\t\t\t\t\tfor (int l = 0; l < anzahl; l++) {\n\t\t\t\t\t\tgesetzeSchiffe.add(new Point(posX + l, posY));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (posY + anzahl <= 10) {\n\t\t\t\t\tfor (int l = 0; l < anzahl; l++) {\n\t\t\t\t\t\tgesetzeSchiffe.add(new Point(posX, posY + l));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Gesetzte Schiffe reduzieren.\n\t\t\tanzahlschiffe--;\n\t\t\t// Wenn alle Schiffe gesetzt wurden dann \"beende\" das Schiffe\n\t\t\t// setzen.\n\t\t\tif (anzahlschiffe == 0) {\n\t\t\t\tstopPlaceingShips();\n\t\t\t\ttry {\n\t\t\t\t\t//Dem Server die Schiffe mitteilen\n\t\t\t\t\tserver.setShips(this.gesetzeSchiffe, this.spielerNummer);\n\t\t\t\t\tthis.setStatus(\"Bitte warten...\");\n\t\t\t\t} catch (RemoteException e) {\n\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Dannach neu malen damit der User die aenderungen gleich sieht!\n\t\t\tthis.repaint();\n\n\t\t}\n\t}",
"public void tellNearby(int x, int y)\r\n {\r\n // checks for nearby bombs\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n try\r\n {\r\n gameBoard.gameCells[row][col].addBombNearby();\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }",
"private void addNewBoard(int x, int y,\n\t\t\tArrayList<ArrayList<Integer>> board) {\n\t\tif (y < 0 || y > board.size() - 1) { //expanding up/down\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tArrayList<Integer> z = new ArrayList<>();\n\t\t\t\tfor (int j = 0; j < board.get(0).size(); j++) {\n\t\t\t\t\tif ((j < x + boardSize && j >= x && x >= 0)) { //adjusts for y if it isn't 0 or negative, almost forgot about this\n\t\t\t\t\t\tz.add(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.add(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (y < 0) {\n\t\t\t\t\tboard.add(0, z);\n\t\t\t\t\ty++;\n\t\t\t\t} else {\n\t\t\t\t\tboard.add(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif (x < 0 || x > board.get(0).size() - 1) { //expanding to the left/right\n\t\t\tint loc = (x < 0) ? 0 : board.get(0).size();\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < board.size(); j++) {\n\t\t\t\t\tif (j < y + boardSize && j >= y) {\n\t\t\t\t\t\tboard.get(j).add(loc, 0); //append as opposed to add\n\t\t\t\t\t} else {\n\t\t\t\t\t\tboard.get(j).add(loc, 5); //append lack of board everywhere else\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif ((y >= 0 && y < board.size())\n\t\t\t\t&& (x >= 0 && x < board.get(0).size())\n\t\t\t\t&& getBoard(x, y) == 5) { //If within board\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t\tboard.get(y + i).set(x + j, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tupdateOffset();\n\t}",
"public void MoveTileSelf(Integer position){\n /**\n * if opponent activated confusion - move to a random tile\n */\n if(confused){\n //random tile for confusion\n Integer tile;\n do{\n Integer tile1 = returnRandom(getNthDigit(position,1)-1,getNthDigit(position,1)+2);\n Integer tile2 = returnRandom(getNthDigit(position,2)-1,getNthDigit(position,2)+2); // between 0 and 2\n tile = Integer.parseInt(tile1.toString() + tile2.toString());\n }while (tile==myTile || tile==opponentTile || getNthDigit(tile,1)<1 || getNthDigit(tile,1)>7 || getNthDigit(tile,2)<1 || getNthDigit(tile,2)>7);\n position = tile;\n showTimedAlertDialog(\"You are confused!\", \"moving at a random direction\", 5);\n confused = false;\n }\n\n /**\n * send message to opponent\n */\n MultiplayerManager.getInstance().SendMessage(position.toString());\n\n if(!is_debug){\n HandleLejos(myTile, position);\n }\n\n ImageView player1 = findImageButton(\"square_\"+position.toString());\n ImageView player1_old = findImageButton(\"square_\"+myTile.toString());\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player1_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n myTile = position;\n myTurn = false;\n turnNumber = turnNumber + 1;\n }",
"public void setSpace(int position, Box player){\r\n\t\tboard[position - 1] = player;\r\n\t\t\r\n\t}",
"public void move(Cell[][] board) {\n Cell[] nextCells = generateNeighbors(this.x, this.y);\n Cell nextCell = nextCells[rand.nextInt(4)];\n if (!this.objectFound) {\n if (nextCell != null && nextCell.isOccupied() && nextCell.occupiedBy instanceof Integer) {\n this.objectFound = true;\n this.goal = nextCell;\n } else if (nextCell != null && !nextCell.isOccupied()) {\n synchronized (board[this.x][this.y]) {\n board[this.x][this.y].resetCell();\n nextCell.occupiedBy = this;\n }\n }\n } else {\n // bfs to location\n System.out.println(\"BFS to goal\");\n }\n }",
"public void move(int x, int y){\n universe.erase(this);\n this.yPosition = y;\n this.xPosition = x;\n universe.draw(this);\n }",
"void whack (int x, int y) {\n\t\tint row = x;\n\t\tint col = y;\n\t\t\n\t\t// Check the value of the moleGrid coordinates and update score, number of attemptsLeft, and\n\t\t// molesLeft to find.\n\t\tif (moleGrid[row][col] == 'M') {\n\t\t\t// Moles was found so mark location as Whacked.\n\t\t\tmoleGrid[row][col] = 'W';\n\t\t\t\n\t\t\t// Increase the users score by an increment of one.\n\t\t\tscore++;\n\t\t\t\n\t\t\t// Reduce the molesLeft to find by an increment of one.\n\t\t\tmolesLeft--;\n\t\t\t\n\t\t\t// Reduce the number of attempts left to find moles by one.\n\t\t\tattemptsLeft--;\n\t\t\t\n\t\t\t// Post feedback to the user on successfully finding mole and inform them of the score and \n\t\t\t// the number of attempts left.\n\t\t\tSystem.out.println(\"Success, you found a mole. Your updated score is: \" + score + \". \"\n\t\t\t\t\t+ \"You have \" + attemptsLeft + \" attempts left to find \" + molesLeft + \" moles.\");\n\t\t\t\n\t\t} else if (moleGrid[row][col] == 'W') {\n\t\t\t// Post feedback to the user that a mole was already found at this location and inform \n\t\t\t// them of the number of attempts left.\n\t\t\tSystem.out.println(\"A mole was already found at this location.\");\n\t\t\tattemptsLeft--;\n\t\t\t// Print Attempts left to the console.\n\t\t\tSystem.out.println(\"You have \" + attemptsLeft + \" attempts left to find \" + molesLeft + \n\t\t\t\t\t\" moles.\");\n\t\t\t\n\t\t\n\t\t} else {\n\t\t\t// Post feedback to the user that NO mole was found at this location and inform \n\t\t\t// them of the number of attempts left.\n\t\t\tSystem.out.println(\"Sorry, NO mole was found at this location.\");\n\t\t\t\n\t\t\t// Reduce the number of attempts left to find moles by one.\n\t\t\tattemptsLeft--;\n\t\t\t\n\t\t\t// Print Attempts left to the console.\n\t\t\tSystem.out.println(\"You have \" + attemptsLeft + \" attempts left to find \" + molesLeft + \n\t\t\t\t\t\" moles.\");\n\n\t\t}\n\t}",
"private void addSaveTile(int x, int y) {\n\t\ttry {\n\t\t\tthis.solver.addClause(new VecInt(new int[]{-tileToIntMapperB(x, y)}));\n\t\t\tthis.solver.addClause(new VecInt(new int[]{-tileToIntMapperS(x, y)}));\n\t\t\tthis.kb.add(new int[]{-tileToIntMapperB(x, y)});\n\t\t\tthis.kb.add(new int[]{-tileToIntMapperS(x, y)});\n\t\t} catch (ContradictionException e) {\n\t\t\tLog.error(\"Initialization of the KB failed\");\n\t\t}\n\t}",
"@Test\n void RookMoveUpBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 4, 1);\n Piece rook2 = new Rook(board, 6, 2, 1);\n\n board.getBoard()[6][4] = rook1;\n board.getBoard()[6][2] = rook2;\n\n board.movePiece(rook1, 6, 1);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][4]);\n Assertions.assertEquals(rook2, board.getBoard()[6][2]);\n Assertions.assertNull(board.getBoard()[6][1]);\n }",
"private void updateGridWithPosition(Pair<Integer, Integer> position) {\n int x = position.getValue0();\n int y = position.getValue1();\n int ox = origin.getValue0();\n int oy = origin.getValue1();\n while (ox + Math.abs(x) >= grid[0].length || oy + Math.abs(y) >= grid.length) {\n reallocateGrid();\n }\n if (x >= 0 && y >= 0) {\n grid[oy + y][ox + x] = '#';\n } else if (x >= 0) {\n grid[oy - Math.abs(y)][ox + x] = '#';\n } else if (y >= 0) {\n grid[oy + y][ox - Math.abs(x)] = '#';\n } else {\n grid[oy - Math.abs(y)][ox - Math.abs(x)] = '#';\n }\n }",
"public void initChessBoardManually() {\r\n\t\tstatus.setStatusEdit();\r\n\t\tclearBoard();\r\n\t\tthis.setBoardEnabled(true);\r\n\t\tfor (int i=0; i<8*8; i++) {\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setBorderPainted(false);\r\n\t\t}\r\n\t\tswitcher.setEnabled(true);\r\n\t\tconfirm.setEnabled(true);\r\n\t\tt.setText(\"<html>Please choose position to put the pieces.<br>Right click to set/cancel King flag</html>\");\r\n\t}",
"public void setPosition(float x, float y);",
"public void setNeighbors(){\t\t\t\t\n\t\tint row = position[0];\n\t\tint column = position[1];\t\t\n\t\tif(column+1 < RatMap.SIDELENGTH){\n\t\t\teastCell = RatMap.getMapCell(row,column+1);\t\t\t\n\t\t}else{\n\t\t\teastCell = null;\n\t\t}\t\n\t\tif(row+1 < RatMap.SIDELENGTH){\n\t\t\tnorthCell = RatMap.getMapCell(row+1,column);\n\t\t}else{\n\t\t\tnorthCell = null;\n\t\t}\t\n\t\tif(column-1 > -1){\n\t\t\twestCell = RatMap.getMapCell(row, column-1);\t\t\t\n\t\t}else{\n\t\t\twestCell = null;\n\t\t}\n\t\tif(row-1 > -1){\n\t\t\tsouthCell = RatMap.getMapCell(row-1, column);\n\t\t}else{\n\t\t\tsouthCell = null;\n\t\t}\n\t}",
"public void solve(int x, int y) {\n\tif ( numQ == xLen ) \n\t solved = true; \n //Checks if you're able to place queen on current space\n\telse if ( board[x][y] == 0 ) {\n\t fill(x,y);\n\t board[x][y] = 9;\n\t numQ++;\n\t //Attempts to call solve for every spot on the board\n\t for ( int r =0; r < xLen; r++ ) {\n\t\tfor ( int c = 0; c < yLen; c++ ) {\n\t\t if (!solved) \n\t\t\tsolve(r,c);\n\t\t \n\t\t}\n\t }\n\t /* Though I got my code to work for the 5x5 example, I had \n\t trouble extending it to larger boards. Essentially my solve\n\t places a queen in the first non-\"threatened\" spot on the board\n\t available, but doesn't go back to try another configuration if\n\t the program runs into a dead-end. */\n\t}\n }",
"public void shipPlacer(Board board, ShipTeam fleet){\r\n\r\n\t\tArrayList<Ship> theShips = fleet.getShips();\r\n\r\n\t\tint randomX, randomY;\r\n\t\tfor (Ship s : theShips){\r\n\t\t\tboolean goodPlace = false;\r\n\t\t\twhile (goodPlace == false){\r\n\t\t\t\tRandom randCoords = new Random();\r\n\t\t\t\trandomX = randCoords.nextInt(10);\r\n\t\t\t\trandomY = randCoords.nextInt(10);\r\n\t\t\t\tif (randomX % 2 == 0)\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 1);\r\n\t\t\t\telse\r\n\t\t\t\t\tgoodPlace = board.placeShip(randomX, randomY, s, 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected void registerTile(int x, int y) {}",
"public void move(@NotNull Map map, int x, int y)\n {\n if (map.map[this.x + x][this.y + y].isBlocking)\n {\n x = 0;\n y = 0;\n }\n\n this.x += x;\n this.y += y;\n }",
"public boolean placeComputerShipsDumb(int pattern) {\n if(cpuHasPlaced){\n return false;\n }\n switch(pattern){\n case 1:\n computerShips[0].setShip(4, 2, 1);\n for (int i = 4; i < 9; i++) {\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[1].setShip(2, 4, 0);\n for (int j = 4; j < 8; j++){\n computerPlayerBoard[2][j] = board.ship.ordinal();\n }\n computerShips[2].setShip(0, 0, 1);\n for (int i = 0; i < 3; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[3].setShip(7, 9, 1);\n for (int i = 6; i < 9; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[4].setShip(5, 4, 1);\n for (int i = 5; i < 7; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n break;\n case 2:\n computerShips[0].setShip(0, 0, 1);\n for(int i = 0; i < 6; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[1].setShip( 0, 3, 1);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n computerShips[2].setShip(0, 4, 1);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[3].setShip(0,1,1);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n computerShips[4].setShip(0,2,1);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n break;\n case 3:\n computerShips[0].setShip(0,0,0);\n for(int i = 0; i < 6; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[1].setShip( 0, 3, 0);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[3][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(0, 4, 0);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[3].setShip( 0, 1, 0);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(0,2,0);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n break;\n case 4:\n computerShips[0].setShip(3,4,1);\n for(int i = 3; i < 8; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[1].setShip( 3, 6, 1);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[i][6] = board.ship.ordinal();\n }\n computerShips[2].setShip(3, 3, 1);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n computerShips[3].setShip( 7, 9, 1);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[4].setShip(8,0,0);\n for(int i = 8; i <= 9; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n break;\n case 5:\n computerShips[0].setShip(0,9,0);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,6,1);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[i][6] = board.ship.ordinal();\n }\n computerShips[2].setShip(3,3,0);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[3][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(0,9,1);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[4].setShip(8,0,1);\n for(int i = 7; i < 9; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n break;\n case 6:\n computerShips[0].setShip(0,9,0);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(0,6,0);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(0,5,0);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(0,8,0);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(0,7,0);\n for(int i = 0; i < 2; i++){\n computerPlayerBoard[7][i] = board.ship.ordinal();\n }\n break;\n case 7:\n computerShips[0].setShip(3,3,0);\n for(int i = 3; i < 8; i++){\n computerPlayerBoard[3][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,5,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n //cruiser\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(3,2,0);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(3,4,0);\n for(int i = 3; i < 5; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n break;\n case 8:\n computerShips[0].setShip(2,4,1);\n for(int i = 2; i < 7; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[1].setShip(2,6,1);\n for(int i = 2; i < 6; i++){\n computerPlayerBoard[i][6] = board.ship.ordinal();\n }\n computerShips[2].setShip(4,5,1);\n for(int i = 4; i < 7; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n computerShips[3].setShip(2,3,1);\n for(int i = 2; i < 5; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n computerShips[4].setShip(2,5,1);\n for(int i = 2; i < 4; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n break;\n case 9:\n computerShips[0].setShip(0,0,1);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[1].setShip(2,1,1);\n for(int i = 2; i < 6; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n computerShips[2].setShip(7,0,1);\n for(int i = 7; i <= 9; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[3].setShip(5,0,1);\n for(int i = 5; i < 8; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[4].setShip(0,1,1);\n for(int i = 0; i < 2; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n break;\n case 10:\n computerShips[0].setShip(0,0,0);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(2,1,0);\n for(int i = 2; i < 6; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(7,0,0);\n for(int i = 7; i <= 9; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(5,0,0);\n for(int i = 5; i < 8; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(0,1,0);\n for(int i = 0; i < 2; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n break;\n case 11:\n computerShips[0].setShip(2,3,1);\n for(int i = 2; i < 7; i++){\n computerPlayerBoard[i][3] = board.ship.ordinal();\n }\n computerShips[1].setShip(2,5,1);\n for(int i = 2; i < 6; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n computerShips[2].setShip(3,0,0);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(4,1,1);\n for(int i = 4; i < 6; i++){\n computerPlayerBoard[i][1] = board.ship.ordinal();\n }\n computerShips[4].setShip(4,8,1);\n for(int i = 4; i < 6; i++){\n computerPlayerBoard[i][8] = board.ship.ordinal();\n }\n break;\n case 12:\n computerShips[0].setShip(3,5,0);\n for(int i = 3; i < 8; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,2,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(4,2,1);\n for(int i = 4; i < 7; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[3].setShip(3,0,0);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(3,9,0);\n for(int i = 3; i < 5; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n break;\n case 13:\n computerShips[0].setShip(0,0,1);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[1].setShip(0,9,1);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[2].setShip(6,0,1);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[i][0] = board.ship.ordinal();\n }\n computerShips[3].setShip(6,9,1);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n computerShips[4].setShip(8,9,1);\n for(int i = 8; i <= 9; i++){\n computerPlayerBoard[i][9] = board.ship.ordinal();\n }\n break;\n case 14:\n computerShips[0].setShip(0,4,1);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[1].setShip(0,2,1);\n for(int i = 0; i < 4; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[2].setShip(5,4,1);\n for(int i = 5; i < 8; i++){\n computerPlayerBoard[i][4] = board.ship.ordinal();\n }\n computerShips[3].setShip(4,2,1);\n for(int i = 4; i < 7; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n computerShips[4].setShip(6,2,1);\n for(int i = 6; i < 8; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n break;\n case 15:\n computerShips[0].setShip(1,4,0);\n for(int i = 1; i < 6; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,5,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(6,4,0);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[4][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(1,5,0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(7,5,0);\n for(int i = 7; i < 9; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n break;\n case 16:\n computerShips[0].setShip(1,1,0);\n for(int i = 1; i < 6; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,8,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(6,1,0);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(1,8,0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(7,8,0);\n for(int i = 7; i < 9; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n break;\n case 17:\n computerShips[0].setShip(1,1,0);\n for(int i = 1; i < 6; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,2,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(6,1,0);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[1][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(1,2,0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(7,2,0);\n for(int i = 7; i < 9; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n break;\n case 18:\n computerShips[0].setShip(1,6,0);\n for(int i = 1; i < 6; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(3,7,0);\n for(int i = 3; i < 7; i++){\n computerPlayerBoard[7][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(6,6,0);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[6][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(1,7,0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[7][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(7,7,0);\n for(int i = 7; i < 9; i++){\n computerPlayerBoard[7][i] = board.ship.ordinal();\n }\n break;\n case 19:\n computerShips[0].setShip(0,5,0);\n for(int i = 0; i < 5; i++){\n computerPlayerBoard[5][i] = board.ship.ordinal();\n }\n computerShips[1].setShip(2,2,0);\n for(int i = 2; i < 6; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(0,9,0);\n for(int i = 0; i < 3; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(6,0,0);\n for(int i = 6; i < 9; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(6,9,0);\n for(int i = 6; i < 8; i++){\n computerPlayerBoard[9][i] = board.ship.ordinal();\n }\n break;\n case 20:\n computerShips[0].setShip(2,5,1);\n for(int i = 2; i < 7; i++){\n computerPlayerBoard[i][5] = board.ship.ordinal();\n }\n computerShips[1].setShip(1,8,0);\n for(int i = 1; i < 5; i++){\n computerPlayerBoard[8][i] = board.ship.ordinal();\n }\n computerShips[2].setShip(3,0,0);\n for(int i = 3; i < 6; i++){\n computerPlayerBoard[0][i] = board.ship.ordinal();\n }\n computerShips[3].setShip(1,2,0);\n for(int i = 1; i < 4; i++){\n computerPlayerBoard[2][i] = board.ship.ordinal();\n }\n computerShips[4].setShip(4,2,1);\n for(int i = 4; i < 6; i++){\n computerPlayerBoard[i][2] = board.ship.ordinal();\n }\n break;\n\n }\n cpuHasPlaced = true;\n return true;\n }",
"private void computerTurn() {\r\n\t\tPoint index = randomIndex();\r\n\t\tSETslot((int)index.getX(), (int)index.getY(), randomValue());\r\n\t}",
"private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }",
"public abstract void manageCell(int x, int y, int livingNeighbours);",
"@Test\n public void testRookPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(0, chessBoard.getPiece(0, 0).getRow());\n assertEquals(0, chessBoard.getPiece(0, 0).getColumn());\n\n assertEquals(0, chessBoard.getPiece(0, 7).getRow());\n assertEquals(7, chessBoard.getPiece(0, 7).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 0).getRow());\n assertEquals(0, chessBoard.getPiece(7, 0).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 7).getRow());\n assertEquals(7, chessBoard.getPiece(7, 7).getColumn());\n }",
"public void move(int fromRow, int fromColumn, int toRow, int toColumn) {\n ImmutablePair<Integer, Integer> from = new ImmutablePair<>(fromRow, fromColumn);\n ImmutablePair<Integer, Integer> to = new ImmutablePair<>(toRow, toColumn);\n // Step 2. Generating move action\n ShiftChipAction moveAction = new ShiftChipAction(getPlayer(), from, to);\n // Step 3. Actually performing action\n perform(moveAction);\n }"
] | [
"0.6332777",
"0.6292649",
"0.6206695",
"0.6182023",
"0.6136774",
"0.61333656",
"0.60635793",
"0.6021614",
"0.59194016",
"0.5913409",
"0.5910836",
"0.5893515",
"0.5892581",
"0.58821905",
"0.5817605",
"0.581293",
"0.57961476",
"0.57951677",
"0.5781112",
"0.5780157",
"0.57715374",
"0.5762029",
"0.5754672",
"0.5739332",
"0.5726954",
"0.5707036",
"0.56998026",
"0.56809086",
"0.5676487",
"0.5673109",
"0.56634116",
"0.56225264",
"0.56177926",
"0.561527",
"0.5612833",
"0.5607439",
"0.5607124",
"0.5604724",
"0.56021816",
"0.5594094",
"0.55852723",
"0.5584599",
"0.5575048",
"0.5572086",
"0.556291",
"0.555486",
"0.554536",
"0.5541386",
"0.5540839",
"0.5525711",
"0.551672",
"0.5513703",
"0.55062324",
"0.55056185",
"0.55045086",
"0.55042076",
"0.5501815",
"0.54972076",
"0.5492996",
"0.54918957",
"0.54828143",
"0.54758334",
"0.5457745",
"0.54561657",
"0.5440556",
"0.5439262",
"0.5437115",
"0.543475",
"0.5431645",
"0.5419317",
"0.53995675",
"0.53925055",
"0.53907",
"0.53884476",
"0.5383619",
"0.5372314",
"0.5370402",
"0.53701913",
"0.5365083",
"0.53622437",
"0.53526896",
"0.53521943",
"0.53500676",
"0.5347695",
"0.5347016",
"0.53370667",
"0.53370106",
"0.5332461",
"0.5331594",
"0.5327838",
"0.53256685",
"0.5323008",
"0.53227895",
"0.53227067",
"0.5322004",
"0.5321711",
"0.5319324",
"0.53181434",
"0.53118753",
"0.5308808"
] | 0.8189344 | 0 |
Return the xcoordinate of repairKit. This method must throw IllegalStateException if repairKit is not placed on a board. | @Override
public long getRepairKitX(RepairKit repairKit) throws IllegalStateException
{
if (repairKit.getBoard() != null)
{
return repairKit.getPosition().getCoordX();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final int getPositionX() {\r\n return (int) position.x();\r\n }",
"public int getX() {\n return (int) center.getX();\n }",
"public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}",
"public double getPositionX() {\n\t\treturn this.tilePositionX;\n\t}",
"public int getX() {\r\n return (int) center.getX();\r\n }",
"public int getXPosition() {\n\t\treturn this.position.x;\n\t}",
"@Override\r\n\tpublic long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getXPosition() {\n return xPosition;\n }",
"public int getX() {\n return (int) this.center.getX();\n }",
"public int getX() {\n synchronized (this.xLock) {\n return (int) this.movementComposer.getXPosition();\n }\n }",
"public int getX() {\r\n\t\treturn xcoord;\r\n\t}",
"public int getX()\n\t{\n\t\treturn m_nPosX;\n\t}",
"public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }",
"public int getxPosition() {\n\t\treturn xPosition;\n\t}",
"public int getX() {\n return PADDING;\n //return columnToX(this.getCols());\n //throw new UnsupportedOperationException();\n }",
"public final int getXOffset() {\n return xOffset;\n }",
"public int getPositionX() {\r\n\t\treturn positionX;\r\n\t}",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition() {\n return this.xPosition;\n }",
"public int getX() {\n return pos_x;\n }",
"public final int getX()\n\t{\n\t\treturn pos.x;\n\t}",
"public int getXPosition(){\n\t\treturn xPosition;\n\t}",
"private int get_x() {\n return center_x;\n }",
"public int getPositionX() {\n return positionX;\n }",
"public int getXPos() {\n\t\treturn xPos;\n\t}",
"public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}",
"protected int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getX() {\n return (int) xPos;\n }",
"@Override\r\n\tpublic long getRobotX(Robot robot) throws IllegalStateException\r\n\t{\r\n\t\tif (robot.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn robot.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getxCoordinate() {\n\t\treturn xCoordinate;\n\t}",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getX() {\n return xCoord;\n }",
"public int getxPos() {\n\t\treturn xPos;\n\t}",
"public int getX() {\n\t\t\tint lastRobot = (state[2 * k] + k - 1) % k;\n\t\t\treturn state[lastRobot];\n\t\t}",
"public int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getX() {\n return posX;\n }",
"@Override\n\tpublic int getX() {\n\t\treturn this.posicionX;\n\t}",
"public int getPositionX(){\n\t\treturn positionx;\n\t}",
"public int getPos_x(){\n\t\treturn pos_x;\n\t}",
"public int getX() {\n return this.coordinate.x;\n }",
"public int getxPos() \n\t{\n\t\treturn xPos;\n\t}",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getCoordX() \r\n {\r\n \treturn this.coordX;\r\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int getX()\r\n {\r\n \treturn xPos;\r\n }",
"public int getxPos() {\n return xPos;\n }",
"public int getX() {\n return positionX;\n }",
"public double getXPosition()\n\t{\n\t\treturn xPosition;\n\t}",
"public int getX() {\r\n return xpos;\r\n }",
"@Override\n\tpublic double getXPos() {\n\t\treturn field_145851_c;\n\t}",
"public int getX()\r\n {\r\n return xCoord;\r\n }",
"protected Number getX() {\n return this.xCoordinate;\n }",
"public int getX()\r\n {\r\n return xLoc;\r\n }",
"public double getX() {\n return position.getX();\n }",
"public int getX() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int getX() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int getX() {\n\t\treturn 0;\n\t}",
"public int getStartX() {\r\n\t\treturn startX;\r\n\t}",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getXCoordinate ()\n {\n return xCoordinate;\n }",
"public int getPosX() {\n\t\treturn posX;\n\t}",
"public int x() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getX()\n\t{\n\t\treturn mX;\n\t}",
"public int getXpos() {\n\t\treturn xpos;\n\t}",
"public int getTileX() {\n\t\treturn tileX;\n\t}",
"public int getPosX() {\r\n\t\treturn posX;\r\n\t}",
"@Override\r\n\tpublic long getBatteryX(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}",
"public int getX(){\n\t\treturn this.x_location;\n\t}",
"public int getX() {\n\t\treturn this.x_indice * DIM_CASE;\n\t}",
"public int getX() { return position.x; }",
"public double getCardPosX(){\r\n return getX();\r\n }",
"public double getXCoordinate() {\n return xCoordinate;\n }",
"public int getLocX() {\n return locX;\n }",
"@Override\n\tpublic int getPosX() {\n\t\treturn posX;\n\t}",
"@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}",
"int getX() {\n return xPos;\n }",
"public double getxCoordinate() {\n return xCoordinate;\n }",
"public int getX() {\r\n\t\t\r\n\t\treturn topX;\r\n\t}",
"public int getTileX()\n\t{\n\t\treturn this.tileX;\n\t}",
"public int getX() {\n return (int) Math.round(x);\n }",
"public int getX() {\n\t\treturn x;\n\t}",
"public int getX() {\n\t\treturn x;\n\t}",
"public int getX() {\n\t\treturn x;\n\t}",
"public int getX() {\n\t\treturn x;\n\t}"
] | [
"0.688758",
"0.6849573",
"0.6835585",
"0.6818578",
"0.681378",
"0.6807152",
"0.68030936",
"0.6776794",
"0.67362744",
"0.6732178",
"0.67292553",
"0.67186147",
"0.6695235",
"0.6694449",
"0.66934544",
"0.6691406",
"0.66907984",
"0.6663321",
"0.6663321",
"0.6663176",
"0.66535354",
"0.66526777",
"0.66400194",
"0.6622499",
"0.6616784",
"0.65953255",
"0.65892255",
"0.6574211",
"0.6574091",
"0.65714854",
"0.6564594",
"0.6562686",
"0.6562686",
"0.6548794",
"0.6548794",
"0.6540274",
"0.6538227",
"0.6536134",
"0.65349317",
"0.65243524",
"0.6520486",
"0.6514517",
"0.64980376",
"0.64882094",
"0.6487181",
"0.64814204",
"0.64814204",
"0.6480378",
"0.64709365",
"0.6469547",
"0.6469513",
"0.6469513",
"0.6436537",
"0.6436537",
"0.6431198",
"0.64276224",
"0.6427436",
"0.63998646",
"0.6399334",
"0.6380684",
"0.637836",
"0.6366512",
"0.6343219",
"0.6331301",
"0.6331201",
"0.631199",
"0.631199",
"0.63042814",
"0.6293839",
"0.6293839",
"0.6293839",
"0.6293839",
"0.6293839",
"0.6293839",
"0.6293368",
"0.6291954",
"0.6285049",
"0.62741315",
"0.6265914",
"0.62628",
"0.6262686",
"0.62482923",
"0.62397027",
"0.6237385",
"0.62251925",
"0.6218595",
"0.6211401",
"0.61981624",
"0.61956656",
"0.6193299",
"0.6190667",
"0.6183773",
"0.6179851",
"0.6169004",
"0.6167798",
"0.6164611",
"0.61585766",
"0.61585766",
"0.61585766",
"0.61585766"
] | 0.88539743 | 0 |
Return the ycoordinate of repairKit. This method must throw IllegalStateException if repairKit is not placed on a board. | @Override
public long getRepairKitY(RepairKit repairKit) throws IllegalStateException
{
if (repairKit.getBoard() != null)
{
return repairKit.getPosition().getCoordY();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getY() {\r\n\t\treturn ycoord;\r\n\t}",
"public int getY() {\n synchronized (this.yLock) {\n return (int) this.movementComposer.getYPosition();\n }\n }",
"public int getY() {\n return PADDING;\n //return rowToY(this.getRows());\n //throw new UnsupportedOperationException();\n }",
"public int getY() {\n return (int) this.center.getY();\n }",
"public int getY()\n\t{\n\t\treturn m_nPosY;\n\t}",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"public int getY()\r\n {\r\n return yLoc;\r\n }",
"public int getY() {\n return (int) center.getY();\n }",
"public int getY() {\n return yCoord;\n }",
"public int getY() {\n return this.coordinate.y;\n }",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\n\t\t\n\t\treturn yPosition;\t\t// Gets the y integer\n\t}",
"public final int getY()\n\t{\n\t\treturn pos.y;\n\t}",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\r\n return (int) center.getY();\r\n }",
"public int getY() {\r\n\t\treturn this.y;\r\n\t}",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return y;\r\n }",
"public int y() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getY()\n\t{\n\t\treturn mY;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return (int) yPos;\n }",
"@Override\r\n\tpublic int getY() {\n\t\treturn (int)y;\r\n\t}",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY()\r\n {\r\n return yCoord;\r\n }",
"public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn this.Y;\r\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\t\tint lastRobot = (state[2 * k] + k - 1) % k;\n\t\t\treturn state[lastRobot + k];\n\t\t}",
"protected Number getY() {\n return this.yCoordinate;\n }",
"public int getY() {\r\n return this.y;\r\n }",
"public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getY() {\n return posY;\n }",
"public int getY() {\n return y;\r\n }",
"public double getPositionY() {\n\t\treturn this.tilePositionY;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn (int)y;\r\n\t}",
"public int getyCoord() {\n\t\treturn yCoord;\n\t}",
"public int getYPosition() {\n\t\treturn this.position.y;\n\t}",
"public int getY() {\n\t\treturn this.y_indice * DIM_CASE;\n\t}",
"public int getY() {\n return positionY;\n }",
"public int getY() {\n\t\treturn Y;\n\t}",
"public int getY()\n {\n return this.y;\n }",
"public double getY() {\n return position.getY();\n }",
"public int getY() {\n return pos_y;\n }",
"public int getYCoordinate()\n\t{\n\t\treturn yCoordinate;\n\t}",
"public int getY(){\r\n\t\treturn y;\r\n\t}",
"public int getYPosition() {\n return yPosition;\n }",
"public int getY()\n {\n return y;\n }",
"public int getY()\n {\n return y;\n }",
"public int getY() {\n\t\treturn 0;\n\t}",
"public int getY() {\n return (int) Math.round(y);\n }",
"public int getYPosition() {\n return this.yPosition;\n }",
"public int getY() {\n return y;\n }"
] | [
"0.69486356",
"0.6947233",
"0.69119954",
"0.69075155",
"0.6899383",
"0.68880576",
"0.68880576",
"0.68770415",
"0.68664646",
"0.68639314",
"0.6862785",
"0.68614125",
"0.68575776",
"0.68575776",
"0.68575776",
"0.68445915",
"0.68425655",
"0.6821859",
"0.6821859",
"0.6821859",
"0.6821859",
"0.6821859",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68206495",
"0.68178135",
"0.68022734",
"0.67705923",
"0.67705923",
"0.6768428",
"0.67661124",
"0.67659795",
"0.67659795",
"0.67659795",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6761427",
"0.6754285",
"0.67484504",
"0.67439836",
"0.67439836",
"0.67439836",
"0.67439836",
"0.67439836",
"0.67412907",
"0.6733681",
"0.67270666",
"0.67244613",
"0.67244613",
"0.67242134",
"0.67234826",
"0.67221665",
"0.67195946",
"0.67192006",
"0.6711172",
"0.6697009",
"0.66938263",
"0.66938263",
"0.66938263",
"0.66938263",
"0.66938263",
"0.66938263",
"0.6684334",
"0.6677982",
"0.66779214",
"0.6653557",
"0.66525435",
"0.6650349",
"0.6646539",
"0.66340387",
"0.6631033",
"0.662861",
"0.66280305",
"0.66271424",
"0.66059667",
"0.66059667",
"0.66022855",
"0.6600222",
"0.6577689",
"0.65686077"
] | 0.8449404 | 0 |
Create a new surprise box with weighing weight. This method must return null if the given parameters are invalid (e.g. negative weight). | @Override
public SurpriseBox createSurpriseBox(int weight)
{
return new SurpriseBox(weight);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testSetWeight()\n {\n WeightedKernel<Vector> instance = new WeightedKernel<Vector>();\n assertEquals(WeightedKernel.DEFAULT_WEIGHT, instance.getWeight());\n \n double weight = RANDOM.nextDouble();\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n weight = 0.0;\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n weight = 4.7;\n instance.setWeight(weight);\n assertEquals(weight, instance.getWeight());\n \n boolean exceptionThrown = false;\n try\n {\n instance.setWeight(-1.0);\n }\n catch ( IllegalArgumentException ex )\n {\n exceptionThrown = true;\n }\n finally\n {\n assertTrue(exceptionThrown);\n }\n \n }",
"private void createDog() {\n String weight = this.weight.getText();\n try {\n int intWeight = Integer.parseInt(weight);\n backToGui();\n } catch (NumberFormatException ex) {\n createFrame(\"Weight Input Not Valid\");\n } catch (WeightException w) {\n createFrame(\"Weight must be between 0 and 200\");\n }\n revalidate();\n repaint();\n }",
"public void setWeighing(Weighing<E> weighing);",
"double getWeight(V v, V w);",
"public float getWeight();",
"public SpaceWeights(int weight)\n {\n earthWeight = weight;\n }",
"public void setWeight(double w){\n weight = w;\n }",
"public void setWeight(float w) {\n weight = w;\n }",
"private void setWeight(float weight){\n this.weight = weight;\n }",
"public void createRabbit(String s, double w, int a)\r\n\t{\r\n\t\tsetRabbitSpecies(s);\r\n\t\tsetRabbitWeight(w);\r\n\t\tsetRabbitAge(a);\r\n\t}",
"public void setWeight(int w){\n\t\tweight = w;\n\t}",
"@Override\n public void setWeight(double w) {\n this.weight = w;\n\n }",
"public Square(int w)\n {\n width = w;\n }",
"public void setWeight(int w) {\n\t\tweight = w;\n\t}",
"public void setWeight(double weight) {\r\n this.weight = weight;\r\n }",
"public abstract double getWeight ();",
"public void setWeight(float value) {\n this.weight = value;\n }",
"int getWeight();",
"int getWeight();",
"public void setWeight(double weight) {\n this.weight = weight;\n }",
"public void setWeight(Double weight) {\n this.weight = weight;\n }",
"protected float clampWeight(float weigth) {\n\t\t float ret = weigth;\n\t\t if (ret < -10) ret = -10;\n\t\t if (ret > 10) ret = 10;\n\t\t return ret;\n\t\t }",
"public BMI(String name, double weight, double height)\n {\n this.name = name;\n this.weight = weight;\n this.height = height;\n }",
"public void setWeight(double weight){\n\t\tthis.weight = weight;\n\t}",
"public Weight getWeight();",
"Box(float x, float y, float w, float h, float strokeWeight) {\r\n setDimensions(x, y, w, h);\r\n this.strokeWeight = strokeWeight;\r\n boxColour = Colour.WHITE;\r\n }",
"public int weight ();",
"public static Goodie makeAsBox(float x, float y, float width, float height, String imgName) {\n Goodie g = new Goodie(width, height, imgName);\n g.setBoxPhysics(0, 0, 0, BodyType.StaticBody, false, x, y);\n g.setCollisionsEnabled(true);\n Lol.sGame.mCurrentLevel.addActor(g, 0);\n return g;\n }",
"Widget(Colour colour,int weight){\n\t\tthis.colour=colour;\n\t\tthis.weight=weight;\n\t}",
"public int getWeight();",
"public Cucumber(float weight) {\n\t\tthis(DEFAULT_CALORIES, weight);\n\t}",
"public void setWeight(Integer weight) {\n this.weight = weight;\n }",
"public WeightingModel(){}",
"public GiftCardProductQuery weight() {\n startField(\"weight\");\n\n return this;\n }",
"@Override\r\n\tpublic void setWeight(double weight) {\n\t\t\r\n\t}",
"public ColorWeight()\n {\n weight = 0;\n }",
"public void setWeight(int weight){\n\t\tthis.weight = weight;\n\t}",
"public Vec getRawWeight();",
"@Test(expected = TrainException.class)\n\tpublic void testCreateLocomotiveWithInvalidGrossWeight() throws TrainException\n\t{\n\t\tString validClassification = \"5E\";\n\t\tInteger invalidGrossWeight = -1;\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tasgn2RollingStock.RollingStock locomotiveWithInvalidGrossWeight = \n\t\t\t\tnew asgn2RollingStock.Locomotive(invalidGrossWeight , validClassification);\n\t}",
"private double newCost(int v, int w) {\n\t\treturn 0.0;\n\t}",
"public void setWeight(final double pWeight){this.aWeight = pWeight;}",
"public void setWeight(double weight){\n\t\tthis._weight = weight;\n\t}",
"public IdealWeightCalculator() {\n initComponents();\n }",
"public void setWeight(String weight) {\n this.weight = weight;\n }",
"@Nonnull\n public static UBL23WriterBuilder <WeightStatementType> weightStatement ()\n {\n return UBL23WriterBuilder.create (WeightStatementType.class);\n }",
"public static Unit siege(){\n\t\tUnit unit = new Unit(\"Siege\", \"C_W_Siege\", 15, 5, 12, 14, 4);\n\t\tunit.addWep(new Weapon(\"Warhammer\",10,5));\n\t\tunit.addActive(ActiveType.SLAM);\n\t\tunit.addActive(ActiveType.POWER);\n\t\tunit.addPassive(PassiveType.ALERT);\n\t\treturn unit;\n\t}",
"public void setWeight(double weight) {\n\t\tthis.weight = weight;\n\t}",
"Box(double h, double w, Double d){\r\n\r\n Height = h;\r\n Width = w;\r\n Depth = d;\r\n }",
"int Weight();",
"@Override\n\tpublic void setWeight(final double weight) {\n\n\t}",
"public InvalidWeightException(String message) {\n super(message);\n }",
"Box(double w, double h, double d) {\n\n widgh =w;\n height =h;\n depth =d;\n\n}",
"public Sqrt(String type, int weight) {\n\t\tsuper(type, weight);\n\t}",
"public void heightWeightTest() {\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.feetDropDownLocator, \"Feet drop-down\", 5)) {\r\n\t\t\tdropDownTest(QuoteForm_ComponentObject.feetDropDownLocator, QuoteForm_ComponentObject.feetDefaultLocator, \r\n\t\t\t\t\tQuoteForm_ComponentObject.feetValidSelectionLocator, QuoteForm_ComponentObject.feetInvalidSelectionLocator, \"FT.\", \"6\");\r\n\t\t}\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.inchesDropDownLocator, \"Inches drop-down\", 5)) {\r\n\t\t\tdropDownTest(QuoteForm_ComponentObject.inchesDropDownLocator, QuoteForm_ComponentObject.inchesDefaultLocator,\r\n\t\t\t\t\tQuoteForm_ComponentObject.inchesValidSelectionLocator, QuoteForm_ComponentObject.inchesInvalidSelectionLocator, \"IN.\", \"1\");\r\n\t\t}\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.weightInputLocator, \"Weight input field\", 5)) {\r\n\t\t\tString weightPlaceHolderLBS = Step.Extract.getContent(QuoteForm_ComponentObject.weightInputLocator, \"Weight placeholder\", \"placeholder\");\r\n\t\t\t\r\n\t\t\tif(weightPlaceHolderLBS.contentEquals(\"LBS.\")) {\r\n\t\t\t\tStep.Passed(\"Weight text box displays 'LBS.' as a placeholder\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Failed(\"Weight text box does not display 'LBS.' as a placeholder\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.weightInputLocator, \"Weight input field\", \"2345\");\r\n\t\t\tString weightSpecified = Step.Extract.getContentUsingJS(QuoteForm_ComponentObject.weightInputLocator,\r\n\t\t\t\t\t\"Weight input field content\");\r\n\t\t\tif(weightSpecified.length() > 3) {\r\n\t\t\t\tStep.Failed(\"Weight input field accepts more than 3 digits\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Weight input field does not accept more than 3 digits\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public int weight() {\n if (this.weight == null) {\n return 0;\n } else {\n return this.weight;\n } // if/else\n }",
"@Override\r\n\tpublic RepairKit createRepairKit(double repairAmount, int weight)\r\n\t{\r\n\t\treturn new RepairKit(repairAmount, weight);\r\n\t}",
"public float getWeight() {\n return weight;\n }",
"public float getWeight() {\n return weight;\n }",
"public WeightedItem(E value, Double w) {\n this.value = value;\n this.w = w;\n }",
"@Test\r\n public void testPutweight() throws Exception {\r\n System.out.println(\"putweight\");\r\n double[][] weightvector = null;\r\n String[] name = null;\r\n int[] faceid = null;\r\n connection instance = new connection();\r\n instance.putweight(weightvector, name, faceid);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public void setWeight (java.lang.Double weight) {\r\n\t\tthis.weight = weight;\r\n\t}",
"public void setWeight(int newWeight) {\n weight = newWeight;\n }",
"public TPageWeightVwRecord() {\n\t\tsuper(TPageWeightVw.T_PAGE_WEIGHT_VW);\n\t}",
"public double getWeight(){\n\t\treturn this._weight;\n\t}",
"public double womanWeight(double height) {\n return (height - 110) * 1.15;\n }",
"public static double weightCylinder( double radius, double height, double weight ) {\n return volumeCylinder( radius, height ) * weight;\n }",
"public double getWeight(){\n return weight;\n }",
"public float getWeight() {\n return weight;\n }",
"public float getWeight() {\n return weight;\n }",
"public double getWeight() {\n return 0;\n }",
"public HumanBuilder setWeight(double weight) {\n\t\t\t/*\n\t\t\t * if weight is a minus or 0 then will assign the value 0.1 to the weight of \n\t\t\t * the Human myHumaan\n\t\t\t */\n\t\t\tif(weight<=0)\n\t\t\t\tweight=0.1;\n\t\t\tmyHuman.weight=weight;\n\t\t\treturn this;\n\t\t}",
"private Node growNode( int w, int h ){\r\n\t\tboolean canGrowDown = (w <= root.w);\r\n\t\tboolean canGrowRight = (h <= root.h);\r\n\r\n\t\tboolean shouldGrowRight = canGrowRight && (root.h >= (root.w + w)); // attempt to keep square-ish by growing right when height is much greater than width\r\n\t\tboolean shouldGrowDown = canGrowDown && (root.w >= (root.h + h)); // attempt to keep square-ish by growing down when width is much greater than height\r\n\r\n\t\tif (shouldGrowRight){\r\n\t\t\treturn growRight(w, h);\r\n\t\t}\r\n\t\telse if (shouldGrowDown){\r\n\t\t\treturn growDown(w, h);\r\n\t\t}\r\n\t\telse if (canGrowRight){\r\n\t\t\treturn growRight(w, h);\r\n\t\t}\r\n\t\telse if (canGrowDown){\r\n\t\t\treturn growDown(w, h);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null; // need to ensure sensible root starting size to avoid this happening\r\n\t\t}\r\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testRectangleScaleHeightToNegative() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(200, 200),\n new Color(1, 0, 0), 1, 100, 50.0, 100.0));\n model1.addShape(Oval.createOval(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 50, 100, 0, -101));\n }",
"laptop(int length, int weight, int height, int width) {\r\n this.length = length;\r\n this.weight = weight;\r\n this.height = height;\r\n this.width = width;\r\n }",
"public double getWeight(){\n\t\treturn weight;\n\t}",
"public void setWeight(final int weight) {\n this.weight = weight;\n }",
"@Override\r\n\tpublic double getWeight() {\n\t\treturn 0;\r\n\t}",
"@Test\n public void calculateWeightedAverage_None() throws Exception {\n WeightedAverage.Builder builder = WeightedAverage.newBuilder();\n assertEquals(builder.calculate(), new BigDecimal(0));\n assertEquals(builder.build().calculateWeightedAverage(),\n new BigDecimal(0));\n }",
"@Override\r\n\tpublic AbstractBoxGift createBoxGift() {\n\t\treturn new HardPlastic();\r\n\t}",
"public WeightedEdge(){\n\t\t\n\t}",
"public double getWeight()\n\t{\n\t\t//metodo precisa retornar alguma coisa\n\t\treturn 0.0;\n\t}",
"@Test(expected = TrainException.class)\n\tpublic void testCreateFreightCarWithInvalidGrossWeight() throws TrainException\n\t{\n\t\tString validGoodsType = \"G\";\n\t\tInteger invalidGrossWeight = -1;\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tasgn2RollingStock.RollingStock freightCarWithInvalidGrossWeight = \n\t\t\t\tnew asgn2RollingStock.FreightCar(invalidGrossWeight , validGoodsType);\n\t}",
"public double getWeight() {\r\n return weight;\r\n }",
"public double getWeight() {\r\n return weight;\r\n }",
"public void setWeight(String newValue);",
"public double getWeight(){return this.aWeight;}",
"public double findWeight(){\n int totalCoins = gold + silver + copper + electrum + platinum;\n if((totalCoins % 3) == 0){\n return totalCoins/3;\n }\n return totalCoins * weight;\n }",
"public static void main(String[] args) {\r\n Scanner in = new Scanner(System.in);\r\n System.out.println(\"Please, enter the height\");\r\n float height = in.nextFloat();\r\n System.out.println(\"Please, enter the weight\");\r\n float weight = in.nextFloat();\r\n float idealWeight = height - 110;\r\n\r\n if (idealWeight < weight){\r\n System.out.println(\"You need to loose \" + (weight - idealWeight) + \"kg\");\r\n } else if (idealWeight > weight){\r\n System.out.println(\"You need to gain \" + (idealWeight - weight) + \"kg\");\r\n } else {\r\n System.out.println(\"Your weight is perfect\");\r\n }\r\n }",
"BigBox(float x, float y, float w, float h, float strokeWeight, Box... littleBoxes) {\r\n super(x, y, w, h, strokeWeight);\r\n boxes = littleBoxes;\r\n shadow = new Box(x + 2.5f, y + 2.5f, w, h, 0, Colour.GREY);\r\n group();\r\n }",
"public void setWeight(float value) {\n\t\t\tthis.weight = value;\n\t\t}",
"public double getWeight() {\n\t\n\t\treturn this.weight;\t \n\t}",
"@Test //TEST FIVE\n void testPositiveOverLimitWeight()\n {\n Rabbit_RegEx rabbit_weight = new Rabbit_RegEx();\n rabbit_weight.setWeight(17);\n rabbit_weight.setIsBaby(false);\n rabbit_weight.setAge(5);\n String expected = \"Is the rabbit a baby?: false\\n\" +\n \"How old is the rabbit?: 5 years\\n\" +\n \"Weight: 15.0 in pounds\\n\" +\n \"Color: \";\n assertEquals(expected, rabbit_weight.toString());\n }",
"public Double getHeadWeight();",
"@Test(expected = IllegalArgumentException.class)\n public void testRectangleScaleWidthToNegative() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(200, 200),\n new Color(1, 0, 0), 1, 100, 50.0, 100.0));\n model1.addShape(Oval.createOval(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 50, 100, -51, 100));\n }",
"@Override\n\tpublic double getWeight() {\n\t\treturn weight;\n\t}",
"public double getWeight() {\n\t\treturn weight; \n\t\t}",
"double getEdgeWeight();",
"public Term(String query, double weight)\n\t{\n\t\ttry\n\t\t{\n\t\t\tif(query == null)\n\t\t\t{\n\t\t\t\tjava.lang.NullPointerException nullString = new \n\t\t\t\t\tjava.lang.NullPointerException(\"String argument \"\n + \"(query) cannot be null.\"); \n\t\t\t\tthrow nullString;\n\t\t\t}\n if(weight < 0)\n {\n java.lang.IllegalArgumentException negativeWeight =\n new java.lang.IllegalArgumentException(\"Numeric\"\n + \" argument (weight) cannot be negative.\");\n throw negativeWeight;\n\n }\n\t\t} \n\n\t\tcatch(NullPointerException nullString)\n\t\t{\n\t\t\tSystem.out.println(nullString.getMessage());\n\t\t\treturn;\n\t\t}\n\t\tcatch(IllegalArgumentException negativeWeight)\n\t\t{\n\t\t\tSystem.out.println(negativeWeight.getMessage());\n\t\t\treturn;\n\t\t}\n\n\t\tthis.query = query;\n\t\tthis.weight = weight;\n\t}",
"@Test //TEST ONE\n void testNegativeWeight()\n {\n Rabbit_RegEx rabbit_weight = new Rabbit_RegEx();\n rabbit_weight.setWeight(-5.0);\n rabbit_weight.setIsBaby(true);\n rabbit_weight.setAge(1);\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 1 weeks\\n\" +\n \"Weight: 1.0 in ounces\\n\" +\n \"Color: \";\n assertEquals(expected, rabbit_weight.toString());\n }",
"public double getWeight() {\n return weight;\n }"
] | [
"0.5629283",
"0.54583836",
"0.5414648",
"0.54007846",
"0.5265859",
"0.5262858",
"0.5254486",
"0.5244365",
"0.5195884",
"0.5193027",
"0.5111058",
"0.5095961",
"0.5056132",
"0.5023445",
"0.5004456",
"0.49961755",
"0.49957457",
"0.49949658",
"0.49949658",
"0.49825525",
"0.49791124",
"0.4956043",
"0.49430382",
"0.49319145",
"0.4920722",
"0.49109754",
"0.49001122",
"0.48998448",
"0.48980647",
"0.48909616",
"0.4880633",
"0.48783347",
"0.48691264",
"0.48403195",
"0.48333615",
"0.4824367",
"0.48227182",
"0.4822163",
"0.48174053",
"0.48103517",
"0.4801576",
"0.480062",
"0.47873452",
"0.47847137",
"0.47793382",
"0.47722596",
"0.4762104",
"0.47539505",
"0.47505984",
"0.4746356",
"0.47428304",
"0.47417608",
"0.47398996",
"0.4739375",
"0.4731104",
"0.47269434",
"0.47108123",
"0.47108123",
"0.47049502",
"0.46945226",
"0.46905696",
"0.46857154",
"0.46830305",
"0.46785936",
"0.46710548",
"0.46702692",
"0.46477327",
"0.4647612",
"0.46454588",
"0.46386904",
"0.46383384",
"0.4629481",
"0.4615858",
"0.46148282",
"0.46141115",
"0.4601544",
"0.4598297",
"0.45904472",
"0.45848423",
"0.4584528",
"0.45794693",
"0.45736784",
"0.4568686",
"0.4568686",
"0.45672965",
"0.45576668",
"0.4555456",
"0.4554659",
"0.4551663",
"0.45433703",
"0.45423278",
"0.4540137",
"0.45379633",
"0.45370418",
"0.45347795",
"0.45309606",
"0.4529512",
"0.45273134",
"0.45232648",
"0.45172808"
] | 0.81605864 | 0 |
Put surpriseBox at position (x, y) on board (if possible). | @Override
public void putSurpriseBox(Board board, long x, long y, SurpriseBox surpriseBox)
{
try
{
surpriseBox.setPosition(new Position(x,y));
surpriseBox.setBoard(board);
}
catch(IllegalStateException exc)
{
System.out.println("Either this surprise box or this board is terminated; the surprise box cannot be placed on the board.");
}
catch(IllegalPositionException exc)
{
System.out.println("This is not a valid position on the board to place an element.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void putPiece(Piece piece, int x, int y)\r\n {\r\n if(isValidSqr(x, y))\r\n {\r\n board[x][y] = piece;\r\n if(piece != null) piece.setLocation(x, y);\r\n }\r\n }",
"private void UpdateSurround(int row, int col) {\n\t\t\n\t\t// updates the 3 positions below the bomb\n\t\tif(row - 1 >= 0) {\n\t\t\tif(grid[row-1][col] < 9)\n\t\t\t\tgrid[row-1][col] = grid[row-1][col] + 1;\n\t\t\tif(col - 1 >= 0) {\n\t\t\t\tif(grid[row-1][col-1] < 9)\n\t\t\t\t\tgrid[row-1][col-1] = grid[row-1][col-1] + 1;\n\t\t\t}\n\t\t\tif(col + 1 < width) {\n\t\t\t\tif(grid[row-1][col+1] < 9)\n\t\t\t\t\tgrid[row-1][col+1] = grid[row-1][col+1] + 1;\n\t\t\t}\n\t\t}\n\t\t// updates the 3 positions above the bomb\n\t\tif(row + 1 < height) {\n\t\t\tif(grid[row+1][col] < 9)\n\t\t\t\tgrid[row+1][col] = grid[row+1][col] + 1;\n\t\t\tif(col - 1 >= 0) {\n\t\t\t\tif(grid[row+1][col-1] <9)\n\t\t\t\t\tgrid[row+1][col-1] = grid[row+1][col-1] + 1;\n\t\t\t}\n\t\t\tif(col + 1 < width) {\n\t\t\t\tif(grid[row+1][col+1] < 9)\n\t\t\t\t\tgrid[row+1][col+1] = grid[row+1][col+1] + 1;\n\t\t\t}\n\t\t}\n\t\t// updates position to the left\n\t\tif(col - 1 >= 0) {\n\t\t\tif(grid[row][col-1] < 9)\n\t\t\t\tgrid[row][col-1] = grid[row][col-1] + 1;\n\t\t}\n\t\t// updates position to the right\n\t\tif(col + 1 < width) {\n\t\t\tif(grid[row][col+1] < 9)\n\t\t\t\tgrid[row][col+1] = grid[row][col+1] + 1;\n\t\t}\n\t}",
"public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }",
"boolean place (int x, int y) {\n\t\tint row = x;\n\t\tint col = y;\n\t\tmoleGrid[row][col] = 'M';\n\t\tmolesLeft++;\n\n\t\tif (moleGrid[row][col] == 'M') {\n\t\t\t// System.out.println(\"You have successfully placed a mole at coordinates.\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// System.out.println(\"Error: A mole was NOT placed at the coordinates.\");\n\t\t\treturn false;\n\n\t\t}\n\t\t\n\t}",
"public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }",
"private void createSquare(int x, int y, int row, int column) {\r\n grid[row][column] = new JLabel();\r\n grid[row][column].setOpaque(true);\r\n grid[row][column].setBackground(SQUARE_COLOR);\r\n grid[row][column].setBorder(SQUARE_BORDER);\r\n this.getContentPane().add(grid[row][column]);\r\n grid[row][column].setBounds(x,y,SQUARE_SIZE,SQUARE_SIZE);\r\n }",
"public boolean placePiece(Piece piece,String side, int row, int col)\n {\n\tboolean placed = true;\n\tint[][] shape = piece.getShape(); //shape of the piece\n\tString[][] fBoard = new String[rows][cols]; //temp front board\n\tString[][] bBoard = new String[rows][cols]; //temp back board\n\tfor(int i=0;i<rows;i++)\n\t {\n\t\tfor(int j=0;j<cols;j++)\n\t\t {\n\t\t\tfBoard[i][j] = frontBoard[i][j];\n\t\t\tbBoard[i][j] = backBoard[i][j];\n\t\t }\n\t }\n\tint insertRow = row; //row on the board being altered\n\tint insertCol = col; //column on the board being altered\n\tfor(int i=0;i<piece.getPieceRows();i++)\n\t {\n\t\tfor(int j=0;j<piece.getPieceCols();j++)\n\t\t {\n\t\t\tif(insertRow<0 || insertRow>rows-1 || insertCol<0 || insertCol>cols-1) //checks that the row and column numbers are valid\n\t\t\t {\n\t\t\t\tplaced = false;\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t\tif(side==\"front\") //places the piece relative to the front of the board\n\t\t\t\t {\n\t\t\t\t\tif(fBoard[insertRow][insertCol].equals(\"0\") || fBoard[insertRow][insertCol].charAt(1)=='0') \n\t\t\t\t\t //if the front board has a 0\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)//if the piece does not have a 0 in the spot\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tfBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2; //front gets a color and a 2\n\t\t\t\t\t\t\tbBoard[insertRow][rows-insertCol] = piece.getColor().charAt(0) + \"\" + shape[i][j]; //back gets a color and a 1\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse if(fBoard[insertRow][insertCol].charAt(1)=='1')\n\t\t\t\t\t //if the front board has a 1\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=2) //if the piece does not have a 2\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tfBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2; //front of the board gets a 2\n\t\t\t\t\t\t }\n\t\t\t\t\t\telse\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse\n\t\t\t\t\t //if the front of the board has a 2, only a piece with a 0 can be placed there\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t placed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\telse //places the piece relative to the back of the board (same rules as above only reversed)\n\t\t\t\t {\n\t\t\t\t\tif(bBoard[insertRow][insertCol].equals(\"0\") || bBoard[insertRow][insertCol].charAt(1)=='0')\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tbBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2;\n\t\t\t\t\t\t\tfBoard[insertRow][rows-insertCol] = piece.getColor().charAt(0) + \"\" + shape[i][j];\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse if(bBoard[insertRow][insertCol].charAt(1)=='1')\n\t\t\t\t\t {\n\t\t\t\t\t\tif(shape[i][j]!=2)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tbBoard[insertRow][insertCol] = piece.getColor().charAt(0) + \"\" + 2;\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\telse\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\telse\n\t\t\t\t\t {\n\t\t\t\t\t if(shape[i][j]!=0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t placed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\tinsertCol++;\n\t\t }\n\t\tinsertRow++;\n\t\tinsertCol = col;\n\t }\n\tif(placed) //if the piece did not encounter a collision, change the actual front and back of the board\n\t{\n\t\tfrontBoard = fBoard;\n\t\tbackBoard = bBoard;\n\t\tString color = piece.getColor();\n\t\tint index = 0;\n\t\twhile(!unused[index].getColor().equals(color))\n\t\t{\n\t\t\tindex++;\n\t\t}\n\t\tfor(int j=index;j<unused.length-1;j++)\n\t {\n\t\t\tunused[j] = unused[j+1];\n\t }\n\t\tunused[unused.length-1] = null;\n\t\tindex = 0;\n\t\tif(onBoard.length>0)\n\t\t{\n\t\t\twhile(onBoard[index]!=null && index<10)\n\t\t\t{\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\tif(index<10)\n\t\t{\n\t\t\tonBoard[index] = color;\n\t\t}\n\t}\n\treturn placed;\n }",
"public void place(Piece p, int x, int y) {\n\t\tif (x >= 8 || y >= 8 || p == null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (pieceAt(x, y) != null) {\n\t\t\t\tremove(x, y);\n\t\t\t}\n\t\t\tb[x][y] = p;\n\t\t\tif (p.isFire()) {\n\t\t\t\tnumFire += 1;\n\t\t\t} else {\n\t\t\t\tnumWater += 1;\n\t\t\t}\n\t\t}\n\t}",
"private void addToMap(int x, int y, MapBox piece){\n\t\tBoxContainer type;\r\n\t\t\n\t\t// determine the type of this square\n\t\ttype = BoxContainer.Open;\r\n\t\t\n\t\tif (piece.hasKey()){\n\t\t\t// this is a key so mark it as such and add it to our array\n\t\t\ttype = BoxContainer.Key;\n\t\t\tPoint thisPoint = new Point(x, y, BoxContainer.Key);\n\t\t\tif (!checkForPointInArr(keys, thisPoint)){ // make sure it's not already in the array\n\t\t\t\tkeys.add(thisPoint); // add this to our key array\n\t\t\t}\n\t\t} else if (piece.isEnd()){\n\t\t\t// this is an exit so mark it as such and add it to our array\n\t\t\ttype = BoxContainer.Exit;\n\t\t\tPoint thisPoint = new Point(x, y, BoxContainer.Exit);\n\t\t\tif (!checkForPointInArr(exits, thisPoint)){ // make sure it's not already in the array\n\t\t\t\texits.add(new Point(x, y, BoxContainer.Exit)); // add this to our exit array\n\t\t\t}\n\t\t}\r\n\t\t\n\t\t// add it to the map\r\n\t\t\n\t\tmap.addElement(x, y, type);\n\t\t\n\t\t// add its surroundings to the map\n\t\tPoint[] surrondings = new Point[4];\r\n\t\t\n\t\tsurrondings[0] = new Point(x, y + 1, castToBoxContainer(piece.North)); // add the north piece\n\t\tsurrondings[1] = new Point(x, y - 1, castToBoxContainer(piece.South)); // add the south piece\n\t\tsurrondings[2] = new Point(x + 1, y, castToBoxContainer(piece.East)); // add the east piece\n\t\tsurrondings[3] = new Point(x - 1, y, castToBoxContainer(piece.West)); // add the west piece\n\t\t\n\t\tfor (int i = 0; i < surrondings.length; i++){\n\t\t\t// check if this is a key or an exit and if so add it to the respective arrays if it not already there\n\t\t\tif (surrondings[i].type == BoxContainer.Exit){\n\t\t\t\tif (!checkForPointInArr(exits, surrondings[i])){ // make sure it's not already there\n\t\t\t\t\texits.add(surrondings[i]);\n\t\t\t\t}\n\t\t\t} else if (surrondings[i].type == BoxContainer.Key){\n\t\t\t\tif (!checkForPointInArr(keys, surrondings[i])){ // make sure it's not already there\n\t\t\t\t\tkeys.add(surrondings[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmap.addElement(surrondings[i].x, surrondings[i].y, surrondings[i].type);\n\t\t}\n\t}",
"public void removePiece(int x, int y)\r\n {\r\n if(isValidSqr(x, y)) board[x][y] = null;\r\n }",
"private void Stingboard(Point2 position) {\r\n GameBoard Stingboard = new GameBoard(position, BoardColor, BoardType.Sting);\r\n boards.add(Stingboard);\r\n }",
"public void pushCell(int x, int y) {\n\n if (fieldManager.isCellMined(x, y)) {\n fieldInerface.putLethalMineToButton(x, y);\n death(x, y);\n return;\n }\n\n fieldManager.openCell(x, y);\n fieldInerface.putEnvToButton(x, y, (int) fieldManager.getEnv(x, y));\n if (fieldManager.getEnv(x, y) == 0)\n for (int i = x - 1; i < x + 2; i++)\n for (int j = y - 1; j < y + 2; j++)\n if ((i >= 0) && (i < widthOfField) && (j >= 0)\n && (j < heightOfField))\n if (fieldManager.isCellOpenable(i, j))\n pushCell(i, j);\n }",
"public void addBox()\n {\n if(Student.sittingRia==false) {\n box = new BoxRia(\"chalkboard.png\",4,2);\n addObject(box,box.myRow,box.mySeat);\n chalk = new BoxRia(\"chalk.png\",0,0);\n addObject(chalk,2,3);\n }\n }",
"@Test\n void RookMoveToFriendlyOccupied() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 4, 3, 1);\n Piece rook2 = new Rook(board, 4, 6, 1);\n\n board.getBoard()[4][3] = rook1;\n board.getBoard()[4][6] = rook2;\n\n board.movePiece(rook1, 4, 6);\n\n Assertions.assertEquals(rook1, board.getBoard()[4][3]);\n Assertions.assertEquals(rook2, board.getBoard()[4][6]);\n }",
"void displayFilledSquare(Button button, int row, int column, ChessPiece piece);",
"public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}",
"public void setUnitOnBoard(Unit unit, int x, int y) {\n\t\tPosition pos = new Position(x, y);\n\t\tunitsOnBoard.put(pos, unit);\n\t\tunitPossitions.put(unit.getId(), pos);\n\t}",
"@Test\n void RookMoveUp() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 5, 4, 1);\n\n board.getBoard()[5][4] = rook;\n\n board.movePiece(rook, 5, 2);\n\n Assertions.assertEquals(rook, board.getBoard()[5][2]);\n Assertions.assertNull(board.getBoard()[5][4]);\n }",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"public void prepareToPlaceOnCurrentRow(Box box) {\n\t\tbox.y = getCurrentY();\n\t\tbox.x = getCurrentX();\n\t}",
"public static void placePlayerPiece(PlayerMovesHandler player) {\n\t\t// char piece = player.getPiece();\n\t\tScanner in = new Scanner(System.in);\n\t\tboolean invalidInput = true;\n\n\t\twhile (invalidInput) {\n\t\t\tSystem.out.println(\"Enter row and column no. where you want to place your mark (Top left is [1,1])\");\n\n\t\t\tint row = in.nextInt() - 1;\n\t\t\tint col = in.nextInt() - 1;\n\t\t\tinvalidInput = !(player.setPiece(row, col));\t// callee returns true if success \n\t\t}\n\t}",
"private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}",
"private void overwritePositionWithEmpty(int row, int col){\n gameBoard[row][col] = new EmptyPiece();\n }",
"void getBlowUp(int x, int y) {\n //YOUR CODE HERE\n\t whichBoard.remove(x, y);\n }",
"public PositionInTheGameBoard(int x, int y) throws PositionIsNotInGameboardException\r\n\t{\r\n\t\tif(x < 0 || x >= PositionInTheGameBoard.max_X || y < 0 || y >= PositionInTheGameBoard.max_Y) throw new PositionIsNotInGameboardException();\r\n\t\tthis.X = x;\r\n\t\tthis.Y = y;\r\n\t}",
"GamePiece(int x, int y) {\n this.row = x;\n this.col = y;\n this.left = false;\n this.right = false;\n this.down = false;\n this.up = false;\n this.neighbors = new HashMap<String, GamePiece>();\n this.powerStation = false;\n }",
"public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }",
"public void drawCell(int x, int y) {\n \n //Sets cell to occupied\n gameBoard[x][y] = 1;\n }",
"private void addNewBoard(int x, int y,\n\t\t\tArrayList<ArrayList<Integer>> board) {\n\t\tif (y < 0 || y > board.size() - 1) { //expanding up/down\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tArrayList<Integer> z = new ArrayList<>();\n\t\t\t\tfor (int j = 0; j < board.get(0).size(); j++) {\n\t\t\t\t\tif ((j < x + boardSize && j >= x && x >= 0)) { //adjusts for y if it isn't 0 or negative, almost forgot about this\n\t\t\t\t\t\tz.add(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz.add(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (y < 0) {\n\t\t\t\t\tboard.add(0, z);\n\t\t\t\t\ty++;\n\t\t\t\t} else {\n\t\t\t\t\tboard.add(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif (x < 0 || x > board.get(0).size() - 1) { //expanding to the left/right\n\t\t\tint loc = (x < 0) ? 0 : board.get(0).size();\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < board.size(); j++) {\n\t\t\t\t\tif (j < y + boardSize && j >= y) {\n\t\t\t\t\t\tboard.get(j).add(loc, 0); //append as opposed to add\n\t\t\t\t\t} else {\n\t\t\t\t\t\tboard.get(j).add(loc, 5); //append lack of board everywhere else\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tif ((y >= 0 && y < board.size())\n\t\t\t\t&& (x >= 0 && x < board.get(0).size())\n\t\t\t\t&& getBoard(x, y) == 5) { //If within board\n\t\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t\tboard.get(y + i).set(x + j, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfreeSpace += boardSize * boardSize;\n\t\t}\n\t\tupdateOffset();\n\t}",
"public void putChessOnBoard(int x, int y, int color) {\n \tif (this.board.put(x, y, color) == true) {\n System.out.println(\"Move played: \" + intToChar(x) + y);\n\n this.switchPlayer();\n\n if (this.board.checkGameOver(x, y, color) == true) {\n this.printResult(color);\n System.out.println(\"Game Over!\");\n System.exit(0);\n } else if (this.board.checkDraw() == true) {\n System.out.println(\"Draw!\");\n System.out.println(\"Game Over!\");\n System.exit(0); \n }\n }\n }",
"private void setFigureAtPlayerBattleground(int row, int col) {\n if (currentPlayer.isInPlayerBattlefield(row) && fields[row][col].isFieldFree()) {\n\n currentField.getCurrentFigure().setOwner(currentPlayer);\n currentPlayer.addFigure(currentField.getCurrentFigure());\n fields[row][col].setCurrentFigure(currentField.getCurrentFigure());\n\n } else {\n showMessageOnScreen(\"Invalid position!\");\n }\n }",
"@Test\n void RookMoveUpBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 4, 1);\n Piece rook2 = new Rook(board, 6, 2, 1);\n\n board.getBoard()[6][4] = rook1;\n board.getBoard()[6][2] = rook2;\n\n board.movePiece(rook1, 6, 1);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][4]);\n Assertions.assertEquals(rook2, board.getBoard()[6][2]);\n Assertions.assertNull(board.getBoard()[6][1]);\n }",
"public void turnToLiving(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = true;\n }",
"public void movePositionBox(double x, double y) {\n double myX = x - positionBoxSizeX / 2;\n double myY = y - positionBoxSizeY / 2;\n if (myX > drawPane.getWidth() - positionBoxSizeX) {\n myX = drawPane.getWidth() - positionBoxSizeX;\n } else if (x < (positionBoxSizeX / 2)) {\n myX = 0;\n }\n if (myY > drawPane.getHeight() - positionBoxSizeY) {\n myY = drawPane.getHeight() - positionBoxSizeY;\n } else if (myY < 0) {\n myY = 0;\n }\n positionBox.relocate(myX, myY);\n }",
"private void drawBox(Graphics window, int hsBtoRGB, int x, int y) {\n\t\t\n\t}",
"@Override\r\n\tpublic void pickUpSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot pick up the surprise box.\");\r\n\t\t}\r\n\t}",
"void setCurrentPosition(Square currentPosition);",
"public void putPiece(Piece piece, Square sqr)\r\n {\r\n if(sqr != null) putPiece(piece, sqr.x, sqr.y);\r\n }",
"final void put(Piece p, Square s) {\r\n if (p == KING) {\r\n map.put(kingPosition(), EMPTY);\r\n king = s;\r\n }\r\n board[s.col()][s.row()] = p;\r\n }",
"void move(int row, int col) {\n\n int rowdiff = row - this._row; int coldiff = col - this.column;\n if (((Math.abs(rowdiff)) > 1) || (Math.abs(coldiff)) > 1);\n || (row >= _side) || (col >= _side) || (row < 0) || (col < 0);\n || ((Math.abs(coldiff)) == 1) && ((Math.abs(rowdiff)) == 1))); {\n throw new java.lang.IllegalArgumentException();\n } \n else if (rowdiff == 1) && (coldiff == 0)//up method\n { \n if (((isPaintedSquare(row, col) && isPaintedFace(2)) || \n (!isPaintedSquare(row, col) && !isPaintedFace(2))) {\n up_method(cube)\n } else if (isPaintedFace(2) == true) {\n _facePainted[2] == false\n grid[row][col] == true\n up_method(cube)\n }\n else {\n _facePainted[2] == true\n grid[row][col] == false \n up_method(cube)\n }\n }\n else if ((rowdiff == -1) && (coldiff == 0)) //down method\n\n { \n if (((isPaintedSquare(row, col) && isPaintedFace(4)) || \n (!isPaintedSquare(row, col) && !isPaintedFace(4))) {\n up_method(cube)\n } else if (isPaintedFace(4) == true) {\n _facePainted[4] == false\n grid[row][col] == true\n up_method(cube)\n } else {\n _facePainted[4] == true\n grid[row][col] == false \n up_method(cube)\n }\n }\n else if (rowdiff == 0) && (coldiff == -1) { //left method\n if (((isPaintedSquare(row, col) && isPaintedFace(5)) || \n (!isPaintedSquare(row, col) && !isPaintedFace(5))) {\n up_method(cube)\n } else if (isPaintedFace(5) == true) {\n _facePainted[5] == false\n grid[row][col] == true\n up_method(cube)}\n else {\n _facePainted[5] == true\n grid[row][col] == false \n up_method(cube)}\n }\n else if ((rowdiff == 0) && (coldiff == 1)) { //right method\n if (((isPaintedSquare(row, col) && isPaintedFace(6)) || \n (!isPaintedSquare(row, col) && !isPaintedFace(6))) {\n up_method(cube)\n } else if (isPaintedFace(6) == true) {\n _facePainted[6] == false\n grid[row][col] == true\n up_method(cube)}\n else {\n _facePainted[6] == true\n grid[row][col] == false \n up_method(cube)\n \n }\n }\n\n\n }",
"private static void setbox(int lx, int ly, int rx, int ry) {\n\t\tfor(int i = ly; i< ry; i++) {\n\t\t\tfor(int j = lx; j<rx; j++) {\n\t\t\t\tarr[i][j] = 1;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void CaptuePiece(int i , int j , int k , int l){\r\n if(GameBoard.get(i,j).getColour() != GameBoard.get(k,l).getColour()){\r\n pos.setPosition(k,l);\r\n GameBoard.get(i,j).capture(pos);\r\n GameBoard.get(k,l).captured();\r\n \r\n\r\n //We need a method to null the (k,l) cell in GameBoard\r\n pos.setPosition(k,l);\r\n GameBoard.setNull(pos);\r\n GameBoard.get(i,j).move(pos); //to move the killer in new cell\r\n\r\n\r\n\r\n }\r\n }",
"void updateBoard(@TTTConstants.Sign int sign, int row, int column) {\n board[row][column] = sign;\n depth++;\n }",
"private void swapPosition(int curRow, int curCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[curRow][curCol];\n gameBoard[curRow][curCol] = new EmptyPiece();\n }",
"public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void placePiece(JumpInButton[][] square) {\r\n\t\tsquare[this.x][this.y].setBackground(Color.RED);\r\n\t}",
"public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}",
"public void putCellInGoodPlace(JmtCell cell, int x, int y, boolean flag) {\n \t\tif (sp > 9) {\r\n \t\t\tsp = 0;\r\n \t\t}\r\n \t\tint oldPointX = 0;\r\n \t\tint oldPointY = 0;\r\n \t\tboolean inGroup = false;\r\n \t\t// Il flag stato creato per capire sapere se e' una block regione e\r\n \t\t// quindi utilizzare\r\n \t\t// il vecchio metodo oppure se e' una cella quindi flag=true allora uso\r\n \t\t// il nuovo\r\n \t\t// System.out.println(\"------------PUT CELL IN GOOD PLACE\r\n \t\t// ----------------------\");\r\n \r\n \t\tif (flag) {\r\n \t\t\tRectangle bounds = GraphConstants.getBounds(cell.getAttributes()).getBounds();\r\n \t\t\tRectangle bounds2 = new Rectangle((int) bounds.getX() - 20, (int) bounds.getY(), (int) bounds.getWidth() + 38, (int) bounds.getHeight());\r\n \r\n \t\t\toldPointX = x;\r\n \t\t\toldPointY = y;\r\n \t\t\t// ---------inzio\r\n \t\t\t// Object[] cells=(graph).getDescendants(graph.getRoots());\r\n \t\t\t// for(int j=0;j<cells.length;j++){\r\n \t\t\t// if((cells[j] instanceof JmtCell) &&(cells[j]!=cell)){\r\n \t\t\t// Rectangle\r\n \t\t\t// boundcell=GraphConstants.getBounds(((JmtCell)cells[j]).getAttributes()).getBounds();\r\n \t\t\t// if(boundcell.intersects(bounds2)){\r\n \t\t\t// System.out.println(\"true\");\r\n \t\t\t// }\r\n \t\t\t// }\r\n \t\t\t// }\r\n \r\n \t\t\t// ---------------fine\r\n \t\t\t// check if a cell isInGroup\r\n \t\t\tif (isInGroup(cell)) {\r\n \r\n \t\t\t\tinGroup = true;\r\n \t\t\t}\r\n \r\n \t\t\t// Avoids negative starting point\r\n \t\t\tif (bounds.getX() < 20) {\r\n \t\t\t\tbounds.setLocation(20, (int) bounds.getY());\r\n \t\t\t}\r\n \t\t\tif (bounds.getY() < 0) {\r\n \t\t\t\tbounds.setLocation((int) bounds.getX(), 0);\r\n \t\t\t}\r\n \r\n \t\t\t// Qua ho le celle e archi che intersecano la mia cella\r\n \t\t\t// selezionata..bounds (molto efficente dal punto di vista della\r\n \t\t\t// pesantezza)\r\n \t\t\tObject[] overlapping = graph.getDescendants(graph.getRoots(bounds2));\r\n \r\n \t\t\tPoint2D zero = new Point(20, 0);\r\n \t\t\tresetOverLapping = 0;\r\n \t\t\twhile (overlapping.length > 0) {\r\n \r\n \t\t\t\t// Moves bounds until it doesn't overlap with anything\r\n \t\t\t\tPoint2D last = (Point2D) zero.clone();\r\n \t\t\t\tfor (int j = 0; j < overlapping.length; j++) {\r\n \r\n \t\t\t\t\tresetOverLapping++;\r\n \t\t\t\t\t// resetOverLapping is inserted for an anormall behavior of\r\n \t\t\t\t\t// Tool\r\n \t\t\t\t\t// in fact, if you disable this variable you can see that\r\n \t\t\t\t\t// the tools\r\n \t\t\t\t\t// stop and \"for cycle\" will be repeated infinite times\r\n \t\t\t\t\tif (resetOverLapping > 50) {\r\n \t\t\t\t\t\tbounds.setLocation(new Point(oldPointX, oldPointY));\r\n \t\t\t\t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \t\t\t\t\t\tresetOverLapping = 0;\r\n \t\t\t\t\t\treturn;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// System.out.println(\"---flag in for---\");\r\n \t\t\t\t\t// if(overlapping[j] instanceof JmtEdge\r\n \t\t\t\t\t// &&((JmtEdge)overlapping[j]).intersects((EdgeView)(graph.getGraphLayoutCache()).getMapping(overlapping[j],\r\n \t\t\t\t\t// false),\r\n \t\t\t\t\t// GraphConstants.getBounds(((JmtCell)cell).getAttributes())))\r\n \t\t\t\t\t// System.out.println(\"Intersect TRUE\");\r\n \r\n \t\t\t\t\t// Puts last to last corner of overlapping cells\r\n \t\t\t\t\tif (overlapping[j] instanceof JmtCell && overlapping[j] != cell && inGroup) {\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\tif (b2.getMaxX() > last.getX()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(b2.getMaxX(), last.getY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tif (b2.getMaxY() > last.getY()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(last.getX(), b2.getMaxY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t\tint numberOfChild = cell.getChildCount();\r\n \r\n \t\t\t\t\tif (!inGroup && overlapping[j] instanceof JmtCell && overlapping[j] != cell) {\r\n \r\n \t\t\t\t\t\tRectangle2D b = GraphConstants.getBounds(((JmtCell) overlapping[j]).getAttributes());\r\n \t\t\t\t\t\t// Consider only rectangles that intersects with given\r\n \t\t\t\t\t\t// bound\r\n \t\t\t\t\t\tif (b.intersects(bounds2)) {\r\n \t\t\t\t\t\t\tlast.setLocation(new Point(oldPointX, oldPointY));\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// inizio a controllare se l intersezione e' un lato\r\n \t\t\t\t\tif (overlapping[j] instanceof JmtEdge\r\n \t\t\t\t\t\t\t&& overlapping[j] != cell\r\n \t\t\t\t\t\t\t&& !isInGroup(overlapping[j])\r\n \t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\tGraphConstants.getBounds(cell.getAttributes())) && ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)) {\r\n \t\t\t\t\t\tboolean access = false;\r\n \t\t\t\t\t\tboolean access2 = false;\r\n \r\n \t\t\t\t\t\t// Nonostatne SourceCell e SinkCell estendano JMTCell\r\n \t\t\t\t\t\t// avevo problemi di nullPointerException per questo\r\n \t\t\t\t\t\t// verifico di che\r\n \t\t\t\t\t\t// tipo sono\r\n \r\n \t\t\t\t\t\tif (cell instanceof SourceCell\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\t\tGraphConstants.getBounds(((SourceCell) cell).getAttributes()))) {\r\n \t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)) {\r\n \t\t\t\t\t\t\t\t// _______INIZIO_____\r\n \t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(((SourceCell) cell).getAttributes());\r\n \t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\tsp = sp + 2;\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, false, true);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \r\n \t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, true, false);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, false, true);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp, false,\r\n \t\t\t\t\t\t\t\t\t\t\tfalse, true, false);\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\taccess = true;\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (cell instanceof SinkCell) {\r\n \r\n \t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(0)) {\r\n \r\n \t\t\t\t\t\t\t\tif (((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j], false),\r\n \t\t\t\t\t\t\t\t\t\tGraphConstants.getBounds(((SinkCell) cell).getAttributes()))) {\r\n \r\n \t\t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \t\t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(((SinkCell) cell).getAttributes());\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\t\tsp = sp + 3;\r\n \t\t\t\t\t\t\t\t\t\t\t// bounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\taccess2 = true;\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!isInGroup(overlapping[j]) && !access && !access2 && overlapping[j] instanceof JmtEdge) {\r\n \t\t\t\t\t\t\tif ((numberOfChild == 2)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getSource() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).getTarget() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t\t&& ((JmtEdge) overlapping[j]).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(overlapping[j],\r\n \t\t\t\t\t\t\t\t\t\t\tfalse), GraphConstants.getBounds(cell.getAttributes()))) {\r\n \r\n \t\t\t\t\t\t\t\taccess = access2 = false;\r\n \r\n \t\t\t\t\t\t\t\tArrayList<Point2D> intersectionPoints = ((JmtEdge) overlapping[j]).getIntersectionVertexPoint();\r\n \t\t\t\t\t\t\t\tif ((intersectionPoints == null) || intersectionPoints.size() <= 0) {\r\n \t\t\t\t\t\t\t\t\tbounds.setLocation(new Point(oldPointX, oldPointY));\r\n \t\t\t\t\t\t\t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \t\t\t\t\t\t\t\t\tresetOverLapping = 0;\r\n \t\t\t\t\t\t\t\t\treturn;\r\n \t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\tPoint2D tmp = (intersectionPoints.get(0));\r\n \r\n \t\t\t\t\t\t\t\t\tRectangle2D cellBound = GraphConstants.getBounds(cell.getAttributes());\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxX = (int) cellBound.getMaxX();\r\n \t\t\t\t\t\t\t\t\tdouble vertexMaxY = (int) cellBound.getMaxY();\r\n \t\t\t\t\t\t\t\t\tdouble vertexHeight = (int) cellBound.getHeight();\r\n \t\t\t\t\t\t\t\t\tdouble vertexWidth = (int) cellBound.getWidth();\r\n \t\t\t\t\t\t\t\t\tboolean upperSideIntersaction = ((JmtEdge) overlapping[j]).getUpperSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean lowerSideIntersaction = ((JmtEdge) overlapping[j]).getLowerSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean leftSideIntersaction = ((JmtEdge) overlapping[j]).getLeftSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tboolean rightSideIntersaction = ((JmtEdge) overlapping[j]).getRightSideIntersaction();\r\n \t\t\t\t\t\t\t\t\tif (upperSideIntersaction && lowerSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxX - (int) (vertexWidth / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getX() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\t;\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (leftSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tint valoreIntermedio = ((int) vertexMaxY - (int) (vertexHeight / 2));\r\n \t\t\t\t\t\t\t\t\t\tif ((int) tmp.getY() < valoreIntermedio) {\r\n \r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\tfalse, true, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition2 = new Point(newPosition.x, newPosition.y + sp);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition2);\r\n \t\t\t\t\t\t\t\t\t\t\tsp = sp + 3;\r\n \t\t\t\t\t\t\t\t\t\t\t// bounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t\t// GraphConstants.setBounds(((SinkCell)cell).getAttributes(),\r\n \t\t\t\t\t\t\t\t\t\t\t// cellBounds);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\t\ttrue, false, false, false);\r\n \t\t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (upperSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && rightSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint2D tmp1 = (intersectionPoints.get(1));\r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp1,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, false, true);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t} else if (lowerSideIntersaction && leftSideIntersaction) {\r\n \r\n \t\t\t\t\t\t\t\t\t\tPoint newPosition = (this.overlapping).findFreePosition(((JmtEdge) overlapping[j]), cell, cellBound, tmp,\r\n \t\t\t\t\t\t\t\t\t\t\t\tfalse, false, true, false);\r\n \t\t\t\t\t\t\t\t\t\tbounds.setLocation(newPosition);\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} // end if of edge\r\n \t\t\t\t}\r\n \r\n \t\t\t\tif (last.equals(zero)) {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \r\n \t\t\t\tbounds.setLocation(new Point((int) (last.getX()), (int) (last.getY())));\r\n \r\n \t\t\t\toverlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \t\t\t}\r\n \r\n \t\t\t// Puts this cell in found position\r\n \t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \r\n \t\t} else {\r\n \r\n \t\t\tRectangle bounds = GraphConstants.getBounds(cell.getAttributes()).getBounds();\r\n \t\t\tif (isInGroup(cell)) {\r\n \t\t\t\tinGroup = true;\r\n \t\t\t}\r\n \r\n \t\t\t// Avoids negative starting point\r\n \t\t\tif (bounds.getX() < 20) {\r\n \t\t\t\tbounds.setLocation(20, (int) bounds.getY());\r\n \t\t\t}\r\n \t\t\tif (bounds.getY() < 0) {\r\n \t\t\t\tbounds.setLocation((int) bounds.getX(), 0);\r\n \t\t\t}\r\n \t\t\tObject[] overlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \r\n \t\t\tif (overlapping == null) {\r\n \r\n \t\t\t\treturn;\r\n \t\t\t}\r\n \r\n \t\t\tPoint2D zero = new Point(20, 0);\r\n \t\t\twhile (overlapping.length > 0) {\r\n \t\t\t\tPoint2D last = (Point2D) zero.clone();\r\n \t\t\t\tfor (Object element : overlapping) {\r\n \t\t\t\t\tif (element instanceof JmtCell && element != cell && inGroup) {\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtCell) element).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\tif (b2.getMaxX() > last.getX()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(b2.getMaxX(), last.getY());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tif (b2.getMaxY() > last.getY()) {\r\n \t\t\t\t\t\t\t\tlast.setLocation(last.getX(), b2.getMaxY());\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!inGroup && element instanceof JmtCell && element != cell) {\r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \t\t\t\t\tint numberOfChild = cell.getChildCount();\r\n \t\t\t\t\tif (isInGroup(element) && element instanceof JmtEdge) {\r\n \t\t\t\t\t\tif ((numberOfChild == 2)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getSource() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getSource() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getTarget() != cell.getChildAt(0)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).getTarget() != cell.getChildAt(1)\r\n \t\t\t\t\t\t\t\t&& ((JmtEdge) element).intersects((EdgeView) (graph.getGraphLayoutCache()).getMapping(element, false), GraphConstants\r\n \t\t\t\t\t\t\t\t\t\t.getBounds(cell.getAttributes()))) {\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tRectangle2D b2 = GraphConstants.getBounds(((JmtEdge) element).getAttributes());\r\n \t\t\t\t\t\tif (b2.intersects(bounds)) {\r\n \t\t\t\t\t\t\t// ___\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\tlast.setLocation(new Point((int) (last.getX() + .5), (int) (last.getY() + .5)));\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t}\r\n \t\t\t\tif (last.equals(zero)) {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\tbounds.setLocation(new Point((int) (last.getX()), (int) (last.getY())));\r\n \t\t\t\toverlapping = graph.getDescendants(graph.getRoots(bounds));\r\n \t\t\t}\r\n \t\t\tGraphConstants.setBounds(cell.getAttributes(), bounds);\r\n \r\n \t\t}\r\n \r\n \t}",
"public static void house(Graphics g, int x, int y){\n\t\tg.setColor(Color.gray);\r\n\t\tg.fillRect(x, y, 20, 20);\r\n\t\tg.setColor(Color.darkGray);\r\n\t\tg.fillRect(x, y + 8, 20, 4);\r\n\t\tg.setColor(Color.LIGHT_GRAY);\r\n\t\tg.drawRect(x, y, 20, 20);\r\n\t}",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"private void setBox(){\n\t\tif((this.row >= 0 && this.row <= 2) && \n\t\t (this.column >= 0 && this.column <= 2)){\n\t\t\t\t\tthis.box = 1;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 0 && this.row <= 2) && \n\t\t (this.column >= 3 && this.column <= 5)){\n\t\t\t\t\tthis.box = 2;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 0 && this.row <= 2) && \n\t\t (this.column >= 6 && this.column <= 8)){\n\t\t\t\t\tthis.box = 3;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 3 && this.row <= 5) && \n\t\t (this.column >= 0 && this.column <= 2)){\n\t\t\t\t\tthis.box = 4;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 3 && this.row <= 5) && \n\t\t (this.column >= 3 && this.column <= 5)){\n\t\t\t\t\tthis.box = 5;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 3 && this.row <= 5) && \n\t\t (this.column >= 6 && this.column <= 8)){\n\t\t\t\t\tthis.box = 6;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 6 && this.row <= 8) && \n\t\t (this.column >= 0 && this.column <= 2)){\n\t\t\t\t\tthis.box = 7;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 6 && this.row <= 8) && \n\t\t (this.column >= 3 && this.column <= 5)){\n\t\t\t\t\tthis.box = 8;\n\t\t\t\t\treturn;\n\t\t}\n\t\tif((this.row >= 6 && this.row <= 8) && \n\t\t (this.column >= 6 && this.column <= 8)){\n\t\t\t\t\tthis.box = 9;\n\t\t\t\t\treturn;\n\t\t}\n\t}",
"static boolean place(int row, int col, char[][] piece) {\n\n if (canPlace(row, col, piece)) {\n for (int r = 0; r < piece.length; r++) {\n for (int c = 0; c < piece[r].length; c++) {\n if (row + r >= 0 && row + r < board.length && col + c >= 0 && col + c < board[row].length) {\n board[row + r][col + c] = piece[r][c];\n }\n }\n }\n }\n return false;\n\n\n }",
"@Test\n void RookMoveLeft() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 5, 5, 1);\n\n board.getBoard()[5][5] = rook;\n\n board.movePiece(rook, 1, 5);\n\n Assertions.assertEquals(rook, board.getBoard()[1][5]);\n Assertions.assertNull(board.getBoard()[5][5]);\n }",
"public void shootBabyInto(int x, int y) {\n home.world.cells[x][y].resident\n = new Omnivore(home.world.cells[x][y]);\n }",
"protected abstract void position(int[][] gameboard, int col, int row);",
"public Cell(int x, int y){\n\t\tif((x<0 || x>7) || (y<0 || y>7)){\n\t\t\tSystem.out.println(\"The provided coordinates for the cell are out of range.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.placedPiece = null;\n\t}",
"public void tellNearby(int x, int y)\r\n {\r\n // checks for nearby bombs\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n try\r\n {\r\n gameBoard.gameCells[row][col].addBombNearby();\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }",
"public void horizontal_right_bp(int x, int y) {\n if (x == 7)\n return;\n\n if (chessBoard[x + 1][y] == status.WHITE) {\n // i e zoodtarin khaneye meshki ke mibinad\n int i_black_cell = -1;\n boolean change = false;\n for (int k = x + 1; k <= 7; k++) {\n if (chessBoard[k][y] == status.EMPTY)\n break;\n if (chessBoard[k][y] == status.BLACK) {\n i_black_cell = k;\n change = true;\n break;\n }\n }\n if (change) {\n for (int k = x + 1; k < i_black_cell; k++) {\n chessBoard[k][y] = status.BLACK;\n }\n }\n }\n }",
"public void winBigSquare (){\n /*for (int i =0; i<9; i++){\n for (int j=0; j<9; j++)\n System.out.print(bSquares.get(i).getSmallSquare(j).getOwnership()+\" \");\n System.out.println();\n }*/\n for (int i =0; i<9; i++){\n if (bSquares.get(i).getOwnership()==0){\n bSquares.get(i).setOwnership(bSquares.get(i).checkThreeInaRow());\n //System.out.println(\"SWAGSTA!\");\n }\n }\n \n }",
"private void putOnBoard(int row, int col, boolean direction,String topWord, ArrayList<Piece> piecesOfTopWord,Board board){\n \t\t\n \t\tif (direction){\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\t\n \t\t\t\tif (board.getPiece(row, col+i)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tboard.insertPiece(toPlace, row, col + i);\n \t\t\t\t\ttoPlace.x = (col+i)*42 + 64;\n \t\t\t\t\ttoPlace.y = (row)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\tif (board.getPiece(row+i, col)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tboard.insertPiece(toPlace, row+i, col);\n \t\t\t\t\ttoPlace.y = (row+i)*42 + 64;\n \t\t\t\t\ttoPlace.x = (col)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t\t\t\n \t\t\t}\n \t\t}\n \t}",
"public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\tOptional<Piece> p = null;\n\t\t\n\t\tp = sq.processMousePress(e);\n\t\tp.ifPresent(item->{\n\t\t\titem.setScale(AnimalQueue.PieceScale);\n\t\t\titem.getMyQueue().addPiece(item, 0);\n\t\t\titem.draw();\n\t\t//\tsq.draw();\n\t\t\t});\n\t\tfor(int i=0; i<this.BOARD_SIZE; i++)\n\t\t{\n\t\t\tAnimalQueue aq = this.TheBoard[i];\n\t\t\tif(aq.contains(e.getPoint()))\n\t\t\t{\n\t\t\t\taq.getTop().ifPresent(item->{\n\t\t\t\t\tif(sq.isValidMove(item))\n\t\t\t\t\t{\n\t\t\t\t\t\taq.removePiece()\n\t\t\t\t\t\t.ifPresent(item2->{\n\t\t\t\t\t\t\tSystem.out.println(item2);\n\t\t\t\t\t\t\titem2.setScale(SolutionQueue.PieceScale);\n\t\t\t\t\t\t\tsq.addPiece(item2);\n\t\t\t\t\t\t\titem2.draw();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\tSystem.out.println(\"Not a valie move\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t/*\n\t\t\t\tp = aq.processMousePress(e);\n\t\t\t\tp.ifPresent(item->{\n\t\t//\t\t\tSystem.out.println(\"\\t aq contents =\"+ aq.myQueue);\n\t\t\t\t\tPiece tempP = aq.removePiece();\n\t\t\t\t\ttempP.setScale(SolutionQueue.PieceScale);\n\t\t\t\t\tsq.addPiece(tempP);\n\t\t//\t\t\tSystem.out.println(\"\\t Peek =\"+ aq.removePiece());\n\t\t//\t\t\tSystem.out.println(\"\\t PieceCode removed =\"+ tempP);\n\t\t//\t\t\tSystem.out.println(\"\\t aq contents =\"+ aq.myQueue);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t*/\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdraw();\n\t\trepaint();\n\t}",
"@Override\r\n\tpublic Set<SurpriseBox> getSurpriseBoxes(Board board)\r\n\t{\r\n\t\treturn board.getElements(SurpriseBox.class);\r\n\t}",
"public void drawBox(Graphics g, int x, int y) \n\t{\n\t\tbox.setX(x);\n\t\tbox.setY(y);\n\t\tg.setColor(null);\n\t\tg.draw(box);\n\t}",
"private void placePiece() {\r\n pieces[numPieces] = getRandomPoint();\r\n Game.movePiece(new PositionData(-1,-1,Constants.PLAYER_A_ID), pieces[numPieces]);\r\n numPieces++;\r\n }",
"@Test\n\tpublic void moveToOccupiedSpace() throws Exception {\n\t\tKing obstruction1 = new King(PieceColor.WHITE, 1, 5);\n\t\tKing obstruction2 = new King(PieceColor.BLACK, 5, 1);\n\t\tRook obstruction3 = new Rook(PieceColor.WHITE, 1, 1);\n\t\tQueen obstruction4 = new Queen(PieceColor.BLACK, 6, 5);\n\t\tgame.board.addPiece(obstruction1);\n\t\tgame.board.addPiece(obstruction2);\n\t\tgame.board.addPiece(obstruction3);\n\t\tgame.board.addPiece(obstruction4);\n\t\t\n\t\tgame.board.movePiece(knightCorner1White, 1, 5);\n\t\tgame.board.movePiece(knightCorner2Black, 5, 1);\n\t\tgame.board.movePiece(knightSide1White, 1, 1);\n\t\tgame.board.movePiece(knightSide2Black, 6, 5);\n\t\tassertEquals(knightCorner1White, game.board.getPiece(0, 7));\n\t\tassertEquals(knightCorner2Black, game.board.getPiece(7, 0));\n\t\tassertEquals(knightSide1White, game.board.getPiece(3, 0));\n\t\tassertEquals(knightSide2Black, game.board.getPiece(7, 3));\n\t}",
"@Test\n void RookMoveRightBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 2, 3, 1);\n Piece rook2 = new Rook(board, 6, 3, 1);\n\n board.getBoard()[2][3] = rook1;\n board.getBoard()[6][3] = rook2;\n\n board.movePiece(rook1, 7, 3);\n\n Assertions.assertEquals(rook1, board.getBoard()[2][3]);\n Assertions.assertEquals(rook2, board.getBoard()[6][3]);\n Assertions.assertNull(board.getBoard()[7][3]);\n }",
"private void placeBomb() {\n\t\tint x = ran.nextInt(worldWidth);\n\t\tint y = ran.nextInt(worldHeight);\n\n\t\tif (!tileArr[x][y].hasBomb()) {\n\t\t\ttileArr[x][y].setBomb(true);\n\n\t\t\tindex.add(\"Index\" + x + \",\" + y); // ADDED COMPONENT\n\t\t\trevealed.put(index, true);\n\t\t\tindex.removeFirst();\n\n\t\t} else {\n\t\t\tindex.add(\"Index\" + x + \",\" + y); // ADDED COMPONENT\n\t\t\trevealed.put(index, false);\n\t\t\tindex.removeFirst();\n\t\t\tplaceBomb();\n\t\t}\n\n\t}",
"public void putInCell (int x, int y, Sprite object){\n\t\tif (object instanceof Tile) {\n\t\t\tgameMap[x][y].setTile((Tile)object);\n\t\t\treturn;\n\t\t}\n\t\telse if(gameMap[x][y].getTile() instanceof Target && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\tdecrementOnTarget();\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\tincrementOnTarget();\n\t\t\t}\n\t\t}\n\t\telse if (gameMap[x][y].getTile() instanceof Switch && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t}\n\t\tgameMap[x][y].setObject((GameObject)object);\n\t}",
"public void markBoardSquare(int curRow, int curCol, int moveCounter) {\n setSquareVisited(curRow, curCol);\n setSquareMoveNumber(curRow, curCol, moveCounter);\n }",
"@Override\n\tpublic void mousePressed(MouseEvent me) {\n\t\tint x = me.getX();\n\t\tint y = me.getY();\n\t\tx = (int)( (x-mrg_x+spc_x/2) / spc_x) + nWALL;\n\t\ty = (int)( (y-mrg_y+spc_y/2) / spc_y) + nWALL;\n\t\t\n\t\tif (isPlaying && arr[x][y] == NONE) {\n\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t\t\n\t\t\tint t = (n+isWhiteWin+1) %2 ;\n\t\t\t\n\t\t\tif ( is33(x, y, (t%2==0)? WHITE:BLACK) ) {\n\t\t\t\t\n\t\t\t\tGraphics g = cvBoard.getGraphics();\n\t\t\t\tg.setColor(Color.red);\n\t\t\t\tg.drawOval((int) (mrg_x + (x-nWALL) * spc_x - spc_x/2) ,\n\t\t\t\t\t\t(int) (mrg_y + (y-nWALL) * spc_y -spc_y/2),\n\t\t\t\t\t\t(int) spc_x-1, (int) spc_y-1);\n\t\t\t\tg.fillOval((int) (mrg_x + (x-nWALL) * spc_x - spc_x/2) ,\n\t\t\t\t\t\t(int) (mrg_y + (y-nWALL) * spc_y -spc_y/2),\n\t\t\t\t\t\t(int) spc_x, (int) spc_y);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}",
"@Override\r\n\tpublic long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public void swapPieceValues(int x, int y, int row, int col) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}",
"@Test\n void RookMoveOutOfBound() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 1, 5, 1);\n board.getBoard()[1][5] = rook;\n board.movePiece(rook, -1, 5);\n }",
"private void actualizaHitbox() {\n hitbox = new Rect((int)(posX + 0.2 * bala.getWidth()), (int)(posY + 0.2 * bala.getHeight()), (int)(posX + 0.8 * bala.getWidth()), (int)(posY + 0.8 * bala.getHeight()));\n }",
"private boolean isInsideBoard(int x, int y){\n if(x < 0 || x > getWidth() - 1 || y < 0 || y > getHeight() - 1)\n return false;\n\n return true;\n }",
"public boolean putPlank(Board board, double x, double y, int direction) {\n if (planks == 0) {\n return false;\n }\n Plank temp = new Plank(x, y, direction);\n if (board.getValidPlankPositions().get(temp) == null || !board.getValidPlankPositions().get(temp)) {\n return false;\n }\n// HashMap<Point, Node> graph = board.getGraph();\n board.removeEdges(x, y, direction);\n // in order for us to draw planks, we have to remember all used planks in each turn.\n board.getUsedPlanks().put(temp, label);\n planks -=1;\n // once we put a plant in (x,y) horizontally, we have to invalidate of vertical plank in the same position.\n // We also need to invalidate the plank with the same direction next to this one.\n board.removePlank(x, y, direction, false);\n board.removePlank(x, y, 1-direction, true);\n return true;\n }",
"@Test\n void RookMoveLeftBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 2, 1);\n Piece rook2 = new Rook(board, 4, 2, 1);\n\n board.getBoard()[6][2] = rook1;\n board.getBoard()[4][2] = rook2;\n\n board.movePiece(rook1, 1, 2);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][2]);\n Assertions.assertEquals(rook2, board.getBoard()[4][2]);\n Assertions.assertNull(board.getBoard()[1][2]);\n }",
"private void drawSquare(int x, int y, Color color) {\r\n\t\t// sets the color to the passed in color.\r\n\t\tg.setColor(color);\r\n\t\t// draws a rectangle based on the given properties.\r\n\t\tg.fillRect(x * TetrisGame.SQUARE_LENGTH, y * TetrisGame.SQUARE_LENGTH,\r\n\t\t\t\t TetrisGame.SQUARE_LENGTH - 1,\r\n\t\t\t\t TetrisGame.SQUARE_LENGTH - 1);\r\n\t}",
"public void deplaceSur(int x, int y, Robot r) {\r\n\t\tif(y >= 0 && y < hauteur && x >= 0 && x < largeur)\r\n\t\t\tthis.plateau[y][x].deplaceSur(r);\r\n\t}",
"public void playOn(int x, int y)\r\n\t{\r\n\t\t//Converts x positions to array indices.\r\n\t\tx--;\r\n\t\ty--;\r\n\t\t//The x and y inputs need to be within the board boundaries.\r\n\t\tif(x>=0 && x<grid.length && y>=0 && y<grid.length)\r\n\t\t{\r\n\t\t\t//The UI grid will be updated.\r\n\t\t\t/*This method will have to be resolved.\r\n\t\t\tif(ships.hitsShipOn(x, y))\r\n\t\t\t\t\tgrid[x][y] = 1;\r\n\t\t\telse\r\n\t\t\t\t\tgrid[x][y] = -1;*/\r\n\t\t}\r\n\t\t\t\r\n\t}",
"void prepareBoardBeforePlacement( Board board );",
"@Test\n\tpublic void moveToValidSpace() throws Exception {\n\t\tgame.board.movePiece(knightCorner1Black, 1, 2);\n\t\tgame.board.movePiece(knightCorner2White, 5, 6);\n\t\tgame.board.movePiece(knightSide1Black, 2, 2);\n\t\tgame.board.movePiece(knightSide2White, 4, 5);\n\t\tgame.board.movePiece(knightMiddleWhite, 5, 2);\n\t\tassertEquals(knightCorner1Black, game.board.getPiece(1, 2));\n\t\tassertEquals(knightCorner2White, game.board.getPiece(5, 6));\n\t\tassertEquals(knightSide1Black, game.board.getPiece(2, 2));\n\t\tassertEquals(knightSide2White, game.board.getPiece(4, 5));\n\t\tassertEquals(knightMiddleWhite, game.board.getPiece(5, 2));\n\t}",
"private void showCells(Integer x, Integer y){\n if(cells[x][y].getBombCount()!=0){\n return;\n }\n if (x >= 0 && x < grid.gridSize-1 && y >= 0 && y < grid.gridSize && !cells[x + 1][y].getBomb())\n clickCell(MouseButton.PRIMARY, cells[x + 1][y]);\n\n if (x > 0 && x < grid.gridSize && y >= 0 && y < grid.gridSize && !cells[x - 1][y].getBomb())\n clickCell(MouseButton.PRIMARY, cells[x - 1][y]);\n\n if (x >= 0 && x < grid.gridSize && y >= 0 && y < grid.gridSize-1 && !cells[x][y + 1].getBomb())\n clickCell(MouseButton.PRIMARY, cells[x][y + 1]);\n\n if (x >= 0 && x < grid.gridSize && y > 0 && y < grid.gridSize && !cells[x][y - 1].getBomb())\n clickCell(MouseButton.PRIMARY, cells[x][y - 1]);\n }",
"@Test\n void RookCapture() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 3, 3, 1);\n Piece rook2 = new Rook(board, 6, 3, 2);\n\n board.getBoard()[3][3] = rook1;\n board.getBoard()[6][3] = rook2;\n\n board.movePiece(rook1, 6, 3);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][3]);\n Assertions.assertNull(board.getBoard()[3][3]);\n }",
"public GamePiece(Color color, int x, int y){\n king = false;\n this.x = x;\n this.y = y;\n this.color = color;\n // Aligns to correct position on centre of the correct tile\n setCenterX(30 + (x * 60));\n setCenterY(30 + (y * 60));\n setRadius(20);\n // Sets the colour of the piece to visually show who it belongs to\n setFill(color);\n }",
"public void putPieceOnBoard(ChessBoardBlock b, String player) {\r\n\t\tint blackCount = getBlackCountInVector();\r\n\t\tint whiteCount = getWhiteCountInVector();\r\n\t\tif (blackCount == 12 && whiteCount == 12) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Cannot put any more pieces on</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (blackCount == 12 && player.equals(\"black\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Black pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (whiteCount == 12 && player.equals(\"white\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>White pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString position = b.position;\r\n\t\tChessPiece tmpPiece;\r\n\t\tif (player.equals(\"black\")) {\r\n\t\t\ttmpPiece = blackPieces[blackCount];\r\n\t\t\tSystem.out.println(player);\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A1\")||position.equals(\"B1\")||position.equals(\"C1\")||position.equals(\"D1\")||\r\n\t\t\t\tposition.equals(\"E1\")||position.equals(\"F1\")||position.equals(\"G1\")||position.equals(\"H1\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"white\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttmpPiece = whitePieces[whiteCount];\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A8\")||position.equals(\"B8\")||position.equals(\"C8\")||position.equals(\"D8\")||\r\n\t\t\t\tposition.equals(\"E8\")||position.equals(\"F8\")||position.equals(\"G8\")||position.equals(\"H8\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"black\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\ttmpPiece.position = position;\r\n\t\tpiece.put(position, tmpPiece);\r\n\t\tbody.add(tmpPiece);\r\n\t\treFormatPieceLayer();\r\n\r\n\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"</html>\");\r\n\t}",
"private void process(int x, int y, int val){\n\t\t//if topology at position x,y is not explored\n\t\t// enqueue the cell\n\t\t// and give the cell a new score\n\t\tif(topology[x][y]==-1){\n\t\t\tqCells.enQueue(new Point(x,y));\n\t\t\ttopology[x][y] = val +1;\n\t\t}\n\t}",
"public Cell(final int indX, final int indY, int x, int y) {\r\n\t\tthis.stage = GameScreen.stage;\r\n\t\tthis.indX = indX;\r\n\t\tthis.indY = indY;\r\n\r\n\t\tthis.img = new Image(Assets.manager.get(Assets.SQUARE_TXT, Texture.class));\r\n\t\timg.setX(x);\r\n\t\timg.setY(y);\r\n\t\tstage.addActor(img);\r\n\t\timg.addListener(new InputListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\r\n\t\t\t\t// Call gameLogic to find where piece belongs and check game state\r\n\t\t\t\tGameScreen.game.placePiece(indX, indY);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"public abstract boolean actualPlace(int row, int col);",
"public void movePiece(int xStart, int yStart, int xEnd, int yEnd) {\n board[xEnd][yEnd] = board[xStart][yStart];\n board[xStart][yStart] = null;\n board[xEnd][yEnd].moveTo(xEnd, yEnd);\n if (board[xEnd][yEnd] instanceof ChessPieceKing) {\n if (board[xEnd][yEnd].isBlack()) {\n locationBlackKing = new Point(xEnd, yEnd);\n } else {\n locationWhiteKing = new Point(xEnd, yEnd);\n }\n }\n\n drawScreen();\n }",
"boolean setStone(int x, int y);",
"private static boolean placeQueen(char[][] board, int row, int col) {\n\n\t\tif (row > board.length || col > board[0].length) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tboard[row][col] = 'Q';\n\t\t\treturn true;\n\t\t}\n\t}",
"public void paintbox(Graphics page, Rectangle box)\n\t\t{\n\t\t\tpage.drawImage(rock, box.x, box.y, box.width, box.height, this); //Places the rock image over the column \n\t\t}",
"public void drawBox( Graphics window, Color i, int x, int y )\n\t{\n\t\twindow.setColor(i);\n\t\twindow.fillRect(x,y,100,100);\n\t\t// this code \"erases\" the center of the box by painting over it in white\n\t\twindow.setColor(Color.WHITE);\n\t\twindow.fillRect(x+10,y+10,80,80);\n\t}",
"@Test\n void RookMoveDownBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 7, 1, 1);\n Piece rook2 = new Rook(board, 7, 4, 1);\n\n board.getBoard()[7][1] = rook1;\n board.getBoard()[7][4] = rook2;\n\n board.movePiece(rook1, 7, 7);\n\n Assertions.assertEquals(rook1, board.getBoard()[7][1]);\n Assertions.assertEquals(rook2, board.getBoard()[7][4]);\n Assertions.assertNull(board.getBoard()[7][7]);\n }",
"public abstract Piece setLocation(int row, int column);",
"private void setUpCollisionBox()\n {\n \txLeftOffsetCollisionBox = width/COLLISION_WIDTH_DIV;\n \tcollisionBoxHeight = height - COLLISION_BOX_H_OFFSET;\n \n \tcollisionBox = new Rectangle(\n\t\t\t\t \t\txPos, \n\t\t\t\t \t\tyPos, \n\t\t\t\t \t\t(int)width / 2,\n\t\t\t\t \t\tcollisionBoxHeight);\n }"
] | [
"0.67930377",
"0.65930176",
"0.6466083",
"0.6396689",
"0.62959516",
"0.62678367",
"0.6225915",
"0.612343",
"0.607027",
"0.6063356",
"0.5982312",
"0.59452677",
"0.5942211",
"0.59329814",
"0.59314275",
"0.59252083",
"0.5891279",
"0.5889623",
"0.58809793",
"0.5880098",
"0.58659154",
"0.5854922",
"0.5826345",
"0.58151746",
"0.5811918",
"0.58112985",
"0.5806843",
"0.58003527",
"0.5783986",
"0.57792866",
"0.57666606",
"0.57663274",
"0.5763861",
"0.5755221",
"0.5747133",
"0.57425606",
"0.57355505",
"0.5729858",
"0.5728796",
"0.57263815",
"0.57256997",
"0.571522",
"0.5713522",
"0.5704111",
"0.56895673",
"0.5689221",
"0.5688482",
"0.568542",
"0.5680115",
"0.5668254",
"0.56598413",
"0.56504935",
"0.5646176",
"0.5634157",
"0.56172806",
"0.5610445",
"0.5609929",
"0.5607984",
"0.56037366",
"0.5602768",
"0.5594821",
"0.55873877",
"0.55824304",
"0.5580166",
"0.55742204",
"0.5571906",
"0.5563446",
"0.55574894",
"0.55505294",
"0.5540916",
"0.5536557",
"0.5533311",
"0.55330914",
"0.55321246",
"0.55274886",
"0.55214417",
"0.5517432",
"0.5505903",
"0.5502109",
"0.54990524",
"0.5497535",
"0.5496306",
"0.5495362",
"0.5491037",
"0.5484516",
"0.54769206",
"0.5475814",
"0.5468428",
"0.5467711",
"0.54633987",
"0.5461749",
"0.5449627",
"0.5443737",
"0.5442498",
"0.54422843",
"0.5441516",
"0.5440662",
"0.5437932",
"0.5436313",
"0.543456"
] | 0.8323775 | 0 |
Return the xcoordinate of surpriseBox. This method must throw IllegalStateException if surpriseBox is not placed on a board. | @Override
public long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException
{
if (surpriseBox.getBoard() != null)
{
return surpriseBox.getPosition().getCoordX();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic long getRepairKitX(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"private int get_x() {\n return center_x;\n }",
"public final int getPositionX() {\r\n return (int) position.x();\r\n }",
"public int getX() {\r\n return (int) center.getX();\r\n }",
"public int getX() {\n return (int) center.getX();\n }",
"public final int getX()\n\t{\n\t\treturn pos.x;\n\t}",
"public int getX() {\n return (int) this.center.getX();\n }",
"public int getX() {\n return pos_x;\n }",
"public int getXPosition() {\n return xPosition;\n }",
"public int getPositionX() {\r\n\t\treturn positionX;\r\n\t}",
"public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getX() {\r\n return xpos;\r\n }",
"public int getXPosition() {\n\t\treturn this.position.x;\n\t}",
"public int getxPosition() {\n\t\treturn xPosition;\n\t}",
"public double getPositionX() {\n\t\treturn this.tilePositionX;\n\t}",
"public int getX() {\r\n\t\treturn xcoord;\r\n\t}",
"public int getX()\n\t{\n\t\treturn m_nPosX;\n\t}",
"public int getXPosition() {\n return this.xPosition;\n }",
"public int getPositionX() {\n return positionX;\n }",
"public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }",
"public int getXPosition(){\n\t\treturn xPosition;\n\t}",
"public int getX() {\n return this.coordinate.x;\n }",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getX() {\n return posX;\n }",
"public int getPos_x(){\n\t\treturn pos_x;\n\t}",
"public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}",
"public int getX() {\n return xCoord;\n }",
"protected int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getPositionX(){\n\t\treturn positionx;\n\t}",
"public int getXPos() {\n\t\treturn xPos;\n\t}",
"@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}",
"public int getxPos() \n\t{\n\t\treturn xPos;\n\t}",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxPos() {\n\t\treturn xPos;\n\t}",
"public int getCoordX() \r\n {\r\n \treturn this.coordX;\r\n }",
"public int getX() {\n return (int) xPos;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getxCoordinate() {\n\t\treturn xCoordinate;\n\t}",
"public int getX()\r\n {\r\n \treturn xPos;\r\n }",
"public int getX()\r\n {\r\n return xCoord;\r\n }",
"public int getXpos() {\n\t\treturn xpos;\n\t}",
"public float getX(){\n return hitBox.left;\n }",
"public int getX() {\n return PADDING;\n //return columnToX(this.getCols());\n //throw new UnsupportedOperationException();\n }",
"@Override\r\n\tpublic long getRobotX(Robot robot) throws IllegalStateException\r\n\t{\r\n\t\tif (robot.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn robot.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getX() {\n return (int) Math.round(x);\n }",
"public int x() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getSeilX() {\n\t\tif (this instanceof Seilaufhaenger) {\n\t\t\tif (((Seilaufhaenger) this).getHangingElement() != null) {\n\t\t\t\tElement hangingElement = ((Seilaufhaenger) this).getHangingElement();\n\t\t\t\treturn hangingElement.getMPoint().x;\n\t\t\t}\n\t\t}\n\t\treturn (getX() + (int) (seilxRel * xscale));\n\t}",
"public int getX() {\r\n\t\t\r\n\t\treturn topX;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int getxPos() {\n return xPos;\n }",
"public int getX() {\n synchronized (this.xLock) {\n return (int) this.movementComposer.getXPosition();\n }\n }",
"public int getXPoint() {\r\n return this.x;\r\n }",
"public int getX() {\n return positionX;\n }",
"double getXPosition();",
"@Override\n\tpublic double getXPos() {\n\t\treturn field_145851_c;\n\t}",
"@Override\n\tpublic int getX() {\n\t\treturn this.posicionX;\n\t}",
"public double getXPosition()\n\t{\n\t\treturn xPosition;\n\t}",
"public double getUserFriendlyXPos(){\n return xPos - myGrid.getWidth()/ HALF;\n }",
"public double getX() {\n\t\tRectangle2D bounds = _parentFigure.getBounds();\n\t\tdouble x = bounds.getX() + (_xt * bounds.getWidth());\n\t\treturn x;\n\t}",
"public int centerX() {\n return mRect.centerX();\n }",
"public float getLowerLeftX()\n {\n return ((COSNumber)rectArray.get(0)).floatValue();\n }",
"public int getPosX() {\n\t\treturn posX;\n\t}",
"public int getCellXCoord(int col) {\n return TOP_LEFT_X + (col * BLOCK_WIDTH);\n }",
"public int getPosX() {\r\n\t\treturn posX;\r\n\t}",
"public int get_X_Coordinate()\n {\n return currentBallX;\n }",
"public double getCardPosX(){\r\n return getX();\r\n }",
"public int getX() { return position.x; }",
"public int getXCoordinate ()\n {\n return xCoordinate;\n }",
"public int getX()\n\t{\n\t\treturn mX;\n\t}",
"public int getXLeftUpper() {\n return xLeftUpper;\n }",
"Coordinate getMinX();",
"int getMouseX(int scWidth) {\n return Mouse.getX() * (scWidth + ZanMinimap.heightOffset) / game.d;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getX() {\n return x_;\n }",
"public int getXLeft() {\n return xLeft;\n }",
"@Override\n\tpublic int getPosX() {\n\t\treturn posX;\n\t}",
"@Basic\n\tpublic double getXCoordinate() {\n\t\treturn this.x;\n\t}",
"public float getX() {\n return pos.x;\n }",
"@Override\n\tpublic int getX() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int getX() {\n\t\treturn 0;\n\t}",
"int getX() {\n return xPos;\n }",
"protected Number getX() {\n return this.xCoordinate;\n }",
"private double getPosX() {\n\t\treturn this.posX.get();\n\t}",
"public double getX() {\n return position.getX();\n }",
"public int getLeftX() {\n\t\treturn 0;\r\n\t}"
] | [
"0.71046853",
"0.67062026",
"0.6586946",
"0.6539601",
"0.6533614",
"0.6495761",
"0.6486897",
"0.6471802",
"0.64567673",
"0.64459527",
"0.64310056",
"0.642839",
"0.642839",
"0.64205486",
"0.6405411",
"0.6405349",
"0.6392244",
"0.6391231",
"0.63909084",
"0.6374378",
"0.63708925",
"0.63701636",
"0.6353904",
"0.63390267",
"0.63358825",
"0.63358825",
"0.63308007",
"0.6319063",
"0.6317747",
"0.6314795",
"0.6305603",
"0.63030344",
"0.630106",
"0.62981725",
"0.62891865",
"0.6278689",
"0.6277709",
"0.6277709",
"0.62755764",
"0.62753147",
"0.62745166",
"0.6272529",
"0.6272529",
"0.627212",
"0.62620956",
"0.62620956",
"0.62612647",
"0.6247291",
"0.62463766",
"0.62408996",
"0.62280804",
"0.62271386",
"0.62210226",
"0.6211734",
"0.62087387",
"0.6205578",
"0.62041396",
"0.61976004",
"0.6193929",
"0.6193929",
"0.6191444",
"0.6185148",
"0.6178168",
"0.6171394",
"0.61654484",
"0.616221",
"0.6159003",
"0.61524194",
"0.61478585",
"0.614397",
"0.6142557",
"0.61247194",
"0.61123526",
"0.6108455",
"0.6105431",
"0.6103887",
"0.6101252",
"0.6101216",
"0.6100286",
"0.60984695",
"0.6096871",
"0.608938",
"0.60879916",
"0.60873306",
"0.60873306",
"0.60873306",
"0.60873306",
"0.60873306",
"0.60873306",
"0.6086287",
"0.6084767",
"0.60812384",
"0.6067992",
"0.60640377",
"0.60640377",
"0.6060375",
"0.60587776",
"0.6049547",
"0.6038595",
"0.6020581"
] | 0.88538677 | 0 |
Return the ycoordinate of surpriseBox. This method must throw IllegalStateException if surpriseBox is not placed on a board. | @Override
public long getSurpriseBoxY(SurpriseBox surpriseBox) throws IllegalStateException
{
if (surpriseBox.getBoard() != null)
{
return surpriseBox.getPosition().getCoordY();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic long getRepairKitY(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public final int getY()\n\t{\n\t\treturn pos.y;\n\t}",
"public int getY() {\n return this.coordinate.y;\n }",
"public int y() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getY() {\n return (int) this.center.getY();\n }",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}",
"@Override\r\n\tpublic int getY() {\n\t\treturn (int)y;\r\n\t}",
"public float getY(){\n return hitBox.top;\n }",
"public int getY() {\n return posY;\n }",
"public double getPositionY() {\n\t\treturn this.tilePositionY;\n\t}",
"public int getY()\n\t{\n\t\treturn m_nPosY;\n\t}",
"public int yPos() {\n\t\treturn Engine.scaleY(y);\n\t}",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return y;\r\n }",
"@Override\r\n\tpublic long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getyCoord() {\n\t\treturn yCoord;\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getYPoint() {\r\n return this.y;\r\n }",
"public int getY() {\r\n\t\treturn this.y;\r\n\t}",
"public int getY() {\r\n\t\treturn ycoord;\r\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn (int)y;\r\n\t}",
"public int getY() {\r\n return this.y;\r\n }",
"public int getY() {\n return pos_y;\n }",
"public int getY() {\n return yCoord;\n }",
"public int getY() {\n return (int) yPos;\n }",
"public int getY()\n {\n return this.y;\n }",
"public int getY()\r\n\t{\r\n\t\treturn this.Y;\r\n\t}",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\r\n return ix / numCols;\r\n }",
"public int getY() {\n return y;\r\n }",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY() {\r\n\t\t\r\n\t\treturn topY;\r\n\t}",
"public final int getPositionY() {\r\n return (int) position.y();\r\n }",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY()\r\n {\r\n return yCoord;\r\n }",
"public int getY() {\n return (int) Math.round(y);\n }",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n\t{\n\t\treturn y;\n\t}",
"public int getY()\n {\n return y;\n }",
"public int getY()\n {\n return y;\n }",
"public int getY() {\n return (int) center.getY();\n }",
"public double getCardPosY(){\r\n return getY();\r\n }",
"public int getCoordY() \r\n {\r\n \treturn this.coordY;\r\n }",
"public int getY() {\n\t\t\n\t\treturn yPosition;\t\t// Gets the y integer\n\t}",
"public int getyPosition() {\n\t\treturn yPosition;\n\t}",
"public int getY()\n\t{\n\t\treturn mY;\n\t}",
"public int getY(){\r\n\t\treturn y;\r\n\t}",
"public int getY()\r\n {\r\n return yLoc;\r\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public double getY() {\n return position.getY();\n }",
"public int getY() {\r\n return (int) center.getY();\r\n }"
] | [
"0.67018145",
"0.663198",
"0.6561997",
"0.65593153",
"0.65081674",
"0.65081674",
"0.65056986",
"0.6494495",
"0.6494495",
"0.6494495",
"0.64933026",
"0.64922",
"0.6483896",
"0.6467897",
"0.6466499",
"0.64642084",
"0.6461033",
"0.64560455",
"0.64560455",
"0.64448994",
"0.64435804",
"0.6442507",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.644154",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6439172",
"0.6438863",
"0.64376056",
"0.6436468",
"0.64346933",
"0.64333475",
"0.64309335",
"0.6429397",
"0.6416197",
"0.64142317",
"0.64139456",
"0.6411538",
"0.6411538",
"0.6411538",
"0.6411538",
"0.6411538",
"0.640634",
"0.6406049",
"0.6396166",
"0.6396166",
"0.63960177",
"0.6391876",
"0.63912845",
"0.63912845",
"0.63912845",
"0.6391021",
"0.6389964",
"0.6381106",
"0.63783413",
"0.63783413",
"0.63783413",
"0.63783413",
"0.63783413",
"0.6375222",
"0.6375222",
"0.6375222",
"0.6375222",
"0.6375222",
"0.6375222",
"0.6365821",
"0.6365821",
"0.6364496",
"0.63638026",
"0.636155",
"0.6354428",
"0.6353224",
"0.6352015",
"0.63476366",
"0.6338847",
"0.6337273",
"0.6337273",
"0.6336932",
"0.6336122"
] | 0.8637382 | 0 |
Create a new Robot looking at orientation with energy wattsecond. This method must return null if the given parameters are invalid (e.g. negative energy). 0, 1, 2, 3 respectively represent up, right, down and left. | @Override
public Robot createRobot(int orientation, double initialEnergy)
{
Orientation ori = Orientation.convertIntToOrientation(orientation);
if(Robot.canHaveAsOrientation(ori))
{
Robot robot = new Robot(null, null, ori, initialEnergy, (double) 20000);
if(robot.canHaveAsEnergy(initialEnergy))
{
return robot;
}
else
{
return null;
}
}
else
{
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Robot() {\t\n\t\tthis.step = myclass.STD_STEP ; \n\t\tthis.speed = myclass.STD_SPEED ; \n\t\tthis.rightM = new EV3LargeRegulatedMotor(myclass.rightP) ; \n\t\tthis.leftM = new EV3LargeRegulatedMotor(myclass.leftP) ; \n\t}",
"Robot getRobot(Position pos);",
"private void calculateLocation()\r\n\t{\r\n\t\tdouble leftAngleSpeed \t= this.angleMeasurementLeft.getAngleSum() / ((double)this.angleMeasurementLeft.getDeltaT()/1000); //degree/seconds\r\n\t\tdouble rightAngleSpeed \t= this.angleMeasurementRight.getAngleSum() / ((double)this.angleMeasurementRight.getDeltaT()/1000); //degree/seconds\r\n\r\n\t\tdouble vLeft\t= (leftAngleSpeed * Math.PI * LEFT_WHEEL_RADIUS ) / 180 ; //velocity of left wheel in m/s\r\n\t\tdouble vRight\t= (rightAngleSpeed * Math.PI * RIGHT_WHEEL_RADIUS) / 180 ; //velocity of right wheel in m/s\t\t\r\n\t\tdouble w \t\t= (vRight - vLeft) / WHEEL_DISTANCE; //angular velocity of robot in rad/s\r\n\t\t\r\n\t\tDouble R \t= new Double(( WHEEL_DISTANCE / 2 ) * ( (vLeft + vRight) / (vRight - vLeft) ));\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\tdouble ICCx = 0;\r\n\t\tdouble ICCy = 0;\r\n\r\n\t\tdouble W_xResult \t\t= 0;\r\n\t\tdouble W_yResult \t\t= 0;\r\n\t\tdouble W_angleResult \t= 0;\r\n\t\t\r\n\t\tdouble E_xResult \t\t= 0;\r\n\t\tdouble E_yResult \t\t= 0;\r\n\t\tdouble E_angleResult \t= 0;\r\n\t\t\r\n\t\t//short axe = 0;\r\n\t\t\r\n\t\tdouble deltaT = ((double)this.angleMeasurementLeft.getDeltaT())/1000;\r\n\t\t\r\n\t\t// Odometry calculations\r\n\t\tif (R.isNaN()) \t\t\t\t//robot don't move\r\n\t\t{\r\n\t\t\tW_xResult\t\t= this.pose.getX();\r\n\t\t\tW_yResult\t\t= this.pose.getY();\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse if (R.isInfinite()) \t//robot moves straight forward/backward, vLeft==vRight\r\n\t\t{ \r\n\t\t\tW_xResult\t\t= this.pose.getX() + vLeft * Math.cos(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_yResult\t\t= this.pose.getY() + vLeft * Math.sin(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse \r\n\t\t{\t\t\t\r\n\t\t\tICCx = this.pose.getX() - R.doubleValue() * Math.sin(this.pose.getHeading());\r\n\t\t\tICCy = this.pose.getY() + R.doubleValue() * Math.cos(this.pose.getHeading());\r\n\t\t\r\n\t\t\tW_xResult \t\t= Math.cos(w * deltaT) * (this.pose.getX()-ICCx) - Math.sin(w * deltaT) * (this.pose.getY() - ICCy) + ICCx;\r\n\t\t\tW_yResult \t\t= Math.sin(w * deltaT) * (this.pose.getX()-ICCx) + Math.cos(w * deltaT) * (this.pose.getY() - ICCy) + ICCy;\r\n\t\t\tW_angleResult \t= this.pose.getHeading() + w * deltaT;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)W_xResult, (float)W_yResult);\r\n\t\tthis.pose.setHeading((float)W_angleResult);\r\n\t\t\r\n\t\t// Conversion to grads\r\n\t\tW_angleResult = W_angleResult/Math.PI*180;\r\n\t\t\r\n\t\t// Get the heading axe\r\n\t\t//axe = getHeadingAxe();\r\n\t\tgetHeadingAxe();\r\n\t\t\r\n\t\t// Verify the coordinates and the heading angle\r\n\t\tif (Po_Corn == 1)\r\n\t\t{\r\n\t\t\tswitch (Po_CORNER_ID)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\tPo_ExpAng = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\tE_yResult = 0.11;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tE_xResult = 1.6;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.45;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tE_angleResult = W_angleResult;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint block = 0;\r\n\t\t\t// white = 0, black = 2, grey = 1\r\n\t\t\tif ((lineSensorLeft == 0) && (lineSensorRight == 0) && (block == 0)) \t// Robot moves on the black line\r\n\t\t\t{\r\n\t\t\t\tswitch (Po_CORNER_ID)\t\t\t\t\t\t\t\t// Even numbers - x, Odd numbers - y\r\n\t\t\t\t{\r\n\t\t\t\tcase 0: \r\n\t\t\t\t\tif (this.pose.getX() < 1.6)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 1: \r\n\t\t\t\t\tif (this.pose.getY() < 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tif (this.pose.getX() > 1.65)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tif (this.pose.getY() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.5; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 4: \r\n\t\t\t\t\tif (this.pose.getX() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tif (this.pose.getY() < 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 6: \r\n\t\t\t\t\tif (this.pose.getX() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tif (this.pose.getY() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 2)) || ((lineSensorLeft == 2) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_W)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_W;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_W))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_W;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 1)) || ((lineSensorLeft == 1) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_G)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_G;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_G))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_G;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tLCD.drawString(\"AngRs: \" + (E_angleResult), 0, 7);\r\n\t\t\r\n\t\t// Conversion to rads\r\n\t\tW_angleResult = W_angleResult*Math.PI/180;\r\n\t\tE_angleResult = E_angleResult*Math.PI/180;\r\n\t\t\r\n\t\tif ((Po_CORNER_ID == 3) && (100*this.pose.getY() < 45))\r\n\t\t{\r\n\t\t\tE_angleResult = 3*Math.PI/180;;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)E_xResult, (float)E_yResult);\r\n\t\tthis.pose.setHeading((float)E_angleResult);\r\n\t\t\r\n\t\t/*\r\n\t\t// Integration deviation correction\r\n\t\tthis.pose.setLocation((float)(W_xResult), (float)(W_yResult + (0.01*22.4)/175));\r\n\t\tthis.pose.setHeading((float)((W_angleResult + 14/175)*Math.PI/180));\r\n\t\t*/\r\n\t}",
"public RobotEngine (){\r\n\t\tthis.fuel = 100;\r\n\t\tthis.recycledMaterial = 0;\r\n\t\tthis.container = new ItemContainer ();\r\n\t\tthis.direction = Direction.NORTH;\r\n\t\tthis.navega = new NavigationModule();\r\n\t}",
"public DriveTrain(){\r\n super(\"Drive Train\");\r\n Log = new MetaCommandLog(\"DriveTrain\", \"Gyro\" , \"Left Jaguars,Right Jaguars\");\r\n gyro1 = new Gyro(RobotMap.AnalogSideCar , RobotMap.DriveTrainGyroInput);\r\n lfJag = new Jaguar(RobotMap.frontLeftMotor);\r\n lfRearJag = new Jaguar(RobotMap.rearLeftMotor);\r\n rtJag = new Jaguar(RobotMap.frontRightMotor);\r\n rtRearJag = new Jaguar(RobotMap.rearRightMotor);\r\n drive = new RobotDrive(lfJag, lfRearJag, rtJag, rtRearJag);\r\n \r\n //lfFrontJag = new Jaguar (3);\r\n //rtFrontJag = new Jaguar (4);\r\n \r\n //joystick2 = new Joystick(2);\r\n //sensor1 = new DigitalInput(1);\r\n //sensor2 = new DigitalInput (2);\r\n\r\n }",
"@Override\n\tprotected ArrayList<ModulePosition> buildRobot() {\n\t\tArrayList<ModulePosition> mPos = new ArrayList<ModulePosition>();\n\t\tmPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\tmPos.add(new ModulePosition(\"custom 1\", new VectorDescription(1*ATRON.UNIT, -5*ATRON.UNIT, 1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 2\", new VectorDescription(1*ATRON.UNIT, -5*ATRON.UNIT, -1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 3\", new VectorDescription(2*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\tmPos.add(new ModulePosition(\"custom 4\", new VectorDescription(3*ATRON.UNIT, -5*ATRON.UNIT, 1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 5\", new VectorDescription(3*ATRON.UNIT, -5*ATRON.UNIT, -1*ATRON.UNIT), ATRON.ROTATION_EW));\n\t\tmPos.add(new ModulePosition(\"custom 6\", new VectorDescription(4*ATRON.UNIT, -5*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(0, 0, -eigth)));\n\t\treturn mPos;\t\n\n\t\t\n\t\t/*\n\t\tArrayList<ModulePosition> mPos = new ArrayList<ModulePosition>();\n\t\tdouble x0 = 1;\n\t\tdouble y0 = 0;\n\t\tdouble z0 = 0;\n\t\tdouble angle = Math.PI/2 + Math.PI;\n\t\tVector3f moduleOrientationVector = new Vector3f(0, 0, 1);\n\t\tDouble moduleOrientationAngle = 0d;\n\t\tQuaternion moduleOrientationQuaternion = new Quaternion( (float)(moduleOrientationVector.x*Math.sin((moduleOrientationAngle)/2)), (float)(moduleOrientationVector.y*Math.sin((moduleOrientationAngle)/2)), (float)(moduleOrientationVector.z*Math.sin((moduleOrientationAngle)/2)), (float)(Math.cos((moduleOrientationAngle)/2)));\n\t\t//System.out.println(moduleOrientation.x + \" \" + moduleOrientation.y + \" \" + moduleOrientation.z);\n\t\tQuaternion rotation = new Quaternion( (float)(x0*Math.sin((angle)/2)), (float)(y0*Math.sin((angle)/2)), (float)(z0*Math.sin((angle)/2)), (float)(Math.cos((angle)/2)));\n\t\t//Vector3f newModuleOrientation = rotation.mult(moduleOrientation);\n\t\t//System.out.println(newModuleOrientation.x + \" \" + newModuleOrientation.y + \" \" + newModuleOrientation.z);\n\t\t//mPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, 0*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(rotation)));\n\t\tmPos.add(new ModulePosition(\"custom 0\", new VectorDescription(0*ATRON.UNIT, 0*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(new Quaternion( (float)(0), (float)(0), (float)(0), (float)(1)))));\n\t\t//x0 = 1; y0 = 0; z0 = 0; angle = 0;\n\t\t//mPos.add(new ModulePosition(\"custom 1\", new VectorDescription(1*ATRON.UNIT, 1*ATRON.UNIT, 0*ATRON.UNIT), new RotationDescription(new Quaternion( (float)(x0*Math.sin(angle/2)), (float)(y0*Math.sin(angle/2)), (float)(z0*Math.sin(angle/2)), (float)(Math.cos(angle/2))))));\n\t\treturn mPos;\n*/\n\t}",
"public Robot(Case pos, int vitesse){\n \tthis.position=pos;\n \tthis.vitesse=(int) (vitesse/3.6);\n \tthis.enDeplacement=false; \n \tthis.destination=new LinkedList<Direction>();\n }",
"public DriveSubsystem() {\n leftFrontMotor = new TalonSRX(RobotMap.leftFrontMotor);\n rightFrontMotor = new TalonSRX(RobotMap.rightFrontMotor);\n leftBackMotor = new TalonSRX(RobotMap.leftBackMotor);\n rightBackMotor = new TalonSRX(RobotMap.rightBackMotor);\n // rightMotor.setInverted(true); \n direction = 0.75;\n SmartDashboard.putString(\"Direction\", \"Shooter side\");\n }",
"@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n /* lets grab the 360 degree position of the MagEncoder's absolute position */\n /* mask out the bottom12 bits, we don't care about the wrap arounds */ \n\t\tint absolutePosition = elevator.getSelectedSensorPosition(0) & 0xFFF;\n \n /* use the low level API to set the quad encoder signal */\n elevator.setSelectedSensorPosition(absolutePosition, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* choose the sensor and sensor direction */\n elevator.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, \n Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* Ensure sensor is positive when output is positive */\n elevator.setSensorPhase(false);\n\n /**\n * Set based on what direction you want forward/positive to be.\n * This does not affect sensor phase. \n */ \n //elevator.setInverted(Constants.kMotorInvert);\n \n /* Config the peak and nominal outputs, 12V means full */\n elevator.configNominalOutputForward(0, Constants.kTimeoutMs);\n elevator.configNominalOutputReverse(0, Constants.kTimeoutMs);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configNominalOutputForward(0.5);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configPeakOutputForward(0.5);\n elevator.configPeakOutputReverse(-1, Constants.kTimeoutMs);\n \n /**\n * Config the allowable closed-loop error, Closed-Loop output will be\n * neutral within this range. See Table in Section 17.2.1 for native\n * units per rotation.\n */\n //elevator.configAllowableClosedloopError(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n \n /* Config Position Closed Loop gains in slot0, typically kF stays zero. */\n elevator.config_kF(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kP(Constants.kPIDLoopIdx, 0.5, Constants.kTimeoutMs);\n elevator.config_kI(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kD(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n\n\n }",
"public Direction getCorrectRobotDirection();",
"public Robot(int orientation, Position pos_ini) {\r\n\t\tthis.pos_courante = pos_ini;\r\n\t\tthis.orientation = orientation;\r\n\t\tderniereAction = AUCUNE_ACTION;\r\n\t}",
"public void robotInit() {\n ;\n System.out.println(\"robot_init\");\n liftJoystick = new Joystick(2);\n armJoystick = new Joystick(4);\n setEncoder(new Encoder(2, 3));\n getEncoder().setDistancePerPulse(8.0 * 3.14 / 360.0 / 2);\n compressor = new Compressor(1, 1);\n compressor.start();\n // cameraMount = new CameraMount(10,9);\n //File file = new File (\"WALT_output.txt\");\n displayIndex = 1;\n driverScreen = DriverStationLCD.getInstance();\n\n //sensor wiring was switche so I fixed it programming wise\n setLeft(new DigitalInput(12));\n if (getLeft() == null) {\n printToScreen(\"LEFT SENSOR [DigitalInput(12)] IS NULL!!\");\n } else {\n printToScreen(\"LEFT SENSOR [DigitalInput(12)] is initialized\");\n }\n\n middle = new DigitalInput(13);\n if (getMiddle() == null) {\n printToScreen(\"MIDDLE SENSOR [DigitalInput(13)] IS NULL!!\");\n } else {\n printToScreen(\"MIDDLE SENSOR [DigitalInput(13)] is initialized\");\n }\n\n right = new DigitalInput(14);\n if (getRight() == null) {\n printToScreen(\"RIGHT SENSOR [DigitalInput(14)] IS NULL!!\");\n } else {\n printToScreen(\"RIGHT SENSOR [DigitalInput(14)] INITIALIZED\");\n }\n\n demoMode = false;\n myDog = Watchdog.getInstance();\n myDog.setEnabled(true);\n myDog.setExpiration(1);\n joysticks = new TankControls(1, 3);//All channel values arbitrary at this point and may need to be changed.\n // xboxController = new XboxControls(3);//channel value\n //initializes pneumatics\n //int[] solenoidChannels=(4,5);\n int spikeChannel = 1;\n int pressureSwitch = 2;\n //pneumatics=new pneumaticSystem(solenoidChannels,spikeChannel,pressureSwitch, 120);\n\n //Arm constructor\n //currently the arm is controlling the drive motors- arm channels are 3,4\n int liftChannel = 3;\n int armChannel = 4;\n int solenoidChannelWrist = 1;\n int clawSolenoid = 2;\n int armGyroChannel = 2;\n arm = new Arm(liftChannel, armChannel, solenoidChannelWrist,\n clawSolenoid, armGyroChannel);\n //channel for gyro\n int gyroChannel = 1;\n\n //channels for camera initiation\n boolean usingCamera = true;\n int panMotorCamChannel = 9;\n int tiltCamChannel = 8;\n\n //channels for accelerators- may want multiple for multiple directions\n int accSlot = -1;\n\n setSensors(new SensorSet(gyroChannel, accSlot, usingCamera,\n tiltCamChannel, panMotorCamChannel));\n\n setRobotDrive(new TwoMotorDrive(1, 2, demoMode));\n getRobotDrive().setInvertedSide(true);//boolean is true to invert right, false for left\n\n //so that it doesn't return nulls- should not be started before re-creating Why do we initialize it here then?\n driveTask = new WaltLineTrack(false, false, this);\n armTask = arm.getNewGoToHeightInstance(2);\n armTask2 = arm.getNewGoToAngleInstance(135);\n }",
"public DriveTrain (int motorChannelL1,int motorChannelL2,int motorChannelR1,int motorChannelR2 ){\n leftMotor1 = new Victor(motorChannelL1);\n leftMotor2 = new Victor(motorChannelL2);\n rightMotor1 = new Victor(motorChannelR1);\n rightMotor2 = new Victor(motorChannelR2);\n highDrive = new RobotDrive(motorChannelL1, motorChannelR1);\n lowDrive = new RobotDrive(motorChannelL2, motorChannelR2);\n \n }",
"public static void init() {\n driveLeft = new VictorSP(1);\r\n LiveWindow.addActuator(\"Drive\", \"Left\", (VictorSP) driveLeft);\r\n \r\n driveRight = new VictorSP(0);\r\n LiveWindow.addActuator(\"Drive\", \"Right\", (VictorSP) driveRight);\r\n \r\n driveMotors = new RobotDrive(driveLeft, driveRight);\r\n \r\n driveMotors.setSafetyEnabled(false);\r\n driveMotors.setExpiration(0.1);\r\n driveMotors.setSensitivity(0.5);\r\n driveMotors.setMaxOutput(1.0);\r\n\r\n driveEncoderLeft = new Encoder(0, 1, true, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderLeft\", driveEncoderLeft);\r\n driveEncoderLeft.setDistancePerPulse(0.053855829);\r\n driveEncoderLeft.setPIDSourceType(PIDSourceType.kRate);\r\n driveEncoderRight = new Encoder(2, 3, false, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderRight\", driveEncoderRight);\r\n driveEncoderRight.setDistancePerPulse(0.053855829);\r\n driveEncoderRight.setPIDSourceType(PIDSourceType.kRate);\r\n driveFrontSonar = new Ultrasonic(4, 5);\r\n LiveWindow.addSensor(\"Drive\", \"FrontSonar\", driveFrontSonar);\r\n \r\n shooterMotor = new VictorSP(3);\r\n LiveWindow.addActuator(\"Shooter\", \"Motor\", (VictorSP) shooterMotor);\r\n \r\n climberMotor = new Spark(2);\r\n LiveWindow.addActuator(\"Climber\", \"Motor\", (Spark) climberMotor);\r\n \r\n gearGrabReleaseSolonoid = new DoubleSolenoid(0, 0, 1);\r\n LiveWindow.addActuator(\"Gear\", \"GrabReleaseSolonoid\", gearGrabReleaseSolonoid);\r\n \r\n powerPanel = new PowerDistributionPanel(0);\r\n LiveWindow.addSensor(\"Power\", \"Panel\", powerPanel);\r\n \r\n cameraMountpan = new Servo(4);\r\n LiveWindow.addActuator(\"CameraMount\", \"pan\", cameraMountpan);\r\n \r\n cameraMounttilt = new Servo(5);\r\n LiveWindow.addActuator(\"CameraMount\", \"tilt\", cameraMounttilt);\r\n \r\n\r\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\r\n\t\tdriveSonarFront = new SonarMB1010(0);\r\n\t\tLiveWindow.addSensor(\"Drive\", \"SonarFront\", driveSonarFront);\r\n\r\n\t\t//driveGyro = new GyroADXRS453();\r\n\t\tdriveGyro = new ADXRS450_Gyro();\r\n\t\tLiveWindow.addSensor(\"Drive\", \"Gyro\", driveGyro);\r\n\t\tdriveGyro.calibrate();\r\n\t}",
"@Override\n public void robotInit() {\n\n rightEnc.reset();\n gyro.reset();\n\n left2.follow(left1);\n left3.follow(left1);\n right2.follow(right1);\n right3.follow(right1);\n\n config = new Trajectory.Config(Trajectory.FitMethod.HERMITE_CUBIC, Trajectory.Config.SAMPLES_HIGH, 0.05, 1.7, 2.0, 50.0);\n trajectory = Pathfinder.generate(points, config);\n\n modifier = new TankModifier(trajectory).modify(0.7);\n\n left = new EncoderFollower(modifier.getLeftTrajectory());\n right = new EncoderFollower(modifier.getRightTrajectory());\n\n left.configureEncoder((int)rightEnc.get(), 1024, 0.1143);\n left.configurePIDVA(0.7, 0.0, 0.0, 0.15, 0.06);\n right.configureEncoder((int)rightEnc.get(), 1024, 0.1143);\n right.configurePIDVA(0.7, 0.0, 0.0, 0.15, 0.06);\n \n }",
"public Atendiendo(Robot robot){\n this.robot = robot;\n }",
"private void robotMovement()\n {\n\n /* If it will be rotating, don't drive */\n if (!joystick.rightShouldMove()) {\n\n if (joystick.leftShouldMove()) {\n\n /* Derive movement values from gamepad */\n Joystick.Direction direction = joystick.getLeftDirection();\n double power = joystick.getLeftPower();\n\n int[] modifier;\n\n if (direction == Joystick.Direction.UP) {\n modifier = modUP;\n } else if (direction == Joystick.Direction.DOWN) {\n modifier = modDOWN;\n } else if (direction == Joystick.Direction.RIGHT) {\n modifier = modRIGHT;\n } else {\n modifier = modLEFT;\n }\n\n motorLeftFront.setPower(modifier[0] * ((power * 0.8) + (0.01 * frontInc)));\n motorRightFront.setPower(modifier[1] * ((power * 0.8) + (0.01 * frontInc)));\n motorLeftBack.setPower(modifier[2] * ((power * 0.8) + (0.01 * backInc)));\n motorRightBack.setPower(modifier[3] * ((power * 0.8) + (0.01 * backInc)));\n\n } else {\n setMotorPowerToZero();\n }\n\n } else {\n\n /* Rotation modifiers for sides of bot */\n Joystick.Direction d = joystick.getRightDirection();\n double power = joystick.getRightPower();\n boolean left = d == Joystick.Direction.LEFT;\n double sideMod = left ? 1 : -1;\n\n /* Set motor power */\n motorLeftFront.setPower(sideMod * power);\n motorLeftBack.setPower(sideMod * power);\n motorRightFront.setPower(sideMod * power);\n motorRightBack.setPower(sideMod * power);\n\n }\n\n }",
"@Override\n\tpublic void robotInit() {\n\t\tdt = new DriveTrain();\n\t\t//Initialize drive Talons\n\t\tRobotMap.vspLeft = new WPI_TalonSRX(RobotMap.dtLeft);\n\t\tRobotMap.vspRight = new WPI_TalonSRX(RobotMap.dtRight);\n\t\t//Initialize drive slave Victors\n\t\t//RobotMap.slaveLeft = new WPI_VictorSPX(RobotMap.slaveDriveLeft);\n\t\t//RobotMap.slaveRight = new WPI_VictorSPX(RobotMap.slaveDriveRight);\n\t\t//Set drive slaves to follower mode\n\t\t//RobotMap.slaveLeft.follow(RobotMap.vspLeft);\n\t\t//RobotMap.slaveRight.follow(RobotMap.vspRight);\n\t\t//Initialize drive train\n\t\tRobotMap.rd = new DifferentialDrive(RobotMap.vspLeft, RobotMap.vspRight);\n\t\t//Initialize drive joystick\n\t\tRobotMap.stick = new Joystick(RobotMap.joystickPort);\n\t\t//Disabled drive safety\n\t\tRobotMap.vspLeft.setSafetyEnabled(false);\n\t\tRobotMap.vspRight.setSafetyEnabled(false);\n\t\tRobotMap.rd.setSafetyEnabled(false);\n\t\t//Initialize lift Talon\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(5);\n\t\t//Initialize operator controller\n\t\tRobotMap.controller = new Joystick(RobotMap.controllerPort);\n\t\t//Initialize intake Victors\n\t\tRobotMap.intakeVictorLeft = new WPI_VictorSPX(RobotMap.intakeMaster);\n\t\tRobotMap.intakeVictorRight = new WPI_VictorSPX(RobotMap.intakeSlave);\n\t\t//Set right intake Victor to follow left intake Victor\n\t\tRobotMap.intakeVictorRight.follow(RobotMap.intakeVictorLeft);\n\t\t\n\t\tRobotMap.climberVictorLeft = new WPI_VictorSPX(RobotMap.climberLeftAddress);\n\t\tRobotMap.climberVictorRight = new WPI_VictorSPX(RobotMap.climberRightAddress);\n\t\t\n\t\tRobotMap.climberVictorRight.follow(RobotMap.climberVictorLeft);\n\t\t\n\t\tRobotMap.piston = new DoubleSolenoid(RobotMap.inChannel, RobotMap.outChannel);\n\t\t\n\t\tRobotMap.intakeLifter = new WPI_VictorSPX(2);\n\t\t\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(RobotMap.liftTalonAddress);\n\t\t\n\t\tautoChooser = new SendableChooser();\n\t\tautoChooser.addDefault(\"Drive to baseline\" , new DriveToBaseline());\n\t\tautoChooser.addObject(\"Null auto\", new NullAuto());\n\t\tautoChooser.addObject(\"Switch from right\", new SwitchFromRight());\n\t\tautoChooser.addObject(\"Switch from left\", new SwitchFromLeft());\n\t\tautoChooser.addObject(\"PID from left\", new PIDfromLeft());\n\t\tautoChooser.addObject(\"PID from right\", new PIDfromRight());\n\t\tautoChooser.addObject(\"Scale from right\", new ScaleAutoRight());\n\t\tautoChooser.addObject(\"Scale from left\", new ScaleAutoLeft());\n\t\tautoChooser.addObject(\"PID tester\", new PIDTESTER());\n\t\tautoChooser.addObject(\"Joe use this one\", new leftOnly());\n\t\tSmartDashboard.putData(\"Autonomous mode chooser\", autoChooser);\n\t\t\n\t\t//RobotMap.liftVictor.follow(RobotMap.climberTalon);\n\t\t\n\t\tRobotMap.vspLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\tRobotMap.vspRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\t\n\t\tRobotMap.intakeLifted = new DigitalInput(1);\n\t\tRobotMap.isAtTop = new DigitalInput(2);\n\t\tRobotMap.isAtBottom = new DigitalInput(0);\n\t\t\n\t\tRobotMap.vspLeft.configVelocityMeasurementPeriod(VelocityMeasPeriod.Period_100Ms, 1);\n\t\tRobotMap.vspRight.configVelocityMeasurementWindow(64, 1); \n\t\t\n\t\toi = new OI();\n\t}",
"public interface MovementParameters {\n\n\t/**\n\t * Value to make the robot steer right on its center\n\t */\n\tstatic final int STEER_RIGHT = -200;\n\t/**\n\t * Value to make the robot steer left on its center\n\t */\n\tstatic final int STEER_LEFT = 200;\n\t/**\n\t * Angular speed of the robot for rotations in degrees / sec\n\t */\n\tstatic final double ANGULAR_SPEED = 5;\n\t/**\n\t * Speed for a single motor\n\t */\n\tstatic final double MOTOR_SPEED = 20;\n\t\n\t/**\n\t * Linear speed of the robot in cm / s\n\t */\n\tstatic final double LINEAR_SPEED = 40;\n\t/**\n\t * Linear acceleration of the robot in cm / s^2\n\t */\n\tstatic final double LINEAR_ACCELERATION = 2;\n\t/**\n\t * Tolerance set to the heading in degrees\n\t */\n\tstatic final float HEADING_TOLERANCE = 1f;\n\t/**\n\t * Minimum distance the robot can reach when is approaching an object\n\t */\n\tstatic final int MIN_DISTANCE = 40;\n}",
"public AutoScript(Robot robot) {\r\n\t\tthis.robot = robot;\r\n\r\n\t\t//leftEncoder = new DirectionalEncoder(1, 2, RobotTemplate.WHEEL_DIAMETER);\r\n\t\tleftEncoderPIDOut = new PIDOut();\r\n\t\tleftEncoderPIDSauce = new PIDSauce(0);\r\n\t\tleftEncoderPID = new PIDWrapper(RobotTemplate.ENCODER_PID_P, RobotTemplate.ENCODER_PID_I, RobotTemplate.ENCODER_PID_D, RobotTemplate.ENCODER_PID_F, leftEncoderPIDSauce, leftEncoderPIDOut, 0.05);\r\n\r\n\t\t//rightEncoder = new DirectionalEncoder(3, 4, RobotTemplate.WHEEL_DIAMETER);\r\n\t\trightEncoderPIDOut = new PIDOut();\r\n\t\trightEncoderPIDSauce = new PIDSauce(0);\r\n\t\trightEncoderPID = new PIDWrapper(RobotTemplate.ENCODER_PID_P, RobotTemplate.ENCODER_PID_I, RobotTemplate.ENCODER_PID_D, RobotTemplate.ENCODER_PID_F, rightEncoderPIDSauce, rightEncoderPIDOut, 0.05);\r\n\r\n\t\tgyro = robot.chassis.gyro;\r\n\t\tgyroPIDOut = new PIDOut();\r\n\t\tgyroPIDSauce = new PIDSauce(0);\r\n\t\tgyroPID = new PIDWrapper(RobotTemplate.GYRO_PID_P, RobotTemplate.GYRO_PID_I, RobotTemplate.GYRO_PID_D, RobotTemplate.GYRO_PID_F, gyroPIDSauce, gyroPIDOut, 0.05);\r\n\t\tgyroPID.enable();\r\n\t}",
"@SuppressWarnings(\"unused\")\n\tpublic void execute(){\n\t\tdouble mtrFrontRight;\n\t\tdouble mtrFrontLeft;\n\t\tdouble mtrBackRight;\n\t\tdouble mtrBackLeft;\n\t\t\n\t\tdouble speed = 3.0; //The variable we are assigning\n\t\tdouble yawHeading = 0; //Obtained from Robot class\n\t\t\n\t\tdouble getCurrentSetPoint = 0.0; //This Will be obtained via a variable set in the turn to heading class as it is obtained. (possible issues)\n\t\tdouble actualEncoderSetpoint; //Represents the value the encoder is actually at.\n\t\t\n\t\tdouble zeroHeading; //This is a weird one. it is there because of the odd difference calculations issue of say being 5 off of zero and heading being 355;\n\t\t\n\t\t\n\t\t//Switch structure stuff\n\t\tint forward = 0;\n\t\tint left = 1;\n\t\tint right = 2;\n\t\tint state = forward;\n\t\t\n\t\t\n\t\tif(getCurrentSetPoint == 0) {\n\t\t\tstate = forward;\n\t\t} else if(getCurrentSetPoint == 90) {\n\t\t\tstate = right;\n\t\t} else if(getCurrentSetPoint == 270) {\n\t\t\tstate = left;\n\t\t}\n\t\t\n\t\t//where the weirdness of zero heading comes into play.\n\t\tif(yawHeading > 180){\n\t\t\tzeroHeading = 360 - yawHeading;\n\t\t\tzeroHeading = -(zeroHeading);\n\t\t} else {\n\t\t\tzeroHeading = yawHeading;\n\t\t}\n\t\t\n\t\t//Here comes the fun math.\n\t\t// oh yeah and brackets are fun just saying.\n\t\t//try not to get cancer.\n\t\t\n\t\tswitch (state) {\n\t\t\t\n\t\t\tcase 0 :\n\t\t\t\tif(zeroHeading < -5) {\n\t\t\t\t\tmtrFrontRight = -(speed - ((-zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t\tmtrBackRight = -(speed - ((-zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t} else {\n\t\t\t\t\tmtrFrontRight = -speed;\n\t\t\t\t\tmtrBackRight = -speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(zeroHeading > 5) {\n\t\t\t\t\tmtrFrontLeft = speed - ((zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t\tmtrBackLeft = speed - ((zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t} else {\n\t\t\t\t\tmtrFrontLeft = speed;\n\t\t\t\t\tmtrBackLeft = speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\tcase 1 :\n\t\t\t\tif(zeroHeading > 5) {\n\t\t\t\t\t\tmtrBackRight = -(speed - ((zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t\t\tmtrBackLeft = speed - ((zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmtrBackRight = -speed;\n\t\t\t\t\t\tmtrBackLeft = speed;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(zeroHeading < -5) {\n\t\t\t\t\t\tmtrFrontRight = -(speed - ((-zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t\t\tmtrFrontLeft = speed - ((-zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmtrFrontRight = -speed;\n\t\t\t\t\t\tmtrFrontLeft = speed;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tcase 2 : \n\t\t\t\tif(zeroHeading < -5) {\n\t\t\t\t\tmtrBackRight = -(speed - ((-zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t\tmtrBackLeft = speed - ((-zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t} else {\n\t\t\t\t\tmtrBackRight = -speed;\n\t\t\t\t\tmtrBackLeft = speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(zeroHeading > 5) {\n\t\t\t\t\tmtrFrontRight = -(speed - ((zeroHeading * Math.pow(10, -1)) * .3) );\n\t\t\t\t\tmtrFrontLeft = speed - ((zeroHeading * Math.pow(10, -1)) * .3);\n\t\t\t\t} else {\n\t\t\t\t\tmtrFrontRight = -speed;\n\t\t\t\t\tmtrFrontLeft = speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}",
"@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }",
"public RobotHardware (LinearOpMode opmode) {\n myOpMode = opmode;\n }",
"public Drive(double left, double right) {\n requires(Robot.drivetrain);\n this.left = left;\n this.right = right;\n }",
"Robot (DcMotor leftWheel,\n DcMotor rightWheel,\n Servo rightCollectServo,\n Servo leftCollectServo,\n DcMotor collectMotor,\n DcMotor landerMotor,\n float wheelDiameter,\n float gearRatio,\n float distanceBetweenWheels) {\n\n this.wheels = new Wheels(leftWheel,\n rightWheel,\n wheelDiameter,\n gearRatio,\n distanceBetweenWheels);\n\n this.arms = new Arms(rightCollectServo,\n leftCollectServo,\n collectMotor,\n landerMotor);\n }",
"public void encoderDrive(double speed,\r\n double leftInches, \r\n double rightInches,\r\n String name) \r\n {\n int newLeftTarget = robot.leftDrive.getCurrentPosition() + (int)(leftInches * COUNTS_PER_INCH);\r\n int newRightTarget = robot.rightDrive.getCurrentPosition() + (int)(rightInches * COUNTS_PER_INCH);\r\n robot.leftDrive.setTargetPosition(newLeftTarget);\r\n robot.rightDrive.setTargetPosition(newRightTarget);\r\n\r\n // Turn On RUN_TO_POSITION\r\n robot.leftDrive.setMode(DcMotor.RunMode.RUN_TO_POSITION);\r\n robot.rightDrive.setMode(DcMotor.RunMode.RUN_TO_POSITION);\r\n\r\n // reset the timeout time and start motion.\r\n ElapsedTime localTimer = new ElapsedTime();\r\n localTimer.reset();\r\n robot.leftDrive.setPower(Math.abs(speed));\r\n robot.rightDrive.setPower(Math.abs(speed));\r\n\r\n // keep looping while we are still active, and there is time left, and both motors are running.\r\n // Note: We use (isBusy() && isBusy()) in the loop test, which means that when EITHER motor hits\r\n // its target position, the motion will stop. This is \"safer\" in the event that the robot will\r\n // always end the motion as soon as possible.\r\n // However, if you require that BOTH motors have finished their moves before the robot continues\r\n // onto the next step, use (isBusy() || isBusy()) in the loop test.\r\n while (localTimer.seconds() < EncoderDrive_Timeout_Second \r\n && (robot.leftDrive.isBusy() || robot.rightDrive.isBusy())) {\r\n\r\n // Display it for the driver.\r\n telemetry.addData(\"\", \"%s @ %s\", name, localTimer.toString());\r\n telemetry.addData(\"To\", \"%7d :%7d\", newLeftTarget, newRightTarget);\r\n telemetry.addData(\"At\", \"%7d :%7d\",\r\n robot.leftDrive.getCurrentPosition(),\r\n robot.rightDrive.getCurrentPosition());\r\n telemetry.update();\r\n idle();\r\n }\r\n\r\n // Stop all motion;\r\n robot.leftDrive.setPower(0);\r\n robot.rightDrive.setPower(0);\r\n\r\n // Turn off RUN_TO_POSITION\r\n robot.leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\r\n robot.rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\r\n }",
"@Override\n public void robotInit() {\n\n // Motor controllers\n leftMotor = new CANSparkMax(1, MotorType.kBrushless);\n leftMotor.setInverted(false);\n leftMotor.setIdleMode(IdleMode.kBrake);\n\n CANSparkMax leftSlave1 = new CANSparkMax(2, MotorType.kBrushless);\n leftSlave1.setInverted(false);\n leftSlave1.setIdleMode(IdleMode.kBrake);\n leftSlave1.follow(leftMotor);\n\n CANSparkMax leftSlave2 = new CANSparkMax(3, MotorType.kBrushless);\n leftSlave2.setInverted(false);\n leftSlave2.setIdleMode(IdleMode.kBrake);\n leftSlave2.follow(leftMotor);\n\n rightMotor = new CANSparkMax(4, MotorType.kBrushless);\n rightMotor.setInverted(false);\n rightMotor.setIdleMode(IdleMode.kBrake);\n\n CANSparkMax rightSlave1 = new CANSparkMax(5, MotorType.kBrushless);\n rightSlave1.setInverted(false);\n rightSlave1.setIdleMode(IdleMode.kBrake);\n rightSlave1.follow(leftMotor);\n\n CANSparkMax rightSlave2 = new CANSparkMax(6, MotorType.kBrushless);\n rightSlave2.setInverted(false);\n rightSlave2.setIdleMode(IdleMode.kBrake);\n rightSlave2.follow(leftMotor);\n\n // Encoders\n leftEncoder = leftMotor.getEncoder();\n rightEncoder = rightMotor.getEncoder();\n\n // Gyro\n gyro = new ADXRS450_Gyro();\n\n }",
"public IntakeArm(RobotHardware robotHardware) {\n super(IntakeArmController.of(() -> 0.0));\n\n this.robotHardware = robotHardware;\n }",
"@Override\npublic void teleopPeriodic() {\nm_robotDrive.arcadeDrive(m_stick.getRawAxis(5)* (-0.5), m_stick.getRawAxis(4)*0.5);\n}",
"public RobotContainer() {\n // Configure the button bindings\n configureButtonBindings();\n\n drivetrain.setDefaultCommand(new RunCommand(\n () -> drivetrain.setTank(Math.pow(-joystick1.getY(), 3), Math.pow(joystick2.getY(), 3)), drivetrain));\n\n }",
"@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }",
"public OI(){\n driveStick = new Joystick(RobotMap.DRIVE_STICK);\n armStick = new Joystick(RobotMap.ARM_STICK);\n assoc(); \n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"protected void initialize() {\n \t starttime = Timer.getFPGATimestamp();\n \tthis.startAngle = RobotMap.navx.getAngle();\n \tangleorientation.setSetPoint(RobotMap.navx.getAngle());\n \t\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \n //settting talon control mode\n \tRobotMap.motorLeftTwo.changeControlMode(TalonControlMode.MotionMagic);\t\t\n\t\tRobotMap.motorLeftOne.changeControlMode(TalonControlMode.Follower);\t\n\t\tRobotMap.motorRightTwo.changeControlMode(TalonControlMode.MotionMagic);\t\n\t\tRobotMap.motorRightOne.changeControlMode(TalonControlMode.Follower);\n\t\t//setting peak and nominal output voltage for the motors\n\t\tRobotMap.motorLeftTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorLeftTwo.configNominalOutputVoltage(0.00f, 0.0f);\n\t\tRobotMap.motorRightTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorRightTwo.configNominalOutputVoltage(0.0f, 0.0f);\n\t\t//setting who is following whom\n\t\tRobotMap.motorLeftOne.set(4);\n\t\tRobotMap.motorRightOne.set(3);\n\t\t//setting pid value for both sides\n\t//\tRobotMap.motorLeftTwo.setCloseLoopRampRate(1);\n\t\tRobotMap.motorLeftTwo.setProfile(0);\n\t RobotMap.motorLeftTwo.setP(0.000014f);\n \tRobotMap.motorLeftTwo.setI(0.00000001);\n\t\tRobotMap.motorLeftTwo.setIZone(0);//325);\n\t\tRobotMap.motorLeftTwo.setD(1.0f);\n\t\tRobotMap.motorLeftTwo.setF(this.fGainLeft+0.014);//0.3625884);\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t RobotMap.motorRightTwo.setCloseLoopRampRate(1);\n\t RobotMap.motorRightTwo.setProfile(0);\n\t\tRobotMap.motorRightTwo.setP(0.000014f);\n\t\tRobotMap.motorRightTwo.setI(0.00000001);\n\t\tRobotMap.motorRightTwo.setIZone(0);//325);\n\t\tRobotMap.motorRightTwo.setD(1.0f);\n\t\tRobotMap.motorRightTwo.setF(this.fGainRight);// 0.3373206);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t\t//setting Acceleration and velocity for the left\n\t\tRobotMap.motorLeftTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorLeftTwo.setMotionMagicCruiseVelocity(250);\n\t\t//setting Acceleration and velocity for the right\n\t\tRobotMap.motorRightTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorRightTwo.setMotionMagicCruiseVelocity(250);\n\t\t//resets encoder position to 0\t\t\n\t\tRobotMap.motorLeftTwo.setEncPosition(0);\n\t\tRobotMap.motorRightTwo.setEncPosition(0);\n\t //Set Allowable error for the loop\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(300);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(300);\n\t\t\n\t\t//sets desired endpoint for the motors\n RobotMap.motorLeftTwo.set(motionMagicEndPoint);\n RobotMap.motorRightTwo.set(-motionMagicEndPoint );\n \t\n }",
"private void initializeElevatorMotor()\n {\n Rectangle base = new Rectangle(shaftWidth*.3, location, shaftWidth*.4, floorHeight*.8);\n Rectangle latch = new Rectangle(shaftWidth*.45, location-5, shaftWidth*.1, floorHeight*.2);\n\n elevator = Shape.union(base, latch);\n elevator.setFill(Color.valueOf(\"#C0C0C0\"));\n\n elevatorTranslate = 0;\n elevatorOffset = 0;\n elevatorSpeed = 20;\n\n motorTimeline = new Timeline(new KeyFrame(Duration.millis(elevatorSpeed), e -> {\n if(location+elevatorOffset <= shaftHeight-60 && location+elevatorOffset >= 10) {\n if(location <= destination && location >= destination-10)\n {\n// System.out.println(location + \" OF \" + (destination) + \" / \" + (destination-10) + \" \" + (10 - destination/floorHeight));\n// System.out.println(\"EARLY STOP\");\n motorTimeline.pause();\n }\n\n elevatorTranslate += elevatorOffset;\n location += elevatorOffset;\n\n elevator.setTranslateY(elevatorTranslate);\n frame.setTranslateY(elevatorTranslate);\n leftDoor.setTranslateY(elevatorTranslate);\n rightDoor.setTranslateY(elevatorTranslate);\n }\n else motorTimeline.pause();\n }));\n motorTimeline.setCycleCount(Animation.INDEFINITE);\n }",
"@Override\n public void teleopInit() {\n /* factory default values */\n _talonL1.configFactoryDefault();\n _talonL2.configFactoryDefault();\n _talonR1.configFactoryDefault();\n _talonR2.configFactoryDefault();\n\n /* flip values so robot moves forward when stick-forward/LEDs-green */\n _talonL1.setInverted(true); // <<<<<< Adjust this\n _talonL2.setInverted(true); // <<<<<< Adjust this\n _talonR1.setInverted(true); // <<<<<< Adjust this\n _talonR2.setInverted(true); // <<<<<< Adjust this\n\n\n /*\n * WPI drivetrain classes defaultly assume left and right are opposite. call\n * this so we can apply + to both sides when moving forward. DO NOT CHANGE\n */\n _drive.setRightSideInverted(true);\n }",
"@Override\n public void robotInit() {\n myRobot = new DifferentialDrive(leftfrontmotor, rightfrontmotor);\n leftrearmotor.follow(leftfrontmotor);\n rightrearmotor.follow(rightfrontmotor);\n leftfrontmotor.setInverted(true); // <<<<<< Adjust this until robot drives forward when stick is forward\n\t\trightfrontmotor.setInverted(true); // <<<<<< Adjust this until robot drives forward when stick is forward\n\t\tleftrearmotor.setInverted(InvertType.FollowMaster);\n rightrearmotor.setInverted(InvertType.FollowMaster);\n \n CameraServer.getInstance().startAutomaticCapture();\n\n \n\n comp.setClosedLoopControl(true);\n \n\n /* Set up Dashboard widgets */\n SmartDashboard.putNumber(\"L Stick\", gamepad.getRawAxis(1));\n\t\tSmartDashboard.putNumber(\"R Stick\", gamepad.getRawAxis(5));\n\t\tSmartDashboard.putBoolean(\"Back Button\", gamepad.getRawButton(5));\n\t\tSmartDashboard.putBoolean(\"Fwd Button\", gamepad.getRawButton(6));\n\t\t\n SmartDashboard.putNumber(\"LF\", pdp.getCurrent(leftfrontmotorid));\n\t\tSmartDashboard.putNumber(\"LR\", pdp.getCurrent(leftrearmotorid));\n\t\tSmartDashboard.putNumber(\"RF\", pdp.getCurrent(rightfrontmotorid));\n\t\tSmartDashboard.putNumber(\"RR\", pdp.getCurrent(rightrearmotorid));\n SmartDashboard.putNumber(\"Total\", pdp.getCurrent(0) + pdp.getCurrent(1) + pdp.getCurrent(2) + pdp.getCurrent(3) + pdp.getCurrent(4) + pdp.getCurrent(5) + pdp.getCurrent(6) + pdp.getCurrent(7) + pdp.getCurrent(8) + pdp.getCurrent(9) + pdp.getCurrent(10) + pdp.getCurrent(11) + pdp.getCurrent(12) + pdp.getCurrent(13) + pdp.getCurrent(14) + pdp.getCurrent(15));\n }",
"@Override\n\tpublic void robotInit() {\n\t\tdrive = new Drive();\n\t\tintake = new Intake();\n\t\tshooter = new Shooter();\n\t\taimShooter = new AimShooter();\n\t\tvision = new Vision();\n\t\tintakeRoller = new IntakeRoller();\n\t\taManipulators = new AManipulators();\n\t\tshooterLock = new ShooterLock();\n\n\t\t// autochooser\n\t\t// autoChooser = new SendableChooser();\n\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\tlowGearCommand = new LowGear();\n\n\t\t// auto chooser commands\n\t\t// autoChooser.addDefault(\"FarLeftAuto\", new FarLeftAuto());\n\t\t// autoChooser.addObject(\"MidLeftAuto\", new MidLeftAuto());\n\t\t// autoChooser.addObject(\"MidAuto\", new MidAuto());\n\t\t// autoChooser.addObject(\"MidRightAuto\", new MidRightAuto());\n\t\t// autoChooser.addObject(\"FarRightAuto\", new FarRightAuto());\n\t\t// autoChooser.addObject(\"Uber Auto\", new UberAuto());\n\t\t// autoChooser.addObject(\"Paper Weight\", new PaperWeightAuto());\n\t\t//\n\t\t// SmartDashboard.putData(\"Autonomous\", autoChooser);\n\n\t\t// autonomousCommand = (Command) autoChooser.getSelected();\n\t\tautonomousCommand = new FarLeftAuto();\n\t\t// autonomousCommand = new MidAuto();\n\t\t// CameraServer.getInstance().startAutomaticCapture(\"cam3\");\n\t\t// autonomousCommand = new FarLeftAuto\n\n\t\tpovUpTrigger.whenActive(new MoveActuatorsUp());\n\t\tpovDownTrigger.whenActive(new MoveActuatorsDown());\n\t}",
"@Override\n public void robotInit() {\n m_driveTrain = new DriveTrain();\n m_oi = new OI(); \n encoder = new Encoder();\n JoystickDrive = new JoystickDrive();\n RoboticArm = new RoboticArm();\n Science = new Science();\n pid = new PID();\n inverse = new Inverse();\n\n // workingSerialCom = new serialComWorking();\n\n\n // while(true){\n // // ros_string = workingSerialCom.read();\n // // System.out.println(ros_string);\n // LeftFront = Robot.m_driveTrain.dr+iveTrainLeftFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // RightFront = Robot.m_driveTrain.driveTrainRightFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // LeftFront_ros = workingSerialCom.floattosString(LeftFront);\n // RigthFront_ros = workingSerialCom.floattosString(RightFront);\n\n // ros_string = workingSerialCom.read();\n // gulce = workingSerialCom.StringConverter(ros_string, 1);\n // System.out.println(gulce);\n // workingSerialCom.write(LeftFront_ros+RigthFront_ros+\"\\n\");\n // }\n // workingSerialCom.write(\"Yavuz\\n\");\n // // RoboticArm.run();\n // // m_driveTrain.run();\n // // workingSerialCom.StringConverter(ros_string, 3);\n }",
"@Override\n public void teleopPeriodic() {\n\n double l = left.calculate((int)rightEnc.get());\n double r = right.calculate((int)rightEnc.get());\n\n double gyro_heading = gyro.getYaw(); // Assuming the gyro is giving a value in degrees\n double desired_heading = Pathfinder.r2d(left.getHeading()); // Should also be in degrees\n\n double angleDifference = Pathfinder.boundHalfDegrees(desired_heading - gyro_heading);\n double turn = 0.8 * (-1.0/80.0) * angleDifference;\n\n //left1.set(l + turn);\n //right1.set(r - turn);\n left1.set(0);\n right1.set(0);\n System.out.println(\"Get: \" + rightEnc.get() + \" Raw: \" + rightEnc.getRaw());\n\n }",
"public void robotInit() {\n\t\t//Get preferences from robot flash memory\n\t\tprefs = Preferences.getInstance();\n\t\tarmCalMinPosition = prefs.getDouble(\"armCalMinPosition\", 0);\n\t\tarmCal90DegPosition = prefs.getDouble(\"armCal90DegPosition\", 0);\n\t\tif (armCalMinPosition==0 || armCal90DegPosition==0) {\n\t\t\tDriverStation.reportError(\"Error: Preferences missing from RoboRio for Shooter Arm position calibration. Shooter arm disabled.\", true);\n\t\t\tshooterArmEnabled = false;\n\t\t} else {\n\t\t\tshooterArmEnabled = true;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tdebugStream = new FileWriter(\"/home/lvuser/debug.log\", true);\n\t\t\tdebugStream.write(\"Robot program started\\n\");\n\t\t\tdebugStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not open debug file: \" + e);\n\t\t}\n\n\t\t//Instantiates the subsystems\n\t\tdriveTrain = new DriveTrain();\n\t\tshifter = new Shifter();\n\t\tshooterArm = new ShooterArm();\n\t\tshooter = new Shooter();\n\t\tintake = new Intake();\n\t\tvision = new Vision();\n\t\tpanel = new PowerDistributionPanel();\n\t\tarmPiston = new ArmPiston();\n\n\t\t// OI must be constructed after subsystems. If the OI creates Commands\n\t\t// (which it very likely will), subsystems are not guaranteed to be\n\t\t// constructed yet. Thus, their requires() statements may grab null\n\t\t// pointers. Bad news. Don't move it.\n\t\toi = new OI();\n\n intake.motorCurrentTrigger.whenActive(new IntakeMotorStop());\n\n timerLEDs.start();\n timerTilt.start();\n timerRumble.start();\n \n // instantiate the command used for the autonomous period\n\t\t//autonomousCommand = new AutonomousCommandGroup();\n\t\traiseArm90 = new ShooterArmMoveToSetLocation(90);\n\t\t\n\t\t// Display active commands and subsystem status on SmartDashboard\n\t\tSmartDashboard.putData(Scheduler.getInstance());\n\t\tSmartDashboard.putData(driveTrain);\n\t\tSmartDashboard.putData(shifter);\n\t\tSmartDashboard.putData(shooterArm);\n\t\tSmartDashboard.putData(shooter);\n\t\tSmartDashboard.putData(intake);\n\t\tSmartDashboard.putData(vision);\n\t\tSmartDashboard.putData(armPiston);\n\t}",
"@Override\n\tpublic void robotInit() {\n\t\tleftDriveBack = new VictorSP(0); // PWM Port, madke sure this is set correctly.\n\t\tleftDriveFront = new VictorSP(1);\n\t\t\n\t\trightDriveFront = new VictorSP(2);\n\t\trightDriveBack = new VictorSP(3);\n\t\t\n\t\tleftIntake = new Spark(5);\n\t\trightIntake = new Spark(6);\n\t\t\n\t\tarmMotor = new TalonSRX(10);\n\t\tarmMotor.setNeutralMode(NeutralMode.Brake);\n\t\tarmMotor.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Absolute, 0, 0);\n\t\tarmMotor.configPeakCurrentLimit(30, 0);\n\t\tarmMotor.configPeakCurrentDuration(250, 0);\n\t\tarmMotor.configContinuousCurrentLimit(20, 0);\n\t\tarmMotor.configClosedloopRamp(0.25, 0);\n\t\tarmMotor.configOpenloopRamp(0.375, 0);\n\t\tarmMotor.enableCurrentLimit(true);\n\t\t\n\t\tarmMotor.configPeakOutputForward(1.0, 0);\n\t\tarmMotor.configPeakOutputReverse(-1.0, 0);\n\t\t\n\t\tarmMotor.config_kP(0, 0.0, 0);\n\t\t\n\t\tarmSetpoint = armMotor.getSelectedSensorPosition(0);\n\t\t\n\t\tstick = new Joystick(0);\n\t\tstickReversed = false;\n\t\txbox = new XboxController(1); // USB port, set in driverstation.\n\t\t\n\t\tdriveCamera = CameraServer.getInstance().startAutomaticCapture(0);\n\t}",
"public Drivetrain(){\r\n LeftSlave.follow(LeftMaster);\r\n RightSlave.follow(RightMaster);\r\n\r\n RightMaster.setInverted(true);\r\n LeftMaster.setInverted(true);\r\n\r\n gyro.reset();\r\n}",
"public DriveTrain() {\n for(int i = 0; i < 2; i++) {\n leftMotors[i] = new CANSparkMax(Constants.LEFT_DRIVE_CANS[i], MotorType.kBrushless);\n rightMotors[i] = new CANSparkMax(Constants.RIGHT_DRIVE_CANS[i], MotorType.kBrushless);\n rightMotors[i].setInverted(true);\n }\n }",
"public Robot(String nombre,\n Srtring modelo,\n double numeroSerie,\n byte bateria,\n boolean power) {\n this.nombre = nombre;\n this.modelo = modelo;\n this. numeroSerie = numeroSerie;\n this.bateria = bateria;\n }",
"public MecanumDrive(RobotMap opModeRobot){\n // initialize the hardware(pass in the opMode Robot map(instance) to this class in order to use it here)\n this.robot = opModeRobot;\n // This is all you need to do to initialize your hardware now when you have to call a motor just use robot.objectName.method\n }",
"public DriveTrain(side left, side right){\n this.left = left;\n this.right = right;\n this.gear = new twoSpeed();\n }",
"public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n// frontLeft = hwMap.get(DcMotor.class, \"frontLeft\");\n// frontRight = hwMap.get(DcMotor.class, \"frontRight\");\n// backLeft = hwMap.get(DcMotor.class, \"backLeft\");\n// lift = hwMap.get(DcMotor.class, \"lift\");\n// backRight = hwMap.get(DcMotor.class, \"backRight\");\n\n leftIntake = hwMap.get(DcMotor.class, \"leftIntake\");\n rightIntake = hwMap.get(DcMotor.class, \"rightIntake\");\n dropper = hwMap.get(DcMotor.class, \"dropper\");\n\n\n //range = hwMap.get(ModernRoboticsI2cRangeSensor.class, \"range\");\n gyro = (ModernRoboticsI2cGyro)hwMap.gyroSensor.get(\"gyro\");\n //color = hwMap.get(ModernRoboticsI2cColorSensor.class, \"color\");\n\n frontLeft.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n frontRight.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n backLeft.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n backRight.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n\n // Set all motors to zero power\n frontLeft.setPower(0);\n frontRight.setPower(0);\n backLeft.setPower(0);\n backRight.setPower(0);\n leftIntake.setPower(0);\n rightIntake.setPower(0);\n dropper.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n frontLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n frontRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n backLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n backRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftIntake.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n rightIntake.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n dropper.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n // Define and initialize ALL installed servos.\n\n// claimingArm = hwMap.get(Servo.class, \"claimingArm\");\n// claw1 = hwMap.get(Servo.class, \"claw1\");\n// claw2 = hwMap.get(Servo.class, \"claw2\");\n// samplingArm = hwMap.get(Servo.class, \"samplingArm\");\n\n helper = hwMap.get(Servo.class, \"helper\");\n leftUp = hwMap.get(Servo.class, \"leftUp\");\n rightUp = hwMap.get(Servo.class, \"rightUp\");\n outLeft = hwMap.get(Servo.class, \"outLeft\");\n outRight = hwMap.get(Servo.class, \"outRight\");\n\n// claimingArm.setPosition(0); // find out what servo they are using\n// claw1.setPosition(0);\n// claw2.setPosition(0);\n// samplingArm.setPosition(0);\n\n helper.setPosition(MID_SERVO);\n leftUp.setPosition(MID_SERVO);\n rightUp.setPosition(MID_SERVO);\n outLeft.setPosition(0.5);\n outRight.setPosition(0.5);\n\n dim = hwMap.get(DeviceInterfaceModule.class, \"Device Interface Module 1\");\n\n }",
"public String getOrientation(){\n\n if(robot.getRotation()%360 == 0){\n return \"NORTH\";\n } else if(robot.getRotation()%360 == 90\n ||robot.getRotation()%360 == -270){\n return \"EAST\";\n } else if(robot.getRotation()%360 == 180\n ||robot.getRotation()%360 == -180){\n return \"SOUTH\";\n } else if(robot.getRotation()%360 == 270\n ||robot.getRotation()%360 == -90){\n return \"WEST\";\n } else\n\n errorMessage(\"Id:10T error\");\n return null;\n }",
"public void robotInit() {\n\t\trightFront = new CANTalon(1);\n\t\tleftFront = new CANTalon(3);\n\t\trightBack = new CANTalon(2);\n\t\tleftBack = new CANTalon(4);\n\t\t\n\t\trightBack.changeControlMode(CANTalon.TalonControlMode.Follower);\n\t\tleftBack.changeControlMode(CANTalon.TalonControlMode.Follower);\n\t\t\n\t\tleftBack.set(leftFront.getDeviceID());\n\t\trightBack.set(rightFront.getDeviceID());\n\t\t\n\t\tturn = new Joystick(0);\n\t\tthrottle = new Joystick(1);\n\t}",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n // robot.leftBumper.setPosition(.5);\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n robot.colorDrop.setPosition(0.45);\n robot.align.setPosition(0.95);\n\n // robot.rightBumper.setPosition(.7);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }",
"public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n driveTrainmotor_leftFront = new Talon(1);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftFront\", (Talon) driveTrainmotor_leftFront);\n \n driveTrainmotor_leftRear = new Talon(2);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_leftRear\", (Talon) driveTrainmotor_leftRear);\n \n driveTrainmotor_rightFront = new Talon(3);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightFront\", (Talon) driveTrainmotor_rightFront);\n \n driveTrainmotor_rightRear = new Talon(4);\n LiveWindow.addActuator(\"DriveTrain\", \"motor_rightRear\", (Talon) driveTrainmotor_rightRear);\n \n driveTrainRobotDrive = new RobotDrive(driveTrainmotor_leftFront, driveTrainmotor_leftRear,\n driveTrainmotor_rightFront, driveTrainmotor_rightRear);\n \n driveTrainRobotDrive.setSafetyEnabled(true);\n driveTrainRobotDrive.setExpiration(0.1);\n driveTrainRobotDrive.setSensitivity(0.5);\n driveTrainRobotDrive.setMaxOutput(1.0);\n\n liftmotor_Lift = new Talon(0);\n LiveWindow.addActuator(\"Lift\", \"motor_Lift\", (Talon) liftmotor_Lift);\n \n liftencoderLiftHeight = new Encoder(1, 2, true, EncodingType.k4X);\n LiveWindow.addSensor(\"Lift\", \"encoder LiftHeight\", liftencoderLiftHeight);\n liftencoderLiftHeight.setDistancePerPulse(1.0);\n liftencoderLiftHeight.setPIDSourceParameter(PIDSourceParameter.kRate);\n liftlimitBottom = new DigitalInput(0);\n LiveWindow.addSensor(\"Lift\", \"limitBottom\", liftlimitBottom);\n \n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }",
"private void placeRobot(List<String> args) {\n int x;\n int y;\n Position.Direction direction;\n\n try {\n x = Integer.parseInt(args.get(0));\n y = Integer.parseInt(args.get(1));\n direction = Position.Direction.valueOf(args.get(2));\n } catch (NumberFormatException e) {\n System.out.println(\"x and y accept only numbers\");\n return;\n } catch (IllegalArgumentException e) {\n System.out.println(args.get(2) + \" looks an unsupported direction\");\n return;\n }\n\n if(x >= lowerBound.getX() && y >= lowerBound.getY() &&\n x <= upperBound.getX() && y <= upperBound.getY() ) {\n currentPosition.setX(x);\n currentPosition.setY(y);\n currentPosition.setDirection(direction);\n } else {\n System.out.println(\"Cannot position the robot outside the table\");\n }\n }",
"public AutoGenerator(RobotHardware hardware,\n Drivetrain drivetrain,\n IntakeArm intakeArm,\n IntakeRoller intakeRoller,\n ShooterArm shooterArm,\n ShooterFlywheel shooterFlywheel,\n ShooterSecondary shooterSecondary) {\n this.hardware = hardware;\n this.drivetrain = drivetrain;\n this.intakeArm = intakeArm;\n this.intakeRoller = intakeRoller;\n this.shooterArm = shooterArm;\n this.shooterFlywheel = shooterFlywheel;\n this.shooterSecondary = shooterSecondary;\n }",
"public DriveTrain() {\n\n\t\tleft1 = new CANTalon(RobotMap.DMTOPleft);\n\t\tleft2 = new CANTalon(RobotMap.DMMIDDLEleft);\n\t\tleft3 = new CANTalon(RobotMap.DMBOTTOMleft);\n\t\tright1 = new CANTalon(RobotMap.DMTOPright);\n\t\tright2 = new CANTalon(RobotMap.DMMIDDLEright);\n\t\tright3 = new CANTalon(RobotMap.DMBOTTOMright);\n\t\tright = new Encoder(RobotMap.DRIVEencoderRA, RobotMap.DRIVEencoderRB, false, Encoder.EncodingType.k4X);\n\t\tleft = new Encoder(RobotMap.DRIVEencoderLA, RobotMap.DRIVEencoderLB, true, Encoder.EncodingType.k4X);\n\t\tspeedShifter = new DoubleSolenoid(RobotMap.PCM, RobotMap.SHIFTLOW, RobotMap.SHIFTHI);\n\t\tultrasonic = new AnalogInput(RobotMap.ULTRASONICDT);\n\t\tservo = new Servo(RobotMap.SERVO_drivetrain);\n\n\t\t// TODO: set left and right encoder distance per pulse here! :)\n\n\t\tspeedShifter.set(DoubleSolenoid.Value.kReverse);\n\t\tdouble dpp = 3 * ((6 * Math.PI) / 1024); // distance per pulse\n\t\t\t\t\t\t\t\t\t\t\t\t\t// (circumference/counts per\n\t\t\t\t\t\t\t\t\t\t\t\t\t// revolution)\n\t\tright.setDistancePerPulse(dpp); // must be changed for both right and\n\t\t\t\t\t\t\t\t\t\t// left\n\t\tleft.setDistancePerPulse(dpp);\n\n\t}",
"public Elevator() {\n\t\t\n \tsuper(\"Elevator\", RobotConstants.ELEVATOR_P, RobotConstants.ELEVATOR_I, RobotConstants.ELEVATOR_D);\n \t\t\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public interface RobotMap {\n\t// CAN Device IDs\n\n\tpublic static final int WINCH_TALON = 1;\n\t// winch motors\n\n\tpublic static final int LEFT_ALIGN_TALON = 3;\n\tpublic static final int RIGHT_ALIGN_TALON = 4;\n\t// allignment wheels\n\n\tpublic static final int REAR_RIGHT_TALON = 5;\n\tpublic static final int REAR_LEFT_TALON = 6;\n\tpublic static final int FRONT_RIGHT_TALON = 7;\n\tpublic static final int FRONT_LEFT_TALON = 8;\n\t// drivetrain wheels\n\n\tpublic static final int PCM_MAIN = 9;\n\n\t/******************\n ** PNEUMATICS ** \n ******************/ \n\tpublic static final int FLIPPER_RIGHT = 0;\n\tpublic static final int FLIPPER_LEFT = 1;\n\tpublic static final int ARMS_A = 2;\n\tpublic static final int ARMS_B = 3;\n\t// End Pneumatic Channels\n\n\t/******************\n **PID CONTROLLER** \n ******************/ \n public static final double ABS_TOL = 100;\n public static final double P = .4;\n public static final double I = .01;\n public static final double D = 11;\n public static final double OUT_RANGE_L = -0.8;\n public static final double OUT_RANGE_H = 0.8;\n\n}",
"@Override\n // float limbSwing(par1), float limbSwingAmount(par2), float ageInTicks(par3), float netHeadYaw(par4), float headPitch(par5), float scaleFactor(par6), Entity entityIn(par7):\n public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)\n {\n EntityFamiliar entityFamiliar = (EntityFamiliar)entityIn;\n\n if (entityFamiliar.isCharging())\n {\n if (entityFamiliar.getPrimaryHand() == EnumHandSide.RIGHT)\n {\n this.armRight.rotateAngleX = 3.7699115F;\n }\n else\n {\n this.armLeft.rotateAngleX = 3.7699115F;\n }\n }\n \n // RightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;\n this.armRight.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 2.0F * limbSwingAmount * 0.5F;\n\n // LeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;\n this.armLeft.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F;\n \n // RightArm.rotateAngleZ = 0.0F;\n this.armRight.rotateAngleZ = 0.0F;\n \n // LeftArm.rotateAngleZ = 0.0F;\n this.armLeft.rotateAngleZ = 0.0F;\n \n // Wings (from EntityVex):\n this.wingRight.rotationPointZ = 2.0F;\n this.wingLeft.rotationPointZ = 2.0F;\n this.wingRight.rotationPointY = 1.0F;\n this.wingLeft.rotationPointY = 1.0F;\n this.wingRight.rotateAngleY = 0.47123894F + MathHelper.cos(ageInTicks * 0.8F) * (float)Math.PI * 0.05F;\n this.wingLeft.rotateAngleY = -this.wingRight.rotateAngleY;\n this.wingLeft.rotateAngleZ = -0.47123894F;\n this.wingLeft.rotateAngleX = 0.47123894F;\n this.wingRight.rotateAngleX = 0.47123894F;\n this.wingRight.rotateAngleZ = 0.47123894F;\n\n // Head.rotateAngleY = par5 (headPitch) / (180F / (float)Math.PI);\n this.head.rotateAngleX = headPitch / (180F / (float)Math.PI);\n\n // Head.rotateAngleY = par4 (netHeadYaw) / (180F / (float)Math.PI);\n this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI);\n\n // Tentacles (using spider model):\n //float f = ((float)Math.PI / 4F);\n this.tentacleFrontLeft.rotateAngleZ = -((float)Math.PI / 4F);\n this.tentacleFrontRight.rotateAngleZ = ((float)Math.PI / 4F);\n this.tentacleFrontMid.rotateAngleZ = -0.58119464F;\n this.tentacleBackMid.rotateAngleZ = 0.58119464F;\n this.tentacleBackLeft.rotateAngleZ = -((float)Math.PI / 4F);\n this.tentacleBackRight.rotateAngleZ = ((float)Math.PI / 4F);\n //float f1 = -0.0F;\n //float f2 = 0.3926991F;\n this.tentacleFrontLeft.rotateAngleY = ((float)Math.PI / 4F);\n this.tentacleFrontRight.rotateAngleY = -((float)Math.PI / 4F);\n this.tentacleFrontMid.rotateAngleY = 0.3926991F;\n this.tentacleBackMid.rotateAngleY = -0.3926991F;\n this.tentacleBackLeft.rotateAngleY = -((float)Math.PI / 4F);\n this.tentacleBackRight.rotateAngleY = ((float)Math.PI / 4F);\n float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount;\n float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * limbSwingAmount;\n float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;\n float f6 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount;\n float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float)Math.PI) * 0.4F) * limbSwingAmount;\n float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;\n this.tentacleFrontLeft.rotateAngleY += f3;\n this.tentacleFrontRight.rotateAngleY += -f3;\n this.tentacleFrontMid.rotateAngleY += f4;\n this.tentacleBackMid.rotateAngleY += -f4;\n this.tentacleBackLeft.rotateAngleY += f5;\n this.tentacleBackRight.rotateAngleY += -f5;\n this.tentacleFrontLeft.rotateAngleZ += f6;\n this.tentacleFrontRight.rotateAngleZ += -f6;\n this.tentacleFrontMid.rotateAngleZ += f7;\n this.tentacleBackMid.rotateAngleZ += -f7;\n this.tentacleBackLeft.rotateAngleZ += f8;\n this.tentacleBackRight.rotateAngleZ += -f8;\n }",
"@Override\n protected void initialize() {\n Robot.leftDriveEncoder.reset();\n Robot.rightDriveEncoder.reset();\n tempTargetDirection = Robot.targetDirection + Robot.navX.getYaw();\n\n\n }",
"public LocalizerOld(OdometerOld left, OdometerOld right, OdometerOld center) {\n this.left = left;\n this.right = right;\n this.center = center;\n\n robotPosition = new Point();\n\n robotPosition.x = 0;\n robotPosition.y = 0;\n robotAngle = 0;\n\n lastResetAngle = 0;\n }",
"public Wander() \t\r\n\t{ \r\n\t\tm_pos = new Point2d(30,0); \r\n\t\tm_r = 20; \r\n\t\tm_influence = 1; \r\n\t\tm_seekPoint = new Point2d(0,0);\r\n\t\tm_rate = 10;\r\n\t\tinit();\r\n\t}",
"public RobotDrive_3C2S(CANTalon leftFrontMotor, CANTalon leftRearMotor, CANTalon leftTopMotor,\r\n\t\t\tCANTalon rightFrontMotor, CANTalon rightRearMotor, CANTalon rightTopMotor) {\r\n\t\tm_leftCIMMotor1 = requireNonNull(leftFrontMotor, \"leftFrontMotor cannot be null\");\r\n\t\tm_leftCIMMotor2 = requireNonNull(leftRearMotor, \"leftRearMotor cannot be null\");\r\n\t\tm_leftMiniCIMMotor1 = requireNonNull(leftTopMotor, \"leftTopMotor cannot be null\"); // TODO: insure brake is off\r\n\t\tm_rightCIMMotor1 = requireNonNull(rightFrontMotor, \"rightFrontMotor cannot be null\");\r\n\t\tm_rightCIMMotor2 = requireNonNull(rightRearMotor, \"rightRearMotor cannot be null\");\r\n\t\tm_rightMiniCIMMotor1 = requireNonNull(rightTopMotor, \"rightTopMotor cannot be null\"); // TODO: insure brake is off\r\n\t\tm_rightGearSolenoid = new DoubleSolenoid(15,0,1);\r\n\t\tm_leftGearSolenoid = new DoubleSolenoid(15,2,3);\r\n\t\tm_leftMiniCIMMotor1.enableBrakeMode(false);\r\n\t\tm_rightMiniCIMMotor1.enableBrakeMode(false);\r\n\t\tm_sensitivity = kDefaultSensitivity;\r\n\t\tm_maxOutput = kDefaultMaxOutput;\r\n\t\tsetupMotorSafety();\r\n\t\tdrive(0, 0);\r\n\t}",
"public void operatorControl() {\n \tdouble ctrlThresh = .2; \n \tdouble minPower = .05; \n \tdouble maxPower = .75; \n \tdouble recip = (1 - ctrlThresh); \n \tdouble mult = (maxPower - minPower); \n \tdouble right; \n \tdouble strafe; \n \tdouble rotate; \n \tdouble rightAxis; \n \tdouble strafeAxis; \n \tdouble rotateAxis; \n \t// \tboolean leftLeft; \n \t// \tboolean leftRight; \n \tdouble rightDir; \n \tdouble strafeDir; \n \tdouble rotateDir; \n \tdouble rightPower; \n \tdouble rotatePower; \n \tdouble strafePower; \n \t\n \tint winchCount;\n \tboolean winchDirection;\n \n \t// \tdouble frontLeftPower; \n \t// \tdouble frontRightPower; \n \t// \tdouble backLeftPower; \n \t// \tdouble backRightPower; \n \n \t//myRobot.setSafetyEnabled(true); \n \t\n \tAccelerometer test = new BuiltInAccelerometer();\n \t\n \twhile (isOperatorControl() && isEnabled()) { \n \t\t// ACCEL TEST CODE\n// \t\tSystem.out.println(test.getX() + \", \" + test.getY() + \", \" + test.getZ());\n \t\t// END ACCEL TEST CODE\n \n \t\t// ********** BEGIN DRIVING CODE ********** \n \t\t// Code for driving using omniwheels and two wheels for strafing \n \t\t// Diagram for the wheels of the robot below. \n \n \t\t// L S R \n \t\t// /--------------------------\\ \n \t\t//\t ||------------------------|| \n \t\t// || [][] || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || [][] || \n \t\t// ||------------------------|| \n \t\t// \\--------------------------/ \n \t\t// \n \t\t// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ \n \n \t\tctrlThresh = .2; // the point at which we want to sense joystick action \n \t\trecip = 1-ctrlThresh; \t\t // = 0.8 \n \n \t\trightAxis = rightStick.getRawAxis(1);\t\t\t\t// right joystick, y (up/down) axis\n \t\t\n \t\t//System.out.println(\"\"+rightAxis);\n \t\tstrafeAxis = rightStick.getRawAxis(0);\t\t\t\t// right joystick, x (left/right) axis; this is \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// arbitrary and could have been the left stick\n \t\trotateAxis = rightStick.getRawAxis(4);\t\t\t\t\t// left joystick, y axis\n \n \t\trightDir = rightAxis/Math.abs(rightAxis);\t\t\t// forward or backward (+1 or -1)\n \t\tstrafeDir = strafeAxis/Math.abs(strafeAxis); \t// \t\t\t'' \n \t\trotateDir = rotateAxis/Math.abs(rotateAxis); // \t\t\t'' \n \n \t\tright = 0; // right input formatted for range of detected values [0.2,1] \n \t\trotate = 0; // left input formatted \n \t\tstrafe = 0; // strafe input formatted \n \n \t\tif(Math.abs(rightAxis) > ctrlThresh) \t// user moved stick beyond threshold \n \t\t{right = (rightAxis-ctrlThresh*rightDir)/recip;} // format right: scale back, set direction, proportion it \n \t\tif(Math.abs(strafeAxis) > ctrlThresh) \n \t\t{strafe = (strafeAxis-ctrlThresh*strafeDir)/recip;} // format left... \n \t\tif(Math.abs(rotateAxis) > ctrlThresh) \n \t\t{rotate = (rotateAxis-ctrlThresh*rotateDir)/recip;}\t\t// format strafe... \n \n \n \t\trightDir = right/Math.abs(right); \n \t\trightPower = (Math.abs(right*mult) + minPower) * rightDir; \t\t// re-proportion for power's range, strip direction,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// and then add back threshold and direction. \n \t\trotateDir = rotate/Math.abs(rotate); \n \t\trotatePower = (Math.abs(rotate*mult) + minPower) * rotateDir;\t\t\t// \t\t'' \n \n \t\tstrafeDir = strafe/Math.abs(strafe); \n \t\tstrafePower = (Math.abs(strafe*mult) + minPower) * strafeDir;\t// \t\t'' \n \n \t\tif(Math.abs(rightPower)>0.2){\n \t\t\tfrontRight.set(rightPower);\t\t\t\t\t\t// set all the motors with the powers we \n \t\t\tbackRight.set(rightPower);\t\t\t\t\t\t/// calculated above : drive! \n \t\t\tfrontLeft.set(-1*rightPower); \n \t\t\tbackLeft.set(-1*rightPower);\n \t\t}\n \t\telse{\n \t\t\tfrontRight.set(rotatePower);\n \t\t\tbackRight.set(rotatePower);\n \t\t\tfrontLeft.set(rotatePower);\n \t\t\tbackLeft.set(rotatePower);\n \t\t}\n \t\t\n// \t\tfrontStrafe.set(strafePower); \n// \t\tbackStrafe.set(-1*strafePower); \n \n// \t\tmyRobot.tankDrive(leftStick, rightStick); \n \t\t \n \t\t// ********** END OF DRIVING CODE ********** \n \t\t//======================================================================= \n \t\t// ************ BEGIN WINCH CODE *********** \n \t\t// We need to code the winch to help raise and lower the elevator \n \t\t// This is just one option between the winch and the lead screw. \n \t\t \n \t\t\n \t\t//second winch test\n \t\t/*\n \t\twinchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n \t \tSystem.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n \t \tif(winchCount<240){\n \t \t\t\n \t \t\twinchCim1.set(.1);\n \t \t\twinchCim2.set(.1);\n \t \t}\n \t \telse{\n \t \t\twinchCim1.set(0);\n \t \t\twinchCim2.set(0);\n \t \t\t\n \t \t}\n \t if(rightStick.getRawButton(5)) \n { \n\t\t\t winchEncoder.reset();// reset the pulse count\n\t\t\t winchCount = 0;\n\t\t\t winchCim1.set(0);\n\t\t\t winchCim2.set(0);\n\t\t\t \n } */ //end of second winch test \n \t \t\n \t\t\n \t\t if(rightStick.getRawButton(5)) \n { \n \t\t\t //winchEncoder.reset();// reset the pulse count\n \tSystem.out.println(\"A\");\n \t winchCim1.set(.5); \t// set winchCim1 to 0.5 power (upwards) \n \t winchCim2.set(.5); \t\t\t\t\t\t\t// set winchCim2 to 0.5 power\n \t\t\t \n } \n \t\telse if(rightStick.getRawButton(4))\n \t\t{\n \t\t\tSystem.out.println(\"B\");\n \t\t\t//winchEncoder.reset();\t\t\t\t\t\t\t// reset the pulse count\n \t \twinchCim1.set(-.3); // set winchCim1 to -0.5 power (downwards) \n \t \twinchCim2.set(-.3);\t \t\t\t\t\t\t\t// set winchCim2 to -0.5 power\n \t\t}\n \n \t \telse// if(rightStick.getRawButton(2)) \n { \n \t winchCim1.set(0); \t\t\t\t\t\t\t// set winchCim1 to 0 power (off/stop) \n \t winchCim2.set(0);\t\t\t\t\t\t\t\t// set winchCim2 to 0 pwoer (off/stop)\n// \t winchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n// \t System.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n } \n \n \t\t// ********** END OF WINCH CODE ********** \n \t\t//======================================================================= \n \t\t \n \t\t \n \t\tTimer.delay(0.005);\t\t// wait for a motor update time \n } \n }",
"public static void init() {\r\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\r\n driveTrainSubsystemleftFront = new Jaguar(1, 1);\r\n\tLiveWindow.addActuator(\"DriveTrainSubsystem\", \"leftFront\", (Jaguar) driveTrainSubsystemleftFront);\r\n \r\n driveTrainSubsystemleftRear = new Jaguar(1, 5);\r\n\tLiveWindow.addActuator(\"DriveTrainSubsystem\", \"leftRear\", (Jaguar) driveTrainSubsystemleftRear);\r\n \r\n driveTrainSubsystemrightFront = new Jaguar(1, 6);\r\n\tLiveWindow.addActuator(\"DriveTrainSubsystem\", \"rightFront\", (Jaguar) driveTrainSubsystemrightFront);\r\n \r\n driveTrainSubsystemrightRear = new Jaguar(1, 7);\r\n\tLiveWindow.addActuator(\"DriveTrainSubsystem\", \"rightRear\", (Jaguar) driveTrainSubsystemrightRear);\r\n \r\n driveTrainSubsystemRobotDrive = new RobotDrive(driveTrainSubsystemleftFront, driveTrainSubsystemleftRear,\r\n driveTrainSubsystemrightFront, driveTrainSubsystemrightRear);\r\n\t\r\n driveTrainSubsystemRobotDrive.setSafetyEnabled(true);\r\n driveTrainSubsystemRobotDrive.setExpiration(0.1);\r\n driveTrainSubsystemRobotDrive.setSensitivity(0.5);\r\n driveTrainSubsystemRobotDrive.setMaxOutput(1.0);\r\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\r\n }",
"public SmartRobot(char name, Grid grid, int row, int col, int energyUnits) {\n\t\tsuper(name,grid,row,col,energyUnits);\n\t}",
"@Override\n public void init() {\n // Get references to dc motors and set initial mode and direction\n // It appears all encoders are reset upon robot startup, but just in case, set all motor\n // modes to Stop-And-Reset-Encoders during initialization.\n motorLeftA = hardwareMap.dcMotor.get(MOTOR_DRIVE_LEFT_A);\n motorLeftA.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorLeftA.setDirection(DcMotor.Direction.FORWARD);\n\n motorLeftB = hardwareMap.dcMotor.get(MOTOR_DRIVE_LEFT_B);\n motorLeftB.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorLeftB.setDirection(DcMotor.Direction.FORWARD);\n\n motorRightA = hardwareMap.dcMotor.get(MOTOR_DRIVE_RIGHT_A);\n motorRightA.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorRightA.setDirection(DcMotor.Direction.REVERSE);\n\n motorRightB = hardwareMap.dcMotor.get(MOTOR_DRIVE_RIGHT_B);\n motorRightB.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorRightB.setDirection(DcMotor.Direction.REVERSE);\n\n //motorGlyphLift = hardwareMap.dcMotor.get(GLYPH_LIFT);\n //motorGlyphLift.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n //motorGlyphLift.setDirection(DcMotor.Direction.FORWARD);\n\n sGlyphL = hardwareMap.servo.get(GLYPH_LEFT);\n //sGlyphL.scaleRange(0,180);\n\n sGlyphR = hardwareMap.servo.get(GLYPH_RIGHT);\n sGem = hardwareMap.servo.get(Gem);\n\n //Initialize vex motor\n sGLift = hardwareMap.crservo.get(Servo_GlyphLift);\n\n //sGLift.setPower(0);\n\n //sGLift2 = hardwareMap.servo.get(Servo_GlyphLift);\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n imu = hardwareMap.get(BNO055IMU.class,\"imu\");\n imu.initialize(parameters);\n\n //servoGlyph1.setPosition(180);\n //servoGlyph2.setPosition(180);\n\n bDirection = true;\n }",
"@Override \n public void init() {\n intakeLeft = hardwareMap.crservo.get(\"intakeLeft\");\n intakeRight = hardwareMap.crservo.get(\"intakeRight\");\n topLeft = hardwareMap.servo.get(\"topLeft\");\n bottomLeft = hardwareMap.servo.get(\"bottomRight\");\n topRight = hardwareMap.servo.get(\"topRight\");\n bottomRight = hardwareMap.servo.get(\"bottomRight\");\n lift = hardwareMap.dcMotor.get(\"lift\");\n }",
"private RightMotor() {\n\t\t// Instantiate left motor class\n\t\tmotor = new Talon(RobotMap.M_RIGHT);\n\t\tencoder = new Encoder(RobotMap.M_RIGHT_ENCODER_CW, RobotMap.M_RIGHT_ENCODER_CCW);\n\t}",
"public DriveTrain(SpeedController left, SpeedController right){\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.drive = new RobotDrive(left,right);\n\t\t/*\n\t\tthis.leftDrive=new RobotDrive(left,right);\n\t\tthis.rightDrive=new RobotDrive(right);\n\t\t*/\n\t}",
"public RobotContainer() {\n\nleftJoystick = new Joystick(0);\nrightJoystick = new Joystick(1);\n\ndriveBase = new DriveBase();\ndriveWithJoystick = new DriveWithJoystick();\nCommandScheduler.getInstance().setDefaultCommand(driveBase, driveWithJoystick);\n\n\n // Configure the button bindings\n configureButtonBindings();\n }",
"public void adjustShooterAngleManual() {\n\n // If the driver pushes the Square Button on the PS4 Controller,\n // set the worm drive motors to go backwards (lower it).\n if (PS4.getRawButton(PS4_X_BUTTON) == true) {\n\n wormDriveMotors.set(-0.2);\n\n // If the driver pushes the Triangle Button on the PS4 Controller,\n // set the worm drive motors to go forwards (raise it up).\n } else if (PS4.getRawButton(PS4_SQUARE_BUTTON) == true) {\n\n wormDriveMotors.set(0.4);\n }\n\n // If the driver is an idiot and is pressing BOTH the Square Button AND the\n // Triangle Button at the same time, OR (||) if the driver is pushing neither\n // button, set the motor speed to 0.\n else if (((PS4.getRawButton(PS4_X_BUTTON) == true) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == true))\n || ((PS4.getRawButton(PS4_X_BUTTON) == false) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == false))) {\n\n wormDriveMotors.set(0);\n }\n\n }",
"public DriveSubsystem() {\n leftDrive = new Spark(0);\n rightDrive = new Spark(1);\n\n leftEncoder = new Encoder(0, 1);\n rightEncoder = new Encoder(2, 3);\n\n leftEncoder.setDistancePerPulse((Math.PI * WHEEL_DIAMETER) / PPR);\n rightEncoder.setDistancePerPulse((Math.PI * WHEEL_DIAMETER) / PPR);\n \n drive = new DifferentialDrive(leftDrive, rightDrive);\n\n }",
"public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }",
"@Override\n\tpublic void robotInit() {\n\t\tfr = new Spark(HardwareMap.PWM.DRIVE_FR);\n\t\tfl = new Spark(HardwareMap.PWM.DRIVE_FL);\n\t\tbr = new Spark(HardwareMap.PWM.DRIVE_BR);\n\t\tbl = new Spark(HardwareMap.PWM.DRIVE_BL);\n\t\t\n\t\t// Create the side modules\n\t\tleftGroup = new SpeedControllerGroup(bl, fl);\n\t\trightGroup = new SpeedControllerGroup(br, fr);\n\n\t\t// Init the the drive train\n\t\tdrive = new DifferentialDrive(leftGroup, rightGroup);\n\t\t\n\t\t//Init the gyro\n\t\tgyro.calibrate();\n\t\tSmartDashboard.putData(\"Gyro\", gyro);\n\t\t\n\t\tdrive.setSafetyEnabled(false);\n\t\tthis.setName(Subsystems.DRIVE);\n\t}",
"public java.lang.Object getRobotOrientation() throws CallError, InterruptedException {\n return (java.lang.Object)service.call(\"getRobotOrientation\").get();\n }",
"public OI() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n\n xBoxOne = new Joystick(0);\n \n autoRight = new JoystickButton(xBoxOne, 10);\n autoRight.whenPressed(new AutoRight());\n autoLeft = new JoystickButton(xBoxOne, 9);\n autoLeft.whenPressed(new AutoLeft());\n vision = new JoystickButton(xBoxOne, 7);\n vision.whenPressed(new SeekAndDriveTo());\n cameraSwitch = new JoystickButton(xBoxOne, 2);\n cameraSwitch.whenPressed(new CameraSwitch());\n latchCloseManual = new JoystickButton(xBoxOne, 6);\n latchCloseManual.whileHeld(new latchCloseManual());\n latchOpenManual = new JoystickButton(xBoxOne, 5);\n latchOpenManual.whileHeld(new latchOpenManual());\n toggleDirection = new JoystickButton(xBoxOne, 3);\n toggleDirection.whenPressed(new SwitchDirection());\n follow = new JoystickButton(xBoxOne, 8);\n follow.whenPressed(new follow());\n driveBackToDistance = new JoystickButton(xBoxOne, 1);\n driveBackToDistance.whenPressed(new AutoReverse());\n driveToDistance = new JoystickButton(xBoxOne, 4);\n driveToDistance.whenPressed(new AutoDrop());\n\n\n // SmartDashboard Buttons\n SmartDashboard.putData(\"Autonomous Command\", new AutonomousCommand());\n SmartDashboard.putData(\"DriveWithJoystick\", new DriveWithJoystick());\n SmartDashboard.putData(\"driveToDistance\", new driveToDistance());\n SmartDashboard.putData(\"HDriveJoystick\", new HDriveJoystick());\n SmartDashboard.putData(\"driveBackToDistance\", new driveBackToDistance());\n SmartDashboard.putData(\"follow\", new follow());\n SmartDashboard.putData(\"Climb\", new Climb());\n SmartDashboard.putData(\"SwitchDirection\", new SwitchDirection());\n SmartDashboard.putData(\"latchClose\", new latchClose());\n SmartDashboard.putData(\"latchOpen\", new latchOpen());\n SmartDashboard.putData(\"AutoDrop\", new AutoDrop());\n SmartDashboard.putData(\"AutoReverse\", new AutoReverse());\n SmartDashboard.putData(\"latchOpenManual\", new latchOpenManual());\n SmartDashboard.putData(\"latchCloseManual\", new latchCloseManual());\n SmartDashboard.putData(\"autoForwardBack\", new autoForwardBack());\n SmartDashboard.putData(\"kickForward\", new kickForward());\n SmartDashboard.putData(\"CameraSwitch\", new CameraSwitch());\n SmartDashboard.putData(\"Vision\", new Vision());\n SmartDashboard.putData(\"SeekAndDriveTo\", new SeekAndDriveTo());\n SmartDashboard.putData(\"turnRightTimed\", new turnRightTimed());\n SmartDashboard.putData(\"turnLeftTimed\", new turnLeftTimed());\n SmartDashboard.putData(\"driveForwardTimed\", new driveForwardTimed());\n SmartDashboard.putData(\"AutoRight\", new AutoRight());\n SmartDashboard.putData(\"AutoLeft\", new AutoLeft());\n SmartDashboard.putData(\"AutoMiddle\", new AutoMiddle());\n SmartDashboard.putData(\"SeekAndDriveSim\", new SeekAndDriveSim());\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }",
"public void operatorDrive() {\n\n changeMode();\n checkForGearShift();\n\n if (Robot.rightJoystick.getRawButton(1)) {\n currentMode = DriveMode.AUTO;\n\n } else if (Robot.rightJoystick.getRawButton(2)) {\n currentMode = DriveMode.CLIMB;\n } else {\n currentMode = DEFAULT_MODE;\n }\n\n isDeploying = false;\n\n if (currentMode == DriveMode.AUTO) {\n currentMode_s = \"Auto\";\n } else if (currentMode == DriveMode.ARCADE) {\n currentMode_s = \"Arcade\";\n } else {\n currentMode_s = \"Tank\";\n }\n\n double leftY = 0;\n double rightY = 0;\n\n switch (currentMode) {\n\n case AUTO:\n rotateCam(4, Robot.visionTargetInfo.visionPixelX);\n\n // driveFwd(4, .25);\n\n break;\n\n case CLIMB:\n\n climb();\n\n break;\n\n case ARCADE:\n resetAuto();\n double linear = 0;\n double turn = 0;\n\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n linear = -Robot.rightJoystick.getY();\n }\n if (Math.abs(Robot.leftJoystick.getX()) > deadband) {\n turn = Math.pow(Robot.leftJoystick.getX(), 3);\n }\n\n leftY = -linear - turn;\n rightY = linear - turn;\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n\n break;\n\n case TANK:\n\n resetAuto();\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n rightY = -Math.pow(Robot.rightJoystick.getY(), 3 / 2);\n }\n if (Math.abs(Robot.leftJoystick.getY()) > deadband) {\n leftY = Math.pow(Robot.leftJoystick.getY(), 3 / 2);\n }\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n break;\n\n default:\n break;\n }\n\n updateTelemetry();\n }",
"public Drive() {\r\n leftFrontDrive = new Talon(Constants.DRIVE_LEFT_FRONT);\r\n leftRearDrive = new Talon(Constants.DRIVE_LEFT_REAR);\r\n rightFrontDrive = new Talon(Constants.DRIVE_RIGHT_FRONT);\r\n rightRearDrive = new Talon(Constants.DRIVE_RIGHT_REAR);\r\n \r\n robotDrive = new RobotDrive(\r\n leftFrontDrive,\r\n leftRearDrive, \r\n rightFrontDrive, \r\n rightRearDrive);\r\n \r\n driveDirection = 1.0;\r\n \r\n arcadeYRamp = new CarbonRamp();\r\n arcadeXRamp = new CarbonRamp();\r\n tankLeftRamp = new CarbonRamp();\r\n tankRightRamp = new CarbonRamp();\r\n \r\n ui = CarbonUI.getUI();\r\n }",
"public MilfordAuton(DriveSubsystem drive, Shooter shooter, ShooterAngle angle, Elevator elevator, double direction) {\n /*\n 1. Set angle to 45\n 2. Tune angle for 1 second\n 3. Rev shooter at 6000 RPM for 1 second\n 4. Shoot at 6000 for 4 seconds\n 5. Wait for 0.5 seconds\n 6. Drive forward for 3 seconds\n */\n super(new SetAngle(angle, 45), new HoldAngle(angle).withTimeout(1), new ShootAt(shooter).withTimeout(1),\n (new ShootAt(shooter).alongWith((new Elevate(elevator)))).withTimeout(4),\n (new NOP().withTimeout(0.5)).andThen(new DriveToWall(drive, direction).withTimeout(3)));\n }",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized\");\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n left = hardwareMap.get(DcMotor.class, \"left\");\n right = hardwareMap.get(DcMotor.class, \"right\");\n wrist = hardwareMap.crservo.get(\"wrist\");\n extension = hardwareMap.get(DcMotor.class, \"extension\");\n lift = hardwareMap.get(DcMotor.class, \"lift\");\n\n\n //lift = hardwareMap.get(DcMotor.class, \"lift\");\n bucket = hardwareMap.servo.get(\"bucket\");\n //fBucket = hardwareMap.get(DcMotor.class, \"fBucket\");\n //fBucket.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n left.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n right.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n extension.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n collection = hardwareMap.crservo.get(\"collection\");\n //lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // Most robots need the motor on one side to be reversed to drive forward\n // Reverse the motor that runs backwards when connected directly to the battery\n left.setDirection(DcMotor.Direction.FORWARD);\n right.setDirection(DcMotor.Direction.REVERSE);\n //lift.setDirection(DcMotor.Direction.FORWARD);\n // fBucket.setDirection(DcMotor.Direction.FORWARD);\n lift.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n lift.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n // Tell the driver that initialization is complete.\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.addData(\"left\", left.getPower());\n telemetry.addData(\"right\", right.getPower());\n //telemetry.addData(\"lift\", lift.getPower());\n telemetry.addData(\"collection\", collection.getPower());\n //wrist.setPosition(-1);\n //telemetry.addData(\"fBucket\", fBucket.getPower());\n //Robot robot = new Robot(lift, extension, wrist, bucket, collection, drive);\n }",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initializing\"); //display on the drivers phone that its working\n\n FLM = hardwareMap.get(DcMotor.class, \"FLM\"); //Go into the config and get the device named \"FLM\" and assign it to FLM\n FRM = hardwareMap.get(DcMotor.class, \"FRM\"); //device name doesn't have to be the same as the variable name\n BLM = hardwareMap.get(DcMotor.class, \"BLM\"); //DcMotor.class because that is what the object is\n BRM = hardwareMap.get(DcMotor.class, \"BRM\");\n\n BigSuck = hardwareMap.get(DcMotor.class, \"BigSUCK\");\n SmallSuck = hardwareMap.get(DcMotor.class, \"SmallSUCK\");\n SmallSuck.setDirection(DcMotor.Direction.REVERSE);\n \n UpLift = hardwareMap.get(DcMotor.class, \"LIFT\");\n UpLift.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n UpLift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n //Make it so we don't have to add flip the sign of the power we are setting to half the motors\n //FRM.setDirection(DcMotor.Direction.REVERSE); //Run the right side of the robot backwards\n FLM.setDirection(DcMotor.Direction.REVERSE);\n BRM.setDirection(DcMotor.Direction.REVERSE); //the right motors are facing differently than the left handed ones\n\n FLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n FRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n DragArm = hardwareMap.servo.get(\"drag_arm\");\n DragArm.setDirection(Servo.Direction.REVERSE);\n DragArm.setPosition(DragArmRestPosition);\n\n LiftGrab = hardwareMap.servo.get(\"GRAB\");\n LiftGrab.setPosition(LiftGrabRestPosition);\n\n LiftSwivel = hardwareMap.servo.get(\"SWIVEL\");\n LiftSwivel.setPosition(LiftSwivelRestPosition);\n\n Push = hardwareMap.get(Servo.class, \"PUSH\");\n Push.setDirection(Servo.Direction.FORWARD);\n Push.setPosition(PushRestPosition);\n\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n }",
"public ElectricShower() {\r\n\t\tthis(12, 0, 4);\r\n\t}",
"protected void ratCrewInit() {\n\n // Init motor state machine.\n motorTurnType = \"none\";\n motorTurnDestination = 0.0f;\n motorTurnAngleToGo = 0.0f;\n motorTurnAngleAdjustedToGo = 0.0f;\n isDriving = false;\n driveLeftStart = 0;\n driveRightStart = 0;\n driveLeftTarget = 0;\n driveRightTarget = 0;\n driveRightSpeed = 0.0f;\n driveLeftSpeed = 0.0f;\n driveAngleOffset = 0.0f;\n driveAngleCorrection = 0.0f;\n\n // TODO: push into initMotor function\n if (doMotors) {\n // Initialize Motors, finding them through the hardware map.\n leftDrive = hardwareMap.get(DcMotor.class, \"motorLeft\");\n rightDrive = hardwareMap.get(DcMotor.class, \"motorRight\");\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // initialize the encoder\n leftDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n leftDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n rightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n // Set all motors to zero power.\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n\n gate = hardwareMap.get(Servo.class, \"Gate\");\n gate.setPosition(1.0);\n }\n initGyroscope();\n\n if (doVuforia){\n initVuforia();\n initTfod();\n\n if (tfod != null) {\n tfod.activate();\n\n // The TensorFlow software will scale the input images from the camera to a lower resolution.\n // This can result in lower detection accuracy at longer distances (> 55cm or 22\").\n // If your target is at distance greater than 50 cm (20\") you can adjust the magnification value\n // to artificially zoom in to the center of image. For best results, the \"aspectRatio\" argument\n // should be set to the value of the images used to create the TensorFlow Object Detection model\n // (typically 1.78 or 16/9).\n\n // Uncomment the following line if you want to adjust the magnification and/or the aspect ratio of the input images.\n tfod.setZoom(2.5, 1.78);\n }\n }\n\n // Init run state.\n madeTheRun = false;\n startTime = 0;\n telemetry.addData(\"Init\", \"motors=%b, gyro=%b, vuforia=%b\", doMotors, doGyro, doVuforia);\n telemetry.update();\n }",
"private void defineVertexes(String orientation){\n if(\"down\".equals(orientation)){\n y2 = y1-height;\n y3 = y1-height;\n \n x2 = x1 - height/2;\n x3 = x1 + height/2;\n }else if(orientation.equals(\"up\")){\n y2 = y1+height;\n y3 = y1+height;\n x2 = x1 - height/2;\n x3 = x1 + height/2;\n }else if(orientation.equals(\"left\")){\n x2 = x1-height;\n y2 = y1+height/2;\n x3 = x1;\n y3 = y1+height;\n }else if(orientation.equals(\"right\")){\n x2 = x1+height;\n y2 = y1+height/2;\n x3 = x1;\n y3 = y1+height;\n }\n }",
"public TurnToDefaultAngle() {\n super(0, RobotContainer.m_robotDrive);\n }",
"public ElevatorApproachSensorEvent(int c, DirectionType dir) {\n super(\"\", EventType.ELEVATOR_APPROACH_SENSOR);\n car = c;\n direction = dir;\n }",
"public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n// leftRearMotor = hwMap.dcMotor.get(\"left_rear_drive\");\n// rightRearMotor = hwMap.dcMotor.get(\"right_rear_drive\");\n leftFrontMotor = hwMap.dcMotor.get(\"left_front_drive\");\n rightFrontMotor = hwMap.dcMotor.get(\"right_front_drive\");\n// liftMotor = hwMap.dcMotor.get(\"lift_motor\");\n brushMotor = hwMap.dcMotor.get(\"brush_motor\");\n leftSpinMotor = hwMap.dcMotor.get(\"left_spin_motor\");\n rightSpinMotor = hwMap.dcMotor.get(\"right_spin_motor\");\n tiltMotor = hwMap.dcMotor.get(\"tilt_motor\");\n\n// rangeSensor = hwMap.get(ModernRoboticsI2cRangeSensor.class, \"range sensor\");\n\n //define and initialize servos\n// loadServo = hwMap.servo.get(\"load_servo\");\n// loadServo.setPosition(BEGIN_SERVO);\n pushServo = hwMap.servo.get(\"push_servo\");\n pushServo.setPosition(MID_SERVO);\n leftLiftServo = hwMap.servo.get(\"left_lift_servo\");\n leftLiftServo.setPosition(MID_SERVO);\n rightLiftServo = hwMap.servo.get(\"right_lift_servo\");\n rightLiftServo.setPosition(MID_SERVO);\n\n //define and initialize buttons\n// bottomTouchButton = hwMap.touchSensor.get(\"bottom_touch_button\");\n// topTouchButton = hwMap.touchSensor.get(\"top_touch_button\");\n\n leftSpinMotor.setDirection(DcMotor.Direction.REVERSE);\n leftFrontMotor.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n rightFrontMotor.setDirection(DcMotor.Direction.FORWARD); // Set to FORWARD if using AndyMark motors\n\n // Set all motors to zero power\n// leftRearMotor.setPower(0);\n// rightRearMotor.setPower(0);\n leftFrontMotor.setPower(0);\n rightFrontMotor.setPower(0);\n// liftMotor.setPower(0);\n brushMotor.setPower(0);\n leftSpinMotor.setPower(0);\n rightSpinMotor.setPower(0);\n tiltMotor.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n// leftRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n// rightRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n rightFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n// liftMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n brushMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n// rightSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n tiltMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }",
"public interface RobotConveyor {\n\n Robot createRobot();\n}",
"public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drivetrainSpeedController1 = new CANTalon(1);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 1\", (CANTalon) drivetrainSpeedController1);\n \n drivetrainSpeedController2 = new CANTalon(2);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController2);\n drivetrainSpeedController3 = new CANTalon(3);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController3);\n drivetrainSpeedController4 = new CANTalon(4);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController4);\n drivetrainSpeedController5 = new CANTalon(5);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController5);\n drivetrainSpeedController6 = new CANTalon(6);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController6);\n \n drivetrainRobotDrive21 = new RobotDrive(drivetrainSpeedController1, drivetrainSpeedController2, drivetrainSpeedController3, drivetrainSpeedController4, drivetrainSpeedController5, drivetrainSpeedController6);\n \n drivetrainRobotDrive21.setSafetyEnabled(true);\n drivetrainRobotDrive21.setExpiration(0.1);\n drivetrainRobotDrive21.setSensitivity(0.5);\n drivetrainRobotDrive21.setMaxOutput(1.0);\n\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }",
"@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized Interative TeleOp Mode\");\n telemetry.update();\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n leftDrive = hardwareMap.dcMotor.get(\"leftDrive\");\n rightDrive = hardwareMap.dcMotor.get(\"rightDrive\");\n armMotor = hardwareMap.dcMotor.get(\"armMotor\");\n\n leftGrab = hardwareMap.servo.get(\"leftGrab\");\n rightGrab = hardwareMap.servo.get(\"rightGrab\");\n colorArm = hardwareMap.servo.get(\"colorArm\");\n leftTop = hardwareMap.servo.get(\"leftTop\");\n rightTop = hardwareMap.servo.get(\"rightTop\");\n\n /*\n left and right drive = motion of robot\n armMotor = motion of arm (lifting the grippers)\n extendingArm = motion of slider (used for dropping the fake person)\n left and right grab = grippers to get the blocks\n */\n\n }",
"public lo(Entity paramwv)\r\n/* 15: */ {\r\n/* 16:23 */ this.a = paramwv.getID();\r\n/* 17:24 */ this.b = MathUtils.floor(paramwv.xPos * 32.0D);\r\n/* 18:25 */ this.c = MathUtils.floor(paramwv.yPos * 32.0D);\r\n/* 19:26 */ this.d = MathUtils.floor(paramwv.zPos * 32.0D);\r\n/* 20:27 */ this.e = ((byte)(int)(paramwv.yaw * 256.0F / 360.0F));\r\n/* 21:28 */ this.f = ((byte)(int)(paramwv.pitch * 256.0F / 360.0F));\r\n/* 22:29 */ this.g = paramwv.landing;\r\n/* 23: */ }",
"public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }",
"@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tm_frontRight = new PWMVictorSPX(0);\n\t\tm_frontLeft = new PWMVictorSPX(2);\n\t\tm_backRight = new PWMVictorSPX(1);\n\t\tm_backLeft = new PWMVictorSPX(3);\n\n\t\tx_aligning = false;\n\n\t\tJoy = new Joystick(0);\n\t\tmyTimer = new Timer();\n\n\t\tfinal SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_backLeft);\n\t\tfinal SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_backRight);\n\n\t\tm_drive = new DifferentialDrive(m_left, m_right);\n\n\t\tdistanceToTarget = 0;\n\n\t\tcounter = new Counter(9);\n\t\tcounter.setMaxPeriod(10.0);\n\t\tcounter.setSemiPeriodMode(true);\n\t\tcounter.reset();\n\t}",
"public Coordinates choosePath(Actor robot) {\n\t\tCoordinates tempV = null;\n\t\tint tempDist = 0;\n\t\tboolean occupied = false;\n\t\ttempV = robot.getCoords();\n\t\tDirections dir = Directions.getDirection();\n\t\tswitch (dir) {\n\t\tcase RIGHT:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX() + 1, tempV.getY());\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX() - 1, tempV.getY());\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase LEFT:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX() - 1, tempV.getY());\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX() + 1, tempV.getY());\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase DOWN:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() + 1);\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() - 1);\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase UP:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() - 1);\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() + 1);\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn tempV;\n\t}",
"public Robot getRobot(String nombre);",
"public Vector reorient(Vector facing, Vector hwd) {\n\t\tout.println(\"reorient\");\n\t\tVector new_vec;\n\t\t//facing E\n\t\tif (facing.getX() == 1){\n\t\t\tnew_vec=new Vector(hwd.getZ(),hwd.getY(),hwd.getX());\n\t\t\tout.println(\"NEW_VEC E: \"+new_vec);\n\t\t\treturn new_vec;\n\t\t}\n\t\t//facing W\n\t\tif (facing.getX() == -1){\n\t\t\tnew_vec=new Vector(hwd.getZ()*-1,hwd.getY(),hwd.getX()*-1);\n\t\t\tout.println(\"NEW_VEC W: \"+new_vec);\n\t\t\treturn new_vec;\n\t\t\t\n\t\t}\n\n\t\t//facing S\n\t\tif (facing.getZ() == 1){\n\t\t\tnew_vec = new Vector(hwd.getX()*-1,hwd.getY(), hwd.getZ());\n\t\t\tout.println(\"NEW_VEC S: \"+new_vec);\n\t\t\treturn new_vec;\n\t\t}\n\t\t//facing N\n\t\tif (facing.getZ() == -1){\n\t\t\tnew_vec = new Vector(hwd.getX(),hwd.getY(), hwd.getZ()*-1);\n\t\t\tout.println(\"NEW_VEC N: \"+new_vec);\n\t\t\treturn new_vec;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}"
] | [
"0.61242586",
"0.56679106",
"0.5544317",
"0.54908955",
"0.5485238",
"0.54706514",
"0.545283",
"0.5404678",
"0.5397624",
"0.5331218",
"0.5329291",
"0.53048444",
"0.5248528",
"0.52318805",
"0.5220308",
"0.5218037",
"0.5214738",
"0.5205896",
"0.51759475",
"0.51743925",
"0.516494",
"0.51539904",
"0.51354855",
"0.51328343",
"0.5118124",
"0.50853366",
"0.5079439",
"0.50722855",
"0.50700194",
"0.5067792",
"0.5035414",
"0.50285214",
"0.50192046",
"0.501711",
"0.49968442",
"0.49963316",
"0.49892953",
"0.49820113",
"0.49781388",
"0.49606183",
"0.49525714",
"0.4946946",
"0.4946938",
"0.49450913",
"0.49338436",
"0.4917444",
"0.49124673",
"0.4903111",
"0.49025694",
"0.4895398",
"0.4865512",
"0.4862381",
"0.4860563",
"0.48438543",
"0.48410246",
"0.4831397",
"0.48300633",
"0.48282647",
"0.48191574",
"0.48188186",
"0.4817933",
"0.48149204",
"0.48139918",
"0.481302",
"0.4809673",
"0.48046303",
"0.4804047",
"0.47985658",
"0.4796141",
"0.4795093",
"0.47809762",
"0.47645593",
"0.47638252",
"0.4761491",
"0.47480565",
"0.47464937",
"0.474547",
"0.47414228",
"0.47332847",
"0.47288397",
"0.47275946",
"0.47232163",
"0.47199503",
"0.4718319",
"0.46990952",
"0.4698605",
"0.46922854",
"0.4690346",
"0.46902728",
"0.46888733",
"0.46836397",
"0.4674208",
"0.46719772",
"0.46709102",
"0.466663",
"0.46645445",
"0.4662289",
"0.46563601",
"0.46476135",
"0.4646459"
] | 0.6582389 | 0 |
Put robot at position (x, y) on board (if possible). | @Override
public void putRobot(Board board, long x, long y, Robot robot)
{
try
{
robot.setPosition(new Position(x,y));
robot.setBoard(board);
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this board is terminated; the robot cannot be placed on the board.");
}
catch(IllegalPositionException exc)
{
System.out.println("This is not a valid position on the board to place an element.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void placeRobot(List<String> args) {\n int x;\n int y;\n Position.Direction direction;\n\n try {\n x = Integer.parseInt(args.get(0));\n y = Integer.parseInt(args.get(1));\n direction = Position.Direction.valueOf(args.get(2));\n } catch (NumberFormatException e) {\n System.out.println(\"x and y accept only numbers\");\n return;\n } catch (IllegalArgumentException e) {\n System.out.println(args.get(2) + \" looks an unsupported direction\");\n return;\n }\n\n if(x >= lowerBound.getX() && y >= lowerBound.getY() &&\n x <= upperBound.getX() && y <= upperBound.getY() ) {\n currentPosition.setX(x);\n currentPosition.setY(y);\n currentPosition.setDirection(direction);\n } else {\n System.out.println(\"Cannot position the robot outside the table\");\n }\n }",
"protected void setRobotCoordinates(int x, int y, float a) {\r\n currentPos.setCoordinates(x, y, a, (float)x, (float)y);\r\n }",
"public void teleportTo(int y, int x){\n\t\tthis.position[y][x] = 1;//makes the position here, used for other object room\n\t}",
"public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }",
"public void turnToLiving(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = true;\n }",
"public void setRobotLocation(Point p);",
"boolean insertRobot(Position pos, Robot rob);",
"public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void placeRobot(String validPlaceCmd, Robot robot) {\r\n\t\ttry {\r\n\t\t\tString[] placePositionFaceArr = this\r\n\t\t\t\t\t.getRobotPositionAndFace(validPlaceCmd);\r\n\t\t\t\r\n\t\t\tif (placePositionFaceArr.length == 3) {\r\n\t\t\t\tint row = RobotSimulator.isInteger(placePositionFaceArr[0]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[0]) : -1;\r\n\t\t\t\tint col = RobotSimulator.isInteger(placePositionFaceArr[1]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[1]) : -1;\r\n\r\n\t\t\t\trobot.setRow(row);\r\n\t\t\t\trobot.setCol(col);\r\n\r\n\t\t\t\tint faceId = robot.getFaceId(placePositionFaceArr[2]);\r\n\t\t\t\trobot.setFace(faceId);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Place robot exception: \" + e.getMessage());\r\n\t\t}\r\n\t}",
"public void setDriveCoords(int x, int y) {\n this.drive_control.driveJoyStick(x, y);\n }",
"public void putInCell (int x, int y, Sprite object){\n\t\tif (object instanceof Tile) {\n\t\t\tgameMap[x][y].setTile((Tile)object);\n\t\t\treturn;\n\t\t}\n\t\telse if(gameMap[x][y].getTile() instanceof Target && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\tdecrementOnTarget();\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\tincrementOnTarget();\n\t\t\t}\n\t\t}\n\t\telse if (gameMap[x][y].getTile() instanceof Switch && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t}\n\t\tgameMap[x][y].setObject((GameObject)object);\n\t}",
"public void move(int x, int y)\r\n\t{\r\n\t\ttheX = x;\r\n\t\ttheY = y;\r\n\t}",
"public void move(int x, int y) {\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public void putPiece(Piece piece, int x, int y)\r\n {\r\n if(isValidSqr(x, y))\r\n {\r\n board[x][y] = piece;\r\n if(piece != null) piece.setLocation(x, y);\r\n }\r\n }",
"protected void moveTo(int x, int y) {\n\n if (x < 0 || x > 2)\n throw new IllegalArgumentException(\"x is out of bound\");\n\n if (y < 0 || y > 3)\n throw new IllegalArgumentException(\"y is out of bound\");\n\n this.xPosition = x;\n this.yPosition = y;\n }",
"public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}",
"protected void moveTo (int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public void setUnitOnBoard(Unit unit, int x, int y) {\n\t\tPosition pos = new Position(x, y);\n\t\tunitsOnBoard.put(pos, unit);\n\t\tunitPossitions.put(unit.getId(), pos);\n\t}",
"public void pushOccupyingRobot(Vector2 pos) {\n IRobot robot = getRobotOnPos(pos);\n Direction dir = getValidDir(pos);\n\n if (dir != null && robot != null) {\n //System.out.println(robot.getName());\n //System.out.println(dir.toString());\n GameScreen.getInstance().unrenderRobot(robot);\n robot.moveOne(dir);\n GameScreen.getInstance().renderRobot(robot);\n }\n }",
"void setLocation(int x, int y);",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"public void move(int x, int y){\n universe.erase(this);\n this.yPosition = y;\n this.xPosition = x;\n universe.draw(this);\n }",
"public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }",
"public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}",
"public void activateNearby(int x, int y)\r\n {\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n if (row != y || col != x)\r\n {\r\n try\r\n {\r\n if (gameBoard.gameCells[row][col].isBomb() == false && gameBoard.gameCells[row][col].isDisable() == false)\r\n {\r\n updateCell(gameBoard.gameCells[row][col]);\r\n }\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }\r\n }",
"public void setMove(char player, int place) {\n\n playBoard[place] = player;\n }",
"@Override\r\n\tpublic void putWall(Board board, long x, long y, Wall wall) throws UnsupportedOperationException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\twall.setPosition(new Position(x,y));\r\n\t\t\twall.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this wall or this board is terminated; the wall cannot be placed on the board.\");\r\n\t\t}\r\n\t}",
"public void teleportPlayer(int x, int y){\n hero.setX(x);\n hero.setY(y);\n }",
"private void easyMove(Board board) {\n\t\t\r\n\t}",
"public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }",
"public void setSpaceAt(int x, int y, int val){\n grids[x][y].setValue(val);\n }",
"public void setSpawn (int x, int y) {\n xCord = x;\n yCord = y;\n }",
"boolean place (int x, int y) {\n\t\tint row = x;\n\t\tint col = y;\n\t\tmoleGrid[row][col] = 'M';\n\t\tmolesLeft++;\n\n\t\tif (moleGrid[row][col] == 'M') {\n\t\t\t// System.out.println(\"You have successfully placed a mole at coordinates.\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// System.out.println(\"Error: A mole was NOT placed at the coordinates.\");\n\t\t\treturn false;\n\n\t\t}\n\t\t\n\t}",
"@Override\n protected void execute() \n {\n move(Robot.oi.mechJoystick);\n }",
"public void makeMove(){\n System.out.println(\"Player choose x or o.\");\n String chose = keyword.nextLine();\n int row;\n int column;\n if (chose.equals(\"x\")){\n System.out.println(\"Type coordenates for first move.\");\n System.out.println(\"Type row.\");\n row = keyword.nextInt();\n System.out.println(\"Type column.\");\n column = keyword.nextInt();\n getBoard(row, column, \"x\");\n }\n else if (chose.equals(\"o\")){\n System.out.println(\"Type coordenates for first move.\");\n System.out.println(\"Type row.\");\n row = keyword.nextInt();\n System.out.println(\"Type column.\");\n column = keyword.nextInt();\n getBoard(row, column, \"o\");\n }\n }",
"public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }",
"public void moveTo(int x, int y) {\n\t\tx2 = x;\n\t\ty2 = y;\n\t}",
"public void setSpace(int position, Box player){\r\n\t\tboard[position - 1] = player;\r\n\t\t\r\n\t}",
"public void setLocation(int x, int y){\n if(x < 0 || x > 19 || y < 0 || y > 19){\n // The user has tried to move outside the bounds of the world, so\n // we call the die() method which causes the Player to die.\n die();\n } else {\n // The user is trying to move within the bounds of the world. Run\n // the Actor class' own setLocation() method to move the Player.\n super.setLocation(x, y);\n }\n }",
"public void move(@NotNull Map map, int x, int y)\n {\n if (map.map[this.x + x][this.y + y].isBlocking)\n {\n x = 0;\n y = 0;\n }\n\n this.x += x;\n this.y += y;\n }",
"public void move(Cell[][] board) {\n Cell[] nextCells = generateNeighbors(this.x, this.y);\n Cell nextCell = nextCells[rand.nextInt(4)];\n if (!this.objectFound) {\n if (nextCell != null && nextCell.isOccupied() && nextCell.occupiedBy instanceof Integer) {\n this.objectFound = true;\n this.goal = nextCell;\n } else if (nextCell != null && !nextCell.isOccupied()) {\n synchronized (board[this.x][this.y]) {\n board[this.x][this.y].resetCell();\n nextCell.occupiedBy = this;\n }\n }\n } else {\n // bfs to location\n System.out.println(\"BFS to goal\");\n }\n }",
"public void setPosition(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public void drawCell(int x, int y) {\n \n //Sets cell to occupied\n gameBoard[x][y] = 1;\n }",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public static void move(int row, int col){\n \n if(board[row][col] == ' '){\n board[row][col] = xo;\n changeXO();\n }\n else\n System.out.println(\"There is already a character there. Please try another spot.\");\n \n }",
"public void agregarRobot(Robot robot);",
"private void initialiseRobotImage(int x, int y) {\r\n\t\trobotImage = new RobotImageComponent(Constant.ROBOTIMAGEPATHS[this.getDirection()], Constant.ROBOTWIDTH, Constant.ROBOTHEIGHT);\r\n\t\tframe.add(robotImage);\r\n\t\trobotImage.setLocation(Constant.MARGINLEFT + (Constant.GRIDWIDTH * 3 - Constant.ROBOTWIDTH)/2 + (x-1) * Constant.GRIDWIDTH, Constant.MARGINTOP + (Constant.GRIDHEIGHT * 3 - Constant.ROBOTHEIGHT)/2 + (y-1) * Constant.GRIDHEIGHT);\r\n\t}",
"public void setPosition(float x, float y);",
"void setBoard(Board board);",
"public void playOn(int x, int y)\r\n\t{\r\n\t\t//Converts x positions to array indices.\r\n\t\tx--;\r\n\t\ty--;\r\n\t\t//The x and y inputs need to be within the board boundaries.\r\n\t\tif(x>=0 && x<grid.length && y>=0 && y<grid.length)\r\n\t\t{\r\n\t\t\t//The UI grid will be updated.\r\n\t\t\t/*This method will have to be resolved.\r\n\t\t\tif(ships.hitsShipOn(x, y))\r\n\t\t\t\t\tgrid[x][y] = 1;\r\n\t\t\telse\r\n\t\t\t\t\tgrid[x][y] = -1;*/\r\n\t\t}\r\n\t\t\t\r\n\t}",
"public void moveToPoint(int x, int y) {\n /**\n * DO NOT EDIT THIS CODE TO REMOVE DUPLICATIONS IT WILL BREAK MULTIPLAYER\n * SERIOUSLY JUST DO NOT DO IT\n *\n * DON'T DO IT\n *\n *\n * JUST DON'T TOUCH THIS CODE AT ALL\n */\n AbstractHero hero = map.getCurrentTurnHero();\n\n // This short circuits but if it's not multiplayer the second statement will do nothing\n if (map.moveEntity(map.getCurrentTurnHero(), x, y)) {\n map.updateVisibilityArray();\n visionChanged = true;\n gameState.updateMovementGoal(x, y);\n }\n\n updateLiveTileEffectsOnCharacter(hero);\n gameChanged = true;\n minimapChanged = true;\n visionChanged = true;\n movementChanged = true;\n\n\n centerMapOnCurrentHero();\n }",
"public void setPosition(int x, int y) {\n this.coordX = x;\n this.coordY = y;\n }",
"Robot getRobot(Position pos);",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public PositionInTheGameBoard(int x, int y) throws PositionIsNotInGameboardException\r\n\t{\r\n\t\tif(x < 0 || x >= PositionInTheGameBoard.max_X || y < 0 || y >= PositionInTheGameBoard.max_Y) throw new PositionIsNotInGameboardException();\r\n\t\tthis.X = x;\r\n\t\tthis.Y = y;\r\n\t}",
"private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }",
"@Override\r\n\tpublic void putBattery(Board board, long x, long y, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbattery.setPosition(new Position(x,y));\r\n\t\t\tbattery.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this battery or this board is terminated; the battery cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public abstract void move(int newXPosition, int newYPosition, PiecePosition position) throws BoardException;",
"public void setPosition(float x, float y)\n {\n if (getMazeSprite() != null)\n {\n this.getMazeSprite().setPosition(x, y);\n }\n }",
"protected abstract void position(int[][] gameboard, int col, int row);",
"void setPosition(double xPos, double yPos);",
"public void setPosition(int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public void setLoc(int x, int y) {\n locX = x;\n locY = y;\n }",
"public void place(Piece p, int x, int y) {\n\t\tif (x >= 8 || y >= 8 || p == null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (pieceAt(x, y) != null) {\n\t\t\t\tremove(x, y);\n\t\t\t}\n\t\t\tb[x][y] = p;\n\t\t\tif (p.isFire()) {\n\t\t\t\tnumFire += 1;\n\t\t\t} else {\n\t\t\t\tnumWater += 1;\n\t\t\t}\n\t\t}\n\t}",
"public boolean setPosition(int x, int y, int w, int h)\n {\n return setPosition( new Position2D(x, y, w, h) );\n }",
"@Override\r\n\tpublic void setRobot(Robot r) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\trobot = (BasicRobot) r;\r\n\t\t//robot.setMaze(this.mC);\r\n\t\t\r\n\t}",
"public boolean move(int x, int y, int player) {\n\t\tif (board[x][y] != EMPTY) {\n\t\t\t// Cell is not empty\n\t\t\treturn false;\n\t\t}\n\t\tboard[x][y] = player;\n\n\t\treturn true;\n\t}",
"void mouseMove(int x,int y) throws BhelpException\n{\n // BoardLog.logD(\"BHELP\",\"MOVE MOUSE \" + x + \" \" + y);\n\n checkMouse();\n\n Point sp = new Point(x,y);\n convertPointToScreen(sp);\n getRobot().mouseMove(sp.x,sp.y);\n setMouse(x,y);\n}",
"public void setLocation(float x, float y);",
"public void setPosition(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public void resetRobotPositionOnUI() {\r\n\t\tthis.x = checkValidX(1);\r\n\t\tthis.y = checkValidY(1);\r\n\t\ttoggleValid();\r\n\t\trobotImage.setLocation(Constant.MARGINLEFT + (Constant.GRIDWIDTH * 3 - Constant.ROBOTWIDTH)/2 + (x-1) * Constant.GRIDWIDTH, Constant.MARGINTOP + (Constant.GRIDHEIGHT * 3 - Constant.ROBOTHEIGHT)/2 + (y-1) * Constant.GRIDHEIGHT);\r\n\t\t\r\n\t}",
"private void setGridElement (int row, int column, Player player)\n {\n mGrid[row][column] = new Move(player, row, column);\n }",
"interface Robot {\n // Returns true if the cell in front is open and robot moves into the cell.\n // Returns false if the cell in front is blocked and robot stays in the current cell.\n public boolean move();\n\n // Robot will stay in the same cell after calling turnLeft/turnRight.\n // Each turn will be 90 degrees.\n public void turnLeft();\n\n public void turnRight();\n\n // Clean the current cell.\n public void clean();\n }",
"public void moveTo(double x, double y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"private void placePlayerShip(int x, int y) {\n\t\tif (shipsToPlace == 3) {\n\t\t\tlongShipCoords = new int[2];\n\t\t\tlongShipCoords[0] = x;\n\t\t\tlongShipCoords[1] = y;\n\n\t\t\t// creates long ship at x,y on egrid\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\tegrid[x + i][y] = 1;\n\n\t\t\t// makes ship tiles blue on enemy's board\n\t\t\tfor (int counter = 0; counter < 5; counter++)\n\t\t\t\tenemyBoard[x + counter][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t}\n\n\t\telse if (shipsToPlace == 2) {\n\t\t\t// create medium ship at x,y on egrid\n\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\t\t\tegrid[x][y + 2] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 2].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t}\n\n\t\telse if (shipsToPlace == 1) {\n\t\t\t// create small ship at x,y on egrid\n\t\t\tegrid[x][y] = 1;\n\t\t\tegrid[x][y + 1] = 1;\n\n\t\t\t// make ship tiles blue on enemy's board\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tileship.jpg\"));\n\t\t\tenemyBoard[x][y + 1].setIcon(createImageIcon(\"tileship.jpg\"));\n\n\t\t\tstatus.setText(\" Click to attack\");\n\t\t}\n\t\tshipsToPlace--;\n\t\tenableAllTiles();\n\t\tdisableRestrictedTiles(x, y);\n\t}",
"public BoardCell(int x, int y){\n xCor=x;\n yCor=y;\n }",
"public void setLocation(int x,int y)\n\t{\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t}",
"public void setPosition(int x, int y) {\r\n\t\tmyX = x;\r\n\t\tmyY = y;\r\n\t}",
"public void setPosition(int x, int y)\n\t{\n\t\tint w = getSize().width;\n\t\tint h = getSize().height;\n\n\t\tpos.x = x;\n\n\t\tpos.y = y;\n\n\t\trect.setLocation(x - w / 2, y - h / 2);\n\t}",
"public void setMoveTo(Coordinate coordinate);",
"void setPos(float x, float y);",
"public void setPosition(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public abstract Piece setLocation(int row, int column);",
"public void moveBallTo(int x, int y)\n {\n currentBallX = x;\n currentBallY = y;\n }",
"public void Move(int x, int y)\r\n\t{\r\n\t\tP.x+=x;\r\n\t\tP.y+=y;\r\n\t}",
"public void setLocation(int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public void tellNearby(int x, int y)\r\n {\r\n // checks for nearby bombs\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n try\r\n {\r\n gameBoard.gameCells[row][col].addBombNearby();\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }",
"public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}",
"private void setCell(boolean[][] board, int i, int j) {\n\t\tint numOfNeighbors = getNeighbors(board, i, j);\n\t\tif(board[i][j]) { // if alive\n\t\t\tif(numOfNeighbors < 2 || numOfNeighbors >= 4) {\n\t\t\t\ttempBoard[i][j] = false; // kill cell\n\t\t\t}\n\t\t}else{ // if dead\n\t\t\tif(numOfNeighbors == 3)\n\t\t\t\ttempBoard[i][j] = true; // become alive\n\t\t}\n\t}",
"private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }",
"public void setPosition(int x, int y){\n\t\t\n\t\tif(x>=ColumnNumber.firstColumn.ordinal() && x<=ColumnNumber.eightColumn.ordinal()){\n\t\t\txPosition=x;\n\t\t}\n\t\tif(y>=RowNumber.firstRow.ordinal() && y<=RowNumber.eightRow.ordinal()){\n\t\t\tyPosition=y;\n\t\t}\n\t\t\n\t}",
"public void putChessOnBoard(int x, int y, int color) {\n \tif (this.board.put(x, y, color) == true) {\n System.out.println(\"Move played: \" + intToChar(x) + y);\n\n this.switchPlayer();\n\n if (this.board.checkGameOver(x, y, color) == true) {\n this.printResult(color);\n System.out.println(\"Game Over!\");\n System.exit(0);\n } else if (this.board.checkDraw() == true) {\n System.out.println(\"Draw!\");\n System.out.println(\"Game Over!\");\n System.exit(0); \n }\n }\n }",
"public void setPosition(double x, double y) {\n getMotion().setPosition(x, y);\n }",
"void makeMove(Location loc);",
"@Override\r\n\tpublic void moveNextTo(Robot robot, Robot other)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.moveNextTo(other);\r\n\t\t}\r\n\t\tcatch(IllegalBoardException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Both robots are not placed on the same board\");\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"One or both robots is either terminated or does not have a board.\");\r\n\t\t}\r\n\t}",
"public void driveJoystick(double x, double y) {\n\t\ty = -y;\n\t\t\n\t\tdouble leftPower;\n\t\tdouble rightPower;\n\t\t\n\t\t// Calculate Power (Drive Train)\n\t\tleftPower = Range.clip(y + x, -1.0, 1.0) ;\n\t\trightPower = Range.clip(y - x, -1.0, 1.0) ;\n\t\t\n\t\tdrive(leftPower, rightPower);\n\t\t\n\t\t/* \n\t\t// Calculate Power (Drive Train)\n\t\tdouble drive = -gamepad1.left_stick_y;\n\t\tdouble turn = gamepad1.right_stick_x;\n\t\tleftPower\t = Range.clip(drive + turn, -1.0, 1.0) ;\n\t\trightPower = Range.clip(drive - turn, -1.0, 1.0) ;\n\t\t*/\n\t}",
"private void tryMove(int row, int column) {\n game.move(new Point(row, column));\n }",
"public void moveToCoord(int x, int y, int angle, double power) throws IOException{\n\t\tresetCoordinates();\n\t\tdouble moveAngle;\n\t\tdouble thetaField;\n\t\tdouble referenceTheta;\n\t\t//(-62,-3)\n\t\treferenceTheta = Math.atan2(y-getY(),getX() - x);\n\t\tthetaField = referenceTheta;\n\t\t//calculate what angle in reference to the robot that the robot should move\n\t\tmoveAngle=thetaField+(Math.PI/2)-Math.toRadians(getAngle());\n\t\tif(Math.abs(moveAngle)>Math.PI&&moveAngle<0){\n\t\t\tmoveAngle=moveAngle+(2*Math.PI);\n\t\t}\n\t\tif(Math.abs(moveAngle)>Math.PI&&moveAngle>0){\n\t\t\tmoveAngle=moveAngle-(2*Math.PI);\n\t\t}\n\t\tpolarDrive(power,moveAngle);\n\t\twhile((Math.abs(getX()-x)>2 || Math.abs(getY()-y)>2)&&opModeIsActive()&&resetCoordinates()){\n\t\t\tresetCoordinates();\n\t\t\tif(gamepad1.a)\n\n\t\t\t\tstopMotors();\n\t\t\telse{\n\t\t\t\tpolarDrive(power,moveAngle);\n\t\t\t}\n\t\t\ttelemetry.addData(\"(x,y)\",\"(\"+getX()+\",\"+getY()+\")\");\n\t\t\ttelemetry.addData(\"(new x,new y\",\"(\"+x+\",\"+y+\")\" );\n\t\t\ttelemetry.addData(\"getX() > x\",getX() > x);\n\t\t\ttelemetry.addData(\"y < getY()\",y < getY());\n\t\t\ttelemetry.addData(\"reference angle\", Math.toDegrees(referenceTheta));\n\t\t\ttelemetry.addData(\"goal Angle\", Math.toDegrees(moveAngle));\n\t\t\ttelemetry.addData(\"current angle\",getAngle());\n\t\t\ttelemetry.addData(\"theta field\",Math.toDegrees(thetaField));\n\t\t\ttelemetry.addData(\"condition\", Math.abs(getX()-x)>1 || Math.abs(getY()-y)>1);\n\t\t\ttelemetry.update();\n\t\t}\n\t\tif(!resetCoordinates())\n\t\t\tthrow new IOException(\"Vuforia not found\");\n\t\tstopMotors();\n\t\trotateToAngle(angle);\n\t\tstopMotors();\n\n\t}",
"public void set(int x, int y, int elem){\n matriz[x][y] = elem;\n }"
] | [
"0.651104",
"0.6507533",
"0.64307404",
"0.6379152",
"0.632765",
"0.6256533",
"0.62564135",
"0.6249974",
"0.6221492",
"0.61844087",
"0.6091605",
"0.60773814",
"0.6062405",
"0.60531604",
"0.6023253",
"0.6021914",
"0.6006585",
"0.5994162",
"0.5993896",
"0.5993147",
"0.5989568",
"0.59891427",
"0.59245795",
"0.5904693",
"0.5893443",
"0.58748955",
"0.5871558",
"0.5865159",
"0.5822179",
"0.5817788",
"0.58106273",
"0.5809269",
"0.58081305",
"0.5803062",
"0.5796892",
"0.57954514",
"0.57931787",
"0.5793105",
"0.57922304",
"0.57888067",
"0.5768501",
"0.5766228",
"0.57603323",
"0.57592446",
"0.5739445",
"0.5721444",
"0.5709452",
"0.5707538",
"0.5707536",
"0.5706049",
"0.5697525",
"0.5695514",
"0.56877226",
"0.56847274",
"0.56795657",
"0.56778425",
"0.5677667",
"0.5670149",
"0.56587607",
"0.5656942",
"0.5648392",
"0.5644462",
"0.56313175",
"0.5626264",
"0.5624518",
"0.56230783",
"0.56195354",
"0.56189895",
"0.5611386",
"0.5608317",
"0.56064296",
"0.5604532",
"0.56042355",
"0.5602586",
"0.56010246",
"0.5593306",
"0.55916804",
"0.5589483",
"0.55816114",
"0.55799603",
"0.55765074",
"0.5568634",
"0.55635643",
"0.55539495",
"0.55357313",
"0.55335957",
"0.5532844",
"0.5532652",
"0.55306447",
"0.5530082",
"0.5527794",
"0.5524348",
"0.55224824",
"0.5511037",
"0.55037546",
"0.5501312",
"0.5481923",
"0.54769254",
"0.54769063",
"0.5475356"
] | 0.80962104 | 0 |
Return the xcoordinate of robot. This method must throw IllegalStateException if robot is not placed on a board. | @Override
public long getRobotX(Robot robot) throws IllegalStateException
{
if (robot.getBoard() != null)
{
return robot.getPosition().getCoordX();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getX() {\n\t\t\tint lastRobot = (state[2 * k] + k - 1) % k;\n\t\t\treturn state[lastRobot];\n\t\t}",
"public final int getPositionX() {\r\n return (int) position.x();\r\n }",
"public int getX() {\n synchronized (this.xLock) {\n return (int) this.movementComposer.getXPosition();\n }\n }",
"public int getXPosition() {\n\t\treturn this.position.x;\n\t}",
"public int getX() {\r\n\t\treturn xcoord;\r\n\t}",
"public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getCoordX() \r\n {\r\n \treturn this.coordX;\r\n }",
"public int getxCoordinate() {\n\t\treturn xCoordinate;\n\t}",
"@Override\r\n\tpublic long getRepairKitX(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getXPosition() {\n return xPosition;\n }",
"@Override\r\n\tpublic long getWallX(Wall wall) throws IllegalStateException, UnsupportedOperationException\r\n\t{\r\n\t\tif (wall.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn wall.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public double getPositionX() {\n\t\treturn this.tilePositionX;\n\t}",
"public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}",
"public int getPositionX() {\r\n\t\treturn positionX;\r\n\t}",
"public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}",
"public final int getX()\n\t{\n\t\treturn pos.x;\n\t}",
"public int getXPosition() {\n return this.xPosition;\n }",
"public int getPositionX() {\n return positionX;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getX() {\n return xCoord;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int getxPosition() {\n\t\treturn xPosition;\n\t}",
"public int getPositionX(){\n\t\treturn positionx;\n\t}",
"public int getX() {\n return pos_x;\n }",
"@Override\r\n\tpublic long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int setObjXCoord() {\n\t\tint objX = ThreadLocalRandom.current().nextInt(1, getRoomWidth() - 1);\r\n\t\treturn objX;\r\n\t}",
"public int getXPos() {\n\t\treturn xPos;\n\t}",
"public int getxPos() {\n\t\treturn xPos;\n\t}",
"@Override\r\n\tpublic long getBatteryX(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}",
"public int getxPos() {\n return xPos;\n }",
"public int getX()\n\t{\n\t\treturn m_nPosX;\n\t}",
"public int getX() {\n return this.coordinate.x;\n }",
"protected int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getXPos() {\r\n\t\treturn this.cameraX;\r\n\t}",
"public int getxPos() \n\t{\n\t\treturn xPos;\n\t}",
"public int getX() {\n return (int) xPos;\n }",
"public int getXPosition(){\n\t\treturn xPosition;\n\t}",
"public double getxCoordinate() {\n return xCoordinate;\n }",
"public int getPos_x(){\n\t\treturn pos_x;\n\t}",
"protected Number getX() {\n return this.xCoordinate;\n }",
"public int getX() {\n return posX;\n }",
"public int getX()\r\n {\r\n return xCoord;\r\n }",
"public double getXPosition()\n\t{\n\t\treturn xPosition;\n\t}",
"public double getXCoordinate() {\n return xCoordinate;\n }",
"public int getX() {\r\n return xpos;\r\n }",
"public double getX() {\n return position.getX();\n }",
"public int getX()\r\n {\r\n \treturn xPos;\r\n }",
"@Basic\n\tpublic double getXCoordinate() {\n\t\treturn this.x;\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int get_X_Coordinate()\n {\n return currentBallX;\n }",
"public double getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getXCoordinate ()\n {\n return xCoordinate;\n }",
"public int getX(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(0)/ AvesAblazeHardware.mmPerInch);\n\t}",
"public int getX() {\n return positionX;\n }",
"public int getPosX() {\r\n\t\treturn posX;\r\n\t}",
"public int getPosX() {\n\t\treturn posX;\n\t}",
"private double getPosX() {\n\t\treturn this.posX.get();\n\t}",
"public int getXpos() {\n\t\treturn xpos;\n\t}",
"public double getLocationX() {\r\n\t\treturn location.getX();\r\n\t}",
"int getX() {\n return xPos;\n }",
"public int x() {\r\n\t\treturn xCoord;\r\n\t}",
"@Override\n\tpublic int getPosX() {\n\t\treturn posX;\n\t}",
"public int getPosX() {\n return posX;\n }",
"@Override\n\tpublic int getX() {\n\t\treturn this.posicionX;\n\t}",
"double getXPosition();",
"public float getxPosition() {\n return xPosition;\n }",
"public int getX(){\n\t\treturn this.x_location;\n\t}",
"public int getX() {\n return (int) this.center.getX();\n }",
"public int getX()\r\n {\r\n return xLoc;\r\n }",
"public int getLocX() {\n return locX;\n }",
"public int getX() {\n return (int) center.getX();\n }",
"public double getX() {\r\n\t\t return this.xCoord;\r\n\t }",
"private int get_x() {\n return center_x;\n }",
"public int getX() { return position.x; }",
"public float getX() {\n return pos.x;\n }",
"public double getXPos() {\n\t\treturn this.position[0];\n\t}",
"public int getX() {\r\n return (int) center.getX();\r\n }",
"public int getXcoord(){\n\t\treturn this.coordinates[0];\n\t}",
"public int getXPos();",
"public int getLocationX() {\r\n\t\treturn x;\r\n\t}",
"public float getPositionX() {return this.position.getX();}",
"public int getMovementX() {\r\n return movementX;\r\n }",
"@Override\n\tpublic double getXPos() {\n\t\treturn field_145851_c;\n\t}",
"public int getPosX(){\n\t\treturn this.posX; \n\t}",
"public int getxOnScreen(){\n this.xOnScreen = xMaze * moverStepSizeOnScreen;\n return this.xOnScreen;\n }",
"public int getScreenX()\r\n\t{\r\n\t\treturn mScreen.getX();\r\n\t}",
"public double getXPos(){\n return xPos;\n }"
] | [
"0.6909655",
"0.6862693",
"0.6814756",
"0.6698004",
"0.6693816",
"0.66933113",
"0.6682005",
"0.6682005",
"0.66722006",
"0.6665289",
"0.66515404",
"0.6646519",
"0.6646286",
"0.6635208",
"0.6635208",
"0.6614507",
"0.66038954",
"0.6571792",
"0.65687597",
"0.65679",
"0.65672624",
"0.65652496",
"0.6562362",
"0.6556767",
"0.6556767",
"0.65561",
"0.6555258",
"0.6554664",
"0.6554664",
"0.65478104",
"0.65478104",
"0.6547645",
"0.65462834",
"0.6532463",
"0.6525272",
"0.6519796",
"0.65050507",
"0.6503395",
"0.64959735",
"0.64954823",
"0.6490985",
"0.64868075",
"0.64846176",
"0.64759564",
"0.64733094",
"0.6472065",
"0.64679307",
"0.64637095",
"0.64554256",
"0.6448501",
"0.644704",
"0.6430798",
"0.6424439",
"0.64232796",
"0.64088356",
"0.6401947",
"0.64016724",
"0.638687",
"0.6386647",
"0.63671535",
"0.6364783",
"0.6364783",
"0.6363939",
"0.63542604",
"0.6341549",
"0.6340714",
"0.6327643",
"0.63274",
"0.6321637",
"0.63184",
"0.6315915",
"0.62782586",
"0.623998",
"0.6229851",
"0.62240493",
"0.62164664",
"0.6213015",
"0.620561",
"0.6198787",
"0.61938465",
"0.6192262",
"0.6184102",
"0.61803734",
"0.6162699",
"0.6160093",
"0.61557865",
"0.61543274",
"0.6144318",
"0.6143288",
"0.61280537",
"0.6127511",
"0.61050916",
"0.6095815",
"0.60907966",
"0.6074308",
"0.60589445",
"0.6056062",
"0.6050351",
"0.60428053",
"0.60159534"
] | 0.88233745 | 0 |
Return the ycoordinate of robot. This method must throw IllegalStateException if robot is not placed on a board. | @Override
public long getRobotY(Robot robot) throws IllegalStateException
{
if (robot.getBoard() != null)
{
return robot.getPosition().getCoordY();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getY() {\n synchronized (this.yLock) {\n return (int) this.movementComposer.getYPosition();\n }\n }",
"public int getY() {\n\t\t\tint lastRobot = (state[2 * k] + k - 1) % k;\n\t\t\treturn state[lastRobot + k];\n\t\t}",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}",
"public final int getPositionY() {\r\n return (int) position.y();\r\n }",
"public int getyCoord() {\n\t\treturn yCoord;\n\t}",
"public double getyCoordinate() {\n return yCoordinate;\n }",
"public int getCoordY() \r\n {\r\n \treturn this.coordY;\r\n }",
"public int getY() {\r\n\t\treturn ycoord;\r\n\t}",
"public final int getY()\n\t{\n\t\treturn pos.y;\n\t}",
"public int y() {\r\n\t\treturn yCoord;\r\n\t}",
"protected Number getY() {\n return this.yCoordinate;\n }",
"public double getLocationY() {\r\n\t\treturn location.getY();\r\n\t}",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"public int getY()\r\n {\r\n return yLoc;\r\n }",
"public int getLocationY() {\r\n\t\treturn y;\r\n\t}",
"public double getyCoord() {\n\t\treturn yCoord;\n\t}",
"public int getY() {\n\t\t\n\t\treturn yPosition;\t\t// Gets the y integer\n\t}",
"public int getY() {\n return yCoord;\n }",
"public double getPositionY() {\n\t\treturn this.tilePositionY;\n\t}",
"public int getyPosition() {\n\t\treturn yPosition;\n\t}",
"public int getYPosition() {\n\t\treturn this.position.y;\n\t}",
"public int getMovementY() {\r\n return movementY;\r\n }",
"public int getyPos() {\n\t\treturn yPos;\n\t}",
"public int getPositionY() {\n return positionY;\n }",
"public int getPositionY() {\r\n\t\treturn positionY;\r\n\t}",
"public int getY() {\n return (int) yPos;\n }",
"public double getY() {\n return position.getY();\n }",
"public int getY()\n\t{\n\t\treturn m_nPosY;\n\t}",
"public double getPositionY() {\n return positionY_;\n }",
"public double getPositionY() {\n return positionY_;\n }",
"public double getPositionY() {\n return positionY_;\n }",
"public int getyPos() {\n return yPos;\n }",
"public int getY() {\n return posY;\n }",
"public double getPositionY() {\n return positionY_;\n }",
"public double getPositionY() {\n return positionY_;\n }",
"public double getPositionY() {\n return positionY_;\n }",
"@Override\r\n\tpublic long getWallY(Wall wall) throws IllegalStateException, UnsupportedOperationException\r\n\t{\r\n\t\tif (wall.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn wall.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getLocY() {\n return locY;\n }",
"public final float getPositionY() {\r\n\t\treturn getState(false).getPositionY();\r\n\t}",
"public int yPos() {\r\n\t\treturn this.yPos;\r\n\t}",
"public int yPos() {\r\n\t\treturn this.yPos;\r\n\t}",
"public int getLocationY( )\n\t{\n\t\treturn locationY;\n\t}",
"public int getY() {\n return this.coordinate.y;\n }",
"public int getyPos() \n\t{\n\t\treturn yPos;\n\t}",
"public static int getEndYCoordinate(){\n\tint y = getThymioEndField_Y(); \n\t\t\n\t\tif(y == 0){\n\t\t\n \t}else{\n \t y *= FIELD_HEIGHT;\n \t}\n\t\treturn y;\n\t}",
"public int getYCoordinate()\n\t{\n\t\treturn yCoordinate;\n\t}",
"public int getPos_y(){\n\t\treturn pos_y;\n\t}",
"public int getY()\r\n {\r\n return yCoord;\r\n }",
"@Basic\n\tpublic double getYCoordinate() {\n\t\treturn this.y;\n\t}",
"public int getYPosition() {\n return yPosition;\n }",
"@Override\r\n\tpublic long getBatteryY(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int get_Y_Coordinate()\n {\n return currentBallY;\n }",
"public double getYCoordinate() {\n return yCoordinate;\n }",
"public int getY() {\n return positionY;\n }",
"public int getYPos() {\n\t\treturn yPos;\n\t}",
"public double getYPosition()\n\t{\n\t\treturn yPosition;\n\t}",
"public int getY() {\n return pos_y;\n }",
"public int getYPos() {\r\n\t\treturn this.cameraY;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getYPosition() {\n return this.yPosition;\n }",
"public int getY() {\r\n\t\treturn this.y;\r\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getPositionY(){\n\t\treturn positiony;\n\t}",
"@Override\r\n\tpublic long getSurpriseBoxY(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY(){\n\t\tif(!resetCoordinates()) return 10000;\n\t\treturn Math.round(robot.translation.get(1)/ AvesAblazeHardware.mmPerInch);\n\t}",
"public double getY() {\r\n\t\t return this.yCoord;\r\n\t }",
"@Override\r\n\tpublic long getRepairKitY(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public final double getY() { return location.getY(); }",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return y;\r\n }",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int setObjYCoord() {\n\t\tint objY = ThreadLocalRandom.current().nextInt(1, getRoomLength() - 1);\r\n\t\treturn objY;\r\n\t}",
"public int getY() {\r\n return this.y;\r\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }"
] | [
"0.71372443",
"0.7072989",
"0.703775",
"0.703775",
"0.6939772",
"0.6925061",
"0.6913028",
"0.6877286",
"0.6844012",
"0.6841058",
"0.6824252",
"0.6777193",
"0.67758656",
"0.67484474",
"0.6746411",
"0.6744397",
"0.674412",
"0.67423666",
"0.6737875",
"0.67365724",
"0.67357945",
"0.67290556",
"0.6727823",
"0.6700778",
"0.6695366",
"0.6691247",
"0.6685876",
"0.6685146",
"0.6671002",
"0.6670551",
"0.66597307",
"0.66597307",
"0.66597307",
"0.6654666",
"0.6653933",
"0.66515386",
"0.66515386",
"0.6651448",
"0.6644323",
"0.66381866",
"0.66348135",
"0.6633926",
"0.6633926",
"0.66317517",
"0.6625516",
"0.66244864",
"0.6623611",
"0.66235757",
"0.6620673",
"0.6616868",
"0.6615677",
"0.65875864",
"0.6577726",
"0.65574265",
"0.655237",
"0.6551734",
"0.65497154",
"0.65310836",
"0.6527609",
"0.65234935",
"0.65210676",
"0.65210676",
"0.65210676",
"0.6509745",
"0.65081024",
"0.6501405",
"0.6501405",
"0.6501405",
"0.6500818",
"0.64975387",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64921147",
"0.64912003",
"0.64864266",
"0.6485524",
"0.6485055",
"0.6485055",
"0.6485055",
"0.6485055",
"0.6485055",
"0.64776814",
"0.64755046",
"0.64755046",
"0.6467491",
"0.6467491",
"0.64650273",
"0.6454387",
"0.64525867",
"0.64525867",
"0.64525867",
"0.64525867"
] | 0.8575249 | 0 |
Return the orientation (either 0, 1, 2 or 3) of robot. 0, 1, 2, 3 respectively represent up, right, down and left. | @Override
public int getOrientation(Robot robot)
{
return robot.getOrientation().ordinal();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getOrientation(){\n\n if(robot.getRotation()%360 == 0){\n return \"NORTH\";\n } else if(robot.getRotation()%360 == 90\n ||robot.getRotation()%360 == -270){\n return \"EAST\";\n } else if(robot.getRotation()%360 == 180\n ||robot.getRotation()%360 == -180){\n return \"SOUTH\";\n } else if(robot.getRotation()%360 == 270\n ||robot.getRotation()%360 == -90){\n return \"WEST\";\n } else\n\n errorMessage(\"Id:10T error\");\n return null;\n }",
"public abstract double getOrientation();",
"public double getOrientation()\r\n\t{\r\n\t\treturn Math.atan2(-end.getY()+start.getY(), end.getX()-start.getX());\r\n\t}",
"public interface Orientation {\n\n int LEFT = 0; //左\n int TOP = 1; //顶\n int RIGHT = 2; //右\n int BOTTOM = 4; //底\n int ALL = 8; //所有方向\n int NONE = 16; //无方向\n\n}",
"public java.lang.Object getRobotOrientation() throws CallError, InterruptedException {\n return (java.lang.Object)service.call(\"getRobotOrientation\").get();\n }",
"public IOrientation getOrientation();",
"public final Vector2D getOrientation() {\n return orientation;\n }",
"public java.lang.Integer getOrientation () {\n\t\treturn orientation;\n\t}",
"public String orientation()\n {\n int height = cat.getWidth();\n int width = cat.getHeight();\n\n if (height >= width)\n {\n return \"landscape\";\n }\n else \n {\n return \"portrait\";\n\n }\n }",
"public final Orientation getOrientation() {\n return orientation == null ? Orientation.HORIZONTAL : orientation.get();\n }",
"public int getOrientation()\n\t{\n\t\treturn orientation;\n\t}",
"public String orientation() {\n\t\tif (orientation == null)\n\t\t\tarea();\n\t\treturn orientation;\n\t}",
"public float getOrientation() {\n return this.orientation + this.baseRotation;\n }",
"public int getOrientation()\n {\n return m_orientation;\n }",
"@Generated\n @Selector(\"orientation\")\n @NInt\n public native long orientation();",
"public String getOrientation() {\n\n if(getResources().getDisplayMetrics().widthPixels > \n getResources().getDisplayMetrics().heightPixels) { \n return \"LANDSCAPE\";\n } else {\n return \"PORTRAIT\";\n } \n \n }",
"public float getOrientation(int angleorder) {\n float orient_angle;\n switch (angleorder) {\n case 1:\n orient_angle = Orientation.getOrientation(lastRobotLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).firstAngle;\n break;\n case 2:\n orient_angle = Orientation.getOrientation(lastRobotLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).secondAngle;\n break;\n default:\n orient_angle = Orientation.getOrientation(lastRobotLocation, AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES).thirdAngle;\n }\n return orient_angle;\n }",
"public float getOrientacion() { return orientacion; }",
"public int getOrientation(){ return mOrientation; }",
"public char getOrientation() {\n return orientation;\n }",
"@Override\n\tpublic float getOrientation() {\n\t\treturn body.getAngle();\n\t}",
"public java.lang.Object getRobotOrientation(Boolean param1) throws CallError, InterruptedException {\n return (java.lang.Object)service.call(\"getRobotOrientation\", param1).get();\n }",
"public int getOrientation() {\n\t\treturn m_nOrientation;\n\t}",
"public final Orientation getOrientation() {\n\n return this.getWrappedControl().getOrientation();\n }",
"@Override\r\n public Orientation getOrientation() {\r\n return this.route.getOrientation();\r\n }",
"private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n if (isFrontFacing && INVERSE_ORIENTATIONS.get(rotation) == 180) {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 90) % 360;\n } else {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }\n\n }",
"private int orientation(Waypoint w1, Waypoint w3, Waypoint w2){\n\t\tdouble w1x = w1.getX();\n\t\tdouble w1y = w1.getY();\n\t\tdouble w2x = w2.getX();\n\t\tdouble w2y = w2.getY();\n\t\tdouble w3x = w3.getX();\n\t\tdouble w3y = w3.getY();\n\t\tdouble val = (w3y - w1y) * (w2x - w3x) - (w3x - w1x) * (w2y - w3y);\n\t\t\n\tif ( val == 0) //colinear\n\t\treturn 0;\n\t\n\treturn (val > 0) ? 1: 2; //clock or counterclock wise\n\t\n\t}",
"public int getNaturalOrientation() {\n if ((!this.mIsLandScapeDefault || this.mBaseDisplayWidth >= this.mBaseDisplayHeight) && this.mBaseDisplayWidth < this.mBaseDisplayHeight) {\n return 1;\n }\n return 2;\n }",
"public Orientation getOrientation() {\n\t\treturn mOrientation;\n\t}",
"public Orientation getOrientation() {\n return this.orientation;\n }",
"int orientation(Coord pos) {\n\t\tint val = (to.y - from.y) * (pos.x - to.x) - (to.x - from.x) * (pos.y - to.y);\n\t\treturn (val > 0) ? 1 : ((val < 0) ? -1 : 0);\n\t}",
"public Direction getCorrectRobotDirection();",
"public int orientation(Location p, Location q, Location r) {\n\t\tdouble ret = (q.getY() - p.getY()) * (r.getX() - q.getX())\n\t\t\t\t- (q.getX() - p.getX()) * (r.getY() - q.getY());\n\t\tif (ret == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (ret > 0) {\n\t\t\t// clockwise\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t// counterclockwise\n\t\t\treturn 2;\n\t\t}\n\t}",
"public int getDeviceRotation();",
"public int getOrientationOnly() {\n return (int) this.orientation;\n }",
"public int getAngle(){\n\t\tif(!resetCoordinates()&&robot.imu1.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu1.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(!resetCoordinates()&&robot.imu.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.YZX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(resetCoordinates()){\n\t\t\tdouble oldAngle = robot.rotation.thirdAngle;\n\t\t\tdouble posAngle = oldAngle;\n\t\t\tint finalAngle;\n\t\t\tif (oldAngle < 0) posAngle = 360 - Math.abs(oldAngle);\n\t\t\tif((int) (Math.round(posAngle)) - 45 < 0){\n\t\t\t\tfinalAngle = 360-(int)Math.round(posAngle);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfinalAngle = (int) (Math.round(posAngle)) - 45;\n\t\t\t}\n\t\t\treturn finalAngle;\n\t\t}\n\t\telse{\n\t\t\treturn 10000;\n\t\t}\n\t}",
"public int getNewOrientation() {\n return newOrientation;\n }",
"private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }",
"private int getOrientation() {\n return getContext().getResources().getConfiguration().orientation;\n }",
"public short getVertOrient() throws TextException {\r\n try {\r\n short verticalAlignment = ((Short) getXPropertySet().getPropertyValue(\"VertOrient\"))\r\n .shortValue();\r\n if (verticalAlignment == VertOrientation.CENTER) {\r\n return ALIGN_CENTER;\r\n } else if (verticalAlignment == VertOrientation.BOTTOM) {\r\n return ALIGN_BOTTOM;\r\n } else if (verticalAlignment == VertOrientation.TOP) {\r\n return ALIGN_TOP;\r\n } else {\r\n return ALIGN_UNDEFINED;\r\n }\r\n } catch (Exception exception) {\r\n TextException textException = new TextException(exception.getMessage());\r\n textException.initCause(exception);\r\n throw textException;\r\n }\r\n }",
"AxisOrientation getAxisOrientation();",
"public int getCameraSensorRotation();",
"int getSensorRotationDegrees();",
"private XYMultipleSeriesRenderer.Orientation getOrientation() {\n String orientation = mData.getConfiguration(\"bar-orientation\", \"\");\r\n if (orientation.equalsIgnoreCase(\"vertical\")) {\r\n return XYMultipleSeriesRenderer.Orientation.HORIZONTAL;\r\n } else {\r\n return XYMultipleSeriesRenderer.Orientation.VERTICAL;\r\n }\r\n }",
"public Orientation getOrientation(){return this.orientation;}",
"public int getLastOrientation() {\n return this.mLastOrientation;\n }",
"public final ObjectProperty<Orientation> orientationProperty() {\n\n return this.getWrappedControl().orientationProperty();\n }",
"void orientation(double xOrientation, double yOrientation, double zOrientation);",
"org.stu.projector.Orientation getOrientations(int index);",
"public int generateMode() {\n\t\tif(up && !down && !left && !right)\n\t\t\treturn UP;\n\t\telse if(!up && down && !left && !right)\n\t\t\treturn DOWN;\n\t\telse if(!up && !down && left && !right)\n\t\t\treturn LEFT;\n\t\telse if(!up && !down && !left && right)\n\t\t\treturn RIGHT;\n\t\telse return -1;\n\t}",
"public ImageOrientation getOrientation()\n\t{\n\t\treturn ImageOrientation.None;\n\t}",
"private static int orientation(Coord p, Coord r, Coord q) \n { \n // See https://www.geeksforgeeks.org/orientation-3-ordered-points/ \n // for details of below formula. \n int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); \n \n if (val == 0) return 0; // colinear \n \n return (val > 0)? 1: 2; // clock or counterclock wise \n }",
"public double getRotation();",
"public int getRotation() {\n\t\treturn config & 0x3;\n\t}",
"private void determineOrientation(float[] rotationMatrix) {\n\t\t\t float[] orientationValues = new float[3];\n\t\t SensorManager.getOrientation(rotationMatrix, orientationValues);\n\t\t double azimuth = Math.toDegrees(orientationValues[0]);\n\t\t double pitch = Math.toDegrees(orientationValues[1]);\n\t\t double roll = Math.toDegrees(orientationValues[2]);\n\t\t if (pitch <= 10)\n\t\t { \n\t\t if (Math.abs(roll) >= 170)\n\t\t {\n\t\t onFaceDown();\n\t\t }\n\t\t else if (Math.abs(roll) <= 10)\n\t\t {\n\t\t onFaceUp();\n\t\t }\n\t\t }\n\t\t\t\n\t\t}",
"public final double getPatternOrientation()\r\n\t{\r\n\t\treturn _orientation;\r\n\t}",
"public double getAngle() {\n\t\treturn armMotor.getEncPosition();\n\t}",
"@Override // com.android.server.wm.WindowContainer\n public int getOrientation() {\n int orientation;\n if (DisplayContent.this.isStackVisible(3) || ((!HwFreeFormUtils.isFreeFormEnable() && DisplayContent.this.isStackVisible(5)) || (this.mDisplayContent != null && this.mWmService.mAtmService.mHwATMSEx.isSplitStackVisible(this.mDisplayContent.mAcitvityDisplay, -1)))) {\n TaskStack taskStack = this.mHomeStack;\n if (taskStack == null || !taskStack.isVisible() || !DisplayContent.this.mDividerControllerLocked.isMinimizedDock() || ((DisplayContent.this.mDividerControllerLocked.isHomeStackResizable() && this.mHomeStack.matchParentBounds()) || (orientation = this.mHomeStack.getOrientation()) == -2)) {\n return -1;\n }\n return orientation;\n }\n int orientation2 = super.getOrientation();\n if (this.mWmService.mContext.getPackageManager().hasSystemFeature(\"android.hardware.type.automotive\")) {\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(DisplayContent.TAG, \"Forcing UNSPECIFIED orientation in car for display id=\" + DisplayContent.this.mDisplayId + \". Ignoring \" + orientation2);\n }\n return -1;\n } else if (orientation2 == -2 || orientation2 == 3) {\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(DisplayContent.TAG, \"No app is requesting an orientation, return \" + DisplayContent.this.mLastOrientation + \" for display id=\" + DisplayContent.this.mDisplayId);\n }\n return DisplayContent.this.mLastOrientation;\n } else {\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(DisplayContent.TAG, \"App is requesting an orientation, return \" + orientation2 + \" for display id=\" + DisplayContent.this.mDisplayId);\n }\n return orientation2;\n }\n }",
"@Override\n public int getCameraOrientation() {\n return characteristics_sensor_orientation;\n }",
"float getDir() {\n return degrees(_rotVector.heading());\n }",
"public final ObjectProperty<Orientation> orientationProperty() {\n return orientation;\n }",
"public Orientation orientation() {\n return this.orientation;\n }",
"public String getAxisOrientation() {\n return axisOrientation;\n }",
"@Test\n public void testCondition4()\n {\n Double[] angles = {75.0, 75.0, 71.0};\n _renderable.orientation(angles);\n Double testVal[] = _renderable.orientation();\n assertEquals(\"x angle did not get set,\", angles[0], testVal[0], 2);\n assertEquals(\"y angle did not get set,\", angles[1], testVal[1], 2);\n assertEquals(\"z angle did not get set,\", angles[2], testVal[2], 2);\n }",
"private void normalizeOrientation() {\n\t\twhile (this.orientation >= 2 * Math.PI) {\n\t\t\torientation -= 2 * Math.PI;\n\t\t}\n\t\twhile (this.orientation < 0) {\n\t\t\torientation += 2 * Math.PI;\n\t\t}\n\t}",
"public double getAngle() {\n synchronized (this.angleLock) {\n return this.movementComposer.getOrientationAngle();\n }\n }",
"private double getAngle()\n {\n Orientation angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n return angles.firstAngle;\n }",
"public double direction(){\n return Math.atan2(this.y, this.x);\n }",
"public int getScreenOrientation() {\n Display getOrient = getWindowManager().getDefaultDisplay();\n int orientation = Configuration.ORIENTATION_UNDEFINED;\n if (getOrient.getWidth() == getOrient.getHeight()) {\n orientation = Configuration.ORIENTATION_SQUARE;\n } else {\n if (getOrient.getWidth() < getOrient.getHeight()) {\n orientation = Configuration.ORIENTATION_PORTRAIT;\n } else {\n orientation = Configuration.ORIENTATION_LANDSCAPE;\n }\n }\n return orientation;\n }",
"@Override // com.android.server.wm.WindowContainer\n public int getOrientation() {\n WindowManagerPolicy policy = this.mWmService.mPolicy;\n if (this.mIgnoreRotationForApps && !HwFoldScreenState.isFoldScreenDevice()) {\n return 2;\n }\n if (!this.mWmService.mDisplayFrozen) {\n int orientation = this.mAboveAppWindowsContainers.getOrientation();\n if (orientation != -2) {\n return orientation;\n }\n } else if (this.mLastWindowForcedOrientation != -1) {\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(TAG, \"Display id=\" + this.mDisplayId + \" is frozen, return \" + this.mLastWindowForcedOrientation);\n }\n return this.mLastWindowForcedOrientation;\n } else if (policy.isKeyguardLocked()) {\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(TAG, \"Display id=\" + this.mDisplayId + \" is frozen while keyguard locked, return \" + this.mLastOrientation);\n }\n return this.mLastOrientation;\n }\n return this.mTaskStackContainers.getOrientation();\n }",
"public void rotate180 (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(180f).setDuration(50); //turn toy robot AROUND (180')\n\n rotateRight += 2; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public double getRotation() {\n return Degrees.atan2(y, x);\n }",
"default Vector3 getDirection() {\r\n return Vector3.fromXYZ(getDirX(), getDirY(), getDirZ());\r\n }",
"public ZeroSides calculateShouldZeroSides() {\r\n if (!(getContext() instanceof Activity)) {\r\n return ZeroSides.NONE;\r\n }\r\n Activity activity = (Activity) getContext();\r\n int i = activity.getResources().getConfiguration().orientation;\r\n int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();\r\n if (i != 2) {\r\n return ZeroSides.NONE;\r\n }\r\n if (rotation == 1) {\r\n return ZeroSides.RIGHT;\r\n }\r\n if (rotation == 3) {\r\n return Build.VERSION.SDK_INT >= 23 ? ZeroSides.LEFT : ZeroSides.RIGHT;\r\n }\r\n if (rotation == 0 || rotation == 2) {\r\n return ZeroSides.BOTH;\r\n }\r\n return ZeroSides.NONE;\r\n }",
"public void rotateRight (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(90f).setDuration(50); //turn toy robot LEFT\n\n rotateRight++; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public String getDirection(){\n\t\tif(this.toRight)\n\t\t\treturn \"RIGHT\";\n\t\telse\n\t\t\treturn \"LEFT\";\n\t}",
"private int m25306b() {\n int rotation = ((WindowManager) this.f19002e.getSystemService(\"window\")).getDefaultDisplay().getRotation();\n if (this.f19007j == C1747a.UNSPECIFIED) {\n return -1;\n }\n if (this.f19007j != C1747a.HORIZONTAL) {\n return rotation != 2 ? 1 : 9;\n } else {\n switch (rotation) {\n case 2:\n case 3:\n return 8;\n default:\n return 0;\n }\n }\n }",
"static int orientation(Point p, Point q, Point r)\n {\n int val = (q.getY() - p.getY()) * (r.getX() - q.getX())\n - (q.getX() - p.getX()) * (r.getY() - q.getY());\n\n if (val == 0)\n {\n return 0; // colinear\n }\n return (val > 0) ? 1 : 2; // clock or counterclock wise\n }",
"public void switchOr() {\n if (orientation == 1) {\n orientation = 0;\n }\n else {\n orientation = 1;\n }\n }",
"public int getRotations();",
"public static int getOrientation(File in) throws IOException {\r\n\r\n\t\tint orientation = 1;\r\n\r\n\t\tMetadata metadata;\r\n\r\n\t\tDirectory directory;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tmetadata = ImageMetadataReader.readMetadata(in);\r\n\r\n\t\t\tdirectory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);\r\n\r\n\t\t\t\r\n\r\n\t\t\tif(directory != null){\r\n\r\n\t\t\t\torientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (ImageProcessingException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not process image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t} catch (MetadataException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not get orientation from image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t\treturn getDegreeForOrientation(orientation);\r\n\r\n\t}",
"public void rotateLeft (View view){ //onClick for LEFT Button\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(-90f).setDuration(50); //turn toy robot LEFT\n\n rotateLeft--; //counter to determine orientation\n System.out.println(\"rotateLeft \" + rotateLeft);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight)); //chk params in Logs\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public AccOrientation calculateAngle(SensorEvent event) {\t\t\n\t final int _DATA_X = 0;\n\t final int _DATA_Y = 1;\n\t final int _DATA_Z = 2;\n\t // Angle around x-axis thats considered almost perfect vertical to hold\n\t // the device\n\t final int PIVOT = 20;\n\t // Angle around x-asis that's considered almost too vertical. Beyond\n\t // this angle will not result in any orientation changes. f phone faces uses,\n\t // the device is leaning backward.\n\t final int PIVOT_UPPER = 65;\n\t // Angle about x-axis that's considered negative vertical. Beyond this\n\t // angle will not result in any orientation changes. If phone faces uses,\n\t // the device is leaning forward.\n\t final int PIVOT_LOWER = -10;\n\t // Upper threshold limit for switching from portrait to landscape\n\t final int PL_UPPER = 295;\n\t // Lower threshold limit for switching from landscape to portrait\n\t final int LP_LOWER = 320;\n\t // Lower threshold limt for switching from portrait to landscape\n\t final int PL_LOWER = 270;\n\t // Upper threshold limit for switching from landscape to portrait\n\t final int LP_UPPER = 359;\n\t // Minimum angle which is considered landscape\n\t final int LANDSCAPE_LOWER = 235;\n\t // Minimum angle which is considered portrait\n\t final int PORTRAIT_LOWER = 60;\n\t \n\t // Internal value used for calculating linear variant\n\t final float PL_LF_UPPER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float PL_LF_LOWER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t // Internal value used for calculating linear variant\n\t final float LP_LF_UPPER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float LP_LF_LOWER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t \n\t int mSensorRotation = -1; \n\t \n\t\t\tfinal boolean VERBOSE = true;\n float[] values = event.values;\n float X = values[_DATA_X];\n float Y = values[_DATA_Y];\n float Z = values[_DATA_Z];\n float OneEightyOverPi = 57.29577957855f;\n float gravity = (float) Math.sqrt(X*X+Y*Y+Z*Z);\n float zyangle = (float)Math.asin(Z/gravity)*OneEightyOverPi;\n int rotation = -1;\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n AccOrientation result = new AccOrientation();\n \n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n result.orientation = orientation;\n result.angle = zyangle; \n result.threshold = 0;\n if ((zyangle <= PIVOT_UPPER) && (zyangle >= PIVOT_LOWER)) {\n // Check orientation only if the phone is flat enough\n // Don't trust the angle if the magnitude is small compared to the y value\n \t/*\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n normalize to 0 - 359 range\n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n mOrientation.setText(String.format(\"Orientation: %d\", orientation));\n */ \n // Orientation values between LANDSCAPE_LOWER and PL_LOWER\n // are considered landscape.\n // Ignore orientation values between 0 and LANDSCAPE_LOWER\n // For orientation values between LP_UPPER and PL_LOWER,\n // the threshold gets set linearly around PIVOT.\n if ((orientation >= PL_LOWER) && (orientation <= LP_UPPER)) {\n float threshold;\n float delta = zyangle - PIVOT;\n if (mSensorRotation == ROTATION_090) {\n if (delta < 0) {\n // Delta is negative\n threshold = LP_LOWER - (LP_LF_LOWER * delta);\n } else {\n threshold = LP_LOWER + (LP_LF_UPPER * delta);\n }\n rotation = (orientation >= threshold) ? ROTATION_000 : ROTATION_090;\n if (mShowLog) \n \tLog.v(TAG, String.format(\"CASE1. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n } else {\n if (delta < 0) {\n // Delta is negative\n threshold = PL_UPPER+(PL_LF_LOWER * delta);\n } else {\n threshold = PL_UPPER-(PL_LF_UPPER * delta);\n }\n rotation = (orientation <= threshold) ? ROTATION_090: ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE2. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n }\n result.threshold = threshold;\n } else if ((orientation >= LANDSCAPE_LOWER) && (orientation < LP_LOWER)) {\n rotation = ROTATION_090;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE3. 90 (%d)\", orientation));\n } else if ((orientation >= PL_UPPER) || (orientation <= PORTRAIT_LOWER)) {\n rotation = ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE4. 00 (%d)\", orientation)); \n } else {\n \tif (mShowLog)\n \t\tLog.v(TAG, \"CASE5. \"+orientation);\n }\n if ((rotation != -1) && (rotation != mSensorRotation)) {\n mSensorRotation = rotation;\n if (mSensorRotation == ROTATION_000) {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 00\");\n }\n else if (mSensorRotation == ROTATION_090) \n {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 90\");\n } \n }\n result.rotation = rotation;\n } else {\n \t//Log.v(TAG, String.format(\"Invalid Z-Angle: %2.4f (%d %d)\", zyangle, PIVOT_LOWER, PIVOT_UPPER));\n }\t\n return result;\n\t\t}",
"@Override // com.android.server.wm.WindowContainer\n public int getOrientation() {\n WindowManagerPolicy policy = this.mWmService.mPolicy;\n WindowState win = getWindow(this.mGetOrientingWindow);\n if (win != null) {\n int req = win.mAttrs.screenOrientation;\n if (policy.isKeyguardHostWindow(win.mAttrs)) {\n DisplayContent.this.mLastKeyguardForcedOrientation = req;\n if (this.mWmService.mKeyguardGoingAway) {\n DisplayContent.this.mLastWindowForcedOrientation = -1;\n return -2;\n }\n }\n if (WindowManagerDebugConfig.DEBUG_ORIENTATION) {\n Slog.v(DisplayContent.TAG, win + \" forcing orientation to \" + req + \" for display id=\" + DisplayContent.this.mDisplayId);\n }\n return DisplayContent.this.mLastWindowForcedOrientation = req;\n }\n DisplayContent.this.mLastWindowForcedOrientation = -1;\n boolean isUnoccluding = DisplayContent.this.mAppTransition.getAppTransition() == 23 && DisplayContent.this.mUnknownAppVisibilityController.allResolved();\n if (policy.isKeyguardShowingAndNotOccluded() || isUnoccluding) {\n return DisplayContent.this.mLastKeyguardForcedOrientation;\n }\n return -2;\n }",
"public short getTextOrientation()\n {\n return field_2_textOrientation;\n }",
"int getMaxRotation();",
"public Rotation2d getHeading() {\n return Rotation2d.fromDegrees(Math.IEEEremainder(gyro.getAngle(), 360) * (Const.kGyroReversed ? -1.0 : 1.0));\n }",
"public double getRotation()\n\t{\n\t\tdouble determinant = this.basisDeterminant();\n\t\tTransform2D m = orthonormalized();\n\t\tif (determinant < 0) \n\t\t{\n\t\t\tm.scaleBasis(new Vector2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.\n\t\t}\n\t\treturn Math.atan2(m.matrix[0].y, m.matrix[0].x);\n\t}",
"public double getDirectionFace();",
"@Override\n public void onSensorChanged(SensorEvent event) {\n mOrientation = event.values[0];\n }",
"public int getRotation() {\r\n\t\treturn rotation;\r\n\t}",
"public void updateOrientationAngles() {\n SensorManager.getRotationMatrix(rotationMatrix, null,\n accelerometerReading, magnetometerReading);\n\n // \"mRotationMatrix\" now has up-to-date information.\n\n float[] angles = SensorManager.getOrientation(rotationMatrix, orientationAngles);\n azimuth = (float) Math.toDegrees(angles[0]);\n // \"mOrientationAngles\" now has up-to-date information.\n TextView az = findViewById(R.id.az);\n rotateDriver(azimuth);\n\n az.setText(Float.toString(azimuth));\n }",
"public int getRotation() {\n\treturn rotation;\n\t//return rotation;\n}",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}",
"public double getRightJoystickVertical() {\n\t\treturn getRawAxis(RIGHT_STICK_VERTICAL) * -1;\n\t}",
"private static double orientation(Point2d p, Point2d q, Point2d r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n }",
"java.util.List<org.stu.projector.Orientation> \n getOrientationsList();",
"public double getLeftJoystickVertical() {\n\t\treturn getRawAxis(LEFT_STICK_VERTICAL) * -1;\n\t}",
"private float findRotation()\r\n\t{\r\n\t\t//conditionals for all quadrants and axis\r\n\t\tif(tarX > 0 && tarY > 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t}\r\n\t\telse if(tarX < 0 && tarY > 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 180 - Math.abs(rotation);\r\n\t\t}\r\n\t\telse if(tarX < 0 && tarY < 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 180 + Math.abs(rotation);\r\n\t\t}\r\n\t\telse if(tarX > 0 && tarY < 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 90 - Math.abs(rotation);\r\n\t\t\trotation = 270 + rotation;\r\n\t\t}\r\n\t\telse if(tarX > 0 && tarY == 0)\r\n\t\t\trotation = 0;\r\n\t\telse if(tarX == 0 && tarY > 0)\r\n\t\t\trotation = 90;\r\n\t\telse if(tarX < 0 && tarY == 0)\r\n\t\t\trotation = 180;\r\n\t\telse if(tarX == 0 && tarY < 0)\r\n\t\t\trotation = 270;\r\n\t\t\r\n\t\treturn (rotation - 90);\r\n\t}",
"public void setOrientation(EditText facingCompass){\n if (facingCompass.getText().toString().matches(\"NORTH\")) {\n orientation = 0;\n rotateRight = orientation;\n angleF = 0;\n\n } else if (facingCompass.getText().toString().matches(\"EAST\")) {\n orientation = 1;\n rotateRight = orientation;\n angleF = 90;\n\n } else if (facingCompass.getText().toString().matches(\"SOUTH\")) {\n orientation = 2;\n rotateRight = orientation;\n angleF = 180;\n\n } else if (facingCompass.getText().toString().matches(\"WEST\")) {\n orientation = 3;\n rotateRight = orientation;\n angleF = 270;\n\n } else\n errorMessage(\"Invalid F Direction...\\ndefaulted to NORTH\");\n return;\n }"
] | [
"0.7933545",
"0.71143806",
"0.6960955",
"0.6939776",
"0.6900556",
"0.6793691",
"0.67908627",
"0.6782272",
"0.67589104",
"0.67355216",
"0.6720861",
"0.66651404",
"0.6656829",
"0.6609996",
"0.65772253",
"0.6536298",
"0.6535519",
"0.6451856",
"0.64450353",
"0.6427382",
"0.6420422",
"0.64133984",
"0.64046013",
"0.6397992",
"0.63814145",
"0.636672",
"0.6337786",
"0.63233316",
"0.6303937",
"0.6292261",
"0.62768537",
"0.6264534",
"0.6255976",
"0.623899",
"0.62334096",
"0.622481",
"0.62247986",
"0.62238675",
"0.62030745",
"0.6201381",
"0.6190318",
"0.61730313",
"0.61557126",
"0.61491835",
"0.61271787",
"0.6126113",
"0.6122632",
"0.61158234",
"0.61070657",
"0.61045426",
"0.61037594",
"0.6082919",
"0.60741276",
"0.6068402",
"0.6055169",
"0.60517484",
"0.6026944",
"0.60121125",
"0.5993577",
"0.5948643",
"0.5926703",
"0.5920371",
"0.591617",
"0.5912161",
"0.5903565",
"0.5880024",
"0.58736396",
"0.5868381",
"0.5866785",
"0.58417505",
"0.58110464",
"0.58099943",
"0.58094704",
"0.5796894",
"0.57892215",
"0.5779606",
"0.5771746",
"0.57648164",
"0.57617074",
"0.57331747",
"0.57217574",
"0.5718343",
"0.5714724",
"0.57126975",
"0.57078147",
"0.5700294",
"0.5690461",
"0.56873405",
"0.56814474",
"0.5655517",
"0.5643989",
"0.5633129",
"0.56315285",
"0.56246024",
"0.5624434",
"0.5621575",
"0.5619131",
"0.5590943",
"0.5586148",
"0.55821365"
] | 0.79392713 | 0 |
Return the current energy in wattsecond of robot. | @Override
public double getEnergy(Robot robot)
{
return robot.getEnergy(EnergyUnit.WATTSECOND);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic float getEnergyConsumption() {\r\n\t\treturn 2500 - robot.getBatteryLevel();\r\n\t}",
"public double getEnergy() {\n\t\treturn energy;\n\t}",
"public double getEnergy() { return energy; }",
"public double getEnergy() {\n\t\treturn _energy;\n\t}",
"int getEnergy();",
"public double getEnergy(){\n\t\t return energy;\n\t}",
"public int getEnergy() {\n return energy;\n }",
"protected int getEnergy() {\n\t\treturn energy;\n\t}",
"public int getEnergy()\n {\n return energy;\n }",
"public int getEnergy() {\n\t\treturn energy;\n\t}",
"public Energy getEnergy() {\n return energy;\n }",
"public int getEnergyTimer()\n\t{\n\t\treturn currentEnergyTimer;\n\t}",
"double energy() {\n\n // brightness values\n double brU = 0;\n double brD = 0;\n double brR = 0;\n double brL = 0;\n double brDR = 0;\n double brTR = 0;\n double brDL = 0;\n double brTL = 0;\n if (this.up != null) {\n brU = this.up.brightness;\n }\n if (this.down != null) {\n brD = this.down.brightness;\n }\n\n if (this.right != null) {\n brR = this.right.brightness;\n }\n\n if (this.left != null) {\n brL = this.left.brightness;\n }\n\n if (this.downRight() != null) {\n brDR = this.downRight().brightness;\n }\n\n if (this.downLeft() != null) {\n brDL = this.downLeft().brightness;\n }\n\n if (this.topLeft() != null) {\n brTL = this.topLeft().brightness;\n }\n\n if (this.topRight() != null) {\n brTR = this.topRight().brightness;\n }\n\n\n double vertEnergy = (brTL + brL + brDL) - (brTR + brR + brDR);\n double horizEnergy = (brTL + brU + brTR) - (brDL + brD + brDR);\n\n return Math.sqrt((vertEnergy * vertEnergy) + (horizEnergy * horizEnergy));\n\n }",
"@java.lang.Override\n public int getEnergy() {\n return energy_;\n }",
"@java.lang.Override\n public int getEnergy() {\n return energy_;\n }",
"@Override\n public double getEnergyLevel() {\n return energy;\n }",
"public int getEnergy(){ return energy; }",
"public float getEnergyRate() { return EnergyRate; }",
"@ComputerMethod\n private FloatingLong getEnergyUsage() {\n return getActive() ? energyContainer.getEnergyPerTick() : FloatingLong.ZERO;\n }",
"public double getEnginePower(){\n return enginePower;\n }",
"public double getCurrentFuel();",
"@ComputerMethod\n private FloatingLong getEnergyUsage() {\n return energyContainer.getEnergyPerTick();\n }",
"protected double getEnginePower(){\n return enginePower;\n }",
"public int getFitness(){\n\t\treturn getEnergy()*-1; \n\t}",
"float getWetness();",
"public double getMaximumAllowedEnergyInRoom() {\n\n\t\treturn this.maximumEnergyConsumptionAllowedInARoom; \n\t}",
"public double getW() {\n return w;\n }",
"public int getPower() {\n\t\treturn aerodynamics.getPower()+engine.getPower()+suspension.getPower()+breaks.getPower()+tires.getPower();\n\t}",
"public double get_thermal_reading() {\n\t\t\n\t\treturn 0;\n\t}",
"public double ElectricCurrent() {\n return OCCwrapJavaJNI.Units_Dimensions_ElectricCurrent(swigCPtr, this);\n }",
"public double getWaterIntensityOfElectricityProduction() {\r\n\t\treturn waterIntensityOfElectricityProduction;\r\n\t}",
"public double getW() {\n\t\treturn w;\n\t}",
"public double getWaist() {\n return waist;\n }",
"public double getWaist() {\n return waist;\n }",
"public double getEnergia() { return energia; }",
"public static int consumedPower(){\n int consumedPower = 0;\n for (ElectricalHomeDevice device : allTrunedOnDevices){\n consumedPower += device.getDevicePower();\n }\n return consumedPower;\n }",
"public double energy(int x, int y) {\n if (!validCoordinates(x, y)) { throw new IndexOutOfBoundsException(\"x or y not in range.\"); }\n if (isBorder(x, y)) { return 1000.0; }\n return Math.sqrt(hzDiff(x, y) + vtDiff(x, y));\n }",
"double getStartW();",
"public double estimatedEnergyPerPanel() {\n\t\tif (estimatedEnergyPerPanel < 0) {\n\t\t\treturn estimatedEnergyPerPanel;\n\t\t}\n\t\t// if est. EnergyPerPanel hasn't been found yet, we find it here...\n\t\tdouble wattToKW = .001;\n\t\testimatedEnergyPerPanel = systemCap * wattToKW;\n\t\t// the returned estimated energy will factor in the powerTolerance,\n\t\t// which typically equates to percent loss on the panel\n\t\treturn estimatedEnergyPerPanel -= estimatedEnergyPerPanel\n\t\t\t\t* (.01 * powerTolerance);\n\t}",
"public int energy_consumed_GET()\n { return (int)((int) get_bytes(data, 29, 4)); }",
"public double getMeterPower() {\n final double current = this.getMeterCurrent().isPresent() ? this.getMeterCurrent().get() : 0;\n final double voltage = this.getMeterVoltage().isPresent() ? this.getMeterVoltage().get() : 0;\n return current * voltage;\n }",
"@Basic\n\tpublic double getTimeInWater(){\n\t\treturn this.time_in_water;\n\t}",
"double getEndW();",
"public int getFitness() {\n\t\treturn getEnergy() * -1;\n\t}",
"private double getVelocity() {\n \tif (currentState == DriveState.accelerating) {\n \t\treturn acceleration * timer.get();\n \t}\n \telse if (currentState == DriveState.cruisung) {\n \t\treturn maxVelocity;\n \t}\n \telse if (currentState == DriveState.decelerating) {\n \t\treturn maxVelocity - acceleration * (timer.get());\n \t}\n \t\t\n \treturn 0;\n }",
"@Override\n public double getPower()\n {\n final String funcName = \"getPower\";\n double power = motor.get();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", power);\n }\n\n return power;\n }",
"public double getDwt() {\n\t\treturn _tempNoTiceShipMessage.getDwt();\n\t}",
"public void setEnergy(double energy) { this.energy = energy; }",
"public Double getTempAvgNightly() {\r\n\t\treturn tempAvgNightly;\r\n\t}",
"public int getEnergie() {\r\n\t\treturn energie;\r\n\t}",
"@Override\n public long getEnergy(ItemStack itemStack)\n {\n return NBTUtility.getNBTTagCompound(itemStack).getLong(\"electricity\");\n }",
"public double bcElevation() {\n return wse[bcIndex];\n }",
"public Float getEulDowntime() {\n return eulDowntime;\n }",
"public double getVenus()\n {\n double venus = earthWeight * 0.9;\n return venus;\n }",
"public Double getCarbon() {\n return product.getCarbon() * weight / 100;\n }",
"public double getMercury()\n {\n double mercury = earthWeight * 0.4;\n return mercury;\n }",
"public int getTemperature() {\n return VirtualHardwareManager.getInstance().getTemperature();\n }",
"public double getHalfCurrWaterPotential() {\r\n\t\t\treturn -Math.sqrt (treeMaxTranspirationPotential * treeMinTranspirationPotential);\r\n\t}",
"double getAcceleration ();",
"@Override\n\tpublic int getEnergyStored() {\n\t\treturn 0;\n\t}",
"public double getConsumedPower() {\n return mPowerComponents.getConsumedPower(UNSPECIFIED_DIMENSIONS);\n }",
"public double getWert() {\r\n return wert;\r\n }",
"public Double getThermistorCelsiusTemperature()\n {\n return finchController.getThermistorCelsiusTemperature();\n }",
"float getHotwordPower();",
"public double getPower()\n {\n return this.power;\n }",
"private double measureTemp() {\n try {\n analog0 = blueTooth.sensor(0);\n analog1 = blueTooth.sensor(1);\n return ((analog0 - analog1) * 5 * 100) / 1024.0;\n } catch (TimeoutException ex) {\n Logger.getLogger(TempMeasure.class.getName()).log(Level.SEVERE, null, ex);\n }\n return ((analog0 - analog1) * 5 * 100) / 1024.0;\n }",
"public static double getEnergy(double energy) {\n double newEnergy;\n\n if (energy < 0 )\n newEnergy = -1.0;\n\n if (energy < 40.0)\n newEnergy = -0.33;\n else if (energy >= 40.0 && energy < 80.0)\n newEnergy = 0.33;\n else\n newEnergy = 1.0;\n return newEnergy;\n }",
"public double getcurrentWeight() {\n\t return this.currentWeight;\n\t}",
"public double getEquipmentWeight() {\r\n\t\tdouble ret = 0;\r\n\t\tPerson p = model.getData();\r\n\t\tif ( p!=null ) {\r\n\t\t\tret = p.getCarriedWeight();\r\n\t\t}\r\n\t\treturn ret;\r\n\t}",
"public double getWindChill() {\n float tempC;\n float windSpeed;\n double windChill = 0;\n double windChillr = 0;\n\n\n if (readings.size() > 0) {\n tempC = readings.get(readings.size() - 1).temperature;\n windSpeed = readings.get(readings.size() - 1).windSpeed;\n windChill = 13.12 + (0.6215 * tempC) - (11.37 * Math.pow(windSpeed, 0.16)) + 0.3965 * 6 * Math.pow(2, 0.16);\n windChillr = Math.round(windChill * 10.0) / 10.0;\n } else {\n\n }\n return windChillr;\n }",
"double a_intake_power ()\n {\n double l_return = 0.0;\n\n if (fly_wheel != null) {\n l_return = fly_wheel.getPower();\n }\n\n return l_return;\n }",
"public Double getOutdoorTemperature() {\n return outdoorTemperature;\n }",
"public double mo9740e() {\n return Double.longBitsToDouble(mo9784w());\n }",
"public double getSecondExtreme(){\r\n return secondExtreme;\r\n }",
"public double getGasInTank()\n {\n return this.fuelInTank;\n }",
"float getW();",
"public int getPowerMeterSum() {\r\n return powerMeterSum;\r\n }",
"public double energy(int x, int y) {\n if (x >= current.width() || x < 0 || y >= current.height() || y < 0)\n throw new IndexOutOfBoundsException(String.format(\n \"Pixel (%d, %d) out of bounds\", x, y));\n if (x == 0 || y == 0 || x == current.width() - 1\n || y == current.height() - 1)\n return 195075;\n\n Color topPixel = current.get(x - 1, y);\n Color bottomPixel = current.get(x + 1, y);\n Color leftPixel = current.get(x, y - 1);\n Color rightPixel = current.get(x, y + 1);\n\n return dualGradientEnergy(topPixel, bottomPixel)\n + dualGradientEnergy(leftPixel, rightPixel);\n\n }",
"public Double getIndoorWindSpeed() {\n return indoorWindSpeed;\n }",
"public double mo9740e() {\n return Double.longBitsToDouble(mo9760w());\n }",
"public double getHigh(){\n return /*home*/ this.high /*and eat everything*/;\r\n //then go to sleep for a day or three \r\n }",
"public double ThermodynamicTemperature() {\n return OCCwrapJavaJNI.Units_Dimensions_ThermodynamicTemperature(swigCPtr, this);\n }",
"public int getWater() {\n\t\treturn water.getValue();\n\t}",
"public double getVelocity() {\n \treturn this.currentSpeed;\n }",
"public double getCurrent() {\n return elevatorSpark.getOutputCurrent();\n }",
"public double energy(int x, int y) {\r\n validate(x, y);\r\n return energy[x][y];\r\n }",
"float getPower();",
"float getW() {\n return _w;\n }",
"@Override\n\tpublic double calcConsumedEnergy() {\n\t\treturn (getBasicEnergyCost() * 4);\n\t}",
"public double getCurrentTemperature() {\n return this.currentTemperature;\n }",
"public double getSaturn()\n {\n double saturn = earthWeight * 1.1;\n return saturn;\n }",
"@java.lang.Override\n public float getW() {\n return w_;\n }",
"public void setEnergy (double energy) {\n\t this.energy = energy;\n\t}",
"public double getWage() {\r\n return wage;\r\n }",
"public int power() {\n int tot = 0;\n for (Equipment e : equipments) {\n tot += e.power();\n }\n\n return tot;\n }",
"public float getW2 () {\r\n return w2;\r\n }",
"@java.lang.Override\n public float getW() {\n return w_;\n }",
"public double getHourlyWage()\r\n {\r\n return hourlyWage;\r\n }",
"@Override\n public double getVelocity()\n {\n final String funcName = \"getVelocity\";\n double velocity = encoder.getVelocity() * encoderSign / 60.0;\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", velocity);\n }\n\n return velocity;\n }",
"public double getCharge() {\n\t\treturn chargedEnergy;\n\t}"
] | [
"0.77324295",
"0.77277726",
"0.7714401",
"0.7650569",
"0.7538683",
"0.7534983",
"0.75112545",
"0.75003904",
"0.74907804",
"0.74060726",
"0.7387983",
"0.7364444",
"0.7250351",
"0.7206885",
"0.7202092",
"0.7175825",
"0.70458347",
"0.7027343",
"0.70110923",
"0.6990221",
"0.6919412",
"0.6907297",
"0.6880431",
"0.67186636",
"0.6716083",
"0.67092174",
"0.664409",
"0.66263163",
"0.66061",
"0.6582993",
"0.65761495",
"0.6550598",
"0.65475655",
"0.65475655",
"0.6515627",
"0.650769",
"0.6450825",
"0.64158756",
"0.6415671",
"0.6414937",
"0.64094317",
"0.6394089",
"0.63883233",
"0.63810277",
"0.6372708",
"0.6362907",
"0.6343088",
"0.63072634",
"0.6305422",
"0.63025635",
"0.63013077",
"0.63002706",
"0.6287381",
"0.6267381",
"0.6236106",
"0.6234334",
"0.6228892",
"0.62260896",
"0.621488",
"0.6190881",
"0.6188116",
"0.6183029",
"0.6177604",
"0.61700696",
"0.6161287",
"0.6159325",
"0.61564463",
"0.61441004",
"0.61389595",
"0.6138542",
"0.61347514",
"0.61313665",
"0.6126734",
"0.6122772",
"0.6117064",
"0.61012304",
"0.6068978",
"0.60666007",
"0.6065997",
"0.6057628",
"0.6053508",
"0.6049198",
"0.6043207",
"0.6036268",
"0.60355765",
"0.6031665",
"0.602691",
"0.6024967",
"0.60246116",
"0.6023875",
"0.60201",
"0.6017744",
"0.60153854",
"0.6015183",
"0.601467",
"0.6003232",
"0.5998365",
"0.5997336",
"0.59969306",
"0.5987776"
] | 0.86616665 | 0 |
Move robot one step in its current direction if the robot has sufficient energy. Do not modify the state of the robot if it has insufficient energy. | @Override
public void move(Robot robot)
{
try
{
if(robot.canMoveOneStep())
{
robot.moveOneStep();
}
else
{
System.out.println("This robot cannot move in its current state.");
}
}
catch(IllegalStateException exc)
{
System.out.println("A terminated robot cannot be moved.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void moveOneStep() {\n if (velocity.getDx() < 0 && this.center.getX() - this.radius < bottomLeftBound) {\n this.setVelocity(-velocity.getDx(), velocity.getDy());\n } else if (velocity.getDx() > 0 && this.center.getX() + this.radius > bottomRightBound) {\n this.setVelocity(-velocity.getDx(), velocity.getDy());\n }\n if (velocity.getDy() < 0 && this.center.getY() - this.radius < topLeftBound) {\n this.setVelocity(velocity.getDx(), -velocity.getDy());\n } else if (velocity.getDy() > 0 && this.center.getY() + this.radius > topRightBound) {\n this.setVelocity(velocity.getDx(), -velocity.getDy());\n }\n this.center = this.getVelocity().applyToPoint(this.center);\n }",
"public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}",
"public void move() {\n energy -= 0.03;\n if (energy < 0) {\n energy = 0;\n }\n }",
"public void moveOneStep() {\n //We will create a line that checks the movement of the ball.\n Line trajectory = new Line(this.center.getX(), this.center.getY(),\n this.center.getX() + this.velocity.getDx(), this.center.getY() + this.velocity.getDy());\n //We will get information for the closest barrier.\n CollisionInfo info = this.gameEnvironment.getClosestCollision(trajectory);\n //If there is information about an obstacle on the way, we will almost change our direction before reaching\n // the barrier.\n if (info != null) {\n this.center = new Velocity(-0.2 * this.velocity.getDx(),\n -0.2 * this.velocity.getDy()).applyToPoint(this.center);\n this.velocity = info.collisionObject().hit(this, info.collisionPoint(), this.velocity);\n //Otherwise, we will allow it to reach its destination\n } else {\n this.center = this.velocity.applyToPoint(this.center);\n }\n }",
"public void move()\n {\n move(WALKING_SPEED);\n }",
"public boolean moveStep() {\n\t\t// TODO: take orientation into account\n\t\t\n\t\t// Work out the distance to the destination\n\t\tDouble2D delta = destination.subtract(getPosition());\n//\t\tSystem.out.println(this.toString() + \"has \" + delta.length() + \" to go.\"); // Debug\n\t \n\t // If this is below a small value, we have arrived, return true\n\t if (delta.length() < 4) return true;\n\t \n\t // FIXME: a better model allow different speed for different vehicle class\n\t // update the speed of vehicle\n\t velocity.setTo(delta.x * 0.004, delta.y * 0.004);;\n\t \n\t // FIXME: avoidance?\n\t \n\t // FIXME: orientation?\n//\t\torientation += angularRate;\n\t // update the vehicle location\n\t\tDouble2D location = _siteState.getArea().getObjectLocation(this);\n\t\t_siteState.getArea().setObjectLocation(this, location.add(new Double2D(velocity)));\n\t \n\t\treturn false;\n\t}",
"public void move(){\n \n currentFloor = currentFloor + ( 1 * this.direction);\n //if we're at the bottom or top after move, flip the bit\n if(Elevator.MIN_FLOOR == currentFloor \n || currentFloor == Elevator.MAX_FLOOR)\n this.direction *= -1;\n \n if(destinedPassengers[ currentFloor ] > 0)\n elevatorStop( currentFloor, true );\n \n if(building.floor(currentFloor).passengersWaiting() > 0)\n elevatorStop(currentFloor, false);\n \n }",
"public void moveOneStep(double dt) {\r\n this.checkLeftAndRightXs();\r\n if (this.leftX <= 20) {\r\n for (Enemy e : enemies) {\r\n e.moveDown();\r\n e.setSpeed(-(e.getSpeed().getDx() * 1.1));\r\n }\r\n\r\n }\r\n if (this.rightX >= 780) {\r\n for (Enemy e : enemies) {\r\n e.moveDown();\r\n\r\n e.setSpeed(-(e.getSpeed().getDx() * 1.1));\r\n\r\n }\r\n\r\n }\r\n for (Enemy e : enemies) {\r\n e.moveOneStep(dt);\r\n }\r\n }",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }",
"@Override\n public void step(double deltaTime) {\n // wheel radius, in meters\n double wheelCircumference = 2 * simulatorConfig.driveBase.wheelRadius * Math.PI;\n\n double leftRadians = 0;\n double rightRadians = 0;\n for (SimMotor simMotor : motorStore.getSimMotorsSorted()) {\n if (simMotor.isLeftDriveMotor()) {\n leftRadians = simMotor.position / simulatorConfig.driveBase.gearRatio;\n } else if (simMotor.isRightDriveMotor()) {\n rightRadians = simMotor.position / simulatorConfig.driveBase.gearRatio;\n }\n }\n\n // invert the left side because forward motor movements mean backwards wheel movements\n rightRadians = -rightRadians;\n\n double currentLinearRadians = (leftRadians + rightRadians) / 2;\n\n double deltaRadians = currentLinearRadians - lastLinearRadians;\n double metersPerRadian = wheelCircumference / (Math.PI * 2);\n double deltaLinearPosition = deltaRadians * metersPerRadian;\n double newHeading = ((leftRadians - rightRadians) * metersPerRadian / simulatorConfig.driveBase.radius);\n\n // for next loop\n lastLinearRadians = currentLinearRadians;\n\n robotPosition.heading = newHeading + startHeading;\n\n robotPosition.velocity = deltaLinearPosition / deltaTime;\n robotPosition.x += deltaLinearPosition * Math.sin(robotPosition.heading);\n robotPosition.y += deltaLinearPosition * Math.cos(robotPosition.heading);\n\n SimNavX simNavX = SimSPI.getNavX(SPI.Port.kMXP.value);\n if (simNavX != null) {\n float degrees = (float)((robotPosition.heading - simulatorConfig.startPosition.heading) * 360 / (Math.PI * 2));\n\n // degrees are between 0 and 360\n if (degrees < 0) {\n degrees = 360 - (Math.abs(degrees) % 360);\n } else {\n degrees = degrees % 360;\n }\n simNavX.heading = degrees;\n }\n\n }",
"void move() {\n\t\tif (reachedEdge()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\t\tif (reachedLeft()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\n\t\tx = x + velocityX;\n\t}",
"public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }",
"public static void move()\n\t{\n\t\tswitch(step)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 1;\n\t\t\tbreak;\n\t\t\t// 1. Right wheels forward\n\t\t\tcase 1:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, .5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 2;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 3;\n\t\t\tbreak;\n\t\t\t// 2. Right wheels back\n\t\t\tcase 3:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, -.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 4;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 5;\n\t\t\tbreak;\n\t\t\t// 3. Left wheels forward\n\t\t\tcase 5:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 6;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 7;\n\t\t\tbreak;\n\t\t\t// 4. Left wheels back\n\t\t\tcase 7:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(-.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 8;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 9;\n\t\t\tbreak;\n\t\t\t// 5. Intake pick up\n\t\t\tcase 9:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tshoot(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 10;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 11;\n\t\t\tbreak;\n\t\t\t// 6. Intake shoot\n\t\t\tcase 11:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tpickUp(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 12;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t// Stop and reset everything\n\t\t\tcase 12:\n\t\t\t\tsetSpeed(0, 0);\n\t\t\t\tpickUp(0);\n\t\t\t\tshoot(0);\n\t\t\t\ttimer.reset();\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\n public void move() {\n int speed = this.getSpeed();\n this.setSpeed(speed - 1);\n\n if (this.getSpeed() == 0) {\n super.move();\n this.setSpeed(1);\n }\n }",
"private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}",
"public void moveOneStep() {\n\n //computing the predicted trajectory\n Line trajectory = computeTrajectory();\n\n //checking the borders\n if (reachedBorder(trajectory)) {\n return;\n }\n\n //getting the closest collision info\n //CollisionInfo collisionInfo = this.gameEnvironment.getClosestCollision(trajectory);\n CollisionInfo collisionInfo = this.gameLevel.getEnvironment().getClosestCollision(trajectory);\n\n if (collisionInfo != null && collisionInfo.collisionObject() != null) {\n\n //changing the velocity according to the collision info (point, type of collidiable\n // and position on the collidable)\n Velocity newVelocity =\n collisionInfo.collisionObject().hit(this, collisionInfo.collisionPoint(), this.velocity);\n this.velocity = newVelocity;\n }\n\n //setting the next position of the center of the ball (new velocity after collision)\n this.center = this.getVelocity().applyToPoint(this.center);\n }",
"public void move() {\r\n\r\n\t\tif(x < 0) {\r\n\t\t\tx = 400;\r\n\t\t}\r\n\r\n\t\t// factor for speed increase\r\n\t\tx -= 1 * factor;\r\n\t}",
"@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }",
"public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}",
"private void move()\n\t{\n\t\tif(moveRight)\n\t\t{\n\t\t\tif(position.getX() + speedMovement <= width)\n\t\t\t{\n\t\t\t\tposition.setX(position.getX() +speedMovement+speedBoost);\n\t\t\t\tmoveRight = false;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\tif(moveLeft)\n\t\t{\n\t\t\tif(position.getX() - speedMovement > 0)\n\t\t\t{\n\t\t\t\tposition.setX(position.getX() -speedMovement - speedBoost + gravitationalMovement);\n\t\t\t\tmoveLeft = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * If a gravitational field is pushing the ship, set the movement accordingly\n\t\t */\n\t\tif(gravitationalMovement>0)\n\t\t{\n\t\t\tif(position.getX()+gravitationalMovement <= width)\n\t\t\t\tposition.setX(position.getX() + gravitationalMovement);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(position.getX() + gravitationalMovement > 0)\n\t\t\t\tposition.setX(position.getX() + gravitationalMovement);\n\t\t}\n\t}",
"public void move() {\r\n if (y > HEIGHT)\r\n y = initialY;\r\n y = y + speed;\r\n }",
"@Override\n\tprotected boolean moveRobot(boolean printEachStep) {\n\t\tboolean move=true;\n\t\tint incOrDecR = destRow > curRow ? 1 : -1, \n\t\t\tincOrDecC = destCol > curCol ? 1 : -1, \n\t\t\tcount = diagonalCount();\n\t\t\t// Move diagonally as close to the destination it can get to\n\t\t\tfor(int i=0; i<count; ++i) {\n\t\t\t\tif(move=grid.moveFromTo(this, curRow, curCol, \n\t\t\t\t\t\tblockedRow=curRow+incOrDecR, \n\t\t\t\t\t\tblockedCol=curCol+incOrDecC)) { \n\t\t\t\t\tcurRow+=incOrDecR; \n\t\t\t\t\tcurCol+=incOrDecC;\n\t\t\t\t\t--energyUnits;\n\t\t\t\t\tif(printEachStep)\n\t\t\t\t\t\tgrid.printGrid();\n\t\t\t\t} else {\n\t\t\t\t\treturn move; \n\t\t\t\t}\n\t\t\t}\n\t\tmove=super.moveRobot(printEachStep);\n\t\treturn move;\n\t}",
"@Override\n\tpublic void step() {\n\t\tthis.y-= speed;\t\n\t}",
"@Override\n\tpublic void step() {\n\t\ty += speed;\n\t}",
"private void move() {\n acceleration.accelerate(velocity, position);\r\n }",
"public void move() {\n\t\tthis.move(velocity.x, velocity.y);\n\t}",
"private void driveLeft() {\n setSpeed(MIN_SPEED, MAX_SPEED);\n }",
"public void move() {\n Grid<Actor> gr = getGrid();\n if (gr == null) {\n return;\n }\n Location loc = getLocation();\n if (gr.isValid(next)) {\n setDirection(getLocation().getDirectionToward(next));\n moveTo(next);\n } else {\n removeSelfFromGrid();\n }\n Flower flower = new Flower(getColor());\n flower.putSelfInGrid(gr, loc);\n }",
"protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}",
"@Override\n\tpublic void move() {\n\t\theading = Heading.randHeading();\n\t\tif (heading == Heading.NORTH) {\n\t\t\tthis.location.y -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.EAST) {\n\t\t\tthis.location.x += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.SOUTH) {\n\t\t\tthis.location.y += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.WEST) {\n\t\t\tthis.location.x -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t}\n\t\tadjustPos();\n\t\tinfect();\n\t}",
"public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }",
"private void doStep() {\n // Add some variables to increase readability.\n int left = RotorPosition.LEFT.ordinal();\n int middle = RotorPosition.MIDDLE.ordinal();\n int right = RotorPosition.RIGHT.ordinal();\n\n //TODO see if this method can be optimized at all\n if (rotors[right].isAtTurnoverPosition()) {\n // Normal stepping.\n if (rotors[middle].isAtTurnoverPosition()) {\n if (rotors[left].isAtTurnoverPosition()) {\n reflector.doStep();\n }\n rotors[left].doStep();\n }\n rotors[middle].doStep();\n } else {\n // Handle the double stepping anomaly.\n if (rotors[middle].isAtTurnoverPosition() && rotors[middle].justStepped()) {\n rotors[left].doStep();\n rotors[middle].doStep();\n }\n }\n rotors[right].doStep();\n }",
"@Override\n public void timePassed() {\n moveOneStep();\n }",
"public void move(double movement){\n\t\tif(movement < 0){\n\t\t\tif(RobotMap.SOFTLIMIT_ARM_LEFT_BTM >= Robot.ARM_RIGHT_SUBSYSTEM.getLeftPot() || btmLS.get()) return;\n\t\t}else{\n\t\t\tif(RobotMap.SOFTLIMIT_ARM_LEFT_TOP <= Robot.ARM_RIGHT_SUBSYSTEM.getLeftPot() || topLS.get()) return;\n\t\t}\n\t\ttalon.set(movement);\n\t}",
"public void step() {\n hasMoved = new boolean[simulationSize][simulationSize]; // Initializing the array and populating it with false values\n\n for(int i = 0; i < hasMoved.length; i++)\n Arrays.fill(hasMoved[i], false);\n\n moveFluid();\n\n yVelocityModifier.add(gravity);\n for(int i = 0; i < simulationSize; i++) { // Iterating through every grid space\n for(int j = 0; j < simulationSize; j++) {\n if(fluidGrid[i][j][0] == EMPTY_VALUE) // If the current space is empty don't use it\n continue;\n\n for(float xModifier : xVelocityModifier) {\n fluidGrid[i][j][0] += xModifier;\n }\n\n for(float yModifier : yVelocityModifier) {\n fluidGrid[i][j][1] += yModifier;\n }\n }\n }\n\n xVelocityModifier.clear();\n yVelocityModifier.clear();\n }",
"@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }",
"public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }",
"public void move() {\n float xpos = thing.getX(), ypos = thing.getY();\n int xdir = 0, ydir = 0;\n if (left) xdir -= SPEED; if (right) xdir += SPEED;\n if (up) ydir -= SPEED; if (down) ydir += SPEED;\n xpos += xdir; ypos += ydir;\n\n VeggieCopter game = thing.getGame();\n int w = game.getWindowWidth(), h = game.getWindowHeight();\n int width = thing.getWidth(), height = thing.getHeight();\n if (xpos < 1) xpos = 1; if (xpos + width >= w) xpos = w - width - 1;\n if (ypos < 1) ypos = 1; if (ypos + height >= h) ypos = h - height - 1;\n thing.setPos(xpos, ypos);\n }",
"public void move() {\n\t\tif ( board.getLevel() == 5 )\n\t\t\tmovementIndex = ( movementIndex + 1 ) % movement.length;\n\t}",
"@Override\r\n public void act() {\r\n boolean willMove = canMove();\r\n if (isEnd) {\r\n // to show step count when reach the goal\r\n if (!hasShown) {\r\n String msg = stepCount.toString() + \" steps\";\r\n JOptionPane.showMessageDialog(null, msg);\r\n hasShown = true;\r\n }\r\n } else if (willMove) {\r\n move();\r\n // increase step count when move\r\n stepCount++;\r\n // 把当前走过的位置加入栈顶的arrayList\r\n crossLocation.peek().add(getLocation());\r\n // 当前方向的概率+1\r\n probablyDir[getDirection() / 90]++;\r\n } else if (!willMove) {\r\n // 这时候必须一步一步返回栈顶arrayList的开头\r\n ArrayList<Location> curCrossed = crossLocation.peek();\r\n curCrossed.remove(curCrossed.size() - 1);\r\n next = curCrossed.get(curCrossed.size() - 1);\r\n move();\r\n stepCount++;\r\n // 当前方向反向的概率-1\r\n probablyDir[((getDirection() + Location.HALF_CIRCLE)\r\n % Location.FULL_CIRCLE) / Location.RIGHT]--;\r\n if (curCrossed.size() == 1) {\r\n // 返回之后pop\r\n crossLocation.pop();\r\n }\r\n }\r\n }",
"public void move(){\n super.move();\n if(getX() >= Main.WIDTH - getWidth() * 1.5) {\n setDirection(-1);\n } else if(getX() <= 50) {\n setDirection(1);\n }\n }",
"public void move() {\n\t\tif(path.size() != 0) {\n\t\t\tCoordinate c = path.get(0);\n\t\t\tint x1 = c.x;\n\t\t\tint y1 = c.y;\n\t\t\t\t\n\t\t\tif(Math.abs(x1 - x) > speed || Math.abs(y1 - y) > speed) {\n\t\t\t\tif(this.x > x1) {\n\t\t\t\t\tvy = 0;\n\t\t\t\t\ttx.translate(-speed, vy);\n\t\t\t\t\tthis.x -= speed;\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if(this.x < x1) {\n\t\t\t\t\t//this.x += speed;\n\t\t\t\t\tvy = 0;\n\t\t\t\t\ttx.translate(speed, vy);\n\t\t\t\t\tthis.x += speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(this.y > y1) {\n\t\t\t\t\t//vx = 0;\n\t\t\t\t\ttx.translate(0, -speed);\n\t\t\t\t\tthis.y -= speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(this.y < y1) {\n\t\t\t\t\t//vx = 0;\n\t\t\t\t\ttx.translate(0, speed);\n\t\t\t\t\tthis.y += speed;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tpath.remove(0);\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}",
"public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tif (gr.isValid(next)) {\n\t\t\tsetDirection(getLocation().getDirectionToward(next));\n\t\t\tmoveTo(next);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t\tFlower flower = new Flower(getColor());\n\t\tflower.putSelfInGrid(gr, loc);\n\t}",
"public void move(){\n\t\tif (currentFloor == TOTALFLOORS) currentDirection = \"DOWN\"; else currentDirection =\"UP\";\t\t//sets inital direction for the elevator.\n\t\tfor (int x = 1; x <= TOTALFLOORS; x++){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//This loop will move the elevator through each floor. \n\t\t\tif (getTotalPassDestFloor()[currentFloor] >0 || destRequest[currentFloor] == 'Y')this.stop(); \t//Checks for the destined passengers or registered request for the current floor.\n\t\t\tif (currentDirection == \"UP\") currentFloor++; else currentFloor--;\t\t\t\t\t\t\t//Moves the elevator up/down based on the direction\n\t\t}\n\t\tif (currentFloor == 8) currentFloor--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Adjusts currentfloor value when elevator-\n\t\tif (currentFloor == 0) currentFloor++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//-is at first or top most floor\n\t}",
"public void move() {\n\t\tthis.hero.setPF(1);\n\t\tthis.hero.setState(this.hero.getMoved());\n\t}",
"@Override\n public void move() {\n switch (direction){\n case SOUTH:\n position.setY(position.getY() + currentSpeed);\n break;\n case NORTH:\n position.setY(position.getY() - currentSpeed);\n break;\n case WEST:\n position.setX(position.getX() - currentSpeed);\n break;\n case EAST:\n position.setX(position.getX() + currentSpeed);\n }\n }",
"public void move() {\n if (!canMove) {\n return;\n }\n int moveX = currDirection == EAST ? PACE : currDirection == WEST ? -PACE : 0;\n int moveY = currDirection == NORTH ? PACE : currDirection == SOUTH ? -PACE : 0;\n if (grid == null || grid.isOutside(currX + moveX, currY + moveY)) {\n return;\n }\n currX += moveX;\n currY += moveY;\n }",
"public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }",
"public void moveForward(double movementSpeed, boolean makeStep) {\r\n\t\tVec3d view = getLookVec();\r\n\r\n\t\tfloat effectiveSpeed = (float) (movementSpeed\r\n\t\t\t\t* getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue());\r\n\t\tVec3d forwardVector = new Vec3d(view.xCoord * effectiveSpeed, motionY, view.zCoord * effectiveSpeed);\r\n\t\tboolean jump = false;\r\n\t\tif (makeStep) {\r\n\t\t\t// copy the bounding box\r\n\t\t\tAxisAlignedBB bounds = getEntityBoundingBox();\r\n\r\n\t\t\tbounds = bounds.offset(forwardVector.xCoord, 0, forwardVector.zCoord);\r\n\t\t\tList<?> normalPathCollision = AIUtils.gatherOverlappingBounds(bounds, this);\r\n\r\n\t\t\tbounds = bounds.offset(0, stepHeight, 0);\r\n\t\t\tList<?> jumpPathCollision = AIUtils.gatherOverlappingBounds(bounds, this);\r\n\r\n\t\t\tif (!normalPathCollision.isEmpty() && jumpPathCollision.isEmpty()) {\r\n\t\t\t\tjump = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (jump) {\r\n\t\t\tthis.move(MoverType.SELF, 0, stepHeight + 0.5, 0);\r\n\t\t\tthis.motionY = 0;\r\n\t\t\tthis.isAirBorne = true;\r\n\t\t}\r\n\t\taddVelocity(forwardVector.xCoord, forwardVector.yCoord, forwardVector.zCoord);\r\n\t\tsetPositionAndUpdate(posX, posY, posZ);\r\n\t}",
"public void move() {\n\t\tsuper.move();\n\t\t\n\t\t// if the slime hit the ground\n\t\tif (y >= 64*2) {\n\t\t\t// begin sliding (only needed for the first time he falls)\n\t\t\tif (accel_x != .25 && accel_x != duck_accel_x) accel_x = .25;\n\t\t\t\n\t\t\t// allow player to jump, since vel_y = 0 stops the jump\n\t\t\tif (jumping)\n\t\t\t\tjumping = false;\n\t\t\telse\n\t\t\t\tvel_y = 0;\n\t\t\t\n\t\t\t// slime is slightly lower while ducking\n\t\t\tif (ducking)\n\t\t\t\ty = 64*2+20;\n\t\t\telse\n\t\t\t\ty = 64*2;\n\t\t}\n\t\t\n\t\t// bounce if the slime hit the top\n\t\tif (y < 0) vel_y *= -1;\n\t}",
"@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}",
"public void move(Joystick joystick)\n {\n double joystickY = joystick.getRawAxis(OIConstants.ELEVATOR_JOYSTICK_Y);\n\n if (Math.abs(joystickY) > OIConstants.ELEVATOR_JOYSTICK_DEADZONE)\n {\n Robot.elevator.setTarget((int)(Robot.elevator.getTarget() + joystickY * Constants.ELEVATOR_SPEED_NORMAL));\n }\n else\n {\n Robot.elevator.setTarget(Robot.elevator.getTarget());\n }\n\n // if the limit switch for level 1 is hit then rumble the controller\n if (!Robot.elevator.isLevel1LimitClosed())\n {\n Robot.oi.mechJoystick.setRumble(RumbleType.kLeftRumble, 0.5);\n Robot.oi.mechJoystick.setRumble(RumbleType.kRightRumble, 0.5);\n }\n else\n {\n Robot.oi.mechJoystick.setRumble(RumbleType.kLeftRumble, 0);\n Robot.oi.mechJoystick.setRumble(RumbleType.kRightRumble, 0);\n }\n }",
"@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);\r\n } else {\r\n removeSelfFromGrid();\r\n }\r\n Flower flower = new Flower(getColor());\r\n flower.putSelfInGrid(gr, loc);\r\n }",
"void move(int direction)\n {\n int step = 1;\n int covered = 0;\n if ((direction==1 && tankY==0) || (direction==2 && tankY >= 512) || (direction==3 && tankX == 0) || (direction==1 && tankX >=512)){\n System.out.println(\"Illegal move \"+ direction);\n return;\n }\n turn(direction);\n\n while (covered < 64){\n if (direction ==1 ){\n tankY -= step;\n }\n if (direction ==2 ){\n tankY += step;\n }\n if (direction ==4){\n tankX += step;\n }\n if (direction ==3 ){\n tankX -= step;\n }\n covered +=step;\n }\n repaint();\n sleep(speed);\n\n }",
"@Override\r\n\tpublic Behaviour update(GameContext context) {\n\t\tif (Math.abs(thing.getX() - moveToX) < thing.getSpeed().getXv() / context.getTimeSinceLastUpdate()) {\r\n\t\t\tthing.setX(moveToX);\r\n\t\t}\r\n\t\tif (Math.abs(thing.getY() - moveToY) < thing.getSpeed().getYv() / context.getTimeSinceLastUpdate()) {\r\n\t\t\tthing.setY(moveToY);\r\n\t\t};\r\n\t\t\r\n\t\tif (!isContinueAfterTarget()) {\r\n\t\t\tthing.changeDirection(moveToX, moveToY, thing.getX(), thing.getY());\r\n\t\t}\r\n\t\tthing.updatePositionBasedOnSpeed(context);\r\n\t\t\r\n\t\tif (!isContinueAfterTarget()) {\r\n\t\t\tif ((int) thing.getX() == (int) moveToX) { // && thing.getY() == moveToLocation.y){\r\n\t\t\t\treturn new IdleBehaviour(thing);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}",
"public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}",
"public void moveLeft() {\n if (!this.state.equals(\"onLeftWall\")) {\n this.dir = -1;\n this.xTargetSpeed = this.X_MAX_SPEED;\n }\n }",
"public void move() {\r\n\t\tx = x + speed;\r\n\t}",
"public void moveRight() {\n\t\tsetPosX(getPosX() + steps);\n\t}",
"public void move() {\n // Check for collisions and reverse deltas accordingly\n if (collisionWithHorizontalWall()) {\n isFacingRight = !isFacingRight;\n dx *= -1;\n }\n if (collisionWithVerticalWall()) {\n dy *= -1;\n }\n \n // Handle actual movement by updating positional values\n if (dx == 0 || dy == 0) {\n xPos += dx;\n yPos += dy;\n } else {\n // Turn diagonal delta movement into 1 instead of sqrt(2)\n xPos += DIAGONAL_DIVISOR * dx;\n yPos += DIAGONAL_DIVISOR * dy;\n }\n }",
"public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}",
"public void moveOneStep(double dt) {\r\n double movementX = this.p.getX() + dt * this.vel.getDx();\r\n double movementY = this.p.getY() + dt * this.vel.getDy();\r\n Line trajectory = new Line(this.p, new Point(movementX, movementY));\r\n CollisionInfo collInfo = gameE.getClosestCollision(trajectory);\r\n // if there is a collision point collInfo doesn't equal to null.\r\n if (collInfo != null) {\r\n double x = this.getX();\r\n double y = this.getY();\r\n Point collisionPoint = collInfo.collisionPoint();\r\n Collidable obj = collInfo.collisionObject();\r\n Rectangle r = obj.getCollisionRectangle();\r\n // Check if the ball hit on one of the corners block.\r\n if (collisionPoint.getY() == collisionPoint.getX()) {\r\n // If the ball hit on the top corners.\r\n if (collisionPoint.getY() == r.getUpperLeft().getY()\r\n || collisionPoint.getX() == r.getUpperLeft().getX()) {\r\n x = collisionPoint.getX() - this.getSize() - 0.001;\r\n y = collisionPoint.getY() - this.getSize() - 0.001;\r\n // else the ball hit on the bottom corners.\r\n } else {\r\n x = collisionPoint.getX() + this.getSize() + 0.001;\r\n y = collisionPoint.getY() + this.getSize() + 0.001;\r\n }\r\n // Set a new velocity.\r\n this.setVelocity(obj.hit(this, collInfo.collisionPoint(), this.getVelocity()));\r\n this.p = new Point(x, y);\r\n return;\r\n }\r\n\r\n // If the ball hit on the left border block.\r\n if (collisionPoint.getX() == r.getUpperLeft().getX()) {\r\n x = collisionPoint.getX() - this.getSize() - 0.001;\r\n y = collisionPoint.getY();\r\n // If the ball hit on the right border block.\r\n } else if (collisionPoint.getX() == r.getWidth() + r.getUpperLeft().getX()) {\r\n x = collisionPoint.getX() + this.getSize() + 0.001;\r\n y = collisionPoint.getY();\r\n\r\n }\r\n // If the ball hit on the top border block.\r\n if (collisionPoint.getY() == r.getUpperLeft().getY()) {\r\n y = collisionPoint.getY() - this.getSize() - 0.001;\r\n x = collisionPoint.getX();\r\n // If the ball hit on the bottom border block.\r\n } else if (collisionPoint.getY() == r.getHeight() + r.getUpperLeft().getY()) {\r\n y = collisionPoint.getY() + this.getSize() + 0.001;\r\n x = collisionPoint.getX();\r\n }\r\n // set a new velocity.\r\n this.setVelocity(obj.hit(this, collInfo.collisionPoint(), this.getVelocity()));\r\n this.p = new Point(x, y);\r\n // else move the ball one step.\r\n } else {\r\n this.p = this.getVelocity().applyToPoint(this.p, dt);\r\n }\r\n }",
"@Override\n public void move(){\n if (flatbed.getCurrentAngle() == flatbed.getMinAngle()){\n super.move();\n }\n }",
"public abstract void move(int direction, double speed);",
"public void setDirectionMove(double direction);",
"public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }",
"private void accelerate() {\r\n\t\tif(physics.angleTo(closestShipPhysics) < 0){\r\n\t\t\tphysics.move(true, RIGHT);\r\n\t\t}\r\n\t\tif(physics.angleTo(closestShipPhysics) > 0){\r\n\t\t\tphysics.move(true, LEFT);\r\n\t\t}\r\n\t\telse{\r\n\t\tphysics.move(true, STRIGHT);\r\n\t\t}\r\n\t}",
"public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}",
"public void advanceTimeStep(double timestep) {\n\t\t\n\t\tif (getDeathTime() > 0) return;\n\t\t\n\t\tList<List<List<Object>>> collisions = getCollisions();\n\t\tif ((noObjectMovementBlocking(collisions.get(0).get(0)) && !(collisions.get(0).get(1).contains(Feature.ground)) && (getVx() < 0))\n\t\t\t|| ((noObjectMovementBlocking(collisions.get(2).get(0)) && !(collisions.get(2).get(1).contains(Feature.ground)) && (getVx() > 0)))) \n\t\t\t\tadvanceX(timestep);\n\t\t\n\t\tsetVx(advanceVx(timestep));\n\t\t\n\t\tcollisions = getCollisions();\n\t\tif (noObjectMovementBlocking(collisions.get(3).get(0)) && !(collisions.get(3).get(1).contains(Feature.ground)) && (getVy() < 0))\n\t\t\tadvanceY(timestep);\n\t\telse if (getVy() > 0) {\n\t\t\tboolean should_advance = true;\n\t\t\tfor(int i = 0; i < 3; i++) {\n\t\t\t\tif (!noObjectMovementBlocking(collisions.get(i).get(0)) || collisions.get(i).get(1).contains(Feature.ground))\n\t\t\t\t\tshould_advance = false;\n\t\t\t}\n\t\t\tif (should_advance) advanceY(timestep);\n\t\t}\n\n\t\tadvanceVy(timestep);\n\t\tsetAy(advanceAy());\n\n\t\tcollisions = getCollisions();\n\t\tif ((this instanceof Mazub) && !(getJustJumped()) &&\n\t\t\t\t((collisions.get(3).get(0).size() != 0) || (collisions.get(3).get(1).contains(Feature.ground)))) {\n\t\t\t((Mazub) this).setJumping(false);\n\t\t}\n\t\t\n\t\tsetTimeInvincible(advanceTimeInvincible(timestep));\n\t}",
"public void moving()\n {\n if(onPlatform()&&endPlatform()){\n direction();\n }\n if(onPlatform()&&!endPlatform()){\n changeDirection();\n direction();\n }\n collideMoveLocation(horzVelocity,1);\n //sharaz\n if(isTouching(PushObject.class)){\n changeDirection();\n direction();\n }\n \n \n }",
"public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }",
"public void moveForward()\r\n\t{\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading-90))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading-90))*distance;\r\n\t\t}\r\n\t}",
"void move(int steps);",
"public void moveRight() {\n if (!this.state.equals(\"onRightWall\")) {\n this.dir = 1;\n this.xTargetSpeed = this.X_MAX_SPEED;\n }\n }",
"@Override\n public Status move(){\n\n if(onNode.getNextNode(this)==null){\n return Status.NOT_EMPTY_CAR;\n }\n List<Train> on = onNode.getNextNode(this).getTrains();\n if(!on.isEmpty()) return Status.CRASHED;\n\n Node next = onNode.getNextNode(this);\n prevNode.removeTrain(this);\n next.addTrain(this);\n x=next.getX();\n y=next.getY();\n try {\n ((Station)next).setGetOff();\n }\n catch (Exception e) {}\n \n return nextCar.move();\n }",
"public void move()\n\t{\n\t\tx = x + frogVelocityX;\n\t}",
"public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}",
"public void move()\n\t{\n\t\tx = x + dx;\n\t}",
"private void think()\n\t{\n\t\tboolean bChange=false;\n\t\tif ((mMoveY+Height)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveY+Height)>500)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)>500)\n\t\t\tbChange=true;\n\t\tif (bChange)\n\t\t{\n\t\t\t//Go in opposite direction\n\t\t\tDirection = Direction+4;\n\t\t\tif (Direction>7)\n\t\t\t\tDirection-=8;\n\t\t\tif (Direction<0)\n\t\t\t\tDirection=0;\n\t\t}\t\t\n\t}",
"public void moveLeft() {\n if (xcoor >= movingSpeed) {\n xcoor = xcoor - movingSpeed * 2;\n }\n }",
"public void move() {\r\n\t\tSystem.out.print(\"This Goose moves forward\");\r\n\t}",
"protected void execute() {\n\t\tdouble tempSpeed = Math.abs(elSpeed);\n\t\tdirection = newPosition.getValue() > Robot.elevator.getCurrentPosition().getValue()\n\t\t\t\t? RelativeDirection.ZAxis.UP : RelativeDirection.ZAxis.DOWN;\n\n\t\tif (direction == RelativeDirection.ZAxis.DOWN) {\n\t\t\ttempSpeed = -tempSpeed;\n\t\t}\n\n\t\tRobot.elevator.setElevatorSpeed(tempSpeed);\n\t}",
"public void move() {\n\t\tdy += acceleration;\n\t\tupdateTail();\n\t\ty += dy;\n\t}",
"private void driveRight() {\n setSpeed(MAX_SPEED, MIN_SPEED);\n }",
"public void step() {\r\n for(int i = 0;i<numberOfCars;i++) {\r\n xtemp[i] = x[i];\r\n }\r\n for(int i = 0;i<numberOfCars;i++) {\r\n if(v[i]<maximumVelocity) {\r\n v[i]++; // acceleration\r\n }\r\n int d = xtemp[(i+1)%numberOfCars]-xtemp[i]; // distance between cars\r\n if(d<=0) { // periodic boundary conditions, d = 0 correctly treats one car on road\r\n d += roadLength;\r\n }\r\n if(v[i]>=d) {\r\n v[i] = d-1; // slow down due to cars in front\r\n }\r\n if((v[i]>0)&&(Math.random()<p)) {\r\n v[i]--; // randomization\r\n }\r\n x[i] = (xtemp[i]+v[i])%roadLength;\r\n flow += v[i];\r\n }\r\n steps++;\r\n computeSpaceTimeDiagram();\r\n }",
"public void move() {\n super.move(DIRECTION.getRandom());\n }",
"public boolean checkAndMove() {\r\n\r\n\t\tif(position == 0)\r\n\t\t\tdirection = true;\r\n\r\n\t\tguardMove();\r\n\r\n\t\tif((position == (guardRoute.length - 1)) && direction) {\r\n\t\t\tposition = 0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(direction)\r\n\t\t\tposition++;\r\n\t\telse\r\n\t\t\tposition--;\r\n\r\n\t\treturn false;\r\n\t}",
"public void moveRight()\n\t{\n\t\tx = x + STEP_SIZE;\n\t}",
"public abstract boolean moveOn(\n double currentX, double currentY, double currentAngle,\n double velX, double velY, double velAngle);",
"public void move(long timePassed) {\r\n\t\t// if ship is moving left and reached the left side of the screen, don't move\r\n\t\tif ((dx < 0) && (x < 10)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if ship is moving right and reached the right side of the screen, don't move\r\n\t\tif ((dx > 0) && (x > 530)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsuper.move(timePassed);\r\n\t}",
"public void move(Direction direction){\r\n if((this.orientation==Orientation.VERTICAL&&\r\n (direction==Direction.RIGHT||direction==Direction.LEFT))||\r\n (this.orientation==Orientation.HORIZONTAL&&\r\n (direction==Direction.UP||direction==Direction.DOWN))){\r\n throw new IllegalArgumentException(\"Move this car is impossible\");\r\n }else{\r\n this.currentPosition.getPosition(direction);\r\n }\r\n }",
"public void moveLeft() {\n\t\tsetPosX(getPosX() - steps);\n\t}",
"public void move() {\n\t\t// tolerance of angle at which the Base starts moving\n\t\tint tolerance = 10;\n\t\tif(Math.abs(angle) < Math.abs(angleDesired)+tolerance && Math.abs(angleDesired)-tolerance < Math.abs(angle)) {\n\t\t\tdouble vX = Math.cos(Math.toRadians(this.angle + 90)) * v;\n\t\t\tdouble vY = Math.sin(Math.toRadians(this.angle + 90)) * v;\n\t\t\t\n\t\t\tthis.x += vX;\n\t\t\tthis.y += vY;\t\n\t\t\tthis.rectHitbox = new Rectangle((int)(x-rectHitbox.width/2),(int)(y-rectHitbox.height/2),rectHitbox.width,rectHitbox.height);\n\t\t}\n\t\t// curTargetPathBoardRectangle\n\t\tRectangle curTPBR = pathBoardRectangles.get(curTargetPathCellIndex).rect;\n\t\tRectangle rectSmallerBR = new Rectangle((int)curTPBR.getCenterX()-5,(int)curTPBR.getCenterY()-5,10,10);\n\t\t// updates the index when it crosses a pathCell so it counts down from pathCell to pathCell,\n\t\t// always having the next pathCell in the array as the target until the end is reached then it stops\n\t\tif(rectSmallerBR.contains(new Point((int)x,(int)y))) {\n\t\t\tif(curTargetPathCellIndex < pathBoardRectangles.size()-1) {\n\t\t\t\tcurTargetPathCellIndex++;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex-1);\n\t\t\t\ttAutoDirectionCorrection.restart();\n\t\t\t}else {\n\t\t\t\tparentGP.isMoving = false;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex);\n\t\t\t\tpathBoardRectangles.clear();\n\t\t\t\ttAutoDirectionCorrection.stop();\n\t\t\t\tStagePanel.tryCaptureGoldMine(parentGP);\n\t\t\t}\n\t\t}\n\t}",
"protected void execute() {\n \tdouble moveValue = -1.0;\n \t\n \tif (useSmoothing) {\n\t \tif (Robot.clawElevator.getContainerHeight() == 0) {\n\t \t\t// TODO Something or other\n\t \t} else {\n\t \t\tdouble percentError = Math708.getPercentError(Robot.clawElevator.getTravelDistance(), Constants.CLAW_ELEVATOR_DOWN_TRAVEL_DISTANCE[Math.abs(Robot.clawElevator.getContainerHeight() - 3)]);\n\t \t\t\n\t \t\tif (percentError <= 0.5) {\n\t \t\tmoveValue = Math708.makeWithin(percentError, moveValue, -Constants.CLAW_ELEVATOR_MOTOR_MINIMUM);\n\t \t}\n\t \t}\n \t}\n \t\n \tRobot.clawElevator.manualMove(moveValue);\n }",
"public void moveForward(int speed) throws JposException;",
"public void moveOneStep() {\n // special case - the ball is inside the paddle\n Map<Integer, Point> result = movingBlock.getCollisionRectangle().insideRectangle(this.center);\n if (result != null) {\n // getting a pair information of:\n // A point: the new point of the center outside the paddle\n // An Integer: 1 if it's on the right, -1 if on the left\n for (Integer direction : result.keySet()) {\n // setting the new center, and the new velocity, based on the result\n this.center = result.get(direction);\n this.setVelocity(Math.abs(this.getVelocity().getX()) * direction, -Math.abs(this.getVelocity().getY()));\n }\n // normal case - the ball is not inside the paddle\n } else {\n // getting the line trajectory\n Line trajectory = new Line(this.center, this.getVelocity().applyToPoint(this.center));\n // getting the collision info\n CollisionInfo info = this.gameEnvironment.getClosestCollision(trajectory);\n int count = 0;\n // while this info is not null\n while (info != null) {\n // changing the velocity of the ball\n // notify the object it has been hit\n this.setVelocity(info.collisionObject().hit(this, info.collisionPoint(), this.getVelocity()));\n // getting the update trajectory and info (while they're not null!)\n trajectory = new Line(this.center, this.getVelocity().applyToPoint(this.center));\n info = this.gameEnvironment.getClosestCollision(trajectory);\n // if the count is 3, it means we are into an infinite loop!\n // oppose the velocity and break\n if (count == 3) {\n this.setVelocity(-this.getVelocity().getX(), -this.getVelocity().getY());\n break;\n }\n count++;\n }\n this.center = this.getVelocity().applyToPoint(this.center);\n }\n }",
"private void checkMovement() {\n\n if (getYVelocity() < 0) state = PlayerState.JUMPING;\n if (getYVelocity() == 0) /*|| getXVelocity() == 0)*/ state = PlayerState.STANDING;\n if (Keyboard.isKeyDown(Keyboard.KEY_W)) {\n\n if (!falling && !floating()) {\n\n if (getYVelocity() >= 0) {\n this.addY(-72);\n }\n\n }\n }\n\n if (Keyboard.isKeyDown(Keyboard.KEY_A)) {\n this.addX((float) -5);\n state = PlayerState.WALKLEFT;\n }\n if (Keyboard.isKeyDown(Keyboard.KEY_D)) {\n this.addX((float) 5);\n state = PlayerState.WALKRIGHT;\n }\n if (getYVelocity() > 0) state = PlayerState.FALLING;\n }"
] | [
"0.72609293",
"0.7014481",
"0.69087315",
"0.6901371",
"0.6816644",
"0.67973334",
"0.6760453",
"0.66845244",
"0.66341007",
"0.66141194",
"0.6595262",
"0.6567337",
"0.65278643",
"0.6480756",
"0.6476849",
"0.64601475",
"0.64548886",
"0.64500636",
"0.6438862",
"0.6432493",
"0.6411734",
"0.6389242",
"0.6383105",
"0.6361456",
"0.62748265",
"0.62548345",
"0.6229429",
"0.62187403",
"0.62094104",
"0.6204973",
"0.6200703",
"0.61998266",
"0.6185835",
"0.6179201",
"0.617278",
"0.6171226",
"0.61627465",
"0.6162148",
"0.61615765",
"0.6142904",
"0.61377317",
"0.6134082",
"0.6125965",
"0.6104586",
"0.60939336",
"0.6092767",
"0.60909444",
"0.60909146",
"0.60708725",
"0.60670507",
"0.6065296",
"0.6059082",
"0.60570514",
"0.6039573",
"0.60238326",
"0.6009193",
"0.6005143",
"0.59973955",
"0.59843695",
"0.5984221",
"0.59801966",
"0.5974748",
"0.59745514",
"0.5969327",
"0.59587085",
"0.5952811",
"0.5944383",
"0.59436774",
"0.59363526",
"0.5934141",
"0.593247",
"0.59319043",
"0.59147286",
"0.59140986",
"0.5913796",
"0.5911514",
"0.5903378",
"0.5900559",
"0.58989686",
"0.58986044",
"0.5890769",
"0.588573",
"0.58842266",
"0.5878024",
"0.58738756",
"0.5872823",
"0.5861458",
"0.5861187",
"0.5856786",
"0.58552015",
"0.5854403",
"0.5853858",
"0.58366346",
"0.58359975",
"0.5831475",
"0.58271194",
"0.58241695",
"0.5823987",
"0.58205724",
"0.5814929"
] | 0.74779433 | 0 |
Turn robot 90 degrees in clockwise direction if the robot has sufficient energy. Do not modify the state of the robot if it has insufficient energy. | @Override
public void turn(Robot robot)
{
try
{
if(robot.canTurn(Direction.CLOCKWISE))
{
robot.turnClockwise();
}
else
{
System.out.println("This robot cannot turn in its current state.");
}
}
catch(IllegalStateException exc)
{
System.out.println("A terminated robot cannot be turned.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void Turn(double degrees) {\n\n // Update the target angle\n TargetAngle = NormalizeAngle(TargetAngle + degrees);\n\n // Loops until the robot has reached the target\n while (opModeIsActive()) {\n\n // Calculate how many degrees the robot still has to turn\n double DegreesRemaining = NormalizeAngle(TargetAngle - GetRobotAngle());\n\n // Calculate the turn speed\n double TurnSpeed;\n if (DegreesRemaining < 180)\n TurnSpeed = -MinTurnSpeed + -((MaxTurnSpeed - MinTurnSpeed) * Math.min(DegreesRemaining / AccelAngle, 1));\n else\n TurnSpeed = MinTurnSpeed + ((MaxTurnSpeed - MinTurnSpeed) * Math.min((360 - DegreesRemaining) / AccelAngle, 1));\n\n // Apply the new motor speeds\n backleft.setPower(TurnSpeed);\n backright.setPower(TurnSpeed);\n frontleft.setPower(TurnSpeed);\n frontright.setPower(TurnSpeed);\n\n if(Math.abs(DegreesRemaining) < 1)\n break;\n }\n\n // Stop the motors\n frontright.setPower(0);\n frontleft.setPower(0);\n backright.setPower(0);\n backleft.setPower(0);\n }",
"public void right90 () {\n saveHeading = 0; //modernRoboticsI2cGyro.getHeading();\n gyroTurn(TURN_SPEED, saveHeading - 90);\n gyroHold(HOLD_SPEED, saveHeading - 90, 0.5);\n }",
"private void turnClockwise(){\n\t\tswitch(this.facingDirection){\n\t\tcase NORTH:\n\t\t\tfacingDirection = Direction.EAST;\n\t\t\tbreak;\n\t\tcase SOUTH:\n\t\t\tfacingDirection = Direction.WEST;\n\t\t\tbreak;\n\t\tcase WEST:\n\t\t\tfacingDirection = Direction.NORTH;\n\t\t\tbreak;\n\t\tcase EAST:\n\t\t\tfacingDirection = Direction.SOUTH;\n\t\t}\n\t}",
"public void turn() {\n rightMotor.resetTachoCount();\n rightMotor.setSpeed(DEFAULT_TURN_SPEED);\n leftMotor.setSpeed(DEFAULT_TURN_SPEED);\n rightMotor.forward();\n leftMotor.backward();\n\n }",
"public void turn(int degree) {\n rightMotor.setSpeed(DEFAULT_TURN_SPEED);\n leftMotor.setSpeed(DEFAULT_TURN_SPEED);\n rightMotor.rotate((int) Math.round(TURN_RATIO * degree), true);\n leftMotor.rotate((int) Math.round(-TURN_RATIO * degree), true);\n }",
"public void turn()\n {\n turn(90);\n }",
"private void robotMovement()\n {\n\n /* If it will be rotating, don't drive */\n if (!joystick.rightShouldMove()) {\n\n if (joystick.leftShouldMove()) {\n\n /* Derive movement values from gamepad */\n Joystick.Direction direction = joystick.getLeftDirection();\n double power = joystick.getLeftPower();\n\n int[] modifier;\n\n if (direction == Joystick.Direction.UP) {\n modifier = modUP;\n } else if (direction == Joystick.Direction.DOWN) {\n modifier = modDOWN;\n } else if (direction == Joystick.Direction.RIGHT) {\n modifier = modRIGHT;\n } else {\n modifier = modLEFT;\n }\n\n motorLeftFront.setPower(modifier[0] * ((power * 0.8) + (0.01 * frontInc)));\n motorRightFront.setPower(modifier[1] * ((power * 0.8) + (0.01 * frontInc)));\n motorLeftBack.setPower(modifier[2] * ((power * 0.8) + (0.01 * backInc)));\n motorRightBack.setPower(modifier[3] * ((power * 0.8) + (0.01 * backInc)));\n\n } else {\n setMotorPowerToZero();\n }\n\n } else {\n\n /* Rotation modifiers for sides of bot */\n Joystick.Direction d = joystick.getRightDirection();\n double power = joystick.getRightPower();\n boolean left = d == Joystick.Direction.LEFT;\n double sideMod = left ? 1 : -1;\n\n /* Set motor power */\n motorLeftFront.setPower(sideMod * power);\n motorLeftBack.setPower(sideMod * power);\n motorRightFront.setPower(sideMod * power);\n motorRightBack.setPower(sideMod * power);\n\n }\n\n }",
"public static void turnByDegree(double degree) {\n LEFT_MOTOR.rotate(convertAngle(WHEEL_RAD, TRACK, degree), true);\n RIGHT_MOTOR.rotate(-convertAngle(WHEEL_RAD, TRACK, degree), false);\n }",
"public final void GyroTurn (int degrees, double power)\n {\n //Define gyro angle\n float GyroAngle = robot.Gyro.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES).firstAngle;\n\n //While the gyro is reading degrees that is not the desired, turn right or left\n while (GyroAngle != degrees)\n {\n //\n robot.DriveLeftBack.setPower(-.1);\n robot.DriveRightBack.setPower(.1);\n robot.DriveRightFront.setPower(.1);\n robot.DriveLeftFront.setPower(-.1);\n\n //Update gyro angle\n GyroAngle = robot.Gyro.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES).firstAngle;\n }\n\n //Stop\n Stop();\n }",
"public static void waltz() {\n //test code written by bokun: self rotation\n leftMotor.setSpeed(ROTATE_SPEED);\n rightMotor.setSpeed(ROTATE_SPEED);\n leftMotor.forward();\n rightMotor.backward();\n }",
"private void turnToDesiredDirection() {\n\n\t\tdouble dir = sens.getDirection();\n\n\t\tif (dir < desiredDirection) {\n\t\t\tif (Math.abs(dir - desiredDirection) < 180) {\n\t\t\t\tdir += TURNSPEED;\n\t\t\t} else {\n\t\t\t\tdir -= TURNSPEED;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Math.abs(dir - desiredDirection) < 180) {\n\t\t\t\tdir -= TURNSPEED;\n\t\t\t} else {\n\t\t\t\tdir += TURNSPEED;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsens.setDirection(dir);\n\t\t\n\t}",
"public void gyroTurn(int degrees, double power) throws InterruptedException{\n //restart angle tracking\n resetAngle();\n\n if(degrees < 0){\n turnClockwise(power);\n }else if(degrees > 0){\n turnCounterClockwise(power);\n }else{\n return;\n }\n\n //Rotate until current angle is equal to the target angle\n if (degrees < 0){\n while (opMode.opModeIsActive() && getAngle() > degrees){\n composeAngleTelemetry();\n //display the target angle\n telemetry.addData(\"Target angle\", degrees);\n telemetry.update();\n }\n }else{\n while (opMode.opModeIsActive() && getAngle() < degrees) {\n composeAngleTelemetry();\n //display the target angle\n telemetry.addData(\"Target angle\", degrees);\n telemetry.update();\n }\n }\n\n completeStop();\n //Wait .5 seconds to ensure robot is stopped before continuing\n Thread.sleep(500);\n resetAngle();\n }",
"private void turnLeft() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.NORTH;\n break;\n case WEST:\n direction = Position.Direction.SOUTH;\n break;\n case NORTH:\n direction = Position.Direction.WEST;\n break;\n case SOUTH:\n direction = Position.Direction.EAST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }",
"public void turnCW() {\n turn(true);\n }",
"@Override\n protected void initialize() {\n\n /* System clock starts */\n baseTime = System.currentTimeMillis();\n /* Determines time that robot has to timeout after */\n thresholdTime = baseTime + duration;\n\n /* Convert the starting angle */\n if (Robot.drivetrain.getGyroYaw() < 0.0f) {\n /* Negative turn to 180-360 */\n startingAngle = Robot.drivetrain.getGyroYaw() + 360.0f;\n } else {\n /* Positives stay 0-180 */\n startingAngle = Robot.drivetrain.getGyroYaw();\n }\n\n /* The total angle needed to turn */\n totalAngleTurn = startingAngle + inputAngle;\n\n /* Declare the turning direction of special cases when the angle passes over 0 or 360 */\n if (totalAngleTurn < 0.0f) { \n /* If the angle is negative, convert it */\n totalAngleTurn += 360.0f;\n /* Trigger special case */\n specialCase = true;\n /* Trigger counterclockwise */\n clockwise = false;\n }\n if (totalAngleTurn > 360.0f) {\n /* If the angle is above 360, subtract 360 */\n totalAngleTurn -= 360.0f;\n /* Trigger special case */\n specialCase = true;\n /* Trigger clockwise */\n clockwise = true;\n }\n /* Only run if the special cases do not already declare a turning direction */\n if (!specialCase) {\n /* If the input angle is bigger, turn clockwise */\n if (totalAngleTurn > startingAngle) {\n clockwise = true;\n }\n /* If the input angle is smaller, turn counterclockwise */\n if (totalAngleTurn < startingAngle) {\n clockwise = false;\n }\n }\n }",
"private void turnRight() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.SOUTH;\n break;\n case WEST:\n direction = Position.Direction.NORTH;\n break;\n case NORTH:\n direction = Position.Direction.EAST;\n break;\n case SOUTH:\n direction = Position.Direction.WEST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }",
"public void turnLeft()\r\n\t{\r\n\t\t\r\n\t\theading -= 2; //JW\r\n\t\t//Following the camera:\r\n\t\t\t//heading -= Math.sin(Math.toRadians(15))*distance; \r\n\t\t\t//heading -= Math.cos(Math.toRadians(15))*distance;\r\n\t}",
"private void rotateRight() {\n robot.leftBack.setPower(TURN_POWER);\n robot.leftFront.setPower(TURN_POWER);\n robot.rightBack.setPower(-TURN_POWER);\n robot.rightFront.setPower(-TURN_POWER);\n }",
"@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}",
"private void rotateLeft() {\n robot.leftBack.setPower(-TURN_POWER);\n robot.leftFront.setPower(-TURN_POWER);\n robot.rightBack.setPower(TURN_POWER);\n robot.rightFront.setPower(TURN_POWER);\n }",
"private void turnAround() {\r\n this.setCurrentDirection(-getCurrentDirection());\r\n }",
"public double turn (double degrees) {\n setHeading(getHeading() + degrees);\n return Math.abs(degrees);\n }",
"public void turnLeft() {\n\t\tthis.setSteeringDirection(getSteeringDirection()-5);\n\t\t}",
"public void changeDirOnGear(IRobot robot) {\n String objectName = getObjectNameOnPos(tiledMap, robot.getPos());\n if (\"Counter_Clockwise\".equals(objectName)) {\n robot.rotateCounterClockwise();\n } else if (\"Clockwise\".equals(objectName)) {\n robot.rotateClockwise();\n }\n }",
"private void turnClockwise() {\n\t\torientation = TurnAlgorithmExecutor.getAlgorithmFromCondition(orientation).execute(orientation);\n\t}",
"public void execute(Robot robot)\r\n\t{\r\n\t\tif(this.getDirection() == Direction.CLOCKWISE)\r\n\t\t{\r\n\t\t\trobot.turnClockwise();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\trobot.turnCounterClockwise();\r\n\t\t}\r\n\t}",
"private void moveClawDown() {\n\t\tMotor.A.setSpeed(45);\n\t\tMotor.A.rotate(-90);\n\t}",
"public void turnRight() {\n\t\tthis.setSteeringDirection(getSteeringDirection()+5);\n\t}",
"private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}",
"public void turnClockWise90(){\n int tmp = this.front;\n this.front = this.right;\n this.right = this.back;\n this.back = this.left;\n this.left = tmp;\n }",
"void turnTo(double theta){\n\t\tdouble currT = odometer.getTheta();\n\t\tdouble deltaT = theta-currT;\n\t\t//makes sure smallest angle\n\t\tif(deltaT>180){\n\t\t\tdeltaT=deltaT-360;\n\t\t}\n\t\telse if(deltaT <-180){\n\t\t\tdeltaT= deltaT+360;\n\t\t}\n\t\t// set motors here \n\t\tleftMotor.setSpeed(LocalizationLab.ROTATE_SPEED);\n\t\trightMotor.setSpeed(LocalizationLab.ROTATE_SPEED);\n\t\tleftMotor.rotate(convertAngle(LocalizationLab.WHEEL_RADIUS, LocalizationLab.TRACK, deltaT), true);\n\t\trightMotor.rotate(-convertAngle(LocalizationLab.WHEEL_RADIUS, LocalizationLab.TRACK, deltaT), false);\n\n\t}",
"public void turnRight()\r\n\t{\r\n\t\theading += 2; //JW\r\n\t\t//Following the camera\r\n\t\t//heading += Math.sin(Math.toRadians(15)); \r\n\t\t//heading += Math.cos(Math.toRadians(15));\r\n\t}",
"public void turnLeft() {\r\n setDirection( modulo( myDirection-1, 4 ) );\r\n }",
"@Override\n protected void execute() {\n /*\n * Keep the angle read from the gyro constantly converted as long as currentAngle is \n * referenced compared to always reading raw values from the getGyroYaw.\n */\n if (Robot.drivetrain.getGyroYaw() < 0.0f) {\n currentAngle = Robot.drivetrain.getGyroYaw() + 360.0f;\n } else {\n currentAngle = Robot.drivetrain.getGyroYaw();\n\n }\n if (!clockwise) {\n /* Counterclockwise turning */\n Robot.drivetrain.arcadeDrive(speedY, -speedZ);\n } else if (clockwise) {\n /* Clockwise turning */\n Robot.drivetrain.arcadeDrive(speedY, speedZ);\n }\n }",
"private void driveLeft() {\n setSpeed(MIN_SPEED, MAX_SPEED);\n }",
"public void RotateRight(double speed, int distance) {\n // Reset Encoders\n robot2.DriveRightFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n sleep(500);\n\n robot2.DriveRightFront.setTargetPosition(0);\n robot2.DriveRightRear.setTargetPosition(0);\n robot2.DriveLeftFront.setTargetPosition(0);\n robot2.DriveLeftRear.setTargetPosition(0);\n\n // Set RUN_TO_POSITION\n\n robot2.DriveRightFront.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // Set Motor Power to 0\n robot2.DriveRightFront.setPower(0);\n robot2.DriveRightRear.setPower(0);\n robot2.DriveLeftFront.setPower(0);\n robot2.DriveLeftRear.setPower(0);\n\n\n double InchesMoving = (distance * COUNTS_PER_INCH);\n\n // Set Target to RotateRight\n robot2.DriveRightFront.setTargetPosition((int) -InchesMoving);\n robot2.DriveRightRear.setTargetPosition((int) -InchesMoving);\n robot2.DriveLeftRear.setTargetPosition((int) InchesMoving);\n robot2.DriveLeftFront.setTargetPosition((int) InchesMoving);\n\n while (robot2.DriveRightFront.isBusy() && robot2.DriveRightRear.isBusy() && robot2.DriveLeftRear.isBusy() && robot2.DriveLeftFront.isBusy()) {\n\n // wait for robot to move to RUN_TO_POSITION setting\n\n double MoveSpeed = speed;\n\n // Set Motor Power\n robot2.DriveRightFront.setPower(MoveSpeed);\n robot2.DriveRightRear.setPower(MoveSpeed);\n robot2.DriveLeftFront.setPower(MoveSpeed);\n robot2.DriveLeftRear.setPower(MoveSpeed);\n\n } // THis brace close out the while Loop\n\n //Reset Encoders\n robot2.DriveRightFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n\n\n robot2.DriveRightFront.setPower(0);\n robot2.DriveRightRear.setPower(0);\n robot2.DriveLeftFront.setPower(0);\n robot2.DriveLeftRear.setPower(0);\n }",
"public void steady(){\n if(steady){\n if(!bellySwitch.get()) {\n leftMotor.set(-.3);\n rightMotor.set(-.3);\n }else {\n leftMotor.set(0);\n rightMotor.set(0);\n } \n }\n }",
"void turn(float degrees) {\n _rotVector.rotate(radians(degrees));\n }",
"public void changeDirection()\n {\n if(goLeft){\n goLeft = false;\n }else{\n goLeft = true;\n }\n }",
"public void turnTo(double theta){//takes theta in degrees\r\n\t\t\t//set the motor speeds to the rotate speed\r\n\t\t\tleftMotor.setSpeed(ROTATE_SPEED);\r\n\t\t\trightMotor.setSpeed(ROTATE_SPEED);\r\n\r\n\t\t\t//makes the left wheel rotate forward theta\r\n\t\t\t//and the right wheel rotate backwards theta\r\n\t\t\tleftMotor.rotate(convertAngle(wheelRadius, wheelBase, theta), true);\r\n\t\t\trightMotor.rotate(-convertAngle(wheelRadius, wheelBase, theta), false);\r\n\t\t\t\r\n\t\t}",
"public void degrees() throws InterruptedException{\n\n\t\tif(keyPressed){\n\t\t\twhile(deg < 90){\n\t\t\t\tdeg += 15;\n\t\t\t\tSystem.out.println(\"Rotating UP \" + opcode);\n\t\t\t}\n\t\t}\n\t\telse if(!keyPressed){\n\t\t\twhile(deg > 0){\n\t\t\t\tdeg -= 15;\n\t\t\t\tSystem.out.println(\"Rotating Down \" + opcode);\n\t\t\t}\n\t\t}\n\t}",
"private void rotateToRisingEdge(boolean counterClockwise) {\n\t\tlastDistance = OUT_WALL_DISTANCE;\n\t\t//rotate until facing the wall\n\t\twhile(getDistanceData() > WALL_DIS+WIDTH) {\n\t\t\tnav.rotate(counterClockwise);\n\t\t}\n\t\tSound.beep();\n\t\t//then rotate the robot to find a rising edge\n\t\twhile(getDistanceData() < WALL_DIS + WIDTH) {\n\t\t\tnav.rotate(counterClockwise);\n\n\t\t}\n\t}",
"public void operatorDrive() {\n\n changeMode();\n checkForGearShift();\n\n if (Robot.rightJoystick.getRawButton(1)) {\n currentMode = DriveMode.AUTO;\n\n } else if (Robot.rightJoystick.getRawButton(2)) {\n currentMode = DriveMode.CLIMB;\n } else {\n currentMode = DEFAULT_MODE;\n }\n\n isDeploying = false;\n\n if (currentMode == DriveMode.AUTO) {\n currentMode_s = \"Auto\";\n } else if (currentMode == DriveMode.ARCADE) {\n currentMode_s = \"Arcade\";\n } else {\n currentMode_s = \"Tank\";\n }\n\n double leftY = 0;\n double rightY = 0;\n\n switch (currentMode) {\n\n case AUTO:\n rotateCam(4, Robot.visionTargetInfo.visionPixelX);\n\n // driveFwd(4, .25);\n\n break;\n\n case CLIMB:\n\n climb();\n\n break;\n\n case ARCADE:\n resetAuto();\n double linear = 0;\n double turn = 0;\n\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n linear = -Robot.rightJoystick.getY();\n }\n if (Math.abs(Robot.leftJoystick.getX()) > deadband) {\n turn = Math.pow(Robot.leftJoystick.getX(), 3);\n }\n\n leftY = -linear - turn;\n rightY = linear - turn;\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n\n break;\n\n case TANK:\n\n resetAuto();\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n rightY = -Math.pow(Robot.rightJoystick.getY(), 3 / 2);\n }\n if (Math.abs(Robot.leftJoystick.getY()) > deadband) {\n leftY = Math.pow(Robot.leftJoystick.getY(), 3 / 2);\n }\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n break;\n\n default:\n break;\n }\n\n updateTelemetry();\n }",
"public void rotate180 (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(180f).setDuration(50); //turn toy robot AROUND (180')\n\n rotateRight += 2; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public void turnAbsolute(int target)\n {\n int heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n double turnSpeed = 0.15;\n\n while (Math.abs(heading - target) > 45)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.5, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.5, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n while (Math.abs(heading - target) > 10)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.1, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.1, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n while (Math.abs(heading - target) > 5)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.01, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.01, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n stop();\n }",
"public void rotateTo(double angle) {\n\t\t\n\t\tangleCache = angle;\n\t\tupdateGyro();\n\t\t\n\t\t//int goTo = angleCache; //lazy programming at its finest lmao //okay yeah no I'm fixing this\n\t\t//clockwise degrees to goTo angle\n\t\tdouble ccw = (angleCache - angleToForward < 0) ? (angleCache - angleToForward + 360) : (angleCache - angleToForward);\n\t\t\n\t\t//counter-clockwise degrees to goTo angle\n\t\tdouble cw = (angleToForward - angleCache < 0) ? (angleToForward - angleCache + 360) : (angleToForward - angleCache);\n\t\t\n\t\t//rotates the fastest way until within +- 5 of goTo angle\n\t\t\n\t\tif (angleCache >= angleToForward + 5 || angleCache <= angleToForward - 5) { //TODO Breaks when any button is pressed (continues spinning indefinitely)\n\t\t\tupdateGyro();\n\t\t\tif (cw <= ccw) {\n\t\t\t\tupdateGyro();\n\t\t\t\tmotorRB.set(-0.25);\n\t\t\t\tmotorRF.set(-0.25);\n\t\t\t\tmotorLB.set(-0.25);\n\t\t\t\tmotorLF.set(-0.25);\n\t\t\t} else {\n\t\t\t\tupdateGyro();\n\t\t\t\tmotorRB.set(0.25);\n\t\t\t\tmotorRF.set(0.25);\n\t\t\t\tmotorLB.set(0.25);\n\t\t\t\tmotorLF.set(0.25);\n\t\t\t}\n\t\t\tupdateGyro();\n\t\t}\n\t\t\n\t}",
"private void rotateToFallingEdge(boolean counterClockwise) {\n\t\t//the robot will facing the wall at the beginning, so rotate until\n\t\t//its not facing a wall\n\t\twhile(getDistanceData() < WALL_DIS + WIDTH) {\n\t\t\tnav.rotate(counterClockwise);\n\t\t}\n\t\tSound.beep();\n\t\t//then rotate the robot to falling a rising edge (facing the wall)\n\t\twhile(getDistanceData() > WALL_DIS+WIDTH) {\n\t\t\tnav.rotate(counterClockwise);\n\t\t}\n\t}",
"public void arcadeDrive() {\n\t\tif (fastBool) {\n\t\t\tmotorRB.set((joystickLYAxis + joystickLXAxis/2));\n\t\t\tmotorRF.set((joystickLYAxis + joystickLXAxis/2));\n\t\t\tmotorLB.set(-(joystickLYAxis - joystickLXAxis/2));\n\t\t\tmotorLF.set(-(joystickLYAxis - joystickLXAxis/2));\n\t\t} else {\n\t\t\tmotorRB.set((joystickLYAxis + joystickLXAxis/2)/2);\n\t\t\tmotorRF.set((joystickLYAxis + joystickLXAxis/2)/2);\n\t\t\tmotorLB.set(-(joystickLYAxis - joystickLXAxis/2)/2);\n\t\t\tmotorLF.set(-(joystickLYAxis - joystickLXAxis/2)/2);\n\t\t}\n\t}",
"private void driveRight() {\n setSpeed(MAX_SPEED, MIN_SPEED);\n }",
"private void moveClawUp() {\n\t\tMotor.A.setSpeed(45);\n\t\tMotor.A.rotate(90);\n\t\t\n\t}",
"void turn(double angle) {\n double absoluteAngle = angle * 0.05;\n\n drive(TURN_SPEED, angle, -angle, 0);\n\n }",
"public static void wheelRadCheck() {\n\t\t// reset the motor\n\t\tfor (EV3LargeRegulatedMotor motor : new EV3LargeRegulatedMotor[] { leftMotor, rightMotor }) {\n\t\t\tmotor.stop();\n\t\t\tmotor.setAcceleration(2000);\n\t\t}\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// There is nothing to be done here\n\t\t}\n\t\t//move the robot forward until the Y asis is detected\n\t\tleftMotor.setSpeed(200);\n\t\trightMotor.setSpeed(200);\n\t\tleftMotor.rotate(Navigation_Test.convertDistance(Project_Test.WHEEL_RAD, 2*Project_Test.TILE_SIZE), true);\n\t\trightMotor.rotate(Navigation_Test.convertDistance(Project_Test.WHEEL_RAD, 2*Project_Test.TILE_SIZE), false);\n\t}",
"public static void turnLeft() {\n LEFT_MOTOR.backward();\n RIGHT_MOTOR.forward();\n }",
"private void turn(double speed, int time, DcMotorSimple.Direction direction) {\n leftDrive.setDirection(direction.inverted());\n rightDrive.setDirection(direction.inverted());\n leftDrive.setPower(speed);\n rightDrive.setPower(speed);\n sleep(time);\n leftDrive.setPower(0.0);\n rightDrive.setPower(0.0);\n }",
"public void move(boolean up, boolean down, boolean left, boolean right){\t\n\t\tif (up) {\n\t\t\tframesAccelerated++;\n\t\t\tspeed -= ACCELERATION;\n\t\t\tif (speed < MAX_SPEED)\n\t\t\t\tspeed = MAX_SPEED;\n\t\t} else {\n\t\t\tframesAccelerated = 0;\n\t\t}\n\t\tif (down) {\n\t\t\tspeed += BACKING_ACCELERATION;\n\t\t\tif (speed > MAX_BACKING_SPEED)\n\t\t\t\tspeed = MAX_BACKING_SPEED;\n\t\t}\n\t\t// Simulate turning the driving wheel by adding \"acceleration\" to\n\t\t// turning speed. We use ints for this since integer math is exact.\n\t\tif ((left && speed < 0) || (speed > 0 && right)) {\n\t\t\tturningFrame ++;\n\t\t\tif (turningFrame > FRAMES_FOR_TURNING){\n\t\t\t\tturningFrame = FRAMES_FOR_TURNING;\n\t\t\t}\n\t\t}\n\t\tif ((right && speed < 0) || (speed > 0 && left)) {\n\t\t\tturningFrame --;\n\t\t\tif (turningFrame < -FRAMES_FOR_TURNING) {\n\t\t\t\tturningFrame = -FRAMES_FOR_TURNING;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Math.abs(turningFrame) == FRAMES_FOR_TURNING) {\n\t\t\tframesAtMaxTurning++;\n\t\t} else framesAtMaxTurning = 0;\n\t\t\n\t\t// Turn the wheels back if not turning.\n\t\tif (!left && !right) {\n\t\t\tif (turningFrame > 0) turningFrame --;\n\t\t\telse if (turningFrame < 0) turningFrame++;\n\t\t}\n\t\t\n\t\t// Slow down if not accelerating or reversing.\n\t\tif (!up && !down) {\n\t\t\tspeed *= FRICTION;\n\t\t}\n\t\t// Break\n\t\tif (speed > 0 && up) {\n\t\t\tspeed *= BACK_BREAK_FRICTION;\n\t\t} else if (speed < 0 && down) {\n\t\t\tspeed *= BREAK_FRICTION;\n\t\t}\n\t\t\n\t\t// Lower max turning speed if velocity is low.\n\t\tdouble maxTurnSpeed = vel.len2() / 0.01 * TURN_SPEED;\n\t\tif (maxTurnSpeed > TURN_SPEED)\n\t\t\tmaxTurnSpeed = TURN_SPEED;\n\t\tdouble angleChange = ((float)turningFrame / FRAMES_FOR_TURNING) * maxTurnSpeed;\n\t\t\n\t\t\n\t\t// Calculate front and back wheel positions.\n\t\tVector2 fWheel = temp;\n\t\tVector2 bWheel = temp2;\n\t\tfWheel.set((float)Math.cos(angle), (float)Math.sin(angle)).scl(WHEEL_DIST/2).add(pos);\n\t\tbWheel.set((float)Math.cos(angle), (float)Math.sin(angle)).scl(-WHEEL_DIST/2).add(pos);\n\t\t\n\t\t// Move the wheels forward in the car's direction. angleChange is added\n\t\t// to the front wheels since they are doing the turning.\n\t\tbWheel.add((float)Math.cos(angle)*speed, (float)Math.sin(angle)*speed);\n\t\tfWheel.add((float)Math.cos(angle+angleChange)*speed, (float)Math.sin(angle+angleChange)*speed);\n\t\t\n\t\tangle -= angleChange;\n\t\t\n\t\t// Scale down the velocity from previous frame.\n\t\tvel.scl(0.95f);\n\t\tif (vel.len2() > MAX_VEL) {\n\t\t\tvel.setLength2(MAX_VEL);\n\t\t}\n\t\t\n\t\t// Add this frames movement to the velocity.\n\t\tif (!locked) {\n\t\t\tvel.add(fWheel.add(bWheel).scl(0.5f).sub(pos));\n\t\t}\n\t\t\n\t\t// Add velocity to car and update position\n\t\toldPos.set(pos);\n\t\tpos.add(vel);\n\t\tcar.setPosition(pos.x, posAboveGround, pos.y);\n\t\t\n\t\ttestForWallCollision();\n\t}",
"public void act() \n {\n move(-2);\n if(isAtEdge())\n {\n turn(180);\n getImage().mirrorVertically();\n }\n }",
"public void turnCCW() {\n turn(false);\n }",
"public void tankDrive() {\n\t\tif (fastBool) {\n\t\t\tmotorRB.set(joystickRYAxis);\n\t\t\tmotorRF.set(joystickRYAxis);\n\t\t\tmotorLB.set(-joystickLYAxis);\n\t\t\tmotorLF.set(-joystickLYAxis);\n\n\t\t} else {\n\t\t\tmotorRB.set(joystickRYAxis/2);\n\t\t\tmotorRF.set(joystickRYAxis/2);\n\t\t\tmotorLB.set(-joystickLYAxis/2);\n\t\t\tmotorLF.set(-joystickLYAxis/2);\n\t\t\t//System.out.println(strongBad.motorMultiplier);\n\t\t\t//SmartDashboard.putNumber(\"MM2\", strongBad.motorMultiplier);\n\n\t\t}\n\t}",
"public void gyroDrive ( double speed,\n double distance,\n double angle) {\n\n\n // Ensure that the opmode is still activ\n\n // Determine new target position, and pass to motor controller\n moveCounts = (int)(distance * COUNTS_PER_INCH);\n newLeftTarget = leftmotor.getCurrentPosition() + moveCounts;\n newRightTarget = rightmotor.getCurrentPosition() + moveCounts;\n\n // Set Target and Turn On RUN_TO_POSITION\n leftmotor.setTargetPosition(newLeftTarget);\n rightmotor.setTargetPosition(newRightTarget);\n\n leftmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n rightmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // start motion.\n speed = Range.clip(Math.abs(speed), 0.0, 1.0);\n\n maxSpeed = speed;\n speed = INCREMENT;\n rampUp = true;\n\n leftmotor.setPower(speed);\n rightmotor.setPower(speed);\n\n // keep looping while we are still active, and BOTH motors are running.\n while ((leftmotor.isBusy() && rightmotor.isBusy())) {\n if (rampUp){\n speed += INCREMENT ;\n if (speed >= maxSpeed ) {\n speed = maxSpeed;\n }\n }\n\n // adjust relative speed based on heading error.\n error = getError(angle);\n steer = getSteer(error, P_DRIVE_COEFF);\n\n // if driving in reverse, the motor correction also needs to be reversed\n if (distance < 0)\n steer *= -1.0;\n\n leftSpeed = speed - steer;\n rightSpeed = speed + steer;\n\n // Normalize speeds if either one exceeds +/- 1.0;\n max = Math.max(Math.abs(leftSpeed), Math.abs(rightSpeed));\n if (max > 1.0)\n {\n leftSpeed /= max;\n rightSpeed /= max;\n }\n\n leftmotor.setPower(leftSpeed);\n rightmotor.setPower(rightSpeed);\n }\n\n // Stop all motion;\n leftmotor.setPower(0);\n rightmotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n leftmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n gyroHold(TURN_SPEED,angle,0.166);\n\n }",
"private void updateDesiredDirection() {\n\t\t/* http://www.cs.mcgill.ca/~hsafad/robotics/, accessed 28/02/16 */\n\n\t\t// First, set all seen bots' charge to -VE, all on LEDs to +VE, all off LEDs to 0.0D\n\t\tpopulateCharges();\n\t\t\n\t\t// VARIABLES\n\t\tdouble dirX = 0.0D; // relative dirX and dirY that the bot will need to face\n\t\tdouble dirY = 0.0D; \n\t\tdouble dx = 0.0D;\t// used to calculate each push/pull force, added to dirX, dirY\n\t\tdouble dy = 0.0D;\n\t\tdouble targetCharge = 0.0D;\t// charge of current target bot / led\n\t\tdouble minS = 50;\n\t\tdouble distSq = 0.0D;\t// distance^2 to bot/led\n\t\tdouble safety = 0.0D;\n\t\tdouble norm = 0.0D;\n\t\t\n\t\tfor (int i = 0; i < seenCharges.size(); i++) {\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// now, update direction depending on charges\n\t\t\t\tif (seenCharges.get(i) instanceof Bot) {\n\t\t\t\t\t\t\n\t\t\t\t\ttargetCharge = ((Bot) seenCharges.get(i)).getCharge();\n\t\t\t\t\tdistSq = sens.getDistanceTo((Bot) seenCharges.get(i));\n\t\t\t\t\tdistSq = distSq * distSq;\n\t\t\t\t\t\n\t\t\t\t\t// calculated forces\n\t\t\t\t\tdx = targetCharge * (((Bot) seenCharges.get(i)).getX() - this.getX()) / distSq;\n\t\t\t\t\tdy = targetCharge * (((Bot) seenCharges.get(i)).getY() - this.getY()) / distSq;\n\n\t\t\t\t\t// add calculated forces to overall direction so far\n\t\t\t\t\tdirX += dx;\n\t\t\t\t\tdirY += dy;\n\t\t\t\t\t\n\t\t\t\t\tsafety = distSq / ((dx*dirX + dy*dirY));\n\t\t\t\t\tif ((safety > 0) && (safety < minS)) { minS = safety; }\n\t\t\t\t\t\t\n\t\t\t\t} else if ((seenCharges.get(i) instanceof LED)) {\n\t\t\t\t\n\t\t\t\t\ttargetCharge = ((LED) seenCharges.get(i)).getCharge();\n\t\t\t\t\t\n\t\t\t\t\tif (targetCharge != 0.0D) { \n\t\t\t\t\t\t\n\t\t\t\t\t\tdistSq = sens.getDistanceTo((LED) seenCharges.get(i));\n\t\t\t\t\t\tdistSq = distSq * distSq;\n\n\t\t\t\t\t\t// calculated forces\n\t\t\t\t\t\tdx = targetCharge * (((LED) seenCharges.get(i)).getTargetX() - this.getX()) / distSq;\n\t\t\t\t\t\tdy = targetCharge * (((LED) seenCharges.get(i)).getTargetY() - this.getY()) / distSq;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// add calculated forces to overall direction so far\n\t\t\t\t\t\tdirX += dx;\n\t\t\t\t\t\tdirY += dy;\n\t\t\t\t\t\t\n\t\t\t\t\t\tsafety = distSq / ((dx*dirX + dy*dirY));\n\t\t\t\t\t\tif ((safety > 0) && (safety < minS)) { minS = safety; }\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (minS < 5) {\n\t\t\t\t\t\t\ttargetCharge *= minS/5;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\tif (minS > 50) {\n\t\t\t\t\t\t\ttargetCharge *= minS/50;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"ERROR: unknown seenCharges item \"+i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// calculate vector normal, apply to dirX, dirY\n\t\tnorm = Math.sqrt(dirX*dirX + dirY*dirY);\n\t\tdirX = dirX / norm;\n\t\tdirY = dirY / norm;\n\t\t\n\t\t// set desired direction if it calculates a number\n\t\tif (dirX == (double) dirX && dirY == (double) dirY) {\n\t\t\tthis.setDesiredDirection(sens.getDirectionTo(dirX + sens.getXPos(), dirY + sens.getYPos()));\n\t\t}\n\t}",
"public void execute() {\n RobotContainer.drive.turnToAngle(this.angle, turnSpeed);\n }",
"public Direction rotate90() {\n return values()[r90index];\n }",
"public Direction rotate90(Node node) {\n node.setRotate(values()[r90index].getDegree());\n return values()[r90index];\n }",
"void GoDir( double power, double theta_degrees ){\n \n double gain = 0.1; // torque power per degree angle\n \n double theta_radians = Math.toRadians(theta_degrees);\n double Fx = power * Math.cos( theta_radians );\n double Fy = power * Math.sin( theta_radians );\n double Tau = gain*(gTheta - getAngle());\n \n double P1 = Fx*2.0/3.0 + Tau/3.0;\n double P2 = -Fx*1.0/3.0 + 1.0/Math.sqrt(3.0)*Fy + Tau/3.0;\n double P3 = -Fx*2.0/3.0 - 1.0/Math.sqrt(3.0)*Fy + Tau/3.0;\n\n topDrive.setPower( P1 );\n leftDrive.setPower( P2 );\n rightDrive.setPower( P3 );\n }",
"public void gyroTurn ( double speed, double angle) {\n\n // keep looping while we are still active, and not on heading.\n while (opModeIsActive() && !onHeading(speed, angle, P_TURN_COEFF)) {\n // Update telemetry & Allow time for other processes to run.\n telemetry.addData(\"Direction\", gyro.getHeading());\n telemetry.update();\n }\n }",
"public void setRotation(){\n\t\t\tfb5.accStop();\n\t\t\twt.turning = true;\n\t\t\tif(state == BotMove.RIGHT_15){\n\t\t\t\tfb5.turnRightBy(6);\n\t\t\t\tangle = (angle+360-20)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.RIGHT_10){\n\t\t\t\tfb5.turnRightBy(3);\n\t\t\t\tangle = (angle+360-10)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.LEFT_5){\n\t\t\t\tfb5.turnLeftBy(2);\n\t\t\t\tangle = (angle+360+5)%360;\n\t\t\t}\n\t\t}",
"protected void rotateTo(double target) {\n robot.rightFront.setDirection(REVERSE);\n robot.rightBack.setDirection(REVERSE);\n\n while (opModeIsActive() && robot.rightFront.getDirection() != REVERSE) {\n idle();\n }\n\n if (target < 0) target += 360;\n\n double heading = get360Heading();\n while (opModeIsActive() && !withinRange(heading, target)) {\n // Run Dubberke-Richards logic\n if (Math.abs(heading - target) <= 180) {\n if (heading-target >= 0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n } else { // |heading-target| > 180\n if (heading-target<0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n }\n\n // Update heading for next loop\n heading = get360Heading();\n\n telemetry.addData(\"Heading\", heading);\n telemetry.update();\n }\n\n halt();\n }",
"private void turnBearing(int bearing) {\n int heading = gyro.getHeadingBasic();\n int cw = (bearing - heading + FULL_CIRCLE) % FULL_CIRCLE;\n int ccw = (heading - bearing + FULL_CIRCLE) % FULL_CIRCLE;\n\n // Turn the short way\n if (Math.abs(cw) <= Math.abs(ccw)) {\n turnAngle(cw);\n } else {\n turnAngle(-ccw);\n }\n }",
"public void TurnCommand() {\n\n requires(Robot.driveSubsystem);\n\n }",
"public void direction()\n {\n if(!goLeft){\n horzVelocity = 1;\n }else{\n horzVelocity = -1;\n }\n }",
"void nearingTheWallBefore(){\n robot.absgyroRotation(0, \"absolute\");\n\n //alligning with the wall before going for the toy\n while(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) > 15 && !isStopRequested()){\n if(robot.leftDistanceSensor.getDistance(DistanceUnit.CM) < 30)\n robot.mecanumMovement(0, .3, 0);\n else\n robot.mecanumMovement(0, .7, 0);\n\n telemetry.addLine(\"Distance from sensor: \" + robot.leftDistanceSensor.getDistance(DistanceUnit.CM));\n telemetry.update();\n }\n robot.mecanumMovement(0, 0, 0);\n\n robot.absgyroRotation(45, \"absolute\");\n }",
"public void moveForward()\r\n\t{\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading-90))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading-90))*distance;\r\n\t\t}\r\n\t}",
"public void operatorControl() {\n \tdouble ctrlThresh = .2; \n \tdouble minPower = .05; \n \tdouble maxPower = .75; \n \tdouble recip = (1 - ctrlThresh); \n \tdouble mult = (maxPower - minPower); \n \tdouble right; \n \tdouble strafe; \n \tdouble rotate; \n \tdouble rightAxis; \n \tdouble strafeAxis; \n \tdouble rotateAxis; \n \t// \tboolean leftLeft; \n \t// \tboolean leftRight; \n \tdouble rightDir; \n \tdouble strafeDir; \n \tdouble rotateDir; \n \tdouble rightPower; \n \tdouble rotatePower; \n \tdouble strafePower; \n \t\n \tint winchCount;\n \tboolean winchDirection;\n \n \t// \tdouble frontLeftPower; \n \t// \tdouble frontRightPower; \n \t// \tdouble backLeftPower; \n \t// \tdouble backRightPower; \n \n \t//myRobot.setSafetyEnabled(true); \n \t\n \tAccelerometer test = new BuiltInAccelerometer();\n \t\n \twhile (isOperatorControl() && isEnabled()) { \n \t\t// ACCEL TEST CODE\n// \t\tSystem.out.println(test.getX() + \", \" + test.getY() + \", \" + test.getZ());\n \t\t// END ACCEL TEST CODE\n \n \t\t// ********** BEGIN DRIVING CODE ********** \n \t\t// Code for driving using omniwheels and two wheels for strafing \n \t\t// Diagram for the wheels of the robot below. \n \n \t\t// L S R \n \t\t// /--------------------------\\ \n \t\t//\t ||------------------------|| \n \t\t// || [][] || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || || \n \t\t// || [] [] || \n \t\t// || [] [] || \n \t\t// || [][] || \n \t\t// ||------------------------|| \n \t\t// \\--------------------------/ \n \t\t// \n \t\t// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ \n \n \t\tctrlThresh = .2; // the point at which we want to sense joystick action \n \t\trecip = 1-ctrlThresh; \t\t // = 0.8 \n \n \t\trightAxis = rightStick.getRawAxis(1);\t\t\t\t// right joystick, y (up/down) axis\n \t\t\n \t\t//System.out.println(\"\"+rightAxis);\n \t\tstrafeAxis = rightStick.getRawAxis(0);\t\t\t\t// right joystick, x (left/right) axis; this is \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// arbitrary and could have been the left stick\n \t\trotateAxis = rightStick.getRawAxis(4);\t\t\t\t\t// left joystick, y axis\n \n \t\trightDir = rightAxis/Math.abs(rightAxis);\t\t\t// forward or backward (+1 or -1)\n \t\tstrafeDir = strafeAxis/Math.abs(strafeAxis); \t// \t\t\t'' \n \t\trotateDir = rotateAxis/Math.abs(rotateAxis); // \t\t\t'' \n \n \t\tright = 0; // right input formatted for range of detected values [0.2,1] \n \t\trotate = 0; // left input formatted \n \t\tstrafe = 0; // strafe input formatted \n \n \t\tif(Math.abs(rightAxis) > ctrlThresh) \t// user moved stick beyond threshold \n \t\t{right = (rightAxis-ctrlThresh*rightDir)/recip;} // format right: scale back, set direction, proportion it \n \t\tif(Math.abs(strafeAxis) > ctrlThresh) \n \t\t{strafe = (strafeAxis-ctrlThresh*strafeDir)/recip;} // format left... \n \t\tif(Math.abs(rotateAxis) > ctrlThresh) \n \t\t{rotate = (rotateAxis-ctrlThresh*rotateDir)/recip;}\t\t// format strafe... \n \n \n \t\trightDir = right/Math.abs(right); \n \t\trightPower = (Math.abs(right*mult) + minPower) * rightDir; \t\t// re-proportion for power's range, strip direction,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// and then add back threshold and direction. \n \t\trotateDir = rotate/Math.abs(rotate); \n \t\trotatePower = (Math.abs(rotate*mult) + minPower) * rotateDir;\t\t\t// \t\t'' \n \n \t\tstrafeDir = strafe/Math.abs(strafe); \n \t\tstrafePower = (Math.abs(strafe*mult) + minPower) * strafeDir;\t// \t\t'' \n \n \t\tif(Math.abs(rightPower)>0.2){\n \t\t\tfrontRight.set(rightPower);\t\t\t\t\t\t// set all the motors with the powers we \n \t\t\tbackRight.set(rightPower);\t\t\t\t\t\t/// calculated above : drive! \n \t\t\tfrontLeft.set(-1*rightPower); \n \t\t\tbackLeft.set(-1*rightPower);\n \t\t}\n \t\telse{\n \t\t\tfrontRight.set(rotatePower);\n \t\t\tbackRight.set(rotatePower);\n \t\t\tfrontLeft.set(rotatePower);\n \t\t\tbackLeft.set(rotatePower);\n \t\t}\n \t\t\n// \t\tfrontStrafe.set(strafePower); \n// \t\tbackStrafe.set(-1*strafePower); \n \n// \t\tmyRobot.tankDrive(leftStick, rightStick); \n \t\t \n \t\t// ********** END OF DRIVING CODE ********** \n \t\t//======================================================================= \n \t\t// ************ BEGIN WINCH CODE *********** \n \t\t// We need to code the winch to help raise and lower the elevator \n \t\t// This is just one option between the winch and the lead screw. \n \t\t \n \t\t\n \t\t//second winch test\n \t\t/*\n \t\twinchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n \t \tSystem.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n \t \tif(winchCount<240){\n \t \t\t\n \t \t\twinchCim1.set(.1);\n \t \t\twinchCim2.set(.1);\n \t \t}\n \t \telse{\n \t \t\twinchCim1.set(0);\n \t \t\twinchCim2.set(0);\n \t \t\t\n \t \t}\n \t if(rightStick.getRawButton(5)) \n { \n\t\t\t winchEncoder.reset();// reset the pulse count\n\t\t\t winchCount = 0;\n\t\t\t winchCim1.set(0);\n\t\t\t winchCim2.set(0);\n\t\t\t \n } */ //end of second winch test \n \t \t\n \t\t\n \t\t if(rightStick.getRawButton(5)) \n { \n \t\t\t //winchEncoder.reset();// reset the pulse count\n \tSystem.out.println(\"A\");\n \t winchCim1.set(.5); \t// set winchCim1 to 0.5 power (upwards) \n \t winchCim2.set(.5); \t\t\t\t\t\t\t// set winchCim2 to 0.5 power\n \t\t\t \n } \n \t\telse if(rightStick.getRawButton(4))\n \t\t{\n \t\t\tSystem.out.println(\"B\");\n \t\t\t//winchEncoder.reset();\t\t\t\t\t\t\t// reset the pulse count\n \t \twinchCim1.set(-.3); // set winchCim1 to -0.5 power (downwards) \n \t \twinchCim2.set(-.3);\t \t\t\t\t\t\t\t// set winchCim2 to -0.5 power\n \t\t}\n \n \t \telse// if(rightStick.getRawButton(2)) \n { \n \t winchCim1.set(0); \t\t\t\t\t\t\t// set winchCim1 to 0 power (off/stop) \n \t winchCim2.set(0);\t\t\t\t\t\t\t\t// set winchCim2 to 0 pwoer (off/stop)\n// \t winchCount = winchEncoder.get();\t\t\t\t// get the pulse count from the encoder\n// \t System.out.println(\"Count: \"+ winchCount);\t\t// print the pulse count \n } \n \n \t\t// ********** END OF WINCH CODE ********** \n \t\t//======================================================================= \n \t\t \n \t\t \n \t\tTimer.delay(0.005);\t\t// wait for a motor update time \n } \n }",
"public void rotateLeft (View view){ //onClick for LEFT Button\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(-90f).setDuration(50); //turn toy robot LEFT\n\n rotateLeft--; //counter to determine orientation\n System.out.println(\"rotateLeft \" + rotateLeft);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight)); //chk params in Logs\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public void turnRight() {\r\n setDirection( modulo( myDirection+1, 4 ) );\r\n }",
"public TurnDegrees(double speed, double degrees, Drivetrain drive) {\n super(new PIDController(0.0085, 0, 0), \n drive::getGyroAngleZ, \n degrees, \n output -> {\n double clampedOutput = MathUtil.clamp(output, -1, 1);\n if(Math.abs(clampedOutput) < 0.325 && Math.abs(clampedOutput) > 0) {\n double tempClampedOutput = clampedOutput;\n clampedOutput = Math.copySign(0.325, tempClampedOutput);\n }\n System.out.println(clampedOutput);\n drive.arcadeDrive(0, clampedOutput);\n }, \n drive);\n\n m_degrees = degrees;\n m_speed = speed;\n m_drive = drive;\n }",
"public void adjustShooterAngleManual() {\n\n // If the driver pushes the Square Button on the PS4 Controller,\n // set the worm drive motors to go backwards (lower it).\n if (PS4.getRawButton(PS4_X_BUTTON) == true) {\n\n wormDriveMotors.set(-0.2);\n\n // If the driver pushes the Triangle Button on the PS4 Controller,\n // set the worm drive motors to go forwards (raise it up).\n } else if (PS4.getRawButton(PS4_SQUARE_BUTTON) == true) {\n\n wormDriveMotors.set(0.4);\n }\n\n // If the driver is an idiot and is pressing BOTH the Square Button AND the\n // Triangle Button at the same time, OR (||) if the driver is pushing neither\n // button, set the motor speed to 0.\n else if (((PS4.getRawButton(PS4_X_BUTTON) == true) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == true))\n || ((PS4.getRawButton(PS4_X_BUTTON) == false) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == false))) {\n\n wormDriveMotors.set(0);\n }\n\n }",
"public void turnLeft ()\n\t{\n\t\t//changeFallSpeed (-1);\n\t\tturnInt = -1;\n\t}",
"public void move(){\n super.move();\n if(getX() >= Main.WIDTH - getWidth() * 1.5) {\n setDirection(-1);\n } else if(getX() <= 50) {\n setDirection(1);\n }\n }",
"private void flip()\r\n\t{\r\n\t\tif(heading == Direction.WEST)\r\n\t\t{\r\n\t\t\tsetDirection(Direction.EAST);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsetDirection(Direction.WEST);\r\n\t\t}\r\n\t}",
"@Override\n public void step(double deltaTime) {\n // wheel radius, in meters\n double wheelCircumference = 2 * simulatorConfig.driveBase.wheelRadius * Math.PI;\n\n double leftRadians = 0;\n double rightRadians = 0;\n for (SimMotor simMotor : motorStore.getSimMotorsSorted()) {\n if (simMotor.isLeftDriveMotor()) {\n leftRadians = simMotor.position / simulatorConfig.driveBase.gearRatio;\n } else if (simMotor.isRightDriveMotor()) {\n rightRadians = simMotor.position / simulatorConfig.driveBase.gearRatio;\n }\n }\n\n // invert the left side because forward motor movements mean backwards wheel movements\n rightRadians = -rightRadians;\n\n double currentLinearRadians = (leftRadians + rightRadians) / 2;\n\n double deltaRadians = currentLinearRadians - lastLinearRadians;\n double metersPerRadian = wheelCircumference / (Math.PI * 2);\n double deltaLinearPosition = deltaRadians * metersPerRadian;\n double newHeading = ((leftRadians - rightRadians) * metersPerRadian / simulatorConfig.driveBase.radius);\n\n // for next loop\n lastLinearRadians = currentLinearRadians;\n\n robotPosition.heading = newHeading + startHeading;\n\n robotPosition.velocity = deltaLinearPosition / deltaTime;\n robotPosition.x += deltaLinearPosition * Math.sin(robotPosition.heading);\n robotPosition.y += deltaLinearPosition * Math.cos(robotPosition.heading);\n\n SimNavX simNavX = SimSPI.getNavX(SPI.Port.kMXP.value);\n if (simNavX != null) {\n float degrees = (float)((robotPosition.heading - simulatorConfig.startPosition.heading) * 360 / (Math.PI * 2));\n\n // degrees are between 0 and 360\n if (degrees < 0) {\n degrees = 360 - (Math.abs(degrees) % 360);\n } else {\n degrees = degrees % 360;\n }\n simNavX.heading = degrees;\n }\n\n }",
"public static void waltz(double degree, boolean immeRet) {\n leftMotor.setSpeed(ROTATE_SPEED);\n rightMotor.setSpeed(ROTATE_SPEED);\n leftMotor.rotate((int) -convertAngle(degree), true);\n rightMotor.rotate((int) convertAngle(degree), immeRet);\n }",
"private boolean needToTurn() {\n\t\tdouble curDir = sens.getDirection();\n\t\tdouble desDirPlusAmount = desiredDirection + TURNSPEED;\n\t\tdouble desDirMinusAmount = desiredDirection - TURNSPEED;\n\n\t\t// if desired direction is <||> +_ x degrees\n\t\tif (curDir < desDirMinusAmount || curDir > desDirPlusAmount) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n public void loop() {\n\n //double armRot = robot.Pivot.getPosition();\n\n double deadzone = 0.2;\n\n double trnSpdMod = 0.5;\n\n float xValueRight = gamepad1.right_stick_x;\n float yValueLeft = -gamepad1.left_stick_y;\n\n xValueRight = Range.clip(xValueRight, -1, 1);\n yValueLeft = Range.clip(yValueLeft, -1, 1);\n\n // Pressing \"A\" opens and closes the claw\n if (gamepad1.a) {\n\n if (robot.Claw.getPosition() < 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(1);}\n else if (robot.Claw.getPosition() > 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(0.4);}\n else\n while(gamepad1.a)\n robot.Claw.setPosition(1);\n }\n\n // Pressing \"B\" changes the wrist position\n if (gamepad1.b) {\n\n if (robot.Wrist.getPosition() == 1)\n while(gamepad1.b)\n robot.Wrist.setPosition(0.5);\n else if (robot.Wrist.getPosition() == 0.5)\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n else\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n }\n\n // Turn left/right, overrides forward/back\n if (Math.abs(xValueRight) > deadzone) {\n\n robot.FL.setPower(xValueRight * trnSpdMod);\n robot.FR.setPower(-xValueRight * trnSpdMod);\n robot.BL.setPower(xValueRight * trnSpdMod);\n robot.BR.setPower(-xValueRight * trnSpdMod);\n\n\n } else {//Forward/Back On Solely Left Stick\n if (Math.abs(yValueLeft) > deadzone) {\n robot.FL.setPower(yValueLeft);\n robot.FR.setPower(yValueLeft);\n robot.BL.setPower(yValueLeft);\n robot.BR.setPower(yValueLeft);\n }\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n\n telemetry.addData(\"Drive Encoder Ticks\", robot.FL.getCurrentPosition());\n telemetry.addData(\"Winch Encoder Ticks\", robot.Winch.getCurrentPosition());\n telemetry.addData(\"ColorArm Position\", robot.ColorArm.getPosition());\n telemetry.addData(\"Wrist Position\", robot.Wrist.getPosition());\n telemetry.addData(\"Claw Position\", robot.Claw.getPosition());\n telemetry.addData(\"Grip Position\", robot.Grip.getPosition());\n telemetry.addData(\"Color Sensor Data Red\", robot.Color.red());\n telemetry.addData(\"Color Sensor Data Blue\", robot.Color.blue());\n\n /*\n\n // This is used for an Omniwheel base\n\n // Group a is Front Left and Rear Right, Group b is Front Right and Rear Left\n float a;\n float b;\n float turnPower;\n if(!gamepad1.x) {\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n\n a = Range.clip(yValueLeft + xValueLeft, -1, 1);\n b = Range.clip(yValueLeft - xValueLeft, -1, 1);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n } else {\n\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n a = Range.clip(yValueLeft + xValueLeft, -0.6f, 0.6f);\n b = Range.clip(yValueLeft - xValueLeft, -0.6f, 0.6f);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n }\n\n\n if (gamepad1.dpad_up) {\n\n robot.Swing.setPower(.6);\n\n } else if (gamepad1.dpad_down) {\n\n robot.Swing.setPower(-.6);\n\n } else {\n\n robot.Swing.setPower(0);\n }\n\n if(gamepad1.a){\n\n robot.Claw.setPosition(.4);\n\n } else if(gamepad1.b){\n\n robot.Claw.setPosition(0);\n }\n\n if(gamepad1.left_bumper) {\n\n robot.Pivot.setPosition(armRot+0.0005);\n\n } else if(gamepad1.right_bumper) {\n\n robot.Pivot.setPosition(armRot-0.0005);\n\n } else{\n\n robot.Pivot.setPosition(armRot);\n }\n\n telemetry.addData(\"position\", position);\n\n */\n\n /*\n * Code to run ONCE after the driver hits STOP\n */\n }",
"protected void initialize() {\n \tSystem.out.println(\"Running: TurnXDegrees\");\n \tstartingAngle = Robot.gyro.getRawAngleDegrees();\n \tisFin = false;\n \tsetTimeout(5);\n \tif(angleTarget < 0) {\n \t\tSystem.out.println(\"Turning Left...\");\n \t\tisTurningLeft = true;\n \t}else {\n \t\tSystem.out.println(\"Turning Right...\");\n \t\tisTurningLeft = false;\n \t}\n \t\n }",
"private void think()\n\t{\n\t\tboolean bChange=false;\n\t\tif ((mMoveY+Height)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveY+Height)>500)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)>500)\n\t\t\tbChange=true;\n\t\tif (bChange)\n\t\t{\n\t\t\t//Go in opposite direction\n\t\t\tDirection = Direction+4;\n\t\t\tif (Direction>7)\n\t\t\t\tDirection-=8;\n\t\t\tif (Direction<0)\n\t\t\t\tDirection=0;\n\t\t}\t\t\n\t}",
"public void updateAngle(){\n\t\tif (turnUp && (angle < 180) ){\n\t\t\tangle+=1;\n\t\t}\n\t\tif (turnDown && (angle > 0)){\n\t\t\tangle-=1;\n\t\t}\n\t}",
"public static void turnleftBy(double angle) {\n leftMotor.rotate(-convertAngle(angle), true);\n rightMotor.rotate(convertAngle(angle), false);\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"public void move() {\n energy -= 0.03;\n if (energy < 0) {\n energy = 0;\n }\n }",
"@Override\r\n\tpublic void move(Robot robot)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canMoveOneStep())\r\n\t\t\t{\r\n\t\t\t\trobot.moveOneStep();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This robot cannot move in its current state.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A terminated robot cannot be moved.\");\r\n\t\t}\r\n\t}",
"public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}",
"public void turnLeft(boolean endWithBrake){\r\n Motor.B.rotate(-1*DEGREES_PER_TURN, true);//Accesses Motor thread\r\n Motor.C.rotate(DEGREES_PER_TURN, true);\r\n while(Motor.B.isMoving() || Motor.C.isMoving())\r\n ;//wait for motors to be done\r\n return;\r\n }",
"public void turnClockwise(double power){\n motorFrontLeft.setPower(-power);\n motorBackLeft.setPower(-power);\n motorFrontRight.setPower(power);\n motorBackRight.setPower(power);\n }",
"public Direction getCorrectRobotDirection();",
"private boolean turnIfNeeded() {\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private static void turnRight(Robot r) \n {\n for(int i=0; i<3;i++)\n {\n r.turnLeft();\n }\n }",
"public TurnDegrees(double distance) {\n m_desiredDistance = distance; \n requires(Robot.m_drive);\n\n // Use requires() here to declare subsystem dependencies\n // eg. requires(chassis);\n }",
"public void gyroDrive ( double speed,\n double distance,\n double angle) {\n\n int newLeftTarget;\n int newRightTarget;\n int moveCounts;\n double max;\n double error;\n double steer;\n double leftSpeed;\n double rightSpeed;\n\n // Ensure that the opmode is still active\n if (opModeIsActive()) {\n\n // Determine new target position, and pass to motor controller\n moveCounts = (int)(distance * COUNTS_PER_INCH);\n newLeftTarget = robot.leftDrive.getCurrentPosition() + moveCounts;\n newRightTarget = robot.rightDrive.getCurrentPosition() + moveCounts;\n\n // Set Target and Turn On RUN_TO_POSITION\n robot.leftDrive.setTargetPosition(newLeftTarget);\n robot.rightDrive.setTargetPosition(newRightTarget);\n\n robot.leftDrive.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.rightDrive.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // start motion.\n speed = Range.clip(Math.abs(speed), 0.0, 1.0);\n robot.leftDrive.setPower(speed);\n robot.rightDrive.setPower(speed);\n\n // keep looping while we are still active, and BOTH motors are running.\n while (opModeIsActive() &&\n (robot.leftDrive.isBusy() && robot.rightDrive.isBusy())) {\n\n // adjust relative speed based on heading error.\n error = getError(angle);\n steer = getSteer(error, P_DRIVE_COEFF);\n\n // if driving in reverse, the motor correction also needs to be reversed\n if (distance < 0)\n steer *= -1.0;\n\n leftSpeed = speed - steer;\n rightSpeed = speed + steer;\n\n // Normalize speeds if either one exceeds +/- 1.0;\n max = Math.max(Math.abs(leftSpeed), Math.abs(rightSpeed));\n if (max > 1.0)\n {\n leftSpeed /= max;\n rightSpeed /= max;\n }\n\n robot.leftDrive.setPower(leftSpeed);\n robot.rightDrive.setPower(rightSpeed);\n\n // Display drive status for the driver.\n telemetry.addData(\"Err/St\", \"%5.1f/%5.1f\", error, steer);\n telemetry.addData(\"Target\", \"%7d:%7d\", newLeftTarget, newRightTarget);\n telemetry.addData(\"Actual\", \"%7d:%7d\", robot.leftDrive.getCurrentPosition(),\n robot.rightDrive.getCurrentPosition());\n telemetry.addData(\"Speed\", \"%5.2f:%5.2f\", leftSpeed, rightSpeed);\n telemetry.update();\n }\n\n // Stop all motion;\n robot.leftDrive.setPower(0);\n robot.rightDrive.setPower(0);\n\n // Turn off RUN_TO_POSITION\n robot.leftDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n robot.rightDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n }",
"public void turnSlower() {\n rightMotor.resetTachoCount();\n rightMotor.setSpeed(DEFAULT_TURN_SPEED/3);\n leftMotor.setSpeed(DEFAULT_TURN_SPEED/3);\n rightMotor.forward();\n leftMotor.backward();\n }"
] | [
"0.7076164",
"0.6813384",
"0.6598622",
"0.65792733",
"0.656475",
"0.6520244",
"0.6468118",
"0.64626807",
"0.6446807",
"0.64456993",
"0.6444081",
"0.6407107",
"0.64027494",
"0.63602793",
"0.6313372",
"0.63053244",
"0.6301109",
"0.6288971",
"0.62882835",
"0.62746",
"0.6269902",
"0.61903703",
"0.6182812",
"0.61821043",
"0.6170299",
"0.6162928",
"0.6149097",
"0.614107",
"0.61357075",
"0.61220825",
"0.6098878",
"0.6093074",
"0.6077873",
"0.6066538",
"0.60615724",
"0.6049997",
"0.6049036",
"0.6044498",
"0.6035742",
"0.6021524",
"0.60155046",
"0.5995388",
"0.59920555",
"0.59907126",
"0.59829193",
"0.5969686",
"0.596395",
"0.59449303",
"0.5934408",
"0.5917752",
"0.5917359",
"0.59141225",
"0.5913564",
"0.5886221",
"0.58768636",
"0.58622384",
"0.5857904",
"0.58569896",
"0.5855434",
"0.5848739",
"0.5835726",
"0.5832365",
"0.58295935",
"0.58241814",
"0.58235884",
"0.58126265",
"0.5799146",
"0.5775312",
"0.5774174",
"0.576042",
"0.5744126",
"0.5741608",
"0.5739072",
"0.57335657",
"0.572941",
"0.5727433",
"0.5725381",
"0.57226574",
"0.57214",
"0.5720995",
"0.57136863",
"0.5707405",
"0.5705279",
"0.56991553",
"0.5697971",
"0.5693447",
"0.5676363",
"0.5674443",
"0.5659255",
"0.5658573",
"0.56517977",
"0.5638168",
"0.5637547",
"0.5637072",
"0.5634714",
"0.56318605",
"0.5631839",
"0.5624728",
"0.5621488",
"0.5618661"
] | 0.69383925 | 1 |
Make robot pick up battery (if possible). | @Override
public void pickUpBattery(Robot robot, Battery battery)
{
try
{
if(robot.canPickUp(battery))
{
robot.pickUp(battery);
}
else
{
System.out.println("This battery could not be picked up by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this battery is terminated; the robot cannot pick up the battery.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int monitorBattery(PrintWriter pw) throws Exception {\n boolean enabled;\n checkPermission(\"change battery monitoring\");\n String opt = getNextArgRequired();\n if (\"on\".equals(opt)) {\n enabled = true;\n } else if (\"off\".equals(opt)) {\n enabled = false;\n } else {\n PrintWriter errPrintWriter = getErrPrintWriter();\n errPrintWriter.println(\"Error: unknown option \" + opt);\n return 1;\n }\n long ident = Binder.clearCallingIdentity();\n try {\n this.mInternal.setMonitorBattery(enabled);\n if (enabled) {\n pw.println(\"Battery monitoring enabled\");\n } else {\n pw.println(\"Battery monitoring disabled\");\n }\n Binder.restoreCallingIdentity(ident);\n return 0;\n } catch (Throwable th) {\n Binder.restoreCallingIdentity(ident);\n throw th;\n }\n }",
"@Override\r\n\tpublic void useBattery(Robot robot, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.use(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot use the battery.\");\r\n\t\t}\r\n\t}",
"private void onFullBattery() {\n\n }",
"int getBattery();",
"@Override\n public void batteryStatus(int value) {\n }",
"private boolean checkBatteryLevelOK() {\n return true;\n }",
"private void forceGetBatteryInfo(IMethodResult result)\n\t{\n\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\tif(activity != null)\n\t\t{\n\t\t\tIntent batteryIntent = activity.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\tboolean isPlugged = (batteryIntent.getIntExtra(\"plugged\", 0) == 1 ? true : false);\n\t\t\tint level = batteryIntent.getIntExtra(\"level\", 0);\n\t\t\tbatteryLevel = level;\n\t\t\tfireBatteryStatus(level, isPlugged, \"User Request\", result);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLogger.E(TAG, \"Could not communicate with main Activity\");\n\t\t\tresult.setError(\"Internal Error. Could not communicate with Activity\");\n\t\t}\n\t}",
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"private synchronized void updateBattery(){\n \tdouble battery = MathUtils.round(Battery.getVoltage(),1);\n \tstore(new DisplayableData(\"battery\", battery+\"V\", battery));\n }",
"@Test\n\tpublic void testsetBattery2zero() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\trobot.setBatteryLevel(0);\n\t\ttry {\n\t\t\tassertFalse(explorer.drive2Exit());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void batteryType(String type)\n {\n\t batteryType = type;\n }",
"public void charge() {\n\t\t\tSystem.out.println(\"Battery is charging\");\n\t\t}",
"@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }",
"public int getBatteryLevel() { return batteryLevel; }",
"@Override\n public void batteryCharge() {\n super.batteryCharge();\n }",
"public float batteryLevel() {\n return 1;\n }",
"public Builder setBattery(int value) {\n \n battery_ = value;\n onChanged();\n return this;\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}",
"@Override\n public void periodic() {\n\t\t// myDrive.\n\n\t\t// System.out.println(Robot.m_oi.getSpeed());\n\t\t// SmartDashboard.putNumber(\"Dial Output: \", Robot.m_oi.getSpeed());\n\n\t\t// //Wheel Speed Limits\n\n\t\t// SmartDashboard.putNumber(\"Front Left Percent\", myDrive.getFLSpeed());\n\t\t// SmartDashboard.putNumber(\"Front Right Percent\", myDrive.getFRSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Left Percent\", myDrive.getRLSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Right Percent\", myDrive.getRRSpeed());\n\n\t\t//Test Code for Selecting Calibration Motor \n\t\t//***COMMENT OUT BEFORE REAL GAME USE***\n\t\t// if (Robot.m_oi.getArmDown()) {\n\t\t// \t// System.out.println(\"Front Left Wheel Selected\");\n\t\t// \tWheel = 1;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getArmUp()) {\n\t\t// \t// System.out.println(\"Back Left Wheel Selected\");\n\t\t// \tWheel = 2;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallIn()) {\n\t\t// \t// System.out.println(\"Front Right Wheel Selected\");\n\t\t// \tWheel = 3;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallOut()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 4;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBlueButton()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 0;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t// } \n\n\t\t// if (Wheel == 1) {\n\n\t\t// \tmyDrive.setFLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 2) {\n\n\t\t// \tmyDrive.setRLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 3) {\n\n\t\t// \tmyDrive.setFRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 4) {\n\n\t\t// \tmyDrive.setRRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// }\n\n\t\t// if (Robot.m_oi.getSafety()) {\n\n\t\t// \tspeedLimit = 1.0;\n\t\t// \tstrafeLimit = 1.0;\n\n\t\t// } else {\n\n\t\t// \tspeedLimit = 0.5; \n\t\t// \tstrafeLimit = 0.8;\n\t\t\t\t\n\t\t// }\n\n\n\n\t\t//System.out.print (\"strafeLimit: \" + strafeLimit);\n\t\t//System.out.println(Robot.m_oi.getX() * strafeLimit);\n\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY() * speedLimit), // set Y speed\n\t\t// \t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t// \t(Robot.m_oi.getRotate() * rotateLimit), // set rotation rate\n\t\t// \t0); // gyro angle \n\t\t\n\t\t//TODO: Rotate robot with vision tracking, set up curve to slow down as target approaches center.\n\t\t// if (Robot.m_oi.getStartButton()) {\n\t\t// \tmyDrive.driveCartesian(\n\t\t// \t\t (0.4), // set Rotation\n\t\t// \t\t (0.0), // set Strafe\n\t\t// \t\t (0.0), // set Forward/Back\n\t\t// \t\t 0);\n\t\t// } else {\n\t\tmyDrive.driveCartesian(\n\t\t\t(Robot.m_oi.getY() * rotateLimit), // set Y speed\n\t\t\t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t\t(Robot.m_oi.getRotate() * speedLimit), // set rotation rate\n\t\t\t0);\n\t\t// }\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY()), // set Y speed\n\t\t// \t(Robot.m_oi.getX()), // set X speed\n\t\t// \t(Robot.m_oi.getRotate()), // set rotation rate\n\t\t// \t0); \n\n }",
"public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}",
"public void setBattery(Byte battery) {\n this.battery = battery;\n }",
"public void setupBackupRobot() throws InterruptedException{\n\n motorFrontLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorFrontRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n setIMUParameters();\n\n while (!imu.isGyroCalibrated()) {\n telemetry.addData(\"IMU\", \"calibrating...\");\n telemetry.update();\n Thread.sleep(50);\n }\n\n telemetry.addData(\"IMU\", \"ready\");\n telemetry.update();\n }",
"private void pump_water() {\n\t\t\r\n\t}",
"public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}",
"public void power()\r\n {\r\n powerOn = true;\r\n }",
"private void fireBatteryStatus(String trigger)\n\t{\n\t\tfireBatteryStatus(batteryLevel, isPowerConnected, trigger, null);\n\t}",
"public void teleopPeriodic() {\n\t\t// resetAndDisable();\n\t\tupdateDashboard();\n\t\tLogitechJoystick.controllers();\n\t\tDrivetrain.arcadeDrive();\n\t\tShooterAngleMotor.angleShooter();\n\t\tBallShooter.shootBalls();\n\t\tSonicSensor.updateSensors();\n\t\t\n\t\t//if(LogitechJoystick.rightBumper2)\n\t\t\t//{\n\t\t\t\t//LowBar.makeArmStable();\n\t\t\t//}\n\n\t}",
"public boolean getOnBattery()\n\t{\n\t\treturn getBooleanIOValue(\"OnBattery\", false);\n\t}",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);\r\n boolean full = level == 100;\r\n\r\n Log.d(TAG, \"Power changed - level \" + level);\r\n\r\n // wenn voll\r\n if (full) {\r\n makeNotification(false);\r\n }\r\n // wenn leerer geworden (nur bei Umstieg von grün auf orange notwendig)\r\n else {\r\n makeNotification(true);\r\n }\r\n }",
"public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }",
"public void goToSleep() {\n mPowerManager.goToSleep(SystemClock.uptimeMillis());\n }",
"public PotatoPower() {\r\n\t\t//pos5 = .975; //Low Bar and Boulder Pickup\r\n\t\t//pos9 = 1.484; //Low Goal Shoot\r\n\t\t//pos12 = 1.770; //High Goal Shoot\r\n\t\t//pos7 = 2.347; //Scale and Human Station\r\n\t\t//pos3 = 0; //Stop Motor\r\n\t\t//m5stopRange = 0.001; // range above and below set point to allow\r\n\t\t// for over or under when motor is moving faster\r\n\t\t\t// than we are reading the sting pot\r\n\t\tgoBall= false;\r\n\t\t//inAuto = false;\r\n\t}",
"public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }",
"@Test(priority = 4)\n\tpublic void clickBatteryStatus() throws Exception {\n\t\t\n\t\tdriver = DashboardPage.clickBatteryStatus(driver);\n\t\t\n\t\t//ExcelUtils.setCellData(\"Execute Battery\", 5, 1);\n\t}",
"private void registerForBatteryStatus()\n\t{\n\t\tif(!isReceiverRegistered)\n\t\t{\n\t\t\tLogger.D(TAG, \"registerForBatteryStatus async\");\n\t\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\t\tif(activity != null)\n\t\t\t{\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_LOW));\n\t\t\t\tisReceiverRegistered = true;\n\t\t\t}\n\t\t\telse Logger.E(TAG, \"Could not communicate with main Activity\");\n\t\t}\n\t}",
"public void charger() throws WargameException;",
"@Test\n\t public void testwith3KgAnd2Km(){\n\t\t robot = new Robot(3, 2);\n\t\t Assert.assertEquals(54.0, robot.calculateRemainingBattery(),0);\n\t }",
"public void loop()\n {\n double rightPower, leftPower;\n double gearRatio = gamepad1.right_bumper ? 0.7 : 0.2;\n // If right_bumper is down, the gearRatio is 0.7. Otherwise, the gearRatio is 0.3\n \n rightPower = gearRatio * gamepad1.left_stick_y;\n leftPower = gearRatio * gamepad1.right_stick_y;\n \n leftpower = Range.clip(leftpower, -1, 1); //gamepad controllers have a value of 1 when you push it to its maximum foward\n rightpower = Range.clip(rightpower, -1, 1); //limiting the range of each power, min first then max\n \n motorR.setPower(rightPower);\n motroL.setPower(leftPower);\n \n telemetry.addData(\"Gear Ratio \", gearRatio);\n telemetry.addData(\"Right Power \", rightPower);\n telemetry.addData(\"Left Power \", leftPower);\n \n \n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tupdate();\n\t\t\n\t\t//dashboard outputs\n\t\tdashboardOutput();\n\t\t\n\t\t\n\t\t\n\t\tif (tankDriveBool) {\n\t\t\ttankDrive();\n\t\t} \n\t\telse {\n\t\t\ttankDrive();\n\t\t}\n\t\tif (buttonA) {\n\t\t\ttest = true;\n\t\t\twhile (test) {\n\t\t\t\tcalibrate(10);\n\t\t\t\ttest = false;\n\t\t\t}\n\t\t}\n\t\tif (buttonY) {\n\t\t\tclimbMode = !climbMode;\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0.5);\n\t\t\tTimer.delay(0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0);\n\t\t}\n\t\tverticalMovement();\n\t\tgrab();\n\t}",
"private void setZeroPowerBrakes() {\n //Initialize Mecanum Wheel DC Motor Behavior\n robot2.DriveRightFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveRightRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n }",
"@Override\n\tpublic void autonomousPeriodic() {\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\n\t\tScheduler.getInstance().run();\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t}",
"@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }",
"void powerOn();",
"public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"public int getBattery() {\n return battery_;\n }",
"@Override\n public void start() {\n\n\n // IF YOU ARE NOT USING THE AUTO MODE\n\n /*\n\n runtime.reset();\n\n ElapsedTime time = new ElapsedTime();\n\n time.reset();\n\n while (time.time() < 1) {\n\n armMotor.setPower(0.5);\n\n }\n\n armMotor.setPower(0);\n\n // get the grabbers ready to grip the blocks\n leftGrab.setPosition(0.9);\n rightGrab.setPosition(0.1);\n\n /*\n time.reset();\n\n while(time.time() < 0.6) {\n\n armMotor.setPower(-0.5);\n\n }\n\n */\n\n\n }",
"public void ApplyMovement() {\n long currTime = SystemClock.uptimeMillis();\n if(currTime - lastUpdateTime < 16){\n return;\n }\n lastUpdateTime = currTime;\n\n\n double tl_power_raw = movement_y-movement_turn+movement_x*1.5;\n double bl_power_raw = movement_y-movement_turn- movement_x*1.5;\n double br_power_raw = -movement_y-movement_turn-movement_x*1.5;\n double tr_power_raw = -movement_y-movement_turn+movement_x*1.5;\n\n\n\n\n //find the maximum of the powers\n double maxRawPower = Math.abs(tl_power_raw);\n if(Math.abs(bl_power_raw) > maxRawPower){ maxRawPower = Math.abs(bl_power_raw);}\n if(Math.abs(br_power_raw) > maxRawPower){ maxRawPower = Math.abs(br_power_raw);}\n if(Math.abs(tr_power_raw) > maxRawPower){ maxRawPower = Math.abs(tr_power_raw);}\n\n //if the maximum is greater than 1, scale all the powers down to preserve the shape\n double scaleDownAmount = 1.0;\n if(maxRawPower > 1.0){\n //when max power is multiplied by this ratio, it will be 1.0, and others less\n scaleDownAmount = 1.0/maxRawPower;\n }\n tl_power_raw *= scaleDownAmount;\n bl_power_raw *= scaleDownAmount;\n br_power_raw *= scaleDownAmount;\n tr_power_raw *= scaleDownAmount;\n\n\n //now we can set the powers ONLY IF THEY HAVE CHANGED TO AVOID SPAMMING USB COMMUNICATIONS\n topLeft.setPower(tl_power_raw);\n bottomLeft.setPower(bl_power_raw);\n bottomRight.setPower(br_power_raw);\n topRight.setPower(tr_power_raw);\n }",
"public msg_battery_batterystatus(){\n msgid = MAVLINK_MSG_ID_BATTERY_batterySTATUS;\n }",
"public interface OnBatteryLow{void changeBrightness(int buttatyPercents);\n}",
"public static void battery1(SetInterface session, String[] argv) throws Exception {\n\t\tlong tims = System.currentTimeMillis();\n\t\tfor(int i = max-1; i >= min; i--) {\n\t\t\tbigtestx b = new bigtestx();\n\t\t\tb.init(i, payloadSize);\n\t\t\tsession.put(b);\n\t\t}\n\t\tlong ms = System.currentTimeMillis();\n\t\tSystem.out.println(\"Added \"+i+\" in \"+(System.currentTimeMillis()-ms)+\"ms.\");\n\t\t System.out.println(\"BATTERY1 SUCCESS in \"+(System.currentTimeMillis()-tims)+\" ms.\");\n\t}",
"public default void battery() {\n\t\tSystem.out.println(\"battery is a default method from Java 1.8\");\n\t}",
"@Override\r\n public void start() {\r\n runtime.reset();\r\n FL.setPower(1);\r\n FR.setPower(1);\r\n BR.setPower(1);\r\n BL.setPower(1);\r\n try{\r\n Thread.sleep(850);\r\n }\r\n catch (Exception e) {\r\n \r\n }\r\n FL.setPower(0);\r\n FR.setPower(0);\r\n BL.setPower(0);\r\n BR.setPower(0); \r\n }",
"protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }",
"public void chargeRobot(String robotUID, Warehouse wh) {\n\t\t//If the robot that wants to be charged is the assignedRobotUID, charge it. \n\t\tif(assignedRobotUID.contentEquals(robotUID)) {\n\t\t\t//Get the robots charge percentage. \n\t\t\tint battery = wh.getRobot(robotUID).getBatteryStatus();\n\t\t\t\n\t\t\t//Take this battery charge, and add the POWER_UNITS_PER_TICK to it.\n\t\t\tbattery += POWER_UNITS_PER_TICK;\n\t\t\t\n\t\t\t//If the robots battery exceeds the max, e.g., 101 / 100, change the battery to the max. \n\t\t\tif(wh.getRobot(robotUID).getBatteryStatus()>wh.getRobot(robotUID).getMaxBattery()) {\n\t\t\t\tbattery = wh.getRobot(robotUID).getMaxBattery();\n\t\t\t}\n\t\t\t\n\t\t\t//Set the battery charge to this new value.\n\t\t\twh.getRobot(robotUID).setBatteryChargePercentage(battery);\n\t\t}\n\t}",
"public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }",
"public void grab() {\n\t\tif (climbMode == false) {\n\t\t\tif (bumperL) {\n\t\t\t\tmotorGL.set(-1);\n\t\t\t\tmotorGR.set(1);\n\t\t\t} \n\t\t\telse if (bumperR) {\n\t\t\t\tmotorGL.set(1);\n\t\t\t\tmotorGR.set(-1);\n\t\t\t}\t\n\t\t\telse {\n\t\t\t\tmotorGL.set(0);\n\t\t\t\tmotorGR.set(0);\n\t\t\t}\n\t\t}\n\t}",
"public void teleopPeriodic() {\n \t//getInstance().run();;\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickRight); //This line drives the robot using the values of the joystick and the motor controllers selected above\n \tScheduler.getInstance().run();\n\t\n }",
"int getBatteryPercentage();",
"void useGodPower(boolean use);",
"public Byte getBattery() {\n return battery;\n }",
"@Override\r\n\tpublic void receiveSunshine() {\r\n\r\n\t\tthis.batteryToLoad.charge(0.1d);\r\n\t}",
"@Override\r\n\tpublic void dropBattery(Robot robot, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot drop the battery.\");\r\n\t\t}\r\n\t}",
"@Override\n public void teleopPeriodic() {\n CommandScheduler.getInstance().run();\n OI.getInstance().getPilot().run();\n SmartDashboard.putNumber(\"gyro\", getRobotContainer().getTecbotSensors().getYaw());\n SmartDashboard.putBoolean(\"isSpeed\", getRobotContainer().getDriveTrain().getTransmissionMode() == DriveTrain.TransmissionMode.speed);\n SmartDashboard.putString(\"DT_MODE\", getRobotContainer().getDriveTrain().getCurrentDrivingMode().toString());\n SmartDashboard.putNumber(\"x_count\", getRobotContainer().getClimber().getxWhenPressedCount());\n\n }",
"public static void updateBatteryPerBlock(Drone drone) {\n\n //synchronized (lock){\n\n if (drone.isShutDown()) {\n return;\n }\n\n if (drone.isEconomyMode()) {\n\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n\n Double economyModeBatteryPerBlock = batteryPerBlock / 2;\n\n Double newCurrentBattery = oldCurrentBattery - economyModeBatteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n } else if (drone.isNormalMode()) {\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n Double newCurrentBattery = oldCurrentBattery - batteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n }\n\n // }\n\n\n }",
"public Builder setBatteryPercentage(int value) {\n extraCase_ = 6;\n extra_ = value;\n onChanged();\n return this;\n }",
"public void powerdown() {\n monitor.sendPowerdown();\n }",
"public int getBattery() {\n return battery_;\n }",
"private boolean loop() throws Exception{\n\t\treadSensors(100);\r\n\t\tint[] lightBumpReadings = getLightBumps();\r\n\t\tdriveDirect(300, 300);\r\n\t\t//driveDirect(500,350);\r\n\t\t\r\n\t\tif(lightBumpReadings[0]>0){\r\n\t\t\tdriveDirect(175,100);\r\n\t\t\tsleep(300);\r\n\t\t\t\r\n\t\t}\r\n\t\tif(lightBumpReadings[1]>0){\r\n\t\t\tdriveDirect(150,100);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[2]>0){\r\n\t\t\tdriveDirect(125,100);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[3]>0){\r\n\t\t\tdriveDirect(100,125);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[4]>0){\r\n\t\t\tdriveDirect(100,150);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[5]>0){\r\n\t\t\tdriveDirect(100,175);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\t\r\n\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\tdriveDirect(0,500);\r\n\t\t\tsleep(750);\r\n\t\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\t\tdriveDirect(0,500);\r\n\t\t\t\tsleep(1500);\r\n\t\t\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\t\t\tdriveDirect(0,500);\r\n\t\t\t\t\tsleep(750);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdriveDirect(300,300);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdriveDirect(300,300);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public void teleopPeriodic() {\n driverScreen.updateLCD();\n }",
"public BatteryMonitor(Context ctx, MsgMux mux) {\n this.ctx = ctx;\n this.mux = mux;\n pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);\n\n IntentFilter mIntentFilter = new IntentFilter();\n mIntentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);\n\n // Battery control - DHCP doesn't work for AP in power save.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n mIntentFilter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n mIntentFilter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);\n }\n ctx.registerReceiver(this, mIntentFilter);\n reg = true;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n bm = (BatteryManager) ctx.getSystemService(Context.BATTERY_SERVICE);\n }\n idleStop = SystemClock.elapsedRealtime();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (pm.isDeviceIdleMode()) {\n idleStart = SystemClock.elapsedRealtime();\n }\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n isPowerSave = pm.isPowerSaveMode();\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (bm.isCharging()) {\n chargingStart = SystemClock.elapsedRealtime();\n }\n }\n\n // TODO: battery pct.\n }",
"@Override\n public void robotPeriodic() {\n\n enabledCompr = pressBoy.enabled();\n //pressureSwitch = pressBoy.getPressureSwitchValue();\n currentCompr = pressBoy.getCompressorCurrent();\n //SmartDashboard.putBoolean(\"Pneumatics Loop Enable\", closedLoopCont);\n SmartDashboard.putBoolean(\"Compressor Status\", enabledCompr);\n //SmartDashboard.putBoolean(\"Pressure Switch\", pressureSwitch);\n SmartDashboard.putNumber(\"Compressor Current\", currentCompr);\n }",
"public void teleopPeriodic() \r\n {\r\n Watchdog.getInstance().feed();\r\n Scheduler.getInstance().run();\r\n \r\n //Polls the buttons to see if they are active, if they are, it adds the\r\n //command to the Scheduler.\r\n if (mecanumDriveTrigger.get()) \r\n Scheduler.getInstance().add(new MechanumDrive());\r\n \r\n else if (tankDriveTrigger.get())\r\n Scheduler.getInstance().add(new TankDrive());\r\n \r\n else if (OI.rightJoystick.getRawButton(2))\r\n Scheduler.getInstance().add(new PolarMechanumDrive());\r\n \r\n resetGyro.get();\r\n \r\n //Puts the current command being run by DriveTrain into the SmartDashboard\r\n SmartDashboard.putData(DriveTrain.getInstance().getCurrentCommand());\r\n \r\n SmartDashboard.putString(ERRORS_TO_DRIVERSTATION_PROP, \"Test String\");\r\n \r\n \r\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"@Override\r\n\t\t\tpublic void monitor()\r\n\t\t\t{\n\t\t\t\twhile(true)\r\n\t\t\t\t{\r\n\t\t\t\t\tRandom rm= new Random();\r\n\t\t\t\t\tint bp=rm.nextInt(200);\r\n\t\t\t\t\tSystem.out.println(bp);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(bp>140)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"High BP\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}",
"private void Perform_SLEEP()\n {\n if (Utils.bit5(get_ioreg(MCUCR)))\n mSleeping = true;\n return;\n }",
"public void begin(){\r\n\t\t\ttry {\r\n\t\t\t\twhile( !superpower )\r\n\t\t\t\t\tThread.sleep( 10 );\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}",
"public void liftArm(){armLifty.set(-drivePad.getThrottle());}",
"public void turnOnCooler() {\n oilPompController.turnPompsOn();\n breakController.turnOff();\n mainPowerController.turnOn();\n supportPowerController.turnOn();\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n System.out.println(\"Waiting to stand up was interrupted.\");\n }\n supportPowerController.turnOff();\n System.out.println(\"System is running.\");\n }",
"public boolean getBatteryAlarm()\n\t{\n\t\treturn getBooleanIOValue(\"BatteryAlarm\", false);\n\t}",
"@Override\n public void run() {\n handler.postDelayed(checkBatteryStatusRunnable, store != null ? 10000\n : DEFAULT_CHECK_BATTERY_INTERVAL);\n logStatic(\"Battery status is \" + currentBattLevel + \"mm cached. Interval: \" + 10000);\n\n donePlayingLoadBeepBelowTenPercent = false;\n int storedPreviousBatLevel = store.getInt(previousBatValueKey, -1);\n //If no stored battery value, then save the current battery level\n if (storedPreviousBatLevel == -1) {\n store.setInt(previousBatValueKey, (int) currentBattLevel);\n storedPreviousBatLevel = (int) currentBattLevel;\n }\n //Only play the TTS if the current battery level is not the same as previous battery level\n if (storedPreviousBatLevel != -1) {\n //Only alert if time is not in between sleep mode\n Calendar nowCal = Calendar.getInstance();\n boolean isCharging;\n isCharging = BaseActivity.isCharging(getApplicationContext());\n\n String checkIntervalOnBatteryServiceLevelCheckerKeyStore = isCharging ?\n checkIntervalOnBatteryServiceLevelCheckerForCharging :\n checkIntervalOnBatteryServiceLevelCheckerForDisCharging;\n\n //We don't wait for the interval to trigger. So it will check every time for level changes.\n if (!isTimeInBetweenSleepMode(\n store.getLong(startTimeLong), nowCal.getTimeInMillis(),\n store.getLong(stopTimeLong))) {\n checkLoudBeepRules(storedPreviousBatLevel);\n }\n\n if (!isTimeInBetweenSleepMode(\n store.getLong(startTimeLong), nowCal.getTimeInMillis(),\n store.getLong(stopTimeLong))\n && isTimeIntervalDone(store, checkIntervalOnBatteryServiceLevelCheckerKeyStore)) {\n checkRulesOnTheList();\n }\n } else\n logStatic(\"Previous battery level \" + storedPreviousBatLevel + \" is the same as current level \" + currentBattLevel);\n\n }",
"public Builder setBatteryPercentage(float value) {\n \n batteryPercentage_ = value;\n onChanged();\n return this;\n }",
"public boolean isForcedAppStandbyForSmallBatteryEnabled() {\n return AppStateTracker.this.injectGetGlobalSettingInt(\"forced_app_standby_for_small_battery_enabled\", 0) == 1;\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\t\n\t\t\n\t\tif (stick.getRawButtonPressed(2)) {\n\t\t\tstickReversed = !stickReversed;\n\t\t}\n\t\t\n\t\t// double means a floating point (decimal) number with a precision of \"hella\"\n\t\tdouble power = -stick.getY(Hand.kLeft); // negated, because microsoft is weird and up is negative\n\t\tdouble steering = stick.getX(Hand.kRight); \n\t\tif (stickReversed) {\n\t\t\tpower = -power;\n\t\t}\n\t\tdrive(power, steering);\n\t\t\n//\t\tif (xbox.getBumper(Hand.kRight)) {\n//\t\t\tleftIntake.set(xbox.getTriggerAxis(Hand.kLeft));\t\n//\t\t\trightIntake.set(-0.9);\n//\t\t} else if (xbox.getBumper(Hand.kLeft)) {\n//\t\t\tleftIntake.set(-1.0);\n//\t\t\trightIntake.set(1.0);\n//\t\t} else {\n//\t\t\tleftIntake.set(0.0);\n//\t\t\trightIntake.set(0.0);\n//\t\t}\n\t\t\n\t\tif (xbox.getBumper(Hand.kLeft)) { // shoot out\n\t\t\tleftIntake.set(-1.0);\n\t\t} else { // intake\n\t\t\tleftIntake.set(xbox.getTriggerAxis(Hand.kLeft));\n\t\t}\n\t\t\n\t\tif(xbox.getBumper(Hand.kRight)) { //shooty i think\n\t\t\trightIntake.set(1.0);\n\t\t} else { //intake\n\t\t\trightIntake.set(-xbox.getTriggerAxis(Hand.kRight));\n\t\t}\n//\t\tarmSetpoint += xbox.getY(Hand.kLeft) * 60;\n//\t\tSystem.out.println(armSetpoint);\n\t\t\n\t\tarmMotor.set(ControlMode.PercentOutput, xbox.getY(Hand.kLeft) * 0.8);\n\t\tSystem.out.println(xbox.getY(Hand.kLeft));\n\t}",
"private void vibrateWiimote(int millis) {\r\n\t\tOscMessage msg = new OscMessage(\"/jumprope\");\r\n\t\tmsg.add(millis);\r\n\t\tosc.send(msg, addr);\r\n\t}",
"public void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t// Light/flash LEDs as needed\n\t\tif (timerLEDs.get() >= timerLEDsHalfPeriod) {\n\t timerLEDs.reset();\n\t timerLEDsCycleHigh = !timerLEDsCycleHigh;\n\t if (timerLEDsCycleHigh) {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle);\n\t } else {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle /*&& !shooter.bLEDsFlywheelAtSpeed*/);\t \t\n\t }\n\t\t}\n/*\t\t\n\t\t// Rumble as needed\n\t\tboolean ballLoaded = shooter.isBallLoaded(); \n\t\tif (ballLoaded && !prevBallLoaded) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kLeftRumble, 1);\n\t\t}\n\t\tprevBallLoaded = ballLoaded;\n\n\t\tboolean readyToShoot = shooter.bLEDsArmAtAngle && shooter.bLEDsFlywheelAtSpeed;\n\t\tif (readyToShoot && !prevReadyToShoot) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kRightRumble, 1);\n\t\t}\n\t\tprevReadyToShoot = readyToShoot;\n\n\t\tif (timerRumble.get() > 0.5) {\n\t \toi.xboxController.setRumble(RumbleType.kLeftRumble, 0);\n\t \toi.xboxController.setRumble(RumbleType.kRightRumble, 0);\n\t\t}\n*/\t\t\n\t\t// Show arm angle\n shooterArm.updateSmartDashboard();\n \n\t\t// Other printouts\n\t\tshooter.updateSmartDashboard();\n\t\tshooter.isBallLoaded();\n\t\tintake.updateSmartDashboard();\n\t\tintake.intakeIsUp();\n\t\tdriveTrain.getDegrees();\n\t\t\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\t\t\t\t\n\t\tif (smartDashboardDebug) {\n\t\t\t// Uncomment the following line to read coPanel knobs.\n//\t\t\toi.updateSmartDashboard();\n\n\t\t\t// Uncomment the following line for debugging shooter motors PIDs.\n//\t\t\tshooter.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following line for debugging the arm motor PID.\n//\t shooterArm.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following lines to see drive train data\n\t \tdriveTrain.getLeftEncoder();\n\t \tdriveTrain.getRightEncoder();\n\t\t\tdriveTrain.smartDashboardNavXAngles();\n\t\t\t\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel voltage\", panel.getVoltage());\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel arm current\", panel.getCurrent(0));\n\t\t}\n\n\t}",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putBoolean(\"Max Intake Extension: \", RobotMap.intakeLifted.get());\n\t\tSmartDashboard.putBoolean(\"Max Lift Extension:\", RobotMap.isAtTop.get());\n\t\tSmartDashboard.putBoolean(\"Min Lift Extension:\", RobotMap.isAtBottom.get());\n\t\tDriveTrain.driveWithJoystick(RobotMap.stick, RobotMap.rd); // Drive\n\t\tTeleOp.RaiseLift(RobotMap.liftTalon, RobotMap.controller); // Raise lift\n\t\tif(RobotMap.controller.getRawAxis(RobotMap.lowerLiftAxis) >= 0.2) {\n\t\tTeleOp.LowerLift(RobotMap.liftTalon, RobotMap.controller);\n\t\t}\n\t\tTeleOp.DropIntake(RobotMap.controller, RobotMap.intakeLifter);\n\t\tTeleOp.spinOut(RobotMap.intakeVictorLeft, RobotMap.controller);\n\t\t//TeleOp.spinnySpinny(RobotMap.intakeVictorLeft, RobotMap.stick);\n\t}",
"public void move() {\n\t\t\tRandom rand = new Random();//random number generator\n\t\t\tint value = rand.nextInt(500000);//there is a 1 in 500000 chance there will be a new powerup every frame.\n\t\t\tif (value==0) {//if the value is 0\n\t\t\t\tRandom ran = new Random();//make a random number generator and a power up vairable\n\t\t\t\tPowerUp currentPowerUp = null;\n\t\t\t\tint type = ran.nextInt(3);//switch the 1 for the amount of types made.\n\t\t\t\tif (type==0) {//add the powerup depending on the random number. There are 3 types\n\t\t\t\t\tcurrentPowerUp = new PowerUp(healthPowerUp, 0);//this adds a life\n\t\t\t\t}\n\t\t\t\telse if (type==1) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(longPowerUp, 1);//this makes the slider wider\n\t\t\t\t} else if (type==2) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(bonusPointsPowerUp, 2);//this just adds points\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//set x and y\n\t\t\t\t//make a random x\n\t\t\t\tint newX = ran.nextInt(401) - 201 + GamePlay.getScreenWidth()/2; //-200 to 200 variance from center\n\t\t\t\tint newY = ran.nextInt(201) - 101 + GamePlay.getScreenHeight()/4;//-100 to 100 variance from the 25% of top distance line.\n\t\t\t\tif (currentPowerUp!=null) {\n\t\t\t\t\tcurrentPowerUp.setX(newX);\n\t\t\t\t\tcurrentPowerUp.setY(newY);\n\t\t\t\t\tpowerUps.add(currentPowerUp);//add the powerups to an array list\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"PowerUp error.\");//if the variable is null, something went wrong.\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//move all powerUps down by ball speed\n\t\t\tfor (PowerUp power: powerUps) {\n\t\t\t\tpower.setY(power.getY() + ballSpeed);\n\t\t\t}\n\t\t\t\n\t\t\t//check if the powerups are off the screen. remove if they are. \n\t\t\tfor (int r = powerUps.size()-1; r>=0; r--) {\n\t\t\t\tif (powerUps.get(r).getY() > GamePlay.getScreenHeight()-h) {\n\t\t\t\t\tpowerUps.remove(r);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//death of a ball\n\t\t\tif (ball.getY()>GamePlay.getScreenHeight() && pause==false) {\n\t\t\t\tdeath();\n\t\t\t}\n\t\t\t\n\t\t\t//no bricks left\n\t\t\tif (blocks.size()==0) {\n\t\t\t\t//you leveled up!\n\t\t\t\tlevelUp();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//wall collision check for ball\n\t\t\t//right wall\n\t\t\tif (ball.rightCollide(GamePlay.getScreenWidth())) {//seperated for later use if wanted.\n\t\t\t\tballVX*=-1;\n\t\t\t} else if (ball.leftCollide(0)) {//left wall\n\t\t\t\tballVX*=-1;\n\t\t\t}\n\t\t\t\n\t\t\tif (ball.topCollide(0)) {//top wall\n\t\t\t\tballVY*=-1;\n\t\t\t} //dont check bottom wall because that is the death of a ball.\n\t\t\t\n\t\t\t//collision with the slider.\n\t\t\tif (ball.getRect().intersects(slider.getRect()) && ball.getY()+ball.getHeight() <= slider.getY()+ballSpeed) {//intersected bool needed\n\t\t\t\tballVY*=-1;\n\t\t\t\tballVX+=sliderVX;//add the slider velocity to the ball velocity, giving user some control over angle. \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//collision with the powerups\n\t\t\t\n\t\t\tfor (int a = powerUps.size()-1; a>=0; a--) {//iterate thrpough the powerups\n\t\t\t\tPowerUp power = powerUps.get(a);\n\t\t\t\tif (power.getRect().intersects(slider.getRect())) {//if the powerups rect intersects, the slider caught it. Remove from screen\n\t\t\t\t\t//THIS MEANS THEY CAUGHT THE POWERUP\n\t\t\t\t\tif (power.getType()==\"HEALTH\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tif (lives<5)\n\t\t\t\t\t\t\tlives+=1;//add a life up to 5\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"LONG\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\textended = true;//extended flag to say the slider is extended. extend the slider's width by the adjust amount preset globally\n\t\t\t\t\t\tslider.resize(slider.getWidth()+adjust, slider.getHeight());\n\t\t\t\t\t\tslider.setX(slider.getX()-adjust/2);\n\t\t\t\t\t\textendTimer.restart();//restart the entend timer\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"BONUS\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tscore+=100;//add a 100 points.\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//collision with blocks\n\t\t\t\n\t\t\tboolean changed = false;//this is a flag to see if any collisions occured this frame\n\t\t\tfor (Block block:blocks) {\n\t\t\t\tRectangle r = block.getRect();\t\t\n\t\t\t\tif (r.intersects(ball.getRect())) {//if the rects intersected, something hit something. However, we don't know from what direction\n\t\t\t\t\t//since the vy is always going to be by 1, we can check if it is equal. There is no multiples to deal with. \n\t\t\t\t\t\n\t\t\t\t\t//this checks if it was colliding from the bottom. Check the bottom edge of block and top of the ball\n\t\t\t\t\tif (ball.getY() + 2 >= block.getBottom() && ball.getY() -2 <= block.getBottom() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//bottom collision\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (ball.getY() + ball.getHeight() + 2 >=block.getTop() && ball.getY() + ball.getHeight() -2 <=block.getTop() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this checks if it was colliding on the top. Check bottom edge of ball and top of block.\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (changed==false && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this must mean it is on the left or right\n\t\t\t\t\t\t//it doesn't matter which one, the change is the exact same!\n\t\t\t\t\t\tballVX*=-1;//flip the x direction\n\t\t\t\t\t\tscore+=block.downColor();//change color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag\n\t\t\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\t\t\tchanged=true;//set the changed flag\n\t\t\t\t\t\thitSound.play();//play the sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}//end the for.\n\t\t\tif (changed==false) {//if no changes, reset the flag.\n\t\t\t\tball.setIntersected(false);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//move everything as per velocity\n\t\t\tif (slider.getX() > 10 && sliderVX<0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);//the slider can move twice as fast as the ball.\n\t\t\t} else if ((slider.getX()+slider.getWidth()) < GamePlay.getScreenWidth()-10 && sliderVX>0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);\n\t\t\t}\n\t\t\tif (ready) {\n\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\tball.setY(ball.getY() + ballVY);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"public void setAwake(boolean aw)\n {\n awake = aw;\n }",
"@Override\n\tpublic void teleopPeriodic() //runs the teleOp part of the code, repeats every 20 ms\n\t{\n\t\tScheduler.getInstance().run(); //has to be here, I think that this is looping the method\n\t\tSmartDashboard.putNumber(\"Encoder Left: \", RobotMap.encoderLeft.getRaw()); //putting the value of the left encoder to the SmartDashboard\n\t\tSmartDashboard.putNumber(\"Encoder Right: \", RobotMap.encoderRight.getRaw()); //putting the value of the right encoder to the smartDashboard\n\t\tSmartDashboard.putNumber(\"Ultrasonic sensor\", ultrasonic.getDistanceIn()); //putting the value of the ultrasonic sensor to the smartDashboard\n//\t\tSmartDashboard.putBoolean(\"allOK\", Robot.driveFar.ultrasonicOK);\n\t\tdriveExecutor.execute(); //running the execute method in driveExecutor\n\t\tgrab.execute(); //running the execute() method in GearGrab_Command (should run without this but this is ensuring us that it is on)\n\t}",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Climber Safety Mode: \", Robot.m_oi.getSafety());\n\n if (Robot.m_oi.getSafety()) {\n \t\tif (Robot.m_oi.getClimbUp()) {\n // if (printDebug) {\n // System.out.println(\"Climb: up speed = \" + speed);\n // }\n // talonMotor.setInverted(false); // do not reverse motor\n talonMotor.set(-speed); // activate motor\n\n \t\t} else if (Robot.m_oi.getClimbDown()) {\n // if (printDebug) {\n // System.out.println(\"IntakeArm: retract speed = \" + speed);\n // }\n // talonMotor.setInverted(true); // reverse motor\n talonMotor.set(speed);\n \n \t\t} else { // else no hand button pressed, so stop motor\n talonMotor.set(0);\n }\n\n if (climbState == 0 && Robot.m_oi.getClimbUp()) {\n climbState = 1;\n }\n\n if (climbState == 1 && Robot.m_oi.getClimbDown()) {\n climbState = 2;\n }\n\n if (climbState == 2 && talonMotor.getSensorCollection().isFwdLimitSwitchClosed()) {\n // Activiate the solenoid\n RobotMap.solenoid.extendSolenoid(true);\n }\n }\n }",
"@Test\n\tpublic void testWithWeight0KgAndTravel3_5Test() {\n\t\trobot = new Robot(0,3.5);\n\t\tAssert.assertEquals(30.0, robot.calculateRemainingBattery(),0);\n\t}",
"public BallPickUp(){\n //pickUpCompressor.start();\n //pickUpCompressor.setClosedLoopControl(true);\n //climbLockLeftSolenoid(true);\n //climbLockRightSolenoid(true);\n\n // testing voltage compensation mode -- hopefully will not brown out \n // ballPickUpTalon.configVoltageCompSaturation(12); // \"full output\" will now scale to 11 Volts for all control modes when enabled.\n // ballPickUpTalon.enableVoltageCompensation(true); // turn on/off feature\n pickUpArmTalon.configFactoryDefault();\n pickUpArmTalon.setNeutralMode(NeutralMode.Brake);\n //configure sensor source for primary PID\n //colorWheelTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.kPIDLoopIDx, RobotMap.kTimeoutMs);\n pickUpArmTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n //set deadband to super small 0.001 (.1%)\n pickUpArmTalon.configNeutralDeadband(0.001, RobotMap.pickUpArmTimeoutMs);\n /* configure Talson SRX utput and sensor direction occordingly invert motor to\n *have green LEDs when driving Talon Forward / requesting positive utput phase sensor\n *to have positive increment when driving Talon Forward (Green LED) */\n pickUpArmTalon.setSensorPhase(false);\n //making this true or false does the same thing\n pickUpArmTalon.setInverted(true);\n /* set relevant frame periods to be at least as fast as periodic rate */\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10, RobotMap.pickUpArmTimeoutMs);\n /* set the peak and nominal outputs */\n pickUpArmTalon.configNominalOutputForward(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configNominalOutputReverse(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputForward(1, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputReverse(-1, RobotMap.pickUpArmTimeoutMs);\n /* set the Motion Magic gains in slot0 - see documentation */\n pickUpArmTalon.config_kF(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kF, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kP(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kP, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kI(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kI, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kD(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kD, RobotMap.pickUpArmTimeoutMs);\n \n pickUpArmTalon.selectProfileSlot(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmPIDLoopIDx);\n /* set acceleration and vcruise velocity - see documentation */\n //numbers should be experimentally derived once we have the color wheel system in place\n pickUpArmTalon.configMotionCruiseVelocity(RobotMap.pickUpArmCruiseVelocity, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configMotionAcceleration(RobotMap.pickUpArmAcceleration, RobotMap.pickUpArmTimeoutMs);\n /* zero the sensor once on robot boot up*/\n pickUpArmTalon.setSelectedSensorPosition(0, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n}",
"public static void climb(boolean button) {\n\t\tif (!Actuators.getWinchRatchetPneumatic().get() && button) {\n\t\t\tActuators.getWinchRatchetPneumatic().set(true);\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.MAX_MOTOR_SPEED);\n\t\t\tActuators.getArmWinchMotor2().set(-Actuators.MAX_MOTOR_SPEED);\n\t\t} else if (Actuators.getWinchRatchetPneumatic().get() && button) {\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.MAX_MOTOR_SPEED);\n\t\t\tActuators.getArmWinchMotor2().set(-Actuators.MAX_MOTOR_SPEED);\n\t\t} else {\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.STOP_MOTOR);\n\t\t\tActuators.getArmWinchMotor2().set(Actuators.STOP_MOTOR);\n\t\t\tActuators.getWinchRatchetPneumatic().set(false);\n\t\t}\n\t}",
"public void teleopPeriodic() {\n Scheduler.getInstance().run();\n// if (oi.driveStick.getRawButton(4)) {\n// System.out.println(\"Left Encoder Distance: \" + RobotMap.leftDriveEncoder.getDistance());\n// System.out.println(\"RightEncoder Distance: \" + RobotMap.rightDriveEncoder.getDistance());\n// }\n\n }",
"public TiltForLowBar() {\n\t\t// Use requires() here to declare subsystem dependencies\n\t\tSystem.out.println(\"starting a new uctilt LOW BAR\");\n\t\trequires(Robot.launcher);\n\t\tinitialize();\n\t\tSystem.out.println(\"made the new uctilt LOW BAR\");\n\n\t}",
"private void localSetWheelPower(double _fl, double _fr, double _bl,\n double _br) {\n Optional<Bot> possibleBot = BaseStation.getInstance().getBotManager()\n .getBotByName(botName);\n if (possibleBot.isPresent()) {\n // if bot exists, make it mine\n Bot myBot = possibleBot.get();\n\n if (myBot.getCommandCenter() instanceof FourWheelMovement) {\n // command center is correctly referenced\n FourWheelMovement fwmCommandCenter = (FourWheelMovement) myBot\n .getCommandCenter();\n fwmCommandCenter.setWheelPower(_fl, _fr, _bl, _br);\n }\n }\n }",
"public void teleopPeriodic() {\n Scheduler.getInstance().run();\n rumbleInYourPants();\n turnSpindleIfNeeded();\n turnWinchIfNeeded();\n if (arcadeDrive != null) \n arcadeDrive.start();\n }",
"public void processAppBatteryUsage() {\n create();\n\n SensorManager sensorManager = (SensorManager) mContext\n .getSystemService(Context.SENSOR_SERVICE);\n final int which = mStatsType;\n final int speedSteps = mPowerProfile.getNumSpeedSteps();\n final double[] powerCpuNormal = new double[speedSteps];\n final long[] cpuSpeedStepTimes = new long[speedSteps];\n for (int p = 0; p < speedSteps; p++) {\n powerCpuNormal[p] = mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_ACTIVE, p);\n }\n final double averageCostPerByte = getAverageDataCost();\n long uSecTime = mStats.computeBatteryRealtime(SystemClock.elapsedRealtime() * 1000, which);\n long appWakelockTime = 0;\n // BatterySipper osApp = null;\n mStatsPeriod = uSecTime;\n SparseArray<? extends Uid> uidStats = mStats.getUidStats();\n final int NU = uidStats.size();\n for (int iu = 0; iu < NU; iu++) {\n Uid u = uidStats.valueAt(iu);\n double power = 0;\n double highestDrain = 0;\n String packageWithHighestDrain = null;\n //mUsageList.add(new AppUsage(u.getUid(), new double[] {power}));\n Map<String, ? extends BatteryStats.Uid.Proc> processStats = u.getProcessStats();\n long cpuTime = 0;\n long cpuFgTime = 0;\n long wakelockTime = 0;\n long gpsTime = 0;\n if (processStats.size() > 0) {\n // Process CPU time\n for (Map.Entry<String, ? extends BatteryStats.Uid.Proc> ent : processStats\n .entrySet()) {\n Log.print(\"Process name = \" + ent.getKey());\n Uid.Proc ps = ent.getValue();\n final long userTime = ps.getUserTime(which);\n final long systemTime = ps.getSystemTime(which);\n final long foregroundTime = ps.getForegroundTime(which);\n cpuFgTime += foregroundTime * 10; // convert to millis\n final long tmpCpuTime = (userTime + systemTime) * 10; // convert to millis\n int totalTimeAtSpeeds = 0;\n // Get the total first\n for (int step = 0; step < speedSteps; step++) {\n cpuSpeedStepTimes[step] = ps.getTimeAtCpuSpeedStep(step, which);\n totalTimeAtSpeeds += cpuSpeedStepTimes[step];\n }\n if (totalTimeAtSpeeds == 0)\n totalTimeAtSpeeds = 1;\n // Then compute the ratio of time spent at each speed\n double processPower = 0;\n for (int step = 0; step < speedSteps; step++) {\n double ratio = (double) cpuSpeedStepTimes[step] / totalTimeAtSpeeds;\n processPower += ratio * tmpCpuTime * powerCpuNormal[step];\n }\n cpuTime += tmpCpuTime;\n power += processPower;\n if (packageWithHighestDrain == null || packageWithHighestDrain.startsWith(\"*\")) {\n highestDrain = processPower;\n packageWithHighestDrain = ent.getKey();\n } else if (highestDrain < processPower && !ent.getKey().startsWith(\"*\")) {\n highestDrain = processPower;\n packageWithHighestDrain = ent.getKey();\n }\n }\n Log.print(\"Max drain of \" + highestDrain + \" by \" + packageWithHighestDrain);\n }\n if (cpuFgTime > cpuTime) {\n if (cpuFgTime > cpuTime + 10000) {\n Log.print(\"WARNING! Cputime is more than 10 seconds behind Foreground time\");\n }\n cpuTime = cpuFgTime; // Statistics may not have been gathered yet.\n }\n power /= 1000;\n\n // Process wake lock usage\n Map<String, ? extends BatteryStats.Uid.Wakelock> wakelockStats = u.getWakelockStats();\n for (Map.Entry<String, ? extends BatteryStats.Uid.Wakelock> wakelockEntry : wakelockStats\n .entrySet()) {\n Uid.Wakelock wakelock = wakelockEntry.getValue();\n // Only care about partial wake locks since full wake locks\n // are canceled when the user turns the screen off.\n BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);\n if (timer != null) {\n wakelockTime += timer.getTotalTimeLocked(uSecTime, which);\n }\n }\n wakelockTime /= 1000; // convert to millis\n appWakelockTime += wakelockTime;\n\n // Add cost of holding a wake lock\n power += (wakelockTime * mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_AWAKE)) / 1000;\n\n // Add cost of data traffic\n long tcpBytesReceived = u.getTcpBytesReceived(mStatsType);\n long tcpBytesSent = u.getTcpBytesSent(mStatsType);\n power += (tcpBytesReceived + tcpBytesSent) * averageCostPerByte;\n\n // Add cost of keeping WIFI running.\n long wifiRunningTimeMs = u.getWifiRunningTime(uSecTime, which) / 1000;\n mAppWifiRunning += wifiRunningTimeMs;\n power += (wifiRunningTimeMs * mPowerProfile.getAveragePower(PowerProfile.POWER_WIFI_ON)) / 1000;\n\n // Process Sensor usage\n Map<Integer, ? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats();\n for (Map.Entry<Integer, ? extends BatteryStats.Uid.Sensor> sensorEntry : sensorStats\n .entrySet()) {\n Uid.Sensor sensor = sensorEntry.getValue();\n int sensorType = sensor.getHandle();\n BatteryStats.Timer timer = sensor.getSensorTime();\n long sensorTime = timer.getTotalTimeLocked(uSecTime, which) / 1000;\n double multiplier = 0;\n switch (sensorType) {\n case Uid.Sensor.GPS:\n multiplier = mPowerProfile.getAveragePower(PowerProfile.POWER_GPS_ON);\n gpsTime = sensorTime;\n break;\n default:\n android.hardware.Sensor sensorData = sensorManager.getDefaultSensor(sensorType);\n if (sensorData != null) {\n multiplier = sensorData.getPower();\n Log.print(\"Got sensor \" + sensorData.getName() + \" with power = \"\n + multiplier);\n }\n }\n power += (multiplier * sensorTime) / 1000;\n }\n\n // Log.print(\"UID \" + u.getUid() + \": power=\" + power);\n Log.print(\"PACKAGE \" + packageWithHighestDrain + \": power=\" + power);\n\n // // Add the app to the list if it is consuming power\n // if (power != 0 || u.getUid() == 0) {\n // BatterySipper app = new BatterySipper(getActivity(), mRequestQueue, mHandler,\n // packageWithHighestDrain, DrainType.APP, 0, u,\n // new double[] {power});\n // app.cpuTime = cpuTime;\n // app.gpsTime = gpsTime;\n // app.wifiRunningTime = wifiRunningTimeMs;\n // app.cpuFgTime = cpuFgTime;\n // app.wakeLockTime = wakelockTime;\n // app.tcpBytesReceived = tcpBytesReceived;\n // app.tcpBytesSent = tcpBytesSent;\n // if (u.getUid() == Process.WIFI_UID) {\n // mWifiSippers.add(app);\n // } else if (u.getUid() == Process.BLUETOOTH_GID) {\n // mBluetoothSippers.add(app);\n // } else {\n // mUsageList.add(app);\n // }\n // if (u.getUid() == 0) {\n // osApp = app;\n // }\n // }\n // if (u.getUid() == Process.WIFI_UID) {\n // mWifiPower += power;\n // } else if (u.getUid() == Process.BLUETOOTH_GID) {\n // mBluetoothPower += power;\n // } else {\n // if (power > mMaxPower) mMaxPower = power;\n // mTotalPower += power;\n // }\n // if (DEBUG) Log.i(TAG, \"Added power = \" + power);\n }\n\n // The device has probably been awake for longer than the screen on\n // time and application wake lock time would account for. Assign\n // this remainder to the OS, if possible.\n // if (osApp != null) {\n // long wakeTimeMillis = mStats.computeBatteryUptime(\n // SystemClock.uptimeMillis() * 1000, which) / 1000;\n // wakeTimeMillis -= appWakelockTime - (mStats.getScreenOnTime(\n // SystemClock.elapsedRealtime(), which) / 1000);\n // if (wakeTimeMillis > 0) {\n // double power = (wakeTimeMillis\n // * mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_AWAKE)) / 1000;\n // osApp.wakeLockTime += wakeTimeMillis;\n // osApp.value += power;\n // osApp.values[0] += power;\n // if (osApp.value > mMaxPower) mMaxPower = osApp.value;\n // mTotalPower += power;\n // }\n // }\n }",
"public static void wakeupPhoneScreen(Context context){\n PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE);\n if(powerManager != null) {\n mScreenLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, \"TAG\");\n // Keep the screen awake for 1 minute\n mScreenLock.acquire(60*1000L /* 1 minute */);\n }\n }"
] | [
"0.66185725",
"0.6525374",
"0.6427244",
"0.6408734",
"0.6388559",
"0.6381295",
"0.6343871",
"0.631996",
"0.6289794",
"0.6273711",
"0.62524796",
"0.6244983",
"0.6207337",
"0.6121633",
"0.6109793",
"0.6083362",
"0.6067685",
"0.6057168",
"0.6056948",
"0.6017028",
"0.6006475",
"0.5992517",
"0.598625",
"0.59813017",
"0.5965191",
"0.596492",
"0.59643376",
"0.59622484",
"0.59544146",
"0.5950598",
"0.5919486",
"0.59098923",
"0.59051347",
"0.58766407",
"0.58710176",
"0.58699185",
"0.58330154",
"0.5831352",
"0.5828565",
"0.5821729",
"0.5814764",
"0.581164",
"0.5809039",
"0.58083475",
"0.58023417",
"0.58003944",
"0.5793587",
"0.57871175",
"0.5784387",
"0.57829386",
"0.5782053",
"0.57776904",
"0.5776484",
"0.5771813",
"0.5767971",
"0.5760431",
"0.57595444",
"0.57494086",
"0.5743961",
"0.5739177",
"0.57152593",
"0.5711069",
"0.5709078",
"0.5708342",
"0.57041764",
"0.5701856",
"0.56996924",
"0.5697066",
"0.5688176",
"0.56734526",
"0.5670386",
"0.5667143",
"0.5662121",
"0.56616426",
"0.56603545",
"0.56466854",
"0.5646536",
"0.56362563",
"0.5618065",
"0.561459",
"0.560645",
"0.5596291",
"0.5596213",
"0.55873394",
"0.55819935",
"0.5580415",
"0.5578699",
"0.5571592",
"0.5571434",
"0.5567352",
"0.55668",
"0.5560851",
"0.55569714",
"0.5549949",
"0.55451494",
"0.5535971",
"0.55237126",
"0.55166984",
"0.550155",
"0.54883766"
] | 0.7286301 | 0 |
Make robot use battery (if possible). | @Override
public void useBattery(Robot robot, Battery battery)
{
try
{
if(robot.canUse(battery))
{
robot.use(battery);
}
else
{
System.out.println("This battery could not be used by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this battery is terminated; the robot cannot use the battery.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int monitorBattery(PrintWriter pw) throws Exception {\n boolean enabled;\n checkPermission(\"change battery monitoring\");\n String opt = getNextArgRequired();\n if (\"on\".equals(opt)) {\n enabled = true;\n } else if (\"off\".equals(opt)) {\n enabled = false;\n } else {\n PrintWriter errPrintWriter = getErrPrintWriter();\n errPrintWriter.println(\"Error: unknown option \" + opt);\n return 1;\n }\n long ident = Binder.clearCallingIdentity();\n try {\n this.mInternal.setMonitorBattery(enabled);\n if (enabled) {\n pw.println(\"Battery monitoring enabled\");\n } else {\n pw.println(\"Battery monitoring disabled\");\n }\n Binder.restoreCallingIdentity(ident);\n return 0;\n } catch (Throwable th) {\n Binder.restoreCallingIdentity(ident);\n throw th;\n }\n }",
"@Override\r\n\tpublic void pickUpBattery(Robot robot, Battery battery)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot pick up the battery.\");\r\n\t\t}\r\n\t}",
"private void onFullBattery() {\n\n }",
"private void forceGetBatteryInfo(IMethodResult result)\n\t{\n\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\tif(activity != null)\n\t\t{\n\t\t\tIntent batteryIntent = activity.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\tboolean isPlugged = (batteryIntent.getIntExtra(\"plugged\", 0) == 1 ? true : false);\n\t\t\tint level = batteryIntent.getIntExtra(\"level\", 0);\n\t\t\tbatteryLevel = level;\n\t\t\tfireBatteryStatus(level, isPlugged, \"User Request\", result);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLogger.E(TAG, \"Could not communicate with main Activity\");\n\t\t\tresult.setError(\"Internal Error. Could not communicate with Activity\");\n\t\t}\n\t}",
"private synchronized void updateBattery(){\n \tdouble battery = MathUtils.round(Battery.getVoltage(),1);\n \tstore(new DisplayableData(\"battery\", battery+\"V\", battery));\n }",
"@Override\n public void batteryStatus(int value) {\n }",
"int getBattery();",
"private boolean checkBatteryLevelOK() {\n return true;\n }",
"public void charge() {\n\t\t\tSystem.out.println(\"Battery is charging\");\n\t\t}",
"@Test\n\tpublic void testsetBattery2zero() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\trobot.setBatteryLevel(0);\n\t\ttry {\n\t\t\tassertFalse(explorer.drive2Exit());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void batteryType(String type)\n {\n\t batteryType = type;\n }",
"@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }",
"public void setBattery(Byte battery) {\n this.battery = battery;\n }",
"@Override\n public void batteryCharge() {\n super.batteryCharge();\n }",
"public void teleopPeriodic() {\n\t\t// resetAndDisable();\n\t\tupdateDashboard();\n\t\tLogitechJoystick.controllers();\n\t\tDrivetrain.arcadeDrive();\n\t\tShooterAngleMotor.angleShooter();\n\t\tBallShooter.shootBalls();\n\t\tSonicSensor.updateSensors();\n\t\t\n\t\t//if(LogitechJoystick.rightBumper2)\n\t\t\t//{\n\t\t\t\t//LowBar.makeArmStable();\n\t\t\t//}\n\n\t}",
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"public int getBatteryLevel() { return batteryLevel; }",
"public Builder setBattery(int value) {\n \n battery_ = value;\n onChanged();\n return this;\n }",
"public float batteryLevel() {\n return 1;\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}",
"public interface OnBatteryLow{void changeBrightness(int buttatyPercents);\n}",
"void useGodPower(boolean use);",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);\r\n boolean full = level == 100;\r\n\r\n Log.d(TAG, \"Power changed - level \" + level);\r\n\r\n // wenn voll\r\n if (full) {\r\n makeNotification(false);\r\n }\r\n // wenn leerer geworden (nur bei Umstieg von grün auf orange notwendig)\r\n else {\r\n makeNotification(true);\r\n }\r\n }",
"public boolean getOnBattery()\n\t{\n\t\treturn getBooleanIOValue(\"OnBattery\", false);\n\t}",
"@Override\n public void periodic() {\n\t\t// myDrive.\n\n\t\t// System.out.println(Robot.m_oi.getSpeed());\n\t\t// SmartDashboard.putNumber(\"Dial Output: \", Robot.m_oi.getSpeed());\n\n\t\t// //Wheel Speed Limits\n\n\t\t// SmartDashboard.putNumber(\"Front Left Percent\", myDrive.getFLSpeed());\n\t\t// SmartDashboard.putNumber(\"Front Right Percent\", myDrive.getFRSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Left Percent\", myDrive.getRLSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Right Percent\", myDrive.getRRSpeed());\n\n\t\t//Test Code for Selecting Calibration Motor \n\t\t//***COMMENT OUT BEFORE REAL GAME USE***\n\t\t// if (Robot.m_oi.getArmDown()) {\n\t\t// \t// System.out.println(\"Front Left Wheel Selected\");\n\t\t// \tWheel = 1;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getArmUp()) {\n\t\t// \t// System.out.println(\"Back Left Wheel Selected\");\n\t\t// \tWheel = 2;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallIn()) {\n\t\t// \t// System.out.println(\"Front Right Wheel Selected\");\n\t\t// \tWheel = 3;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallOut()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 4;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBlueButton()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 0;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t// } \n\n\t\t// if (Wheel == 1) {\n\n\t\t// \tmyDrive.setFLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 2) {\n\n\t\t// \tmyDrive.setRLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 3) {\n\n\t\t// \tmyDrive.setFRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 4) {\n\n\t\t// \tmyDrive.setRRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// }\n\n\t\t// if (Robot.m_oi.getSafety()) {\n\n\t\t// \tspeedLimit = 1.0;\n\t\t// \tstrafeLimit = 1.0;\n\n\t\t// } else {\n\n\t\t// \tspeedLimit = 0.5; \n\t\t// \tstrafeLimit = 0.8;\n\t\t\t\t\n\t\t// }\n\n\n\n\t\t//System.out.print (\"strafeLimit: \" + strafeLimit);\n\t\t//System.out.println(Robot.m_oi.getX() * strafeLimit);\n\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY() * speedLimit), // set Y speed\n\t\t// \t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t// \t(Robot.m_oi.getRotate() * rotateLimit), // set rotation rate\n\t\t// \t0); // gyro angle \n\t\t\n\t\t//TODO: Rotate robot with vision tracking, set up curve to slow down as target approaches center.\n\t\t// if (Robot.m_oi.getStartButton()) {\n\t\t// \tmyDrive.driveCartesian(\n\t\t// \t\t (0.4), // set Rotation\n\t\t// \t\t (0.0), // set Strafe\n\t\t// \t\t (0.0), // set Forward/Back\n\t\t// \t\t 0);\n\t\t// } else {\n\t\tmyDrive.driveCartesian(\n\t\t\t(Robot.m_oi.getY() * rotateLimit), // set Y speed\n\t\t\t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t\t(Robot.m_oi.getRotate() * speedLimit), // set rotation rate\n\t\t\t0);\n\t\t// }\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY()), // set Y speed\n\t\t// \t(Robot.m_oi.getX()), // set X speed\n\t\t// \t(Robot.m_oi.getRotate()), // set rotation rate\n\t\t// \t0); \n\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tupdate();\n\t\t\n\t\t//dashboard outputs\n\t\tdashboardOutput();\n\t\t\n\t\t\n\t\t\n\t\tif (tankDriveBool) {\n\t\t\ttankDrive();\n\t\t} \n\t\telse {\n\t\t\ttankDrive();\n\t\t}\n\t\tif (buttonA) {\n\t\t\ttest = true;\n\t\t\twhile (test) {\n\t\t\t\tcalibrate(10);\n\t\t\t\ttest = false;\n\t\t\t}\n\t\t}\n\t\tif (buttonY) {\n\t\t\tclimbMode = !climbMode;\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0.5);\n\t\t\tTimer.delay(0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0);\n\t\t}\n\t\tverticalMovement();\n\t\tgrab();\n\t}",
"private void fireBatteryStatus(String trigger)\n\t{\n\t\tfireBatteryStatus(batteryLevel, isPowerConnected, trigger, null);\n\t}",
"private void registerForBatteryStatus()\n\t{\n\t\tif(!isReceiverRegistered)\n\t\t{\n\t\t\tLogger.D(TAG, \"registerForBatteryStatus async\");\n\t\t\tActivity activity = RhodesActivity.safeGetInstance();\n\t\t\tif(activity != null)\n\t\t\t{\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));\n\t\t\t\tactivity.registerReceiver(this, new IntentFilter(Intent.ACTION_BATTERY_LOW));\n\t\t\t\tisReceiverRegistered = true;\n\t\t\t}\n\t\t\telse Logger.E(TAG, \"Could not communicate with main Activity\");\n\t\t}\n\t}",
"public static void updateBatteryPerBlock(Drone drone) {\n\n //synchronized (lock){\n\n if (drone.isShutDown()) {\n return;\n }\n\n if (drone.isEconomyMode()) {\n\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n\n Double economyModeBatteryPerBlock = batteryPerBlock / 2;\n\n Double newCurrentBattery = oldCurrentBattery - economyModeBatteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n } else if (drone.isNormalMode()) {\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n Double newCurrentBattery = oldCurrentBattery - batteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n }\n\n // }\n\n\n }",
"public void teleopPeriodic() {\n \t//getInstance().run();;\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickRight); //This line drives the robot using the values of the joystick and the motor controllers selected above\n \tScheduler.getInstance().run();\n\t\n }",
"@Override\n\tpublic void autonomousPeriodic() {\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\n\t\tScheduler.getInstance().run();\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t}",
"@Override\n public void teleopPeriodic() {\n CommandScheduler.getInstance().run();\n OI.getInstance().getPilot().run();\n SmartDashboard.putNumber(\"gyro\", getRobotContainer().getTecbotSensors().getYaw());\n SmartDashboard.putBoolean(\"isSpeed\", getRobotContainer().getDriveTrain().getTransmissionMode() == DriveTrain.TransmissionMode.speed);\n SmartDashboard.putString(\"DT_MODE\", getRobotContainer().getDriveTrain().getCurrentDrivingMode().toString());\n SmartDashboard.putNumber(\"x_count\", getRobotContainer().getClimber().getxWhenPressedCount());\n\n }",
"public default void battery() {\n\t\tSystem.out.println(\"battery is a default method from Java 1.8\");\n\t}",
"@Test\n\t public void testwith3KgAnd2Km(){\n\t\t robot = new Robot(3, 2);\n\t\t Assert.assertEquals(54.0, robot.calculateRemainingBattery(),0);\n\t }",
"public void teleopPeriodic() {\n driverScreen.updateLCD();\n }",
"int getBatteryPercentage();",
"public void power()\r\n {\r\n powerOn = true;\r\n }",
"public void setupBackupRobot() throws InterruptedException{\n\n motorFrontLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorFrontRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n setIMUParameters();\n\n while (!imu.isGyroCalibrated()) {\n telemetry.addData(\"IMU\", \"calibrating...\");\n telemetry.update();\n Thread.sleep(50);\n }\n\n telemetry.addData(\"IMU\", \"ready\");\n telemetry.update();\n }",
"public Builder setBatteryPercentage(float value) {\n \n batteryPercentage_ = value;\n onChanged();\n return this;\n }",
"public msg_battery_batterystatus(){\n msgid = MAVLINK_MSG_ID_BATTERY_batterySTATUS;\n }",
"@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }",
"public void teleopPeriodic() \r\n {\r\n Watchdog.getInstance().feed();\r\n Scheduler.getInstance().run();\r\n \r\n //Polls the buttons to see if they are active, if they are, it adds the\r\n //command to the Scheduler.\r\n if (mecanumDriveTrigger.get()) \r\n Scheduler.getInstance().add(new MechanumDrive());\r\n \r\n else if (tankDriveTrigger.get())\r\n Scheduler.getInstance().add(new TankDrive());\r\n \r\n else if (OI.rightJoystick.getRawButton(2))\r\n Scheduler.getInstance().add(new PolarMechanumDrive());\r\n \r\n resetGyro.get();\r\n \r\n //Puts the current command being run by DriveTrain into the SmartDashboard\r\n SmartDashboard.putData(DriveTrain.getInstance().getCurrentCommand());\r\n \r\n SmartDashboard.putString(ERRORS_TO_DRIVERSTATION_PROP, \"Test String\");\r\n \r\n \r\n }",
"public Byte getBattery() {\n return battery;\n }",
"public BatteryMonitor(Context ctx, MsgMux mux) {\n this.ctx = ctx;\n this.mux = mux;\n pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);\n\n IntentFilter mIntentFilter = new IntentFilter();\n mIntentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);\n\n // Battery control - DHCP doesn't work for AP in power save.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n mIntentFilter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n mIntentFilter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);\n }\n ctx.registerReceiver(this, mIntentFilter);\n reg = true;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n bm = (BatteryManager) ctx.getSystemService(Context.BATTERY_SERVICE);\n }\n idleStop = SystemClock.elapsedRealtime();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (pm.isDeviceIdleMode()) {\n idleStart = SystemClock.elapsedRealtime();\n }\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n isPowerSave = pm.isPowerSaveMode();\n }\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (bm.isCharging()) {\n chargingStart = SystemClock.elapsedRealtime();\n }\n }\n\n // TODO: battery pct.\n }",
"public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}",
"@Override\n public void start() {\n\n\n // IF YOU ARE NOT USING THE AUTO MODE\n\n /*\n\n runtime.reset();\n\n ElapsedTime time = new ElapsedTime();\n\n time.reset();\n\n while (time.time() < 1) {\n\n armMotor.setPower(0.5);\n\n }\n\n armMotor.setPower(0);\n\n // get the grabbers ready to grip the blocks\n leftGrab.setPosition(0.9);\n rightGrab.setPosition(0.1);\n\n /*\n time.reset();\n\n while(time.time() < 0.6) {\n\n armMotor.setPower(-0.5);\n\n }\n\n */\n\n\n }",
"@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n // ros_string = workingSerialCom.read();\n // yavuz = workingSerialCom.StringConverter(ros_string, 2);\n // Inverse.Inverse(yavuz);\n\n // JoystickDrive.execute();\n\n\n\n // ros_string = workingSerialCom.read();\n // alt_yurur = workingSerialCom.StringConverter(ros_string, 1);\n // robot_kol = workingSerialCom.StringConverter(ros_string, 2);\n Full.Full(yavuz);\n \n }",
"public PotatoPower() {\r\n\t\t//pos5 = .975; //Low Bar and Boulder Pickup\r\n\t\t//pos9 = 1.484; //Low Goal Shoot\r\n\t\t//pos12 = 1.770; //High Goal Shoot\r\n\t\t//pos7 = 2.347; //Scale and Human Station\r\n\t\t//pos3 = 0; //Stop Motor\r\n\t\t//m5stopRange = 0.001; // range above and below set point to allow\r\n\t\t// for over or under when motor is moving faster\r\n\t\t\t// than we are reading the sting pot\r\n\t\tgoBall= false;\r\n\t\t//inAuto = false;\r\n\t}",
"@Override\r\n public void start() {\r\n runtime.reset();\r\n FL.setPower(1);\r\n FR.setPower(1);\r\n BR.setPower(1);\r\n BL.setPower(1);\r\n try{\r\n Thread.sleep(850);\r\n }\r\n catch (Exception e) {\r\n \r\n }\r\n FL.setPower(0);\r\n FR.setPower(0);\r\n BL.setPower(0);\r\n BR.setPower(0); \r\n }",
"public Builder setBatteryPercentage(int value) {\n extraCase_ = 6;\n extra_ = value;\n onChanged();\n return this;\n }",
"@Override\n public void robotPeriodic() {\n\n enabledCompr = pressBoy.enabled();\n //pressureSwitch = pressBoy.getPressureSwitchValue();\n currentCompr = pressBoy.getCompressorCurrent();\n //SmartDashboard.putBoolean(\"Pneumatics Loop Enable\", closedLoopCont);\n SmartDashboard.putBoolean(\"Compressor Status\", enabledCompr);\n //SmartDashboard.putBoolean(\"Pressure Switch\", pressureSwitch);\n SmartDashboard.putNumber(\"Compressor Current\", currentCompr);\n }",
"public int getBattery() {\n return battery_;\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"public void chargeRobot(String robotUID, Warehouse wh) {\n\t\t//If the robot that wants to be charged is the assignedRobotUID, charge it. \n\t\tif(assignedRobotUID.contentEquals(robotUID)) {\n\t\t\t//Get the robots charge percentage. \n\t\t\tint battery = wh.getRobot(robotUID).getBatteryStatus();\n\t\t\t\n\t\t\t//Take this battery charge, and add the POWER_UNITS_PER_TICK to it.\n\t\t\tbattery += POWER_UNITS_PER_TICK;\n\t\t\t\n\t\t\t//If the robots battery exceeds the max, e.g., 101 / 100, change the battery to the max. \n\t\t\tif(wh.getRobot(robotUID).getBatteryStatus()>wh.getRobot(robotUID).getMaxBattery()) {\n\t\t\t\tbattery = wh.getRobot(robotUID).getMaxBattery();\n\t\t\t}\n\t\t\t\n\t\t\t//Set the battery charge to this new value.\n\t\t\twh.getRobot(robotUID).setBatteryChargePercentage(battery);\n\t\t}\n\t}",
"@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Climber Safety Mode: \", Robot.m_oi.getSafety());\n\n if (Robot.m_oi.getSafety()) {\n \t\tif (Robot.m_oi.getClimbUp()) {\n // if (printDebug) {\n // System.out.println(\"Climb: up speed = \" + speed);\n // }\n // talonMotor.setInverted(false); // do not reverse motor\n talonMotor.set(-speed); // activate motor\n\n \t\t} else if (Robot.m_oi.getClimbDown()) {\n // if (printDebug) {\n // System.out.println(\"IntakeArm: retract speed = \" + speed);\n // }\n // talonMotor.setInverted(true); // reverse motor\n talonMotor.set(speed);\n \n \t\t} else { // else no hand button pressed, so stop motor\n talonMotor.set(0);\n }\n\n if (climbState == 0 && Robot.m_oi.getClimbUp()) {\n climbState = 1;\n }\n\n if (climbState == 1 && Robot.m_oi.getClimbDown()) {\n climbState = 2;\n }\n\n if (climbState == 2 && talonMotor.getSensorCollection().isFwdLimitSwitchClosed()) {\n // Activiate the solenoid\n RobotMap.solenoid.extendSolenoid(true);\n }\n }\n }",
"public void charger() throws WargameException;",
"public void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t// Light/flash LEDs as needed\n\t\tif (timerLEDs.get() >= timerLEDsHalfPeriod) {\n\t timerLEDs.reset();\n\t timerLEDsCycleHigh = !timerLEDsCycleHigh;\n\t if (timerLEDsCycleHigh) {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle);\n\t } else {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle /*&& !shooter.bLEDsFlywheelAtSpeed*/);\t \t\n\t }\n\t\t}\n/*\t\t\n\t\t// Rumble as needed\n\t\tboolean ballLoaded = shooter.isBallLoaded(); \n\t\tif (ballLoaded && !prevBallLoaded) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kLeftRumble, 1);\n\t\t}\n\t\tprevBallLoaded = ballLoaded;\n\n\t\tboolean readyToShoot = shooter.bLEDsArmAtAngle && shooter.bLEDsFlywheelAtSpeed;\n\t\tif (readyToShoot && !prevReadyToShoot) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kRightRumble, 1);\n\t\t}\n\t\tprevReadyToShoot = readyToShoot;\n\n\t\tif (timerRumble.get() > 0.5) {\n\t \toi.xboxController.setRumble(RumbleType.kLeftRumble, 0);\n\t \toi.xboxController.setRumble(RumbleType.kRightRumble, 0);\n\t\t}\n*/\t\t\n\t\t// Show arm angle\n shooterArm.updateSmartDashboard();\n \n\t\t// Other printouts\n\t\tshooter.updateSmartDashboard();\n\t\tshooter.isBallLoaded();\n\t\tintake.updateSmartDashboard();\n\t\tintake.intakeIsUp();\n\t\tdriveTrain.getDegrees();\n\t\t\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\t\t\t\t\n\t\tif (smartDashboardDebug) {\n\t\t\t// Uncomment the following line to read coPanel knobs.\n//\t\t\toi.updateSmartDashboard();\n\n\t\t\t// Uncomment the following line for debugging shooter motors PIDs.\n//\t\t\tshooter.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following line for debugging the arm motor PID.\n//\t shooterArm.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following lines to see drive train data\n\t \tdriveTrain.getLeftEncoder();\n\t \tdriveTrain.getRightEncoder();\n\t\t\tdriveTrain.smartDashboardNavXAngles();\n\t\t\t\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel voltage\", panel.getVoltage());\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel arm current\", panel.getCurrent(0));\n\t\t}\n\n\t}",
"protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }",
"private void setZeroPowerBrakes() {\n //Initialize Mecanum Wheel DC Motor Behavior\n robot2.DriveRightFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveRightRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n }",
"public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}",
"void setGodPower(boolean b);",
"private void localSetWheelPower(double _fl, double _fr, double _bl,\n double _br) {\n Optional<Bot> possibleBot = BaseStation.getInstance().getBotManager()\n .getBotByName(botName);\n if (possibleBot.isPresent()) {\n // if bot exists, make it mine\n Bot myBot = possibleBot.get();\n\n if (myBot.getCommandCenter() instanceof FourWheelMovement) {\n // command center is correctly referenced\n FourWheelMovement fwmCommandCenter = (FourWheelMovement) myBot\n .getCommandCenter();\n fwmCommandCenter.setWheelPower(_fl, _fr, _bl, _br);\n }\n }\n }",
"@Override\n public void run() {\n handler.postDelayed(checkBatteryStatusRunnable, store != null ? 10000\n : DEFAULT_CHECK_BATTERY_INTERVAL);\n logStatic(\"Battery status is \" + currentBattLevel + \"mm cached. Interval: \" + 10000);\n\n donePlayingLoadBeepBelowTenPercent = false;\n int storedPreviousBatLevel = store.getInt(previousBatValueKey, -1);\n //If no stored battery value, then save the current battery level\n if (storedPreviousBatLevel == -1) {\n store.setInt(previousBatValueKey, (int) currentBattLevel);\n storedPreviousBatLevel = (int) currentBattLevel;\n }\n //Only play the TTS if the current battery level is not the same as previous battery level\n if (storedPreviousBatLevel != -1) {\n //Only alert if time is not in between sleep mode\n Calendar nowCal = Calendar.getInstance();\n boolean isCharging;\n isCharging = BaseActivity.isCharging(getApplicationContext());\n\n String checkIntervalOnBatteryServiceLevelCheckerKeyStore = isCharging ?\n checkIntervalOnBatteryServiceLevelCheckerForCharging :\n checkIntervalOnBatteryServiceLevelCheckerForDisCharging;\n\n //We don't wait for the interval to trigger. So it will check every time for level changes.\n if (!isTimeInBetweenSleepMode(\n store.getLong(startTimeLong), nowCal.getTimeInMillis(),\n store.getLong(stopTimeLong))) {\n checkLoudBeepRules(storedPreviousBatLevel);\n }\n\n if (!isTimeInBetweenSleepMode(\n store.getLong(startTimeLong), nowCal.getTimeInMillis(),\n store.getLong(stopTimeLong))\n && isTimeIntervalDone(store, checkIntervalOnBatteryServiceLevelCheckerKeyStore)) {\n checkRulesOnTheList();\n }\n } else\n logStatic(\"Previous battery level \" + storedPreviousBatLevel + \" is the same as current level \" + currentBattLevel);\n\n }",
"public boolean isForcedAppStandbyForSmallBatteryEnabled() {\n return AppStateTracker.this.injectGetGlobalSettingInt(\"forced_app_standby_for_small_battery_enabled\", 0) == 1;\n }",
"void powerOn();",
"public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"public void liftArm(){armLifty.set(-drivePad.getThrottle());}",
"public static final void setBatteryGain(float battery_gain) {\r\n\t\tBATTERY_GAIN = battery_gain;\r\n\t}",
"public int getBattery() {\n return battery_;\n }",
"public void loop()\n {\n double rightPower, leftPower;\n double gearRatio = gamepad1.right_bumper ? 0.7 : 0.2;\n // If right_bumper is down, the gearRatio is 0.7. Otherwise, the gearRatio is 0.3\n \n rightPower = gearRatio * gamepad1.left_stick_y;\n leftPower = gearRatio * gamepad1.right_stick_y;\n \n leftpower = Range.clip(leftpower, -1, 1); //gamepad controllers have a value of 1 when you push it to its maximum foward\n rightpower = Range.clip(rightpower, -1, 1); //limiting the range of each power, min first then max\n \n motorR.setPower(rightPower);\n motroL.setPower(leftPower);\n \n telemetry.addData(\"Gear Ratio \", gearRatio);\n telemetry.addData(\"Right Power \", rightPower);\n telemetry.addData(\"Left Power \", leftPower);\n \n \n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tisAutonomous = false;\n\t\tisTeleoperated = true;\n\t\tisEnabled = true;\n\t\tupdateLedState();\n\t\t//SmartDashboard.putNumber(\"Gyro\", Robot.drivebase.driveGyro.getAngle());\n\t\tSmartDashboard.putNumber(\"Climber Current Motor 1\", Robot.climber.climberTalon.getOutputCurrent());\n\t\tSmartDashboard.putNumber(\"Climber Current motor 2\", Robot.climber.climberTalon2.getOutputCurrent());\n\t\t//visionNetworkTable.getGearData();\n\t//\tvisionNetworkTable.showGearData();\n\t\tSmartDashboard.putNumber(\"GM ACTUAL POSITION\", Robot.gearManipulator.gearManipulatorPivot.getPosition());\n\n\t\tif(Robot.debugging){\t\t\t\n\t\t\tSmartDashboard.putNumber(\"Shooter1RPM Setpoint\", shooter.shooter1.getSetpoint());\n\t \tSmartDashboard.putNumber(\"Intake Pivot Encoder Position\", Robot.gearManipulator.gearManipulatorPivot.getPosition());\n\t\n\t\t\tSmartDashboard.putNumber(\"Gear Manipulator Setpoint\", gearManipulator.gearManipulatorPivot.getSetpoint());\n\t\t}\n\t\t//\tvisionNetworkTable.getGearData();\n\t\t//visionNetworkTable.getHighData();\n\t}",
"@Test\n\tpublic void testWithWeight0KgAndTravel3_5Test() {\n\t\trobot = new Robot(0,3.5);\n\t\tAssert.assertEquals(30.0, robot.calculateRemainingBattery(),0);\n\t}",
"public void setAwake(boolean aw)\n {\n awake = aw;\n }",
"public void teleopPeriodic() {\n Scheduler.getInstance().run();\n// if (oi.driveStick.getRawButton(4)) {\n// System.out.println(\"Left Encoder Distance: \" + RobotMap.leftDriveEncoder.getDistance());\n// System.out.println(\"RightEncoder Distance: \" + RobotMap.rightDriveEncoder.getDistance());\n// }\n\n }",
"public void ApplyMovement() {\n long currTime = SystemClock.uptimeMillis();\n if(currTime - lastUpdateTime < 16){\n return;\n }\n lastUpdateTime = currTime;\n\n\n double tl_power_raw = movement_y-movement_turn+movement_x*1.5;\n double bl_power_raw = movement_y-movement_turn- movement_x*1.5;\n double br_power_raw = -movement_y-movement_turn-movement_x*1.5;\n double tr_power_raw = -movement_y-movement_turn+movement_x*1.5;\n\n\n\n\n //find the maximum of the powers\n double maxRawPower = Math.abs(tl_power_raw);\n if(Math.abs(bl_power_raw) > maxRawPower){ maxRawPower = Math.abs(bl_power_raw);}\n if(Math.abs(br_power_raw) > maxRawPower){ maxRawPower = Math.abs(br_power_raw);}\n if(Math.abs(tr_power_raw) > maxRawPower){ maxRawPower = Math.abs(tr_power_raw);}\n\n //if the maximum is greater than 1, scale all the powers down to preserve the shape\n double scaleDownAmount = 1.0;\n if(maxRawPower > 1.0){\n //when max power is multiplied by this ratio, it will be 1.0, and others less\n scaleDownAmount = 1.0/maxRawPower;\n }\n tl_power_raw *= scaleDownAmount;\n bl_power_raw *= scaleDownAmount;\n br_power_raw *= scaleDownAmount;\n tr_power_raw *= scaleDownAmount;\n\n\n //now we can set the powers ONLY IF THEY HAVE CHANGED TO AVOID SPAMMING USB COMMUNICATIONS\n topLeft.setPower(tl_power_raw);\n bottomLeft.setPower(bl_power_raw);\n bottomRight.setPower(br_power_raw);\n topRight.setPower(tr_power_raw);\n }",
"@Override\r\n\tpublic void dropBattery(Robot robot, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot drop the battery.\");\r\n\t\t}\r\n\t}",
"@Override\n public void robotPeriodic() {\n\n SmartDashboard.putString(\"DB/String 0\", \": \" + ControllerMap.driverMode);\n SmartDashboard.putString(\"DB/String 3\",\n \"pot value: \" + String.valueOf(Intake.getInstance().potentiometer.getVoltage()));\n SmartDashboard.putString(\"DB/String 7\", \"Zero position: \" + Intake.getInstance().getStartingWristEncoderValue());\n SmartDashboard.putString(\"DB/String 8\",\n \"wrist encoder: \" + String.valueOf(Hardware.intakeWrist.getSensorCollection().getQuadraturePosition()));\n SmartDashboard.putString(\"DB/String 9\",\n \"Corrected wrist: \" + String.valueOf(Intake.getInstance().getCorrectedWristEncoderValue()));\n // SmartDashboard.putString(\"DB/String 4\", \"pot value: \" +\n // String.valueOf(intake.potentiometer.getValue()));\n // SmartDashboard.putString(\"DB/String 9\", \"pot voltage: \" +\n // String.valueOf(intake.potentiometer.getVoltage()));\n }",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"public TiltForLowBar() {\n\t\t// Use requires() here to declare subsystem dependencies\n\t\tSystem.out.println(\"starting a new uctilt LOW BAR\");\n\t\trequires(Robot.launcher);\n\t\tinitialize();\n\t\tSystem.out.println(\"made the new uctilt LOW BAR\");\n\n\t}",
"public void teleopPeriodic() {\n Scheduler.getInstance().run();\n rumbleInYourPants();\n turnSpindleIfNeeded();\n turnWinchIfNeeded();\n if (arcadeDrive != null) \n arcadeDrive.start();\n }",
"@Override\n\tpublic void teleopPeriodic() //runs the teleOp part of the code, repeats every 20 ms\n\t{\n\t\tScheduler.getInstance().run(); //has to be here, I think that this is looping the method\n\t\tSmartDashboard.putNumber(\"Encoder Left: \", RobotMap.encoderLeft.getRaw()); //putting the value of the left encoder to the SmartDashboard\n\t\tSmartDashboard.putNumber(\"Encoder Right: \", RobotMap.encoderRight.getRaw()); //putting the value of the right encoder to the smartDashboard\n\t\tSmartDashboard.putNumber(\"Ultrasonic sensor\", ultrasonic.getDistanceIn()); //putting the value of the ultrasonic sensor to the smartDashboard\n//\t\tSmartDashboard.putBoolean(\"allOK\", Robot.driveFar.ultrasonicOK);\n\t\tdriveExecutor.execute(); //running the execute method in driveExecutor\n\t\tgrab.execute(); //running the execute() method in GearGrab_Command (should run without this but this is ensuring us that it is on)\n\t}",
"private void pump_water() {\n\t\t\r\n\t}",
"public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }",
"@Override\n public void initialize() {\n // Robot.Climber.setLimits();\n SmartDashboard.putBoolean(\"Climb:\", true);\n \n }",
"@Test(priority = 4)\n\tpublic void clickBatteryStatus() throws Exception {\n\t\t\n\t\tdriver = DashboardPage.clickBatteryStatus(driver);\n\t\t\n\t\t//ExcelUtils.setCellData(\"Execute Battery\", 5, 1);\n\t}",
"public boolean getBatteryAlarm()\n\t{\n\t\treturn getBooleanIOValue(\"BatteryAlarm\", false);\n\t}",
"void setGoalRPM(double goalRPM);",
"public static void battery1(SetInterface session, String[] argv) throws Exception {\n\t\tlong tims = System.currentTimeMillis();\n\t\tfor(int i = max-1; i >= min; i--) {\n\t\t\tbigtestx b = new bigtestx();\n\t\t\tb.init(i, payloadSize);\n\t\t\tsession.put(b);\n\t\t}\n\t\tlong ms = System.currentTimeMillis();\n\t\tSystem.out.println(\"Added \"+i+\" in \"+(System.currentTimeMillis()-ms)+\"ms.\");\n\t\t System.out.println(\"BATTERY1 SUCCESS in \"+(System.currentTimeMillis()-tims)+\" ms.\");\n\t}",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putBoolean(\"Max Intake Extension: \", RobotMap.intakeLifted.get());\n\t\tSmartDashboard.putBoolean(\"Max Lift Extension:\", RobotMap.isAtTop.get());\n\t\tSmartDashboard.putBoolean(\"Min Lift Extension:\", RobotMap.isAtBottom.get());\n\t\tDriveTrain.driveWithJoystick(RobotMap.stick, RobotMap.rd); // Drive\n\t\tTeleOp.RaiseLift(RobotMap.liftTalon, RobotMap.controller); // Raise lift\n\t\tif(RobotMap.controller.getRawAxis(RobotMap.lowerLiftAxis) >= 0.2) {\n\t\tTeleOp.LowerLift(RobotMap.liftTalon, RobotMap.controller);\n\t\t}\n\t\tTeleOp.DropIntake(RobotMap.controller, RobotMap.intakeLifter);\n\t\tTeleOp.spinOut(RobotMap.intakeVictorLeft, RobotMap.controller);\n\t\t//TeleOp.spinnySpinny(RobotMap.intakeVictorLeft, RobotMap.stick);\n\t}",
"public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }",
"public void goToSleep() {\n mPowerManager.goToSleep(SystemClock.uptimeMillis());\n }",
"@java.lang.Override\n public float getBatteryPercentage() {\n return batteryPercentage_;\n }",
"public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n if(switchesSubsystem.readyToFire()) {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"ready to fire\");\n \t} else {\n \t\tSmartDashboard.putString(\"DB/String \"+0, \"reloading\");\n \t}\n \n SmartDashboard.putString(\"DB/String \"+1, \"Wound switch: \" + switchesSubsystem.isBarDown());\n \tSmartDashboard.putString(\"DB/String \"+2, \"Taut switch: \" + switchesSubsystem.isTaut());\n \tSmartDashboard.putString(\"DB/String \"+3, \"Fired switch: \" + switchesSubsystem.isLauncherFired());\n }",
"public void begin(){\r\n\t\t\ttry {\r\n\t\t\t\twhile( !superpower )\r\n\t\t\t\t\tThread.sleep( 10 );\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}",
"public void robotInit(){\n\t\tSmartDashboard.putNumber(\"Climber Arm Speed: \", 0.5);\n\t\tSmartDashboard.putNumber(\"Climber Winch Speed: \", 0.25);\n\t}",
"private boolean loop() throws Exception{\n\t\treadSensors(100);\r\n\t\tint[] lightBumpReadings = getLightBumps();\r\n\t\tdriveDirect(300, 300);\r\n\t\t//driveDirect(500,350);\r\n\t\t\r\n\t\tif(lightBumpReadings[0]>0){\r\n\t\t\tdriveDirect(175,100);\r\n\t\t\tsleep(300);\r\n\t\t\t\r\n\t\t}\r\n\t\tif(lightBumpReadings[1]>0){\r\n\t\t\tdriveDirect(150,100);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[2]>0){\r\n\t\t\tdriveDirect(125,100);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[3]>0){\r\n\t\t\tdriveDirect(100,125);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[4]>0){\r\n\t\t\tdriveDirect(100,150);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\tif(lightBumpReadings[5]>0){\r\n\t\t\tdriveDirect(100,175);\r\n\t\t\tsleep(300);\r\n\t\t}\r\n\t\t\r\n\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\tdriveDirect(0,500);\r\n\t\t\tsleep(750);\r\n\t\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\t\tdriveDirect(0,500);\r\n\t\t\t\tsleep(1500);\r\n\t\t\t\tif(lightBumpReadings[2]>0 && lightBumpReadings[3]>0){\r\n\t\t\t\t\tdriveDirect(0,500);\r\n\t\t\t\t\tsleep(750);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdriveDirect(300,300);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdriveDirect(300,300);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void teleopPeriodic() {\n\t\t\n\t\t\n\t\t\n//\t\tSmartDashboard.putBoolean(\"Alliance_R\", alliance_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Alliance_L\", alliance_L_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"Scale_R\", R_scaleState);\n//\t\tSmartDashboard.putBoolean(\"Scale_L\", L_scaleState);\n//\t\tSmartDashboard.putBoolean(\"oppisite_R\", opposite_R_SwitchState);\n//\t\tSmartDashboard.putBoolean(\"opposite_L\", opposite_L_SwitchState);\n//\t\t\n//\t\tSmartDashboard.putNumber(\"right Vel\", chassis.rightMagVelocity());\n//\t\tSmartDashboard.putNumber(\"left Vel\", chassis.leftMagVelocity());\n//\t\tSmartDashboard.putNumber(\"right Pos\", chassis.rightMagPosition());\n//\t\tSmartDashboard.putNumber(\"left Pos\", chassis.leftMagPosition());\n\t\tSmartDashboard.putData(\"gyro\", chassis.navx);\n\t\tSmartDashboard.putData(\"Chassis\",chassis);\n\t\tSmartDashboard.putBoolean(\"shift is high\", chassis.shiftIsHigh);\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\t\tSmartDashboard.putNumber(\"Elevator Encoder\", elevator.getElevatorMagPosition());\n\t\t\n//\t\tSmartDashboard.putNumber(\"TurnPID\", chassis.turnSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"TurnController\", chassis.turnController);\n//\t\tSmartDashboard.putData(\"Turn\",new Turn());\t\t\n//\t\tSmartDashboard.putNumber(\"leftDistPID\", chassis.leftDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putNumber(\"rightDistPID\", chassis.rightDistanceSpeed.getSpeed());\n//\t\tSmartDashboard.putData(\"right drive controller\", chassis.rightDistanceController);\n//\t\tSmartDashboard.putData(\"left drive controller\", chassis.leftDistanceController);\t\t\t\n//\t\tSmartDashboard.putData(\"test\",new drivefrompoint());\n\t\tSmartDashboard.putData(\"Arm PID\", arm.armPID);\n\t\tSmartDashboard.putData(\"Elevator PID\", elevator.elePID);\n\t\tSmartDashboard.putData(\"Elevator Subsystem\", elevator);\n\t\tSmartDashboard.putData(\"Hold Climb Command\", new LowerElevatorManual(0.1));\n\t\t\n\t\tSmartDashboard.putNumber(\"intake lead current\", Robot.intake.intakeLeader.getOutputCurrent());\n\t\tSmartDashboard.putNumber(\"intake follow current\", Robot.intake.intakeFollower.getOutputCurrent());\n\t\t\n\t\tSmartDashboard.putNumber(\"arm current\", arm.arm.getOutputCurrent());\n\t\t//SmartDashboard.putBoolean(\"Upper Elevator Limit Switch\", elevato);\n\t\t\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t\t\n\t}",
"public void teleopPeriodic() {\n \t\n \twhile (isOperatorControl() && isEnabled()) {\n \t\tdebug();\n \t\tsmartDashboardVariables();\n \t\t//driver control functions\n \t\tdriverControl();\n \t//state machine\n \tterrainStates();\n \t//this function always comes last\n \t//armSlack();\n Timer.delay(0.005);\t\t// wait for a motor update time\n }\n \tTimer.delay(0.005);\n }",
"private void enableBtmon() {\n System.out.println(\"Starting Btmon Service...\");\n try {\n btmonProcess = new ProcessBuilder(\"/usr/bin/btmon\").start();\n InputStreamReader inputStream = new InputStreamReader(btmonProcess.getInputStream());\n int size;\n char buffer[] = new char[1024];\n while ((size = inputStream.read(buffer, 0, 1024)) != -1) {\n // System.out.println(\" --- Read ----\");\n String data = String.valueOf(buffer, 0, size);\n processBeaconMessage(data);\n // Thread.sleep(1000);\n }\n } catch (IOException ex ) {\n ex.printStackTrace();\n } catch (Exception ex ) {\n ex.printStackTrace();\n } finally {\n if (btmonProcess != null)\n btmonProcess.destroy();\n }\n }",
"private void vibrateWiimote(int millis) {\r\n\t\tOscMessage msg = new OscMessage(\"/jumprope\");\r\n\t\tmsg.add(millis);\r\n\t\tosc.send(msg, addr);\r\n\t}"
] | [
"0.6698333",
"0.6679694",
"0.6597823",
"0.65677476",
"0.6525692",
"0.65211856",
"0.6514249",
"0.64825237",
"0.64392424",
"0.643855",
"0.6409518",
"0.6395725",
"0.6309309",
"0.6261828",
"0.62355494",
"0.61933494",
"0.6185826",
"0.6159555",
"0.6145423",
"0.61306983",
"0.61040175",
"0.61018765",
"0.60909235",
"0.6088273",
"0.60771126",
"0.60402596",
"0.60225296",
"0.60000926",
"0.599345",
"0.5969083",
"0.59670925",
"0.59624493",
"0.5959022",
"0.594522",
"0.59217423",
"0.591348",
"0.59110606",
"0.59092355",
"0.5873858",
"0.5868858",
"0.5867985",
"0.58631045",
"0.5851321",
"0.5849348",
"0.58486617",
"0.5845215",
"0.58416903",
"0.5840356",
"0.5837964",
"0.5827849",
"0.58252037",
"0.5819961",
"0.5810009",
"0.58001465",
"0.57905704",
"0.5790151",
"0.5781927",
"0.5777327",
"0.57759887",
"0.57664806",
"0.5748818",
"0.57451403",
"0.57389086",
"0.5738553",
"0.5735617",
"0.57313746",
"0.57043016",
"0.5701602",
"0.56991",
"0.56942433",
"0.5694099",
"0.56939965",
"0.5690351",
"0.5690331",
"0.5688853",
"0.5684416",
"0.5668377",
"0.56623536",
"0.5646987",
"0.56453663",
"0.5632603",
"0.5626342",
"0.5620561",
"0.5618476",
"0.5617587",
"0.56156486",
"0.5611119",
"0.5609828",
"0.5607119",
"0.56030524",
"0.5602109",
"0.5601646",
"0.5597708",
"0.5596724",
"0.55911815",
"0.558819",
"0.5587673",
"0.5586263",
"0.55719376",
"0.5568058"
] | 0.70001185 | 0 |
Make robot drop battery (if possible). | @Override
public void dropBattery(Robot robot, Battery battery)
{
try
{
if(robot.canDrop(battery))
{
robot.drop(battery);
}
else
{
System.out.println("This battery could not be dropped by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this battery is terminated; the robot cannot drop the battery.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"public void liftArm(){armLifty.set(-drivePad.getThrottle());}",
"public void brake(){\n if (speed <= 0){\n speed = 0;\n }\n else{\n speed -= 5;\n }\n }",
"public void action() {\r\n\t\tsuppressed = false;\r\n\t\tMotor.B.stop();\r\n\t\tMotor.C.stop();\r\n\t\tDelay.msDelay(1000);\r\n\t\tMotor.B.setSpeed(180);\r\n\t\tMotor.C.setSpeed(180);\r\n\t\tMotor.B.forward();\r\n\t\tMotor.C.forward();\r\n\t\tif((light.getLightValue()>46 && light.getLightValue()<49) || (light.getLightValue()>27 && light.getLightValue()<31)){\r\n\t\t\tMotor.B.stop();\r\n\t\t\tMotor.C.stop();\r\n\t\t\tDelay.msDelay(500);\r\n\t\t\tMotor.B.forward();\r\n\t\t\tMotor.C.forward();\r\n\t\t\tif(light.getLightValue()>44 && light.getLightValue()<45){//home base\r\n\t\t\t\tMotor.B.stop();\r\n\t\t\t\tMotor.C.stop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!suppressed){\r\n\t\t\tThread.yield();\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void pickUpBattery(Robot robot, Battery battery)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot pick up the battery.\");\r\n\t\t}\r\n\t}",
"private void pump_water() {\n\t\t\r\n\t}",
"private void onFullBattery() {\n\n }",
"void driveStop() {\n flMotor.setPower(0);\n frMotor.setPower(0);\n blMotor.setPower(0);\n brMotor.setPower(0);\n }",
"@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }",
"public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }",
"public void charge() {\n\t\t\tSystem.out.println(\"Battery is charging\");\n\t\t}",
"public void teleopPeriodic() {\n\t\t// resetAndDisable();\n\t\tupdateDashboard();\n\t\tLogitechJoystick.controllers();\n\t\tDrivetrain.arcadeDrive();\n\t\tShooterAngleMotor.angleShooter();\n\t\tBallShooter.shootBalls();\n\t\tSonicSensor.updateSensors();\n\t\t\n\t\t//if(LogitechJoystick.rightBumper2)\n\t\t\t//{\n\t\t\t\t//LowBar.makeArmStable();\n\t\t\t//}\n\n\t}",
"public DropPower(Brick owner, Breakout game) {\n\t\tsuper(owner, game);\n\t\tthis.falling = false;\n\t}",
"@Test\n\tpublic void testsetBattery2zero() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\trobot.setBatteryLevel(0);\n\t\ttry {\n\t\t\tassertFalse(explorer.drive2Exit());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void stop()\n {\n robot.FL_drive.setPower(0);\n robot.FR_drive.setPower(0);\n robot.BL_drive.setPower(0);\n robot.BR_drive.setPower(0);\n }",
"@Override\r\n\tpublic void useBattery(Robot robot, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(battery))\r\n\t\t\t{\r\n\t\t\t\trobot.use(battery);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This battery could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this battery is terminated; the robot cannot use the battery.\");\r\n\t\t}\r\n\t}",
"public void powerdown() {\n monitor.sendPowerdown();\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tupdate();\n\t\t\n\t\t//dashboard outputs\n\t\tdashboardOutput();\n\t\t\n\t\t\n\t\t\n\t\tif (tankDriveBool) {\n\t\t\ttankDrive();\n\t\t} \n\t\telse {\n\t\t\ttankDrive();\n\t\t}\n\t\tif (buttonA) {\n\t\t\ttest = true;\n\t\t\twhile (test) {\n\t\t\t\tcalibrate(10);\n\t\t\t\ttest = false;\n\t\t\t}\n\t\t}\n\t\tif (buttonY) {\n\t\t\tclimbMode = !climbMode;\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0.5);\n\t\t\tTimer.delay(0.5);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kRightRumble, 0);\n\t\t\tcontroller.setRumble(Joystick.RumbleType.kLeftRumble, 0);\n\t\t}\n\t\tverticalMovement();\n\t\tgrab();\n\t}",
"public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}",
"@Override\n public void batteryCharge() {\n super.batteryCharge();\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tRobot.intakeSubsystem._getSpeed();\n\n\t\tRobot.driveSubsystem.operatorOverride();\n\t\tScheduler.getInstance().run();\n\n\t\tTargetRegion boilerTarget = Robot.navigator.getBoilerTarget();\n\t\tif (boilerTarget != null) {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", boilerTarget.m_centerTop);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", boilerTarget.m_bounds.m_top);\n\t\t} else {\n\t\t\tSmartDashboard.putNumber(\"Target Center X\", -1);\n\t\t\tSmartDashboard.putNumber(\"Target Center Y\", -1);\n\t\t}\n\t}",
"@Override\n public void batteryStatus(int value) {\n }",
"@Override\n protected void end() {\n Robot.m_drive.SetPower(0);\n }",
"public static void climb(boolean button) {\n\t\tif (!Actuators.getWinchRatchetPneumatic().get() && button) {\n\t\t\tActuators.getWinchRatchetPneumatic().set(true);\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.MAX_MOTOR_SPEED);\n\t\t\tActuators.getArmWinchMotor2().set(-Actuators.MAX_MOTOR_SPEED);\n\t\t} else if (Actuators.getWinchRatchetPneumatic().get() && button) {\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.MAX_MOTOR_SPEED);\n\t\t\tActuators.getArmWinchMotor2().set(-Actuators.MAX_MOTOR_SPEED);\n\t\t} else {\n\t\t\tActuators.getArmWinchMotor1().set(Actuators.STOP_MOTOR);\n\t\t\tActuators.getArmWinchMotor2().set(Actuators.STOP_MOTOR);\n\t\t\tActuators.getWinchRatchetPneumatic().set(false);\n\t\t}\n\t}",
"public void ApplyMovement() {\n long currTime = SystemClock.uptimeMillis();\n if(currTime - lastUpdateTime < 16){\n return;\n }\n lastUpdateTime = currTime;\n\n\n double tl_power_raw = movement_y-movement_turn+movement_x*1.5;\n double bl_power_raw = movement_y-movement_turn- movement_x*1.5;\n double br_power_raw = -movement_y-movement_turn-movement_x*1.5;\n double tr_power_raw = -movement_y-movement_turn+movement_x*1.5;\n\n\n\n\n //find the maximum of the powers\n double maxRawPower = Math.abs(tl_power_raw);\n if(Math.abs(bl_power_raw) > maxRawPower){ maxRawPower = Math.abs(bl_power_raw);}\n if(Math.abs(br_power_raw) > maxRawPower){ maxRawPower = Math.abs(br_power_raw);}\n if(Math.abs(tr_power_raw) > maxRawPower){ maxRawPower = Math.abs(tr_power_raw);}\n\n //if the maximum is greater than 1, scale all the powers down to preserve the shape\n double scaleDownAmount = 1.0;\n if(maxRawPower > 1.0){\n //when max power is multiplied by this ratio, it will be 1.0, and others less\n scaleDownAmount = 1.0/maxRawPower;\n }\n tl_power_raw *= scaleDownAmount;\n bl_power_raw *= scaleDownAmount;\n br_power_raw *= scaleDownAmount;\n tr_power_raw *= scaleDownAmount;\n\n\n //now we can set the powers ONLY IF THEY HAVE CHANGED TO AVOID SPAMMING USB COMMUNICATIONS\n topLeft.setPower(tl_power_raw);\n bottomLeft.setPower(bl_power_raw);\n bottomRight.setPower(br_power_raw);\n topRight.setPower(tr_power_raw);\n }",
"public void downgrade(){\n\n //downgrade a buildings stats \n this.setLevel(this.getLevel() - 1);\n this.setMaxHealth(this.getMaxHealth() - 500);\n this.setHealth(this.getHealth() - 500);\n this.maxCapacity -= 20;\n\n }",
"private synchronized void updateBattery(){\n \tdouble battery = MathUtils.round(Battery.getVoltage(),1);\n \tstore(new DisplayableData(\"battery\", battery+\"V\", battery));\n }",
"public void brake(double amount){\n if (amount >= 0 && amount <= 1) {\n decrementSpeed(amount);\n }\n }",
"public void unleash() {\n\t\tlocked = false;\n\t\tfloat percent = framesAccelerated/60.0f;\n\t\tif (percent > 1) percent = 2 - percent;\n\t\tif (percent < 0) percent = 0;\n\t\t\n\t\tif (player.aiControlled()) {\n\t\t\tpercent = AIcontroller.randomStartBoost();\n\t\t}\n\t\t\n\t\tspeed = MAX_SPEED * percent;\n\t}",
"public void dropRamp() {\n if (currentSpeed == 0) {\n storage.dropRamp();\n }\n }",
"public void arm_down() {\n arm_analog(-RobotMap.Arm.arm_speed);\n }",
"public void loop()\n {\n double rightPower, leftPower;\n double gearRatio = gamepad1.right_bumper ? 0.7 : 0.2;\n // If right_bumper is down, the gearRatio is 0.7. Otherwise, the gearRatio is 0.3\n \n rightPower = gearRatio * gamepad1.left_stick_y;\n leftPower = gearRatio * gamepad1.right_stick_y;\n \n leftpower = Range.clip(leftpower, -1, 1); //gamepad controllers have a value of 1 when you push it to its maximum foward\n rightpower = Range.clip(rightpower, -1, 1); //limiting the range of each power, min first then max\n \n motorR.setPower(rightPower);\n motroL.setPower(leftPower);\n \n telemetry.addData(\"Gear Ratio \", gearRatio);\n telemetry.addData(\"Right Power \", rightPower);\n telemetry.addData(\"Left Power \", leftPower);\n \n \n }",
"void useGodPower(boolean use);",
"public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }",
"@Override\n protected void end() {\n drive.setEnabled(false);\n drive.setLeftPower(0);\n drive.setRightPower(0);\n }",
"public void arm_kill() {\n arm_analog(0);\n }",
"private void turnBeaconOff() {\n\t\t\t\n\t\t\tString beaconSetAdvertisingDisable = getSetAdvertisingEnableCmd( false);\n\t\t\t\n\t\t\tfinal String envVars[] = { \n\t\t\t\t\t\"SET_ADV_ENABLE_CMD=\" + beaconSetAdvertisingDisable\n\t\t\t};\n\t\t\t\n\t\t\tfinal String cmd = \"./scripts/beacon_stop\";\n\t\t\t\n\t\t\tboolean status = runScript( cmd, envVars, null, null);\n\t\t\t\n\t\t}",
"private void setZeroPowerBrakes() {\n //Initialize Mecanum Wheel DC Motor Behavior\n robot2.DriveRightFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveRightRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftFront.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot2.DriveLeftRear.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n }",
"public void setBoulderLockOff(){\r\n\t\tservoTarget = Constants.BALL_HOLDER_RETRACTED;\r\n\t}",
"private void halt() {\n robot.leftFront.setPower(0);\n robot.leftBack.setPower(0);\n robot.rightFront.setPower(0);\n robot.rightBack.setPower(0);\n }",
"public Builder clearBatteryPercentage() {\n if (extraCase_ == 6) {\n extraCase_ = 0;\n extra_ = null;\n onChanged();\n }\n return this;\n }",
"@Override\n public void teleopPeriodic() {\n double triggerVal = \n (m_driverController.getTriggerAxis(Hand.kRight)\n - m_driverController.getTriggerAxis(Hand.kLeft))\n * RobotMap.DRIVING_SPEED;\n\n double stick = \n (m_driverController.getX(Hand.kLeft))\n * RobotMap.TURNING_RATE;\n \n m_driveTrain.tankDrive(triggerVal + stick, triggerVal - stick);\n\n if(m_driverController.getAButton()){\n m_shooter.arcadeDrive(RobotMap.SHOOTER_SPEED, 0.0);\n }\n \n else{\n m_shooter.arcadeDrive(0.0, 0.0);\n }\n \n }",
"public void cutHair(){\r\n \t\t System.out.println(\"The barber is cutting hair\");\r\n \t\t\ttry {\r\n\t\t\t sleep(5000);\r\n \t\t\t } catch (InterruptedException ex){ }\r\n \t\t }",
"public void setRemainingAir ( int ticks ) {\n\t\texecute ( handle -> handle.setRemainingAir ( ticks ) );\n\t}",
"int getBattery();",
"private int monitorBattery(PrintWriter pw) throws Exception {\n boolean enabled;\n checkPermission(\"change battery monitoring\");\n String opt = getNextArgRequired();\n if (\"on\".equals(opt)) {\n enabled = true;\n } else if (\"off\".equals(opt)) {\n enabled = false;\n } else {\n PrintWriter errPrintWriter = getErrPrintWriter();\n errPrintWriter.println(\"Error: unknown option \" + opt);\n return 1;\n }\n long ident = Binder.clearCallingIdentity();\n try {\n this.mInternal.setMonitorBattery(enabled);\n if (enabled) {\n pw.println(\"Battery monitoring enabled\");\n } else {\n pw.println(\"Battery monitoring disabled\");\n }\n Binder.restoreCallingIdentity(ident);\n return 0;\n } catch (Throwable th) {\n Binder.restoreCallingIdentity(ident);\n throw th;\n }\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"public void grab() {\n\t\tif (climbMode == false) {\n\t\t\tif (bumperL) {\n\t\t\t\tmotorGL.set(-1);\n\t\t\t\tmotorGR.set(1);\n\t\t\t} \n\t\t\telse if (bumperR) {\n\t\t\t\tmotorGL.set(1);\n\t\t\t\tmotorGR.set(-1);\n\t\t\t}\t\n\t\t\telse {\n\t\t\t\tmotorGL.set(0);\n\t\t\t\tmotorGR.set(0);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void robotPeriodic() {\n double high = m_filter.calculate(m_photoHigh.getValue());// * kValueToInches;\n double low = m_filter.calculate(m_photoLow.getValue()); //* kValueToInches;\n if (low<=6){\n BallPresent = true;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0);\n } else {\n BallPresent = false;\n //stop motor if ultrasonic sensor median falls below 6 inches indicating a ball is blocking the sensor\n m_RightMotor.set(ControlMode.PercentOutput, 0.5);\n }\n /*Shuffleboard.getTab(\"Shooter\").add(\"Ball Present\", BallPresent)\n .withWidget(BuiltInWidgets.kBooleanBox)\n .withPosition(0, 0)\n .withSize(1, 1)\n .withProperties(Map.of(\"colorWhenTrue\",\"green\",\"colorWhenFalse\",\"black\"));*/\n SmartDashboard.putNumber(\"High\", high);\n SmartDashboard.putNumber(\"Low\", low); \n /*Shuffleboard.getTab(\"Shooter\").add(\"Ultrasonic 1\", currentDistance)\n .withWidget(BuiltInWidgets.kGraph)\n .withPosition(0, 2)\n .withSize(4, 4);*/\n // convert distance error to a motor speed\n //double currentSpeed = (kHoldDistance - currentDistance) * kP;\n\n // drive robot\n //m_robotDrive.arcadeDrive(currentSpeed, 0);\n }",
"void setGodPower(boolean b);",
"public void descend()\n {\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);\n extend.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);\n\n latch.release();\n\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n extend.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n intake.deploy();\n }",
"@Override\n\tpublic void autonomousPeriodic() {\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\n\t\tScheduler.getInstance().run();\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t}",
"public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }",
"public static void updateBatteryPerBlock(Drone drone) {\n\n //synchronized (lock){\n\n if (drone.isShutDown()) {\n return;\n }\n\n if (drone.isEconomyMode()) {\n\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n\n Double economyModeBatteryPerBlock = batteryPerBlock / 2;\n\n Double newCurrentBattery = oldCurrentBattery - economyModeBatteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n } else if (drone.isNormalMode()) {\n Double oldCurrentBattery = drone.getCurrentBattery();\n Double batteryPerBlock = drone.getBatteryPerBlock();\n Double newCurrentBattery = oldCurrentBattery - batteryPerBlock;\n\n drone.setCurrentBattery(newCurrentBattery);\n\n }\n\n // }\n\n\n }",
"public void raiseBed(int angle) {\n\n if (getCurrentSpeed() == 0)\n truckBed.raiseRamp(angle);\n else\n System.out.println(\"You can't raise the bed when the truck is moving.\");\n }",
"public void hold() throws DeviceException {\n \t\ttry {\n \t\t\tcontroller.caput(holdChannel, 1, 2.0);\n \t\t} catch (Throwable e) {\n \t\t\tthrow new DeviceException(\"failed to stop or hole the JOB\", e);\n \t\t}\n \t}",
"protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }",
"public void hold() {\n _collectorMotor.set(holdSpeed);\n }",
"public void lift(){\n\t\twhile(Math.abs(robot.lift1.getCurrentPosition()-robot.startingHeight)<3900&&opModeIsActive()){\n\t\t\trobot.lift1.setPower(1);\n\t\t\trobot.lift2.setPower(1);\n\t\t}\n\t\tlift(\"stop\");\n\t}",
"@Override\n\tprotected void takeOff(){\n\t\tgvh.log.i(TAG, \"Drone taking off\");\n\t\tsetControlInput(0, 0, 0, 1);\n\t}",
"public void drop() {\n\t\t// Has player waited cooldown before trying to fire again?\n\t\tif (System.currentTimeMillis() - this.lastFired > Config.WEAPON_COOLDOWN_TIME * 1000) {\n\t\t\t\n\t\t\t// Can this airship drop bombs?\n\t\t\tif (this.properties.DROPS_BOMB) {\n\t\t\t\tBlock[] cannons = getCannons();\n\t\t\t\tint numfiredcannons = 0;\n\t\t\t\tfor (int i = 0; i < cannons.length; i++) {\n\t\t\t\t\tif (cannons[i] != null && cannons[i].getRelative(0, -1, 0).getType().equals(Material.AIR) && cannonHasTnt(cannons[i], Config.NUM_TNT_TO_DROP_BOMB)) {\n\t\t\t\t\t\tif (numfiredcannons < this.properties.MAX_NUMBER_OF_CANNONS ) {\n\t\t\t\t\t\t\tnumfiredcannons++;\n\t\t\t\t\t\t\tlastFired = System.currentTimeMillis();\n\t\t\t\t\t\t\twithdrawTnt(cannons[i], Config.NUM_TNT_TO_DROP_BOMB);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Spawn primed tnt firing downwards TODO: maybe add sound effects for tnt firing? :P\n\t\t\t\t\t\t\tTNTPrimed tnt = cannons[i].getWorld().spawn(cannons[i].getLocation().clone().add(0, -1, 0), TNTPrimed.class);\n\t\t\t\t\t\t\ttnt.setVelocity(new Vector(0, -0.5, 0));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// More cannons on ship than allowed. Not all fired - can break out of loop now.\n\t\t\t\t\t\t\tplayer.sendMessage(ChatColor.AQUA + \"Some cannons did not fire. Max cannon limit is \" + ChatColor.GOLD + this.properties.MAX_NUMBER_OF_CANNONS);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tplayer.sendMessage(ChatColor.GOLD + this.properties.SHIP_TYPE + \" CANNOT DROP BOMBS\");\n\t\t} else\n\t\t\tplayer.sendMessage(ChatColor.GOLD + \"COOLING DOWN FOR \" + ChatColor.AQUA + (int)(Math.round(6 - (System.currentTimeMillis() - this.lastFired) / 1000)) + ChatColor.GOLD + \" MORE SECONDS\");\n\t}",
"private void wentOffWall() {\n //random location\n b.numX = r.nextInt(2400) + 100;\n b.numY = r.nextInt(1400) + 100;\n //random speed\n b.xSpeed = this.newSpeed();\n b.ySpeed = this.newSpeed();\n }",
"public void batteryType(String type)\n {\n\t batteryType = type;\n }",
"public void move() {\n\t\t\tRandom rand = new Random();//random number generator\n\t\t\tint value = rand.nextInt(500000);//there is a 1 in 500000 chance there will be a new powerup every frame.\n\t\t\tif (value==0) {//if the value is 0\n\t\t\t\tRandom ran = new Random();//make a random number generator and a power up vairable\n\t\t\t\tPowerUp currentPowerUp = null;\n\t\t\t\tint type = ran.nextInt(3);//switch the 1 for the amount of types made.\n\t\t\t\tif (type==0) {//add the powerup depending on the random number. There are 3 types\n\t\t\t\t\tcurrentPowerUp = new PowerUp(healthPowerUp, 0);//this adds a life\n\t\t\t\t}\n\t\t\t\telse if (type==1) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(longPowerUp, 1);//this makes the slider wider\n\t\t\t\t} else if (type==2) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(bonusPointsPowerUp, 2);//this just adds points\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//set x and y\n\t\t\t\t//make a random x\n\t\t\t\tint newX = ran.nextInt(401) - 201 + GamePlay.getScreenWidth()/2; //-200 to 200 variance from center\n\t\t\t\tint newY = ran.nextInt(201) - 101 + GamePlay.getScreenHeight()/4;//-100 to 100 variance from the 25% of top distance line.\n\t\t\t\tif (currentPowerUp!=null) {\n\t\t\t\t\tcurrentPowerUp.setX(newX);\n\t\t\t\t\tcurrentPowerUp.setY(newY);\n\t\t\t\t\tpowerUps.add(currentPowerUp);//add the powerups to an array list\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"PowerUp error.\");//if the variable is null, something went wrong.\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//move all powerUps down by ball speed\n\t\t\tfor (PowerUp power: powerUps) {\n\t\t\t\tpower.setY(power.getY() + ballSpeed);\n\t\t\t}\n\t\t\t\n\t\t\t//check if the powerups are off the screen. remove if they are. \n\t\t\tfor (int r = powerUps.size()-1; r>=0; r--) {\n\t\t\t\tif (powerUps.get(r).getY() > GamePlay.getScreenHeight()-h) {\n\t\t\t\t\tpowerUps.remove(r);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//death of a ball\n\t\t\tif (ball.getY()>GamePlay.getScreenHeight() && pause==false) {\n\t\t\t\tdeath();\n\t\t\t}\n\t\t\t\n\t\t\t//no bricks left\n\t\t\tif (blocks.size()==0) {\n\t\t\t\t//you leveled up!\n\t\t\t\tlevelUp();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//wall collision check for ball\n\t\t\t//right wall\n\t\t\tif (ball.rightCollide(GamePlay.getScreenWidth())) {//seperated for later use if wanted.\n\t\t\t\tballVX*=-1;\n\t\t\t} else if (ball.leftCollide(0)) {//left wall\n\t\t\t\tballVX*=-1;\n\t\t\t}\n\t\t\t\n\t\t\tif (ball.topCollide(0)) {//top wall\n\t\t\t\tballVY*=-1;\n\t\t\t} //dont check bottom wall because that is the death of a ball.\n\t\t\t\n\t\t\t//collision with the slider.\n\t\t\tif (ball.getRect().intersects(slider.getRect()) && ball.getY()+ball.getHeight() <= slider.getY()+ballSpeed) {//intersected bool needed\n\t\t\t\tballVY*=-1;\n\t\t\t\tballVX+=sliderVX;//add the slider velocity to the ball velocity, giving user some control over angle. \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//collision with the powerups\n\t\t\t\n\t\t\tfor (int a = powerUps.size()-1; a>=0; a--) {//iterate thrpough the powerups\n\t\t\t\tPowerUp power = powerUps.get(a);\n\t\t\t\tif (power.getRect().intersects(slider.getRect())) {//if the powerups rect intersects, the slider caught it. Remove from screen\n\t\t\t\t\t//THIS MEANS THEY CAUGHT THE POWERUP\n\t\t\t\t\tif (power.getType()==\"HEALTH\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tif (lives<5)\n\t\t\t\t\t\t\tlives+=1;//add a life up to 5\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"LONG\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\textended = true;//extended flag to say the slider is extended. extend the slider's width by the adjust amount preset globally\n\t\t\t\t\t\tslider.resize(slider.getWidth()+adjust, slider.getHeight());\n\t\t\t\t\t\tslider.setX(slider.getX()-adjust/2);\n\t\t\t\t\t\textendTimer.restart();//restart the entend timer\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"BONUS\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tscore+=100;//add a 100 points.\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//collision with blocks\n\t\t\t\n\t\t\tboolean changed = false;//this is a flag to see if any collisions occured this frame\n\t\t\tfor (Block block:blocks) {\n\t\t\t\tRectangle r = block.getRect();\t\t\n\t\t\t\tif (r.intersects(ball.getRect())) {//if the rects intersected, something hit something. However, we don't know from what direction\n\t\t\t\t\t//since the vy is always going to be by 1, we can check if it is equal. There is no multiples to deal with. \n\t\t\t\t\t\n\t\t\t\t\t//this checks if it was colliding from the bottom. Check the bottom edge of block and top of the ball\n\t\t\t\t\tif (ball.getY() + 2 >= block.getBottom() && ball.getY() -2 <= block.getBottom() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//bottom collision\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (ball.getY() + ball.getHeight() + 2 >=block.getTop() && ball.getY() + ball.getHeight() -2 <=block.getTop() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this checks if it was colliding on the top. Check bottom edge of ball and top of block.\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (changed==false && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this must mean it is on the left or right\n\t\t\t\t\t\t//it doesn't matter which one, the change is the exact same!\n\t\t\t\t\t\tballVX*=-1;//flip the x direction\n\t\t\t\t\t\tscore+=block.downColor();//change color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag\n\t\t\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\t\t\tchanged=true;//set the changed flag\n\t\t\t\t\t\thitSound.play();//play the sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}//end the for.\n\t\t\tif (changed==false) {//if no changes, reset the flag.\n\t\t\t\tball.setIntersected(false);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//move everything as per velocity\n\t\t\tif (slider.getX() > 10 && sliderVX<0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);//the slider can move twice as fast as the ball.\n\t\t\t} else if ((slider.getX()+slider.getWidth()) < GamePlay.getScreenWidth()-10 && sliderVX>0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);\n\t\t\t}\n\t\t\tif (ready) {\n\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\tball.setY(ball.getY() + ballVY);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"public void brake(double amount){\n if(acceptedValueRange(amount)){\n decrementSpeed(Math.abs(amount));\n }\n }",
"public void charger() throws WargameException;",
"private void controlLift()\n {\n if (gamepad1.dpad_up) {\n liftMotor.setPower(-0.5);\n } else if (gamepad1.dpad_down) {\n liftMotor.setPower(0.5);\n } else {++backInc;\n liftMotor.setPower(0);\n }\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putBoolean(\"Max Intake Extension: \", RobotMap.intakeLifted.get());\n\t\tSmartDashboard.putBoolean(\"Max Lift Extension:\", RobotMap.isAtTop.get());\n\t\tSmartDashboard.putBoolean(\"Min Lift Extension:\", RobotMap.isAtBottom.get());\n\t\tDriveTrain.driveWithJoystick(RobotMap.stick, RobotMap.rd); // Drive\n\t\tTeleOp.RaiseLift(RobotMap.liftTalon, RobotMap.controller); // Raise lift\n\t\tif(RobotMap.controller.getRawAxis(RobotMap.lowerLiftAxis) >= 0.2) {\n\t\tTeleOp.LowerLift(RobotMap.liftTalon, RobotMap.controller);\n\t\t}\n\t\tTeleOp.DropIntake(RobotMap.controller, RobotMap.intakeLifter);\n\t\tTeleOp.spinOut(RobotMap.intakeVictorLeft, RobotMap.controller);\n\t\t//TeleOp.spinnySpinny(RobotMap.intakeVictorLeft, RobotMap.stick);\n\t}",
"public void shoot() {\n _shooterMotor1.set(_targetRPM);\n }",
"@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}",
"@Override\r\n public void teleopPeriodic() {\n if (m_stick.getRawButton(12)){\r\n TestCompressor.setClosedLoopControl(true);\r\n System.out.println(\"??\");\r\n } \r\n if (m_stick.getRawButton(11)) {\r\n TestCompressor.setClosedLoopControl(false);\r\n }\r\n //// fireCannon(Solenoid_1, m_stick, 8);\r\n //// fireCannon(Solenoid_2, m_stick, 10);\r\n //// fireCannon(Solenoid_3, m_stick, 12);\r\n //// fireCannon(Solenoid_4, m_stick, 7);\r\n //// fireCannon(Solenoid_5, m_stick, 9);\r\n //// fireCannon(Solenoid_6, m_stick, 11);\r\n\r\n // Logic to control trigering is inside\r\n // DO: Move the logic out here, makes more sense. \r\n fireTrio(topSolonoids, m_stick, 5);\r\n fireTrio(bottomSolonoids, m_stick, 6);\r\n\r\n // Make robit go\r\n double[] movementList = adjustJoystickInput(-m_stick.getY(), m_stick.getX(), m_stick.getThrottle());\r\n m_myRobot.arcadeDrive(movementList[0], movementList[1]);\r\n //System.out.println(m_gyro.getAngle());\r\n }",
"public void damageDevice() {\n\t\t\r\n\t}",
"public void raiseFlatbed(){\n if(getCurrentSpeed() == 0){\n flatbed.raiseFlatbed();\n }\n }",
"@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Climber Safety Mode: \", Robot.m_oi.getSafety());\n\n if (Robot.m_oi.getSafety()) {\n \t\tif (Robot.m_oi.getClimbUp()) {\n // if (printDebug) {\n // System.out.println(\"Climb: up speed = \" + speed);\n // }\n // talonMotor.setInverted(false); // do not reverse motor\n talonMotor.set(-speed); // activate motor\n\n \t\t} else if (Robot.m_oi.getClimbDown()) {\n // if (printDebug) {\n // System.out.println(\"IntakeArm: retract speed = \" + speed);\n // }\n // talonMotor.setInverted(true); // reverse motor\n talonMotor.set(speed);\n \n \t\t} else { // else no hand button pressed, so stop motor\n talonMotor.set(0);\n }\n\n if (climbState == 0 && Robot.m_oi.getClimbUp()) {\n climbState = 1;\n }\n\n if (climbState == 1 && Robot.m_oi.getClimbDown()) {\n climbState = 2;\n }\n\n if (climbState == 2 && talonMotor.getSensorCollection().isFwdLimitSwitchClosed()) {\n // Activiate the solenoid\n RobotMap.solenoid.extendSolenoid(true);\n }\n }\n }",
"public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"private void strafe(double powerA, double powerB, int millis, boolean stopAfter) {\n motorFL.setPower(-powerA);\n motorBL.setPower(-powerB);\n motorFR.setPower( powerB);\n motorBR.setPower( powerA);\n\n sleep(millis);\n\n if (stopAfter) {\n motorFL.setPower(0);\n motorBL.setPower(0);\n motorFR.setPower(0);\n motorBR.setPower(0);\n sleep(200);\n }\n }",
"@Override\n public void loop() {\n\n\n if (gamepad1.right_bumper) {\n leftDrive.setDirection(DcMotor.Direction.FORWARD);\n leftDrive.setPower(3);\n } else if (gamepad1.left_bumper) {\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n leftDrive.setPower(3);\n\n }\n\n }",
"public PotatoPower() {\r\n\t\t//pos5 = .975; //Low Bar and Boulder Pickup\r\n\t\t//pos9 = 1.484; //Low Goal Shoot\r\n\t\t//pos12 = 1.770; //High Goal Shoot\r\n\t\t//pos7 = 2.347; //Scale and Human Station\r\n\t\t//pos3 = 0; //Stop Motor\r\n\t\t//m5stopRange = 0.001; // range above and below set point to allow\r\n\t\t// for over or under when motor is moving faster\r\n\t\t\t// than we are reading the sting pot\r\n\t\tgoBall= false;\r\n\t\t//inAuto = false;\r\n\t}",
"@Override\n public void loop() {\n\n //double armRot = robot.Pivot.getPosition();\n\n double deadzone = 0.2;\n\n double trnSpdMod = 0.5;\n\n float xValueRight = gamepad1.right_stick_x;\n float yValueLeft = -gamepad1.left_stick_y;\n\n xValueRight = Range.clip(xValueRight, -1, 1);\n yValueLeft = Range.clip(yValueLeft, -1, 1);\n\n // Pressing \"A\" opens and closes the claw\n if (gamepad1.a) {\n\n if (robot.Claw.getPosition() < 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(1);}\n else if (robot.Claw.getPosition() > 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(0.4);}\n else\n while(gamepad1.a)\n robot.Claw.setPosition(1);\n }\n\n // Pressing \"B\" changes the wrist position\n if (gamepad1.b) {\n\n if (robot.Wrist.getPosition() == 1)\n while(gamepad1.b)\n robot.Wrist.setPosition(0.5);\n else if (robot.Wrist.getPosition() == 0.5)\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n else\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n }\n\n // Turn left/right, overrides forward/back\n if (Math.abs(xValueRight) > deadzone) {\n\n robot.FL.setPower(xValueRight * trnSpdMod);\n robot.FR.setPower(-xValueRight * trnSpdMod);\n robot.BL.setPower(xValueRight * trnSpdMod);\n robot.BR.setPower(-xValueRight * trnSpdMod);\n\n\n } else {//Forward/Back On Solely Left Stick\n if (Math.abs(yValueLeft) > deadzone) {\n robot.FL.setPower(yValueLeft);\n robot.FR.setPower(yValueLeft);\n robot.BL.setPower(yValueLeft);\n robot.BR.setPower(yValueLeft);\n }\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n\n telemetry.addData(\"Drive Encoder Ticks\", robot.FL.getCurrentPosition());\n telemetry.addData(\"Winch Encoder Ticks\", robot.Winch.getCurrentPosition());\n telemetry.addData(\"ColorArm Position\", robot.ColorArm.getPosition());\n telemetry.addData(\"Wrist Position\", robot.Wrist.getPosition());\n telemetry.addData(\"Claw Position\", robot.Claw.getPosition());\n telemetry.addData(\"Grip Position\", robot.Grip.getPosition());\n telemetry.addData(\"Color Sensor Data Red\", robot.Color.red());\n telemetry.addData(\"Color Sensor Data Blue\", robot.Color.blue());\n\n /*\n\n // This is used for an Omniwheel base\n\n // Group a is Front Left and Rear Right, Group b is Front Right and Rear Left\n float a;\n float b;\n float turnPower;\n if(!gamepad1.x) {\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n\n a = Range.clip(yValueLeft + xValueLeft, -1, 1);\n b = Range.clip(yValueLeft - xValueLeft, -1, 1);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n } else {\n\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n a = Range.clip(yValueLeft + xValueLeft, -0.6f, 0.6f);\n b = Range.clip(yValueLeft - xValueLeft, -0.6f, 0.6f);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n }\n\n\n if (gamepad1.dpad_up) {\n\n robot.Swing.setPower(.6);\n\n } else if (gamepad1.dpad_down) {\n\n robot.Swing.setPower(-.6);\n\n } else {\n\n robot.Swing.setPower(0);\n }\n\n if(gamepad1.a){\n\n robot.Claw.setPosition(.4);\n\n } else if(gamepad1.b){\n\n robot.Claw.setPosition(0);\n }\n\n if(gamepad1.left_bumper) {\n\n robot.Pivot.setPosition(armRot+0.0005);\n\n } else if(gamepad1.right_bumper) {\n\n robot.Pivot.setPosition(armRot-0.0005);\n\n } else{\n\n robot.Pivot.setPosition(armRot);\n }\n\n telemetry.addData(\"position\", position);\n\n */\n\n /*\n * Code to run ONCE after the driver hits STOP\n */\n }",
"@Override\n public void loop() {\n // Setup a variable for each drive wheel to save power level for telemetry\n double leftDrivePower;\n double rightDrivePower;\n double driveMultiplier;\n double slowMultiplier;\n double fastMultiplier;\n double BASE_DRIVE_SPEED = 0.6;\n double elevPower;\n double armPower;\n boolean lowerLimitPressed;\n boolean upperLimitPressed;\n\n\n\n\n // Tank Mode uses one stick to control each wheel.\n // - This requires no math, but it is hard to drive forward slowly and keep straight.\n armPower = -gamepad2.right_stick_x * 0.3;\n\n lowerLimitPressed = !lowerLimit.getState();\n upperLimitPressed = !upperLimit.getState();\n\n if((lowerLimitPressed && -gamepad2.left_stick_y < 0) || (upperLimitPressed && -gamepad2.left_stick_y > 0)){\n elevPower = 0;\n }\n else {\n elevPower = -gamepad2.left_stick_y * 1;\n }\n\n if (gamepad2.left_bumper){\n hookPosDeg = HOOK_UP;\n }\n else if (gamepad2.left_trigger > 0){\n hookPosDeg = HOOK_DOWN;\n }\n\n if (gamepad2.right_bumper){\n clawPosDeg = CLAW_OPEN;\n }\n else if (gamepad2.right_trigger > 0){\n clawPosDeg = CLAW_CLOSED;\n }\n\n if (gamepad1.left_trigger > 0){\n slowMultiplier = 0.10;\n }\n else\n slowMultiplier = 0;\n\n if (gamepad1.right_trigger > 0){\n fastMultiplier = 0.30;\n }\n else\n fastMultiplier = 0;\n\n driveMultiplier = BASE_DRIVE_SPEED + slowMultiplier + fastMultiplier;\n leftDrivePower = -gamepad1.left_stick_y * driveMultiplier;\n rightDrivePower = -gamepad1.right_stick_y * driveMultiplier;\n\n // Send power to actuators\n leftDrive.setPower(leftDrivePower);\n rightDrive.setPower(rightDrivePower);\n elev.setPower(elevPower);\n// arm.setTargetPosition(armTarget);\n// arm.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n arm.setPower(armPower);\n hookPos = map(hookPosDeg, HOOK_MIN_POS_DEG, HOOK_MAX_POS_DEG, HOOK_MIN_POS, HOOK_MAX_POS);\n clawPos = map(clawPosDeg, CLAW_MIN_POS_DEG, CLAW_MAX_POS_DEG, CLAW_MIN_POS, CLAW_MAX_POS);\n hook.setPosition(hookPos);\n claw.setPosition(clawPos);\n\n // Show the elapsed game time and wheel power.\n telemetry.addData(\"Status\", \"Run Time: \" + runtime.toString());\n telemetry.addData(\"Drive\", \"left (%.2f), right (%.2f)\", leftDrivePower, rightDrivePower);\n telemetry.addData( \"Elev\", \"power (%.2f)\", elevPower);\n telemetry.addData(\"Limit\", \"lower (%b), upper (%b)\", lowerLimitPressed, upperLimitPressed);\n telemetry.addData(\"Arm Enc\", arm.getCurrentPosition());\n\n }",
"@Override\npublic void teleopPeriodic() {\nm_robotDrive.arcadeDrive(m_stick.getRawAxis(5)* (-0.5), m_stick.getRawAxis(4)*0.5);\n}",
"private boolean checkBatteryLevelOK() {\n return true;\n }",
"public void resetFuelWarning();",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);\r\n boolean full = level == 100;\r\n\r\n Log.d(TAG, \"Power changed - level \" + level);\r\n\r\n // wenn voll\r\n if (full) {\r\n makeNotification(false);\r\n }\r\n // wenn leerer geworden (nur bei Umstieg von grün auf orange notwendig)\r\n else {\r\n makeNotification(true);\r\n }\r\n }",
"@Override\n\tpublic void teleopPeriodic() {\n\t\t\n\t\t\n\t\tif (stick.getRawButtonPressed(2)) {\n\t\t\tstickReversed = !stickReversed;\n\t\t}\n\t\t\n\t\t// double means a floating point (decimal) number with a precision of \"hella\"\n\t\tdouble power = -stick.getY(Hand.kLeft); // negated, because microsoft is weird and up is negative\n\t\tdouble steering = stick.getX(Hand.kRight); \n\t\tif (stickReversed) {\n\t\t\tpower = -power;\n\t\t}\n\t\tdrive(power, steering);\n\t\t\n//\t\tif (xbox.getBumper(Hand.kRight)) {\n//\t\t\tleftIntake.set(xbox.getTriggerAxis(Hand.kLeft));\t\n//\t\t\trightIntake.set(-0.9);\n//\t\t} else if (xbox.getBumper(Hand.kLeft)) {\n//\t\t\tleftIntake.set(-1.0);\n//\t\t\trightIntake.set(1.0);\n//\t\t} else {\n//\t\t\tleftIntake.set(0.0);\n//\t\t\trightIntake.set(0.0);\n//\t\t}\n\t\t\n\t\tif (xbox.getBumper(Hand.kLeft)) { // shoot out\n\t\t\tleftIntake.set(-1.0);\n\t\t} else { // intake\n\t\t\tleftIntake.set(xbox.getTriggerAxis(Hand.kLeft));\n\t\t}\n\t\t\n\t\tif(xbox.getBumper(Hand.kRight)) { //shooty i think\n\t\t\trightIntake.set(1.0);\n\t\t} else { //intake\n\t\t\trightIntake.set(-xbox.getTriggerAxis(Hand.kRight));\n\t\t}\n//\t\tarmSetpoint += xbox.getY(Hand.kLeft) * 60;\n//\t\tSystem.out.println(armSetpoint);\n\t\t\n\t\tarmMotor.set(ControlMode.PercentOutput, xbox.getY(Hand.kLeft) * 0.8);\n\t\tSystem.out.println(xbox.getY(Hand.kLeft));\n\t}",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"public void initiateRespawnBlindness() {\n this.respawnBlindnessEndTick = CommonUtil.getServerTicks() + 5;\n }",
"@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }",
"public void resupply()\n {\n fuel = model.maxFuel;\n ammo = model.maxAmmo;\n }",
"public Builder setBattery(int value) {\n \n battery_ = value;\n onChanged();\n return this;\n }",
"public Builder clearBattery() {\n \n battery_ = 0;\n onChanged();\n return this;\n }",
"public void liftDown() {\n set(m_defaultLiftSpeedDown);\n }",
"@Override\n public void teleopPeriodic() {\n CommandScheduler.getInstance().run();\n OI.getInstance().getPilot().run();\n SmartDashboard.putNumber(\"gyro\", getRobotContainer().getTecbotSensors().getYaw());\n SmartDashboard.putBoolean(\"isSpeed\", getRobotContainer().getDriveTrain().getTransmissionMode() == DriveTrain.TransmissionMode.speed);\n SmartDashboard.putString(\"DT_MODE\", getRobotContainer().getDriveTrain().getCurrentDrivingMode().toString());\n SmartDashboard.putNumber(\"x_count\", getRobotContainer().getClimber().getxWhenPressedCount());\n\n }",
"@Override\n protected void execute() {\n if(!Robot.SCISSOR.getFloorSensor() && speed < 0) {\n Robot.SCISSOR.liftRobotPnumatic(false);\n }\n }",
"public void teleopPeriodic() {\r\n //Driving\r\n if (driveChooser.getSelected().equals(\"tank\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.tankDrive(leftJoystick.getY(), rightJoystick.getY());\r\n } \r\n else {\r\n drive.tankDrive(manipulator.getY(), manipulator.getThrottle());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade1\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), leftJoystick.getX());\r\n } \r\n else {\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getX());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade2\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), rightJoystick.getX());\r\n }\r\n else{\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getTwist());\r\n }\r\n }\r\n \r\n //Shooting\r\n if (shootButton1.get()||shootButton2.get()){\r\n frontShooter.set(-1);\r\n backShooter.set(1);\r\n }\r\n else{\r\n frontShooter.set(0);\r\n backShooter.set(0); \r\n }\r\n if (transportButton1.get()||transportButton2.get()){\r\n transport.set(-1);\r\n }\r\n else{\r\n transport.set(0); \r\n }\r\n \r\n //Intake\r\n if (intakeButton1.get()||intakeButton2.get()){\r\n //intakeA.set(-1);BROKEN\r\n intakeB.set(-1);\r\n }\r\n else{\r\n intakeA.set(0);\r\n intakeB.set(0); \r\n }\r\n \r\n //Turret\r\n if (toggleTurretButton.get()){\r\n turret.set(leftJoystick.getX());\r\n }\r\n else{\r\n turret.set(manipulator.getX());\r\n }\r\n }",
"public void raiseRamp() {\n if (currentSpeed == 0) {\n storage.raiseRamp();\n }\n }",
"public void stay() {\n energy -= 0.01;\n if (energy < 0) {\n energy = 0;\n }\n }",
"public void eject() {\n _collectorMotor.set(ejectSpeed);\n }",
"public Builder clearBatteryPercentage() {\n \n batteryPercentage_ = 0F;\n onChanged();\n return this;\n }",
"@Override\n protected void execute() {\n\n float roll = Robot.driveBase.getRoll();\n\n // if robot is balance, continue climb\n if (roll < 0.2 && roll > -0.2) {\n Robot.climber.frontDown();\n Robot.climber.rearDown();\n } else {\n if (roll > 0.2) {\n // front is too fast -- slow front down\n Robot.climber.frontStop();\n Robot.climber.rearDown();\n }\n if (roll < -0.2) {\n Robot.climber.rearStop();\n Robot.climber.frontDown();\n // rear is too fast -- slow rear down\n }\n\n }\n }"
] | [
"0.694587",
"0.64018106",
"0.63001573",
"0.6264294",
"0.6252969",
"0.6226289",
"0.62094676",
"0.62034607",
"0.6197995",
"0.61897224",
"0.61495405",
"0.612817",
"0.6115241",
"0.610834",
"0.60953015",
"0.60925364",
"0.6082595",
"0.6080912",
"0.604423",
"0.60419416",
"0.6022813",
"0.6003345",
"0.5986063",
"0.59420234",
"0.5894583",
"0.588583",
"0.58835894",
"0.5856722",
"0.58543706",
"0.5850053",
"0.58485055",
"0.58386177",
"0.58314914",
"0.583088",
"0.5810195",
"0.5808756",
"0.5798785",
"0.5794114",
"0.57811004",
"0.5780575",
"0.578055",
"0.57618845",
"0.5761302",
"0.57590425",
"0.57450575",
"0.57444286",
"0.57439613",
"0.57248324",
"0.57216865",
"0.572037",
"0.57158226",
"0.57149774",
"0.57026476",
"0.56977373",
"0.5691994",
"0.56910694",
"0.5689186",
"0.56864125",
"0.56824553",
"0.56814295",
"0.5679801",
"0.56697696",
"0.56673384",
"0.56659573",
"0.5665669",
"0.56634384",
"0.56623816",
"0.566094",
"0.5650647",
"0.56485015",
"0.5646282",
"0.56378025",
"0.56358093",
"0.5630277",
"0.5622429",
"0.5618427",
"0.56181985",
"0.5614262",
"0.5613148",
"0.5610907",
"0.5607376",
"0.5605495",
"0.5604591",
"0.5604458",
"0.55975926",
"0.55956024",
"0.55929184",
"0.55922806",
"0.5592055",
"0.5589601",
"0.5577041",
"0.55615044",
"0.55589634",
"0.5551498",
"0.5548807",
"0.5547045",
"0.55356556",
"0.5531893",
"0.55260766",
"0.5524785"
] | 0.68359137 | 1 |
Make robot pick up repairKit (if possible). | @Override
public void pickUpRepairKit(Robot robot, RepairKit repairKit)
{
try
{
if(robot.canPickUp(repairKit))
{
robot.pickUp(repairKit);
}
else
{
System.out.println("This repair kit could not be picked up by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this repair kit is terminated; the robot cannot pick up the repair kit.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void useRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.use(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot use the repair kit.\");\r\n\t\t}\r\n\t}",
"private void performHandShake() {\n try {\n boolean OK = false;\n // String rsp= new String( this.defaultComTool.WriteAndRead((String) command.get(\"restore_defaults\")));\n // while(!OK) { }\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_echo\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_linefeed\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_headers\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_spaces\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"protocol auto set\"));\n Thread.sleep(3000);\n\n this.CheckRequiredCommands_Availability(FIRSTLEVEL_CHECK);\n //Thread.sleep(2000);\n\n this.CheckRequiredCommands_Availability(SECONDLEVEL_CHECK);\n for (int i = 1; i < 6; i++) {\n switch (i) {\n case 1:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: RPM Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 2:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: SPEED Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 3:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: COOLANT TEMP Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 4:\n if (av_commands[i] == false) {\n int arbFuel;\n Random rnd = new Random();\n arbFuel = rnd.nextInt(100) + 1;\n Kernel.interfc.sim.log.append(\"WARNING: FUEL LVL Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbFuel + \") set!! \\n\");\n\n }\n break;\n case 5:\n if (av_commands[i] == false) {\n int arbCheck;\n Random rnd = new Random();\n arbCheck = rnd.nextInt(2);\n Kernel.interfc.sim.log.append(\"WARNING: CheckEngine Light Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbCheck + \") set!! \\n\");\n\n }\n break;\n\n }\n }\n {\n Kernel.interfc.sim.log.append(\"HANDSHAKE PERFORMED...Awaiting for SelfTest\\n\");\n\n }\n\n } catch (Exception e) {\n System.out.println(\"PERFORM HANDSHAKE:\" + e.getMessage() + \" \" + e.getLocalizedMessage());\n }\n }",
"private static void pickAllThings(Robot r)\n {\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }",
"@Override\r\n\tpublic void dropRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot drop the repair kit.\");\r\n\t\t}\r\n\t}",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }",
"protected abstract void fixChassis();",
"protected void initialize() {\n \tRobot.intake.setHard(isHard);\n }",
"private void canRepair(boolean b) {\n\t\t\n\t}",
"private void placeKitOnInspection(MyKit mk)\n\t{\n\t\tmyStand.setSlotThreeTaken();\n\t\tif(guiEnable){\n\t\t\tthis.kitRobotGUI.DoMoveKitToCameraInspection(mk.kit.guikit, mk.kit.position);\n\t\t\tprint(\"Moving Kit to Inspection Slot\");\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Camera Inspection. Finished moving. Telling Agent.\");\n\n\n\t\tmyStand.setSlotAvilable(mk.slot);\n\t\tmk.kit.position = KitPosition.POSITION3;\n\t\tprint(\"Kit Slot number : \"+mk.slot+\" is Available but slot 3 is taken\");\n\t\tmk.status = KitStatus.On_CameraInspection;\n\t\tkitCamera.msgInspectKit(mk.kit);\n\t\tstateChanged();\n\t}",
"private void bypassIt(){\n rebootDialog();\n }",
"@Test\n\tpublic void riposteShieldTest() {\n\t\tDisplayWithShield();\n\t\t\n\t\tint cardPos = 0;\n\t\tint targetPlayer = 1;\n\t\tint targetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t/*\n\t\t * test to make sure the target has a maiden as the last played card\n\t\t*/\n\t\tassertTrue(game.getDisplay(1).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t */\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t\t\n\t\t\n\t\t//assertFalse(game.getDisplay(0).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t//test the size of discard deck before playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\tassertEquals(game.getDisplay(targetPlayer).deckSize(), 7);\n\t\t\n\t\t//play Riposte\n\t\tRulesEngine.riposte(game, cardPos, targetPlayer);\n\t\t\n\t\t//test the size of discard deck after playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\t//Update this variable after a card has been removed from the display\n\t\ttargetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t\n\t\t/*\n\t\t * test to make sure the target's last played card is still a maiden\n\t\t*/\n\t\tassertTrue(game.getDisplay(targetPlayer).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t*/\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t}",
"public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }",
"public void autoMode4Red(int delay){\n \taddParallel(new LightCommand(0.25));\n// \taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddSequential(new AutoDriveCommand(6));\n \taddSequential(new TurnWithPIDCommand(-45)); \n \taddSequential(new WaitWithoutCheckCommand(.5));\n \taddSequential(new VisionGearTargetCommand(\"targets\"));\n \taddSequential(new TargetGearSortCommand());\n \taddSequential(new AutoTurnCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"),0.5);\n// \t\taddSequential(new TargetGearSortCommand(),0.5);\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}else{\n// \t\n// \t}\n }",
"public void autoMode1Red(int delay){\n \taddParallel(new LightCommand(0.5));\n//\t\taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.7, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"));\n// \t\taddSequential(new TargetGearSortCommand());\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}\n \taddParallel(new EnvelopeCommand(false));\n \taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 50));\n \taddSequential(new TurnWithPIDCommand(-100));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(1, 45));\n \taddSequential(new VisionBoilerTargetCommand(\"targets\"));\n\t\taddSequential(new TargetBoilerSortCommand());\n\t\taddSequential(new AutoTurnCommand());\n \taddSequential(new ShootCommand(true,0.85));\n \t\n }",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"@Override\n protected void initialize() {\n Robot.powerCellManipulator.stopIntake();\n }",
"public void runRoover() throws IOException\n { \n String drivingInstr = rooverSetUp();\n if (drivingInstr == null)\n return;\n \n //check to see if roover's original position has a dirt patch\n if (dirtSet.contains(Integer.toString(currXPos) + Integer.toString(currYPos)))\n {\n dirtSet.remove(Integer.toString(currXPos) + Integer.toString(currYPos));\n numPatchesCleaned++;\n }\n \n //at this point, currline will be the last line in our input, which is driving instructions\n char[] instructions = drivingInstr.toUpperCase().toCharArray();\n for (int i = 0; i < instructions.length; i++)\n {\n switch(instructions[i]) {\n case 'N':\n if (currYPos + 1 < numRows)\n {\n currYPos++;\n }\n break;\n case 'S':\n if (currYPos - 1 >= 0)\n {\n currYPos--;\n }\n break;\n case 'W':\n if (currXPos - 1 >= 0)\n {\n currXPos--;\n }\n break;\n case 'E':\n if (currXPos + 1 < numCols)\n {\n currXPos++;\n }\n break;\n default:\n System.err.println(\"Invalid driving instruction, please enter N, S, W, or E only.\");\n break;\n }\n \n if (dirtSet.contains(Integer.toString(currXPos) + Integer.toString(currYPos)))\n {\n dirtSet.remove(Integer.toString(currXPos) + Integer.toString(currYPos));\n numPatchesCleaned++;\n }\n }\n \n System.out.println(currXPos + \" \" + currYPos);\n System.out.println(numPatchesCleaned);\n }",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }",
"@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }",
"@Override\n public void execute() {\n intake.intakeMotor.set(-.8);\n }",
"public void runOpMode(){\n JAWLDrive3796 drive = new JAWLDrive3796(hardwareMap.dcMotor.get(\"left_drive\"), hardwareMap.dcMotor.get(\"right_drive\"));\n //Set the drive motors to run without encoders\n drive.setEncoders(false);\n //Create Grabber object\n JAWLGrabber3796 grabber = new JAWLGrabber3796(hardwareMap.servo.get(\"left_arm\"), hardwareMap.servo.get(\"right_arm\"));\n //Create Lift object\n JAWLLift3796 lift = new JAWLLift3796(hardwareMap.dcMotor.get(\"lift_motor\"));\n //Create color arm object\n JAWLColorArm3796 colorArm = new JAWLColorArm3796(hardwareMap.servo.get(\"color_arm\"));\n //Creates color sensor name\n ColorSensor colorSensorTemp = hardwareMap.get(ColorSensor.class, \"color_distance\");\n //Creates distance sensor name\n DistanceSensor distanceSensorTemp = hardwareMap.get(DistanceSensor.class, \"color_distance\");\n //Creates the color-distance sensor object\n JAWLColorSensor3796 colorDistanceSensor = new JAWLColorSensor3796(colorSensorTemp, distanceSensorTemp);\n //Creates the variable that will hold the color of the jewel\n String colorOfBall;\n //Creates relic arm objects\n //TTTTRelicArm3796 relicArm = new TTTTRelicArm3796(hardwareMap.dcMotor.get(\"relic_up_down\"), hardwareMap.dcMotor.get(\"relic_out_in\"), hardwareMap.dcMotor.get(\"relic_grab\"));\n //We never ended up having a relic arm!\n //The lift helper will set the idle power of the motor to a small double, keeping the lift from idly falling down\n boolean liftHelper = false;\n int i = 0;\n\n waitForStart();\n\n colorArm.armUp();\n\n while (opModeIsActive()) {\n //Here is where we define how the controllers should work\n //In theory, no logic retaining to controlling the components should be in here\n\n /*\n * Drive\n */\n\n //The left drive wheel is controlled by the opposite value of the left stick's y value on the first gamepad\n //The right drive is the same way except with the right drive wheel\n drive.leftDrive(-gamepad1.left_stick_y);\n drive.rightDrive(-gamepad1.right_stick_y);\n\n /*\n * Lift\n */\n telemetry.addData(\"Gamepad2 Right Stick Y\", -gamepad2.right_stick_y);\n\n if (-gamepad2.right_stick_y > 0) {\n //First checks to see if the right stick's negative y value is greater then zero.\n lift.moveMotor(-gamepad2.right_stick_y);\n //If it is, it sets the power for the motor to 1, and adds telemetry\n telemetry.addData(\"Lift Power\", 1);\n } else if (-gamepad2.right_stick_y < 0) {\n //Checks if the negative value of the right right stick's y position is less than zero\n lift.moveMotor(-0.1);\n //Sets the power for the motor to -0.1, and adds telemetry\n telemetry.addData(\"Lift Power\", -0.1);\n } else {\n //We check to see if the liftHelper is enabled\n if(liftHelper) {\n lift.moveMotor(0.1466 );\n } else {\n lift.moveMotor(0);\n }\n }\n\n\n\n /*\n * Lift helper control\n */\n\n if(gamepad2.a) {\n if(i == 0) {\n liftHelper = !liftHelper;\n }\n i = 5;\n }\n\n if(i != 0) {\n i--;\n }\n\n telemetry.addData(\"Lift Helper Enabled\", liftHelper);\n\n\n\n /*\n * Grabbers\n */\n if (gamepad2.left_trigger > 0) {\n //Closes the left arm, then displays the position in telemetry\n grabber.leftArmClose();\n double a = grabber.leftPosition();\n //Adds telemetry to display positions of grabbers, mostly for testing, but can be useful later on\n telemetry.addData(\"Left\", a);\n }\n\n if (gamepad2.left_bumper) {\n //Opens the left arm, then displays the position in telemetry\n grabber.leftArmOpen();\n double b = grabber.leftPosition();\n //We made the variables different as to avoid any and all possible errors\n telemetry.addData(\"Left\", b);\n }\n\n if (gamepad2.right_trigger > 0) {\n //Opens the right arm, then displays the position in telemetry\n grabber.rightArmClose();\n double c = grabber.rightPosition();\n telemetry.addData(\"Right\", c);\n }\n\n if (gamepad2.right_bumper) {\n //Closes the right arm, then displays the position in telemetry\n grabber.rightArmOpen();\n double d = grabber.rightPosition();\n telemetry.addData(\"Right\", d);\n }\n\n if (gamepad2.dpad_left){\n //Closes the left arm to a shorter distance\n grabber.leftArmShort();\n }\n\n if(gamepad2.dpad_right){\n //Closes the right arm to a shorter distance\n grabber.rightArmShort();\n\n }\n\n //Update all of our telemetries at once so we can see all of it at the same time\n telemetry.update();\n }\n }",
"public void xboxHatchControl()\n {\n if (RobotMap.assistantDriverController.getStartButtonPressed())\n {\n RobotMap.hatchHolderTalon.set(0);\n }\n if (RobotMap.assistantDriverController.getBumperPressed(Hand.kLeft))\n {\n if (RobotMap.hatchHolderHasHatch)\n new ReleaseHatchCommand().start();\n else\n new GrabHatchCommand().start();\n RobotMap.hatchHolderHasHatch = !RobotMap.hatchHolderHasHatch;\n }\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}",
"@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }",
"public static void giveKIT(Player p) {\r\n\t\tp.getInventory().clear();\r\n\t\tfor (String kitget : kit.keySet()) {\r\n\t\t\tString[] kitdojogador = kit.get(kitget).split(\":\");\r\n\t\t\tString kit1 = kitdojogador[0];\r\n\t\t\tString kit2 = kitdojogador[1];\r\n\t\t\tif (kit1.equalsIgnoreCase(\"PvP\") || kit2.equalsIgnoreCase(\"PvP\")) {\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));\r\n\t\t\t}\r\n\t\t\tif (kit1.equalsIgnoreCase(\"Archer\") || kit2.equalsIgnoreCase(\"Minerador\")) {\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.BOW));\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.ARROW, 10));\r\n\t\t\t}\r\n\t\t\tif (kit1.equalsIgnoreCase(\"Barbarian\")) {\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));\r\n\t\t\t}\r\n\t\t\tif (kit1.equalsIgnoreCase(\"Beastmaster\")) {\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.BONE, 3));\r\n\t\t\t\tp.getInventory().addItem(new ItemStack(Material.MONSTER_EGG, 3, EntityType.WOLF.getTypeId()));\r\n\t\t\t}\r\n\t\t\tif (kit1.equalsIgnoreCase(\"Grandpa\")) {\r\n\t\t\t\tItemStack g = new ItemStack(Material.STICK);\r\n\t\t\t\tItemMeta gm =g.getItemMeta();\r\n\t\t\t\tgm.addEnchant(Enchantment.KNOCKBACK, 2, true);\r\n\t\t\t\tg.setItemMeta(gm);\r\n\t\t\t\tp.getInventory().addItem(g);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void applyGear() {\n\t\t\r\n\t}",
"protected void initialize() {\n \t//Robot.getFlywheel().setRunning(!Robot.getFlywheel().running());\n \t//Robot.getElevator().setRunning(!Robot.getElevator().running());\n \tif (run == false)\n \t{\n \t\tRobot.getFlywheel().setRunning(false);\n \t\t//Robot.getIndexer().setRunning(false);\n \t\tRobot.getFlywheel().setSetpoint(0.0);\n \t\tRobot.getFlywheel().disable();\n \t\t//Robot.getIndexer().disable();\n \t\tSystem.out.println(\"not running\");\n \t}\n \telse\n \t{\n \t\tRobot.getFlywheel().initialize();\n \t\tRobot.getFlywheel().enable();\n \t\tRobot.getFlywheel().setRunning(true);\n \t\tdouble m_motorLevel;\n \t\t//m_rpms = SmartDashboard.getNumber(\"FlywheelVelocity\", 1850);\n \t//m_motorLevel = m_rpms / 6750 * 1.35;//6750 = max rpms\n \tm_motorLevel =( m_rpms + 1000) / 6750 *1.1;//6750 = max rpms\n \tRobot.getFlywheel().setSetpoint(m_rpms);\n \tRobot.getFlywheel().setExpectedMotorLevel(m_motorLevel);\n \tSmartDashboard.putNumber(\"FlywheelVelocity\", m_rpms);\n \tSystem.out.println(m_rpms + \" \" + m_motorLevel + \" setpoint: \" + Robot.getFlywheel().getSetpoint());\n \t}\n }",
"public void action() {\n\t\tsuppressed = false;\r\n\t\tpilot.setLinearSpeed(8);\r\n\t\tpilot.setLinearAcceleration(4);\r\n\t\tColorThread.updatePos = false;\r\n\t\tColorThread.updateCritical = false;\r\n\t\t//create a array to save the map information\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\trobot.probability[a][b] = -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 8; a++) {\r\n\t\t\tfor (int b = 0; b < 8; b++) {\r\n\t\t\t\tif (a == 0 || a == 7 || b == 0 || b == 7) {\r\n\t\t\t\t\trobot.probability[a][b] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 6; a++) {\r\n\t\t\tfor (int b = 0; b < 6; b++) {\r\n\t\t\t\tif (robot.map[a][b].getOccupied() == 1) {\r\n\t\t\t\t\trobot.probability[a + 1][b + 1] = 100;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Step1: use ArrayList to save all of the probability situation.\r\n\t\tfloat front, left, right, back;\r\n\t\tfront = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\tleft = USThread.disSample[0];\r\n\t\trobot.setmotorM(-180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tright = USThread.disSample[0];\r\n\t\trobot.setmotorM(90);\r\n\t\tDelay.msDelay(1000);\r\n\t\trobot.correctHeading(180);\r\n\t\tDelay.msDelay(1000);\r\n\t\tback = USThread.disSample[0];\r\n\t\trobot.correctHeading(180);\r\n\t\tfor (int a = 1; a < 7; a++) {\r\n\t\t\tfor (int b = 1; b < 7; b++) {\r\n\t\t\t\tif (robot.probability[a][b] == -1) {\r\n\t\t\t\t\tif (((robot.probability[a][b + 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t//direction is north\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(0, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"0 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a + 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is east\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(1, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"1 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a][b - 1] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a - 1][b] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is sourth\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(2, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"2 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (((robot.probability[a - 1][b] == 100 && front < 0.25)\r\n\t\t\t\t\t\t\t|| (robot.probability[a - 1][b] == -1 && front > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b + 1] == 100 && right < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b + 1] == -1 && right > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a + 1][b] == 100 && back < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a + 1][b] == -1 && back > 0.25))\r\n\t\t\t\t\t\t\t&& ((robot.probability[a][b - 1] == 100 && left < 0.25)\r\n\t\t\t\t\t\t\t\t\t|| (robot.probability[a][b - 1] == -1 && left > 0.25))) {\r\n\t\t\t\t\t\t// direction is west\r\n\t\t\t\t\t\trobot.listOfPro.add(new ProPoint(3, 0, a, b));\r\n\t\t\t\t\t\t//System.out.println(\"3 \"+a+\" \"+b);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Step 2: use loop to take control of robot walk and check the location correction\r\n\t\tboolean needLoop = true;\r\n\t\tint loopRound = 0;\r\n\t\twhile (needLoop) {\r\n\t\t\t// One of way to leave the loop is at the hospital\r\n\t\t\tif ((ColorThread.leftColSample[0] >= 0.2 && ColorThread.leftColSample[1] < 0.2\r\n\t\t\t\t\t&& ColorThread.leftColSample[1] >= 0.14 && ColorThread.leftColSample[2] <= 0.8)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] >= 0.2 && ColorThread.rightColSample[1] < 0.2\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[1] >= 0.11 && ColorThread.rightColSample[2] <= 0.08)) {\r\n\t\t\t\trobot.updatePosition(0, 0);\r\n\t\t\t\tint numOfAtYellow = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtYellow++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtYellow == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 1 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\t//have two way to go to the yellow part\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//Another way to leave the loop is the robot arrive the green cell.\r\n\t\t\tif ((ColorThread.leftColSample[0] <= 0.09 && ColorThread.leftColSample[1] >= 0.17\r\n\t\t\t\t\t&& ColorThread.leftColSample[2] <= 0.09)\r\n\t\t\t\t\t&& (ColorThread.rightColSample[0] <= 0.09 && ColorThread.rightColSample[1] >= 0.014\r\n\t\t\t\t\t\t\t&& ColorThread.rightColSample[2] <= 0.11)) {\r\n\t\t\t\trobot.updatePosition(5, 0);\r\n\t\t\t\tint numOfAtGreen = 0;\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\tnumOfAtGreen++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(numOfAtGreen==1) {\r\n\t\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowX() == 6 && robot.listOfPro.get(i).getNowY() == 1) {\r\n\t\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfront = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tleft = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(-180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tright = USThread.disSample[0];\r\n\t\t\t\t\trobot.setmotorM(90);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tback = USThread.disSample[0];\r\n\t\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\t\tDelay.msDelay(1000);\r\n\t\t\t\t\tif(front<0.25 && right<0.25 && left>0.25 && back>0.25) {\r\n\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t}else if(front<0.25 && right>0.25 && back>0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else if(front>0.25 && right>0.25 && back<0.25 && left<0.25) {\r\n\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The third way of leave the loop is the robot have already know his position and direction.\r\n\t\t\tint maxStepNumber = 0;\r\n\t\t\tint numberOfMaxSteps = 0;\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() > maxStepNumber) {\r\n\t\t\t\t\tmaxStepNumber = robot.listOfPro.get(i).getSteps();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\tnumberOfMaxSteps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (numberOfMaxSteps == 1) {\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getSteps() == maxStepNumber) {\r\n\t\t\t\t\t\trobot.updatePosition(robot.listOfPro.get(i).getNowX() - 1,\r\n\t\t\t\t\t\t\t\trobot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.setDirection(false);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 3) {\r\n\t\t\t\t\t\t\trobot.setDirection(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// do not to set the heading, because the default value is 0.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneedLoop = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//The below part are the loops.\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\t// move\r\n\t\t\t\r\n\t\t\tif (front > 0.25) {\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (left > 0.25) {\r\n\t\t\t\trobot.correctHeading(-90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (right > 0.25) {\r\n\t\t\t\trobot.correctHeading(90);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\trobot.correctHeading(180);\r\n\t\t\t\trobot.getPilot().travel(25);\r\n\t\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t\tif(robot.listOfPro.get(i).getSteps()==loopRound) {\r\n\t\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(2);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(3);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() - 1);\r\n\t\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(0);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowY(robot.listOfPro.get(i).getNowY() + 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowHeading(1);\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setNowX(robot.listOfPro.get(i).getNowX() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// It time to check the around situation\r\n\t\t\tfront = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tleft = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(-180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tright = USThread.disSample[0];\r\n\t\t\trobot.setmotorM(90);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tback = USThread.disSample[0];\r\n\t\t\trobot.correctHeading(180);\r\n\t\t\tDelay.msDelay(1000);\r\n\t\t\tfor (int i = 0; i < robot.listOfPro.size(); i++) {\r\n\t\t\t\t//System.out.println(robot.listOfPro.get(i).getSteps());\r\n\t\t\t\t\tif (robot.listOfPro.get(i).getNowHeading() == 0) {\r\n\t\t\t\t\t\tif (((front < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 1) {\r\n\t\t\t\t\t\tif (((left < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (robot.listOfPro.get(i).getNowHeading() == 2) {\r\n\t\t\t\t\t\tif (((back < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((right < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (((right < 0.25\r\n\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro.get(i).getNowY()\r\n\t\t\t\t\t\t\t\t\t\t+ 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (right > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() + 1] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((front < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t- 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (front > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() - 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((back < 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ 1][robot.listOfPro.get(i).getNowY()] == 100)\r\n\t\t\t\t\t\t\t\t|| (back > 0.25\r\n\t\t\t\t\t\t\t\t\t\t&& robot.probability[robot.listOfPro.get(i).getNowX() + 1][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get(i).getNowY()] == -1))\r\n\t\t\t\t\t\t\t\t\t\t&& ((left < 0.25 && robot.probability[robot.listOfPro.get(i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getNowX()][robot.listOfPro.get(i).getNowY() - 1] == 100)\r\n\t\t\t\t\t\t\t\t|| (left > 0.25 && robot.probability[robot.listOfPro.get(i).getNowX()][robot.listOfPro\r\n\t\t\t\t\t\t\t\t\t\t.get(i).getNowY() - 1] == -1))) {\r\n\t\t\t\t\t\t\t//It is correct when the robot have the same data information with estimate information\r\n\t\t\t\t\t\t\trobot.listOfPro.get(i).setSteps(robot.listOfPro.get(i).getSteps() + 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tloopRound++;\r\n\t\t}\r\n\t\t// if is out the while loop, it will find the heading and the position of robot right now.\r\n\t\t//Step 3: It is time to use wavefront to come back to the hospital\r\n\t\trobot.restoreDefault();\r\n\t\trobot.RunMode = 1;\r\n\t\tColorThread.updatePos = true;\r\n\t\tColorThread.updateCritical = true;\r\n\t}",
"public ResetClawArm() {\n\n\t\tif(Robot.kClawArm.isClawRetracted() == true) {\n\t\t\taddSequential(new DeployClawArm());\n\t\t}\n\t\telse {\n\t\t\taddSequential(new RetractClawArm());\n\t\t}\n\t\t\n\t}",
"protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }",
"protected void interrupted() {\n \tRobot.claw.setClawMotor(0);\n }",
"protected void initialize() {\n \tif ((deploy && Robot.intake.getHopperTracker() == Status.deployed) || \n \t\t\t(!deploy && Robot.intake.getHopperTracker() == Status.stowed)) {\n \t\t// Hopper is already in desired position, so do nothing\n \t\twaitForMovement = false;\n \t} else if (deploy && (Robot.intake.getIntakeTracker() != Status.deployed)) {\n \t\t// Can't deploy hopper if intake is not deployed (ie., if stowed or unknown or moving)\n \t\twaitForMovement = false;\n \t} else {\n \t\t// OK, we can move the hopper\n \t\twaitForMovement = true;\n \t\tRobot.intake.setHopperTracker(Status.unknown);\t// put in unknown state while hopper is moving\n \tif (deploy) Robot.intake.deployHopper();\n \telse { Robot.intake.stowHopper(); }\n \t}\n }",
"protected void processButton1(Robot robot ){\n robot.getIntake().intakeSuckIn(1);\n\n }",
"protected void execute() {\n\t\tPickup.setRollers(RobotValues.getDouble(\"ArmWheels_In\"));\n\t}",
"private void setComputerChoice() {\n\t\tcomputerChoice = POSSIBLE_CHOICE[randomNumber];\n\t}",
"private void newPowerUp() {\r\n int row = 0;\r\n int column = 0;\r\n do {\r\n row = Numbers.random(0,maxRows-1);\r\n column = Numbers.random(0,maxColumns-1);\r\n } while(isInSnake(row,column,false));\r\n powerUp = new Location(row,column,STOP);\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }",
"public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }",
"protected void initialize() {\n \tRobot.conveyor.stop();\n }",
"public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n protected void interrupted() {\n Robot.myLifter.setLeftSpeed(0);\n Robot.myLifter.setRightSpeed(0);\n }",
"public void selectRepairable (String strRepairable)\r\n\t{\r\n\t\tif (strRepairable.equalsIgnoreCase (\"Yes\") || strRepairable.equalsIgnoreCase (\"Y\"))\r\n\t\t{\r\n\t\t\tList<WebElement> radiobuttons = orClaimEstimateSummary.rdoRepairable;\r\n\t\t\tfor (WebElement radiobutton : radiobuttons)\r\n\t\t\t{\r\n\t\t\t\tif (radiobutton.getAttribute (\"value\").equals (\"1\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tradiobutton.click ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (strRepairable.equalsIgnoreCase (\"No\") || strRepairable.equalsIgnoreCase (\"N\"))\r\n\t\t{\r\n\t\t\tList<WebElement> radiobuttons = orClaimEstimateSummary.rdoRepairable;\r\n\t\t\tfor (WebElement radiobutton : radiobuttons)\r\n\t\t\t{\r\n\t\t\t\tif (radiobutton.getAttribute (\"value\").equals (\"0\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tradiobutton.click ();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }",
"private static void moveAndPickAllThings(Robot r, int x)\n {\n for(int i=0; i<x; i++)\n {\n r.move();\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }\n \n }",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"protected void execute() { \t\n \tif (isLowered != Robot.oi.getOperator().getRawButton(2)) {\n \t\tisLowered = Robot.oi.getOperator().getRawButton(2);\n \t\tif (isLowered)\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kForward);\n \t\telse\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kReverse);\n \t}\n \t\n \tif (Robot.oi.getOperator().getRawButton(11))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0.75);\n \telse if (Robot.oi.getOperator().getRawButton(12))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0);\n \telse if (Robot.oi.getOperator().getRawButton(10))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(-0.75);\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"public static void stopCase(Robot r)\n {\n while(r.frontIsClear() == false)\n while(r.canPickThing() == false)\n break;\n }",
"@Override\n\tpublic void makeShoeComfortable() {\n\t\t\n\t}",
"public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }",
"public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }",
"private static void loop() throws GameActionException {\n RobotCount.reset();\n MinerEffectiveness.reset();\n\n //Update enemy HQ ranges in mob level\n if(Clock.getRoundNum()%10 == 0) {\n enemyTowers = rc.senseEnemyTowerLocations();\n numberOfTowers = enemyTowers.length;\n if(numberOfTowers < 5 && !Map.isEnemyHQSplashRegionTurnedOff()) {\n Map.turnOffEnemyHQSplashRegion();\n }\n if(numberOfTowers < 2 && !Map.isEnemyHQBuffedRangeTurnedOff()) {\n Map.turnOffEnemyHQBuffedRange();\n }\n }\n \n // Code that runs in every robot (including buildings, excepting missiles)\n sharedLoopCode();\n \n updateEnemyInRange(52);//52 includes splashable region\n checkForEnemies();\n \n int rn = Clock.getRoundNum();\n \n // Launcher strategy\n if(rn == 80) {\n BuildOrder.add(RobotType.HELIPAD); \n } else if(rn == 220) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 280) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 350) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 410) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } else if (rn == 500) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } \n if (rn > 500 && rn%200==0) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n //rc.setIndicatorString(1, \"Distance squared between HQs is \" + distanceBetweenHQs);\n \n \n \n if(rn > 1000 && rn%100 == 0 && rc.getTeamOre() > 700) {\n int index = BuildOrder.size()-1;\n if(BuildOrder.isUnclaimedOrExpired(index)) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n }\n \n \n \n /**\n //Building strategy ---------------------------------------------------\n if(Clock.getRoundNum() == 140) {\n BuildOrder.add(RobotType.TECHNOLOGYINSTITUTE);\n BuildOrder.add(RobotType.TRAININGFIELD);\n }\n if(Clock.getRoundNum() == 225) {\n BuildOrder.add(RobotType.BARRACKS);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n if(Clock.getRoundNum() == 550) {\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n }\n if(Clock.getRoundNum() == 800) {\n BuildOrder.add(RobotType.HELIPAD);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n //BuildOrder.printBuildOrder();\n }\n //---------------------------------------------------------------------\n **/\n \n //Spawn beavers\n if (hasFewBeavers()) { \n trySpawn(HQLocation.directionTo(enemyHQLocation), RobotType.BEAVER);\n }\n \n //Dispense supply\n Supply.dispense(suppliabilityMultiplier);\n \n //Debug\n //if(Clock.getRoundNum() == 700) Map.printRadio();\n //if(Clock.getRoundNum() == 1500) BuildOrder.print();\n\n }",
"public void setupBackupRobot() throws InterruptedException{\n\n motorFrontLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorFrontRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackLeft.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorBackRight.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n setIMUParameters();\n\n while (!imu.isGyroCalibrated()) {\n telemetry.addData(\"IMU\", \"calibrating...\");\n telemetry.update();\n Thread.sleep(50);\n }\n\n telemetry.addData(\"IMU\", \"ready\");\n telemetry.update();\n }",
"public void repairOnWrench(IRobot robot) {\n TiledMapTileLayer wrenchLayer = (TiledMapTileLayer) tiledMap.getLayers().get(\"Wrench\");\n if (wrenchLayer.getCell((int) robot.getPos().x, (int) robot.getPos().y) != null) {\n robot.heal();\n }\n }",
"private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }",
"@Override\n protected void initialize() {\n switch (Intake.intakeState) {\n case 2:\n case 1:\n case 0:\n default:\n //Robot.intake.setHarpoonExtend(false);\n break;\n }\n\n Intake.overridePassive = true;\n }",
"@Override\n protected void initialize() {\n if (extend) {\n Robot.rearHatch.setRearHatchPiston(true);\n } else {\n Robot.rearHatch.setRearHatchMotorPercentOutput(-0.6);\n Robot.rearHatch.setRearHatchPiston(false);\n }\n }",
"public ConfigureRobot()\n {\n Scheduler.getInstance().removeAll(); //remove all running commands\n addSequential(new BrakeOpen(),2);\n addSequential(new WaitCommand(1));\n addSequential(new LiftToBottom(),3);\n }",
"public void setChipOnExistingProjectBurnSZTTwice(Subproject project) {\n\t\tcurrent.raiseScore(project.setChip(current.removeChip()).getAmountSZT()*2);\n\t}",
"@Override\n\tpublic void robotInit() {\n\t\tdt = new DriveTrain();\n\t\t//Initialize drive Talons\n\t\tRobotMap.vspLeft = new WPI_TalonSRX(RobotMap.dtLeft);\n\t\tRobotMap.vspRight = new WPI_TalonSRX(RobotMap.dtRight);\n\t\t//Initialize drive slave Victors\n\t\t//RobotMap.slaveLeft = new WPI_VictorSPX(RobotMap.slaveDriveLeft);\n\t\t//RobotMap.slaveRight = new WPI_VictorSPX(RobotMap.slaveDriveRight);\n\t\t//Set drive slaves to follower mode\n\t\t//RobotMap.slaveLeft.follow(RobotMap.vspLeft);\n\t\t//RobotMap.slaveRight.follow(RobotMap.vspRight);\n\t\t//Initialize drive train\n\t\tRobotMap.rd = new DifferentialDrive(RobotMap.vspLeft, RobotMap.vspRight);\n\t\t//Initialize drive joystick\n\t\tRobotMap.stick = new Joystick(RobotMap.joystickPort);\n\t\t//Disabled drive safety\n\t\tRobotMap.vspLeft.setSafetyEnabled(false);\n\t\tRobotMap.vspRight.setSafetyEnabled(false);\n\t\tRobotMap.rd.setSafetyEnabled(false);\n\t\t//Initialize lift Talon\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(5);\n\t\t//Initialize operator controller\n\t\tRobotMap.controller = new Joystick(RobotMap.controllerPort);\n\t\t//Initialize intake Victors\n\t\tRobotMap.intakeVictorLeft = new WPI_VictorSPX(RobotMap.intakeMaster);\n\t\tRobotMap.intakeVictorRight = new WPI_VictorSPX(RobotMap.intakeSlave);\n\t\t//Set right intake Victor to follow left intake Victor\n\t\tRobotMap.intakeVictorRight.follow(RobotMap.intakeVictorLeft);\n\t\t\n\t\tRobotMap.climberVictorLeft = new WPI_VictorSPX(RobotMap.climberLeftAddress);\n\t\tRobotMap.climberVictorRight = new WPI_VictorSPX(RobotMap.climberRightAddress);\n\t\t\n\t\tRobotMap.climberVictorRight.follow(RobotMap.climberVictorLeft);\n\t\t\n\t\tRobotMap.piston = new DoubleSolenoid(RobotMap.inChannel, RobotMap.outChannel);\n\t\t\n\t\tRobotMap.intakeLifter = new WPI_VictorSPX(2);\n\t\t\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(RobotMap.liftTalonAddress);\n\t\t\n\t\tautoChooser = new SendableChooser();\n\t\tautoChooser.addDefault(\"Drive to baseline\" , new DriveToBaseline());\n\t\tautoChooser.addObject(\"Null auto\", new NullAuto());\n\t\tautoChooser.addObject(\"Switch from right\", new SwitchFromRight());\n\t\tautoChooser.addObject(\"Switch from left\", new SwitchFromLeft());\n\t\tautoChooser.addObject(\"PID from left\", new PIDfromLeft());\n\t\tautoChooser.addObject(\"PID from right\", new PIDfromRight());\n\t\tautoChooser.addObject(\"Scale from right\", new ScaleAutoRight());\n\t\tautoChooser.addObject(\"Scale from left\", new ScaleAutoLeft());\n\t\tautoChooser.addObject(\"PID tester\", new PIDTESTER());\n\t\tautoChooser.addObject(\"Joe use this one\", new leftOnly());\n\t\tSmartDashboard.putData(\"Autonomous mode chooser\", autoChooser);\n\t\t\n\t\t//RobotMap.liftVictor.follow(RobotMap.climberTalon);\n\t\t\n\t\tRobotMap.vspLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\tRobotMap.vspRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\t\n\t\tRobotMap.intakeLifted = new DigitalInput(1);\n\t\tRobotMap.isAtTop = new DigitalInput(2);\n\t\tRobotMap.isAtBottom = new DigitalInput(0);\n\t\t\n\t\tRobotMap.vspLeft.configVelocityMeasurementPeriod(VelocityMeasPeriod.Period_100Ms, 1);\n\t\tRobotMap.vspRight.configVelocityMeasurementWindow(64, 1); \n\t\t\n\t\toi = new OI();\n\t}",
"public void intakeCargo(){\n intake.set(INTAKE_SPEED);\n }",
"@Override\n protected void interrupted() {\n Robot.drive.setCoastMode();\n Robot.tapeAlignSys.disable();\n Robot.lidarAlignSys.disable();\n }",
"public static void plaatsComputerVloot(){\n\t\tfor (int iPlaats = 0; iPlaats < 5; iPlaats++){\n\t\t\tboolean shipOrientation = Math.random() < 0.5;\n\t\t\tGame.computer1.fleet.get(iPlaats).horizontal = shipOrientation;\n\t\t\tif (Game.computer1.fleet.get(iPlaats).horizontal) {\n\t\t\t\tGame.computer1.fleet.get(iPlaats).switchlb();\n\t\t\t}\n\t\t\tRandom random = new Random();\n\t\t\tboolean conflict = false;\n\t\t\tif(Game.computer1.fleet.get(iPlaats).horizontal){ //horizontaal\n\t\t\t\tint randomx = random.nextInt(11 - Game.computer1.fleet.get(iPlaats).getBreedte());\n\t\t\t\tint randomy = random.nextInt(10);\n\t\t\t\tfor(int xLoper=0; xLoper < Game.computer1.fleet.get(iPlaats).getBreedte();xLoper++){ //controleer coordinaten die huidige schip wil hebben op conflicten\n\t\t\t\t\tfor(int iConflictIndex=0; iConflictIndex < iPlaats; iConflictIndex++){// deze lus pakt alle eerder geplaatste schepen (heeft geen zin om nog niet geplaatste schepen te controleren)\n\t\t\t\t\t\tfor(int iConflictCo=0;iConflictCo < Game.computer1.fleet.get(iConflictIndex).coordinates.length;iConflictCo++){ //doorloopt coordinaten van een eerder geplaatst schip en controleert op overeenkomsten.\n\t\t\t\t\t\t\tif(Game.computer1.fleet.get(iConflictIndex).coordinates[0][iConflictCo] == randomx+xLoper && Game.computer1.fleet.get(iConflictIndex).coordinates[1][iConflictCo] == randomy){\n\t\t\t\t\t\t\t\tconflict = true; //indien overeenkomst, is er een conflict.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!conflict){\n\t\t\t\t\tfor(int l = 0; l < Game.computer1.fleet.get(iPlaats).getBreedte(); l++){ \n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[0][l] = randomx + l;\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[1][l] = randomy;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{ //verticaal. komt grotendeels overeen met horizontaal, commentaar: zie daar.\n\t\t\t\tint randomx = random.nextInt(10);\n\t\t\t\tint randomy = random.nextInt(11 - Game.computer1.fleet.get(iPlaats).getLengte());\n\t\t\t\tfor(int yLoper=0; yLoper < Game.computer1.fleet.get(iPlaats).getLengte();yLoper++){\n\t\t\t\t\tfor(int iConflictIndex=0; iConflictIndex < iPlaats; iConflictIndex++){\n\t\t\t\t\t\tfor(int iConflictCo=0;iConflictCo < Game.computer1.fleet.get(iConflictIndex).coordinates.length;iConflictCo++){\n\t\t\t\t\t\t\tif(Game.computer1.fleet.get(iConflictIndex).coordinates[0][iConflictCo] == randomx && Game.computer1.fleet.get(iConflictIndex).coordinates[1][iConflictCo] == randomy+yLoper){\n\t\t\t\t\t\t\t\tconflict = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!conflict){\n\t\t\t\t\tfor(int l = 0; l < Game.computer1.fleet.get(iPlaats).getLengte(); l++){\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[0][l] = randomx;\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[1][l] = randomy + l;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(conflict){\n\t\t\t\tiPlaats--;\n\t\t\t}\n\t\t}\n\t\tspelen(); //alles geplaatst, dan spelen.\n\t}",
"static boolean settleDown() throws GameActionException {\n\t\treturn !rc.isCircleOccupiedExceptByThisRobot(rc.getLocation(), SETTLERADIUS);\n\t}",
"protected void execute() {\n//\t\tRobot.chassis.drive(0, .5, 0);\n//\t\tRobotMap.chassisfrontLeft.set(50);\n\t\tLiquidCrystal lcd = RobotMap.lcd;\n\n\t\t\n\t\t\n\n\t\t\n\t\tif(talonNum == 2){\n\t\t\tRobotMap.chassisfrontLeft.set(150);\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontLeft.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontLeft.getEncPosition());\n\t\t\t\n\t\t\t\n\n\t\t}else if(talonNum == 3){\n\t\t\tRobotMap.chassisfrontRight.set(150);\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontRight.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontRight.getEncPosition());\n\t\t\t\n\n\t\t}else if(talonNum == 4){\n\t\t\tRobotMap.chassisrearLeft.set(150);\t\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearLeft.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearLeft.getEncPosition());\n\n\t\t}else if(talonNum == 5){\n\t\t\tRobotMap.chassisrearRight.set(150);\t\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearRight.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearRight.getEncPosition());\n\n\t\t}else if(talonNum == 11){\n\t\t\tRobotMap.climberclimbMotor.set(.5);\t\n\n\t\t}else if(talonNum == 12){\n\t\t\tRobotMap.floorfloorLift.set(.75);\t\n\n\t\t}else if(talonNum == 13){\n\t\t\tRobotMap.acquisitionacquisitionMotor.set(.25);\t\n\n\t\t}\n\t\t\n\t\t\n\t}",
"public void enableKillSwitch(){\n isClimbing = false;\n isClimbingArmDown = false;\n Robot.isKillSwitchEnabled = true;\n }",
"@Override\n public DriveSignal runJackWheels() {\n return DriveSignal.NEUTRAL;\n }",
"public static void fixCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select(new Filter<GameObject>() {\n @Override\n public boolean accept(GameObject gameObject) {\n return gameObject.name().toLowerCase().contains(\"broken\");\n }\n }).nearest().poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Repair\"));\n sleep(3000);\n }\n }",
"public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }",
"public void interactWhenSteppingOn() {\r\n\t\t\r\n\t}",
"@Override\n\t\tpublic void driveRobot(double power, double pivot) {\n\t\t\tclosedLoopArcade(power, pivot);\n\t\t}",
"public void checkInputs() {\n\n gearShift = driveStick.getXButtonReleased();\n slow = driveStick.getAButtonReleased();\n\n manualClimb = driveStick.getBumper(Hand.kLeft) && driveStick.getBumper(Hand.kRight);\n\n //climbToggle = driveStick.getBumperReleased(Hand.kLeft);\n climbToggle = false;\n climbRelease = driveStick.getStartButton();\n\n resetBalls = gunnerStick.getStartButtonReleased();\n visionShoot = gunnerStick.getBButtonReleased();\n manualShoot = gunnerStick.getYButton();\n distShoot = gunnerStick.getAButton();\n intakeToggle = gunnerStick.getBumperReleased(Hand.kRight);\n hoodToggle = gunnerStick.getBumperReleased(Hand.kLeft);\n intakeReverse = gunnerStick.getXButtonReleased();\n magazineReverse = gunnerStick.getBackButton();\n\n\n //Switch statement to determine controls for the driver\n switch (driverScheme) {\n case \"Reverse Turning\":\n XSpeed = -driveStick.getY(Hand.kLeft);\n ZRotation = driveStick.getX(Hand.kRight);\n break;\n default:\n XSpeed = driveStick.getY(Hand.kLeft);\n ZRotation = -driveStick.getX(Hand.kRight);\n break;\n }\n\n //Switch statement to determine controls for the gunner\n switch (gunnerScheme) {\n case \"Fun Mode\":\n\n discoToggle = gunnerStick.getBackButtonReleased();\n break;\n\n default:\n\n // if ((gunnerStick.getTriggerAxis(Hand.kRight) >= 0.75) && (gunnerStick.getTriggerAxis(Hand.kLeft) >= 0.75) && !overriding) {\n // overrideSafeties = !overrideSafeties;\n // overriding = true;\n // } else if ((gunnerStick.getTriggerAxis(Hand.kRight) <= 0.75) && (gunnerStick.getTriggerAxis(Hand.kLeft) <= 0.75)) {\n // overriding = false;\n // }\n\n break;\n }\n }",
"@Override\n public void runOpMode() {\n hw = new RobotHardware(robotName, hardwareMap);\n rd = new RobotDrive(hw);\n rs=new RobotSense(hw, telemetry);\n /*rd.moveDist(RobotDrive.Direction.FORWARD, .5, .3);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, .3);\n rd.moveDist(RobotDrive.Direction.FORWARD, .5, 1);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, 1);*/\n telemetry.addData(\"Ready! \", \"Go Flamangos!\"); \n telemetry.update();\n\n //Starting the servos in the correct starting position\n /*hw.armRight.setPosition(1-.3);\n hw.armLeft.setPosition(.3);\n hw.level.setPosition(.3+.05);*/\n hw.f_servoLeft.setPosition(1);\n hw.f_servoRight.setPosition(0.5);\n \n rd.moveArm(hw.startPos());\n waitForStart();\n while (opModeIsActive()) {\n \n /*Starting close to the bridge on the building side\n Move under the bridge and push into the wall*/\n rd.moveDist(RobotDrive.Direction.LEFT,2,.5);\n rd.moveDist(RobotDrive.Direction.FORWARD, 10, .5);\n break;\n }\n }",
"public void fixShield(CrewMember member) {\n\t\t\n\t\tmember.minusAction();\n\t\t\n\t\tRandom rand = new Random();\n\t\tint randomElement = rand.nextInt(100);\n\t\t\n\t\tif(randomElement <= member.getRepair()) {\n\t\t\t// Increases progress bar\n\t\t\tshieldLevel += 1;\n\t\t}\n\t\t\n\t\tif (! (member instanceof Engineer)) {\n\t\t\tmember.minusTiredness(20);\n\t\t\t} \n\t}",
"private void unintelligentDecideMove() {\n\t\twander();\r\n\t}",
"@Test\r\n\tpublic void MakeBeverageTest() throws InsuficientException, InterruptedException\r\n\t{\n\t\tmachine.MakeBeverage(\"Tea\", machine.GetOutlet(1));\r\n\t\tmachine.MakeBeverage(\"Tea\", machine.GetOutlet(0));\r\n\t\tSystem.out.println(\"Servered Successfully !!\");\r\n\t}",
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"protected void reInitialize() {\r\n currentPos.reInitialize();\r\n motorState.reInitialize();\r\n armState = KSGripperStates.ARM_UP;\r\n gripperState = KSGripperStates.GRIP_OPEN;\r\n objPresent = false;\r\n objHeld = false;\r\n resistivity = 0;\r\n }",
"@Override\n protected void execute() {\n Robot.elevatorRear.setElevatorRear(Robot.oi.controller.getY(Hand.kLeft), rearLiftLocked);\n }",
"@Override\n public void testPeriodic()\n {\n // test is currently built to debug cargo arm placements\n // press 'A' on the second controller to output the encoder's position\n // and whatever angle it thinks we're at\n // press 'Select' on p2 to re-zero the cargo arm\n \n // cargoArm.armUp();\n \n if(driver2.pressed(driver2.A))\n {\n System.out.println(\"Cargo arm is at encoder value: \" + cargoArm.encCargoArm.position());\n System.out.println(\"Which is \" + (cargoArm.encCargoArm.angle() + cargoArm.ZERO_ANGLE) + \" degrees.\");\n \n System.out.println(\"Hatch finger is at encoder value: \" + hatchArm.fingerEncValue());\n }\n if(driver2.pressed(driver2.Select))\n {\n cargoArm.zeroEncoder();\n System.out.println(\"Cargo arm zeroed.\");\n\n hatchArm.zero();\n System.out.println(\"Hatch finger zeroed.\");\n\n hatchArm.finger_target = 0;\n hatchArm.finger_moving = false;\n hatchArm.dirMoving = 0;\n }\n \n // if(driver2.pressed(driver2.B))\n // {\n // cargoArm.armPositionTarget = testGoalAngle * 56.9;\n // //double forceToApply = cargoArm.getArmCalculation();\n // System.out.println(\"To reach the goal of \" + testGoalAngle + \", the following force would be applied: \" + forceToApply);\n // }\n \n // adjust test goal angle to combine with the above to see, without moving, a cargo arm motor speed to apply\n if(driver2.dpad(driver2.Up))\n {\n testGoalAngle += 5;\n cargoArm.armPositionTarget = testGoalAngle * 56.9;\n System.out.println(\"Test goal angle incremented to \" + testGoalAngle);\n }\n if(driver2.dpad(driver2.Down))\n {\n testGoalAngle -= 5;\n \n cargoArm.armPositionTarget = testGoalAngle * 56.9;\n System.out.println(\"Test goal angle decremented to \" + testGoalAngle);\n }\n \n // // adjust gravitational constant for on-the-go tweak testing\n // // if you don't know what you're doing, do not try to do this!\n // if(driver2.pressed(driver2.R1))\n // {\n // cargoArm.GRAV_CONSTANT += 0.02;\n // System.out.println(\"Gravitational constant incremented to \" + cargoArm.GRAV_CONSTANT);\n // }\n // if(driver2.pressed(driver2.L1))\n // {\n // cargoArm.GRAV_CONSTANT -= 0.02;\n // System.out.println(\"Gravitational constant decremented to \" + cargoArm.GRAV_CONSTANT);\n // }\n // button 7: L2\n // button 8: R2\n // L2 will reverse the finger\n // R2 will rotate it forward\n if(driver2.down(driver2.L1))\n {\n hatchArm.rotateFinger(1);\n }\n else\n {\n if(driver2.down(driver2.L2))\n {\n hatchArm.rotateFinger(-1);\n }\n else\n {\n hatchArm.rotateFinger(0);\n }\n }\n hatchArm.periodic();\n\n if(driver2.pressed(driver2.B))\n {\n hatchArm.toggleFinger();\n }\n\n // test brake power\n if(driver2.pressed(driver2.Start))\n {\n cargoArm.toggleBrake();\n System.out.println(\"Bike brake toggled to: \" + cargoArm.solArmBrake.get());\n }\n\n // press 'x' to toggle whether or not arm should attempt to ONLY counterract the force of gravity\n // use this to check if the grav constant is correct. if it is, the arm should not fall\n if(driver2.pressed(driver2.X))\n {\n cargoArm.toggleArmLock();\n System.out.println(\"Arm lock toggled.\");\n if(cargoArm.armLockEnabled)\n {\n System.out.println(\"Arm should stay constant at given location.\");\n }\n }\n\n // if(driver2.down(driver2.L2) && driver2.pressed(driver2.R2))\n // {\n // movementInTest = !movementInTest;\n // if(movementInTest)\n // {\n // System.out.println(\"Movement in test has been enabled!\");\n // }\n // else\n // {\n // System.out.println(\"Movement in test has been disabled.\");\n // }\n // }\n if(driver2.pressed(driver2.R1))\n {\n System.out.println(\"Moving hatch finger to UP\");\n hatchArm.fingerUp();\n }\n if(driver2.pressed(driver2.R2))\n {\n System.out.println(\"Moving hatch finger to GRAB\");\n hatchArm.fingerGrab();\n }\n\n // if(movementInTest)\n // {\n // cargoArm.rotateArm(cargoArm.getArmCalculation());\n // }\n \n // // this is an attempt to read values from the DriverStation so we can edit constants without redeploying\n // // this may need tweaking b/c the resource that said this was possible was from 2013\n // if(driver2.pressed(driver2.Start))\n // {\n // System.out.println(\"Grabbing constants from Smart Dashboard...\");\n // cargoArm.GRAV_CONSTANT = prefs.getDouble(\"Grav_Constant\", 0.5);\n // // cargoArm.ENCODER_RATIO = prefs.getDouble(\"Cargo_Gear_Ratio\", 1);\n // cargoArm.armPositions[1] = prefs.getDouble(\"Cargo_Full_Down_Pos\", -6000);\n // }\n\n }",
"@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }",
"public static void main(String[] args) {\n//\t\tmotorGrab.setSpeed(360);\r\n//\t\tdouble rotationGrab=(-0.02)*90/0.01;\r\n//\t\tmotorGrab.rotate(-(int)rotationGrab);\r\n//\t\t\r\n\t\t\r\n\t\tposFork.add(rack11); posFork.add(rack21);posFork.add(rack31);posFork.add(rack41);\r\n\t\tposFork.add(rack42); posFork.add(rack32);posFork.add(rack22);posFork.add(rack12);\r\n\t\tposFork.add(rack13); posFork.add(rack23);posFork.add(rack33);posFork.add(rack43);\r\n\t\tposFork.add(rack44); posFork.add(rack34);posFork.add(rack24);posFork.add(rack14);\r\n\t\tpositionFork=new double[3];\r\n\t\tpositionFork[0]=0.30;\r\n\t\tpositionFork[1]=0.05;\r\n\t\tpositionFork[2]=0.05;\r\n\r\n\t\tgoToInitialState();\r\n\t\tint i=0;\r\n\t\twhile(i<15)\r\n\t\t{\r\n\t\t\tscanPos(i);\r\n\t\t\tmoveFork(posFork.get(i).getCoordinates(),posFork.get(i+1).getCoordinates());\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t// This moment the full rack is scanned, starting from the first shelf on the first row. The code below, could be written inside the while loop.\r\n\t\t// Then, we can for example break the while loop immediately when one column seems to be empty.\r\n\t\t// The code below will also be used to check if the class works\r\n\t\t// Idea if the movement of the motors is not accurate enough: use the color sensor to decide what the position of the robot is.\r\n\t\tint[] emptyOrMistake=new int[16];//0: right color, 1: empty, 2: wrong color \r\n\t\tfor(int j=0;j<16;j++)\r\n\t\t{\r\n\t\t\tif(posFork.get(j).getColorBlock()!=posFork.get(j).getColorShelf() && posFork.get(j).getColorBlock()!=5 )\r\n\t\t\t{\r\n\t\t\t\temptyOrMistake[j]=2;\r\n\t\t\t}\r\n\t\t\tif(posFork.get(j).getColorBlock()==5)\r\n\t\t\t{\r\n\t\t\t\temptyOrMistake[j]=1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\twhile(Button.readButtons()==0) {\r\n\t\tfor(int k=0;k<16;k++)\r\n\t\t{\r\n\t\t\tSystem.out.println(emptyOrMistake[k]);\r\n\t\t}\r\n\t\t}\r\n\t\t// conditions for this class to be called: the robot shouldn't have a box on its fork, it should not have an assignment to deliver a box\r\n\t\t// it is not very efficient to scan each time a box is placed in the warehouse --> it could be an idea to give the robot different assignements after scanning one time\r\n\t\t\r\n\t}",
"@Override\n public void robotPeriodic() {\n // m_driveTrain.run(gulce);\n\n\n\n // workingSerialCom.StringConverter(ros_string, 2);\n // RoboticArm.run( workingSerialCom.StringConverter(ros_string, 2));\n }",
"@Override\r\n\tpublic RepairKit createRepairKit(double repairAmount, int weight)\r\n\t{\r\n\t\treturn new RepairKit(repairAmount, weight);\r\n\t}",
"@Override\n public void loop() {\n\n //double armRot = robot.Pivot.getPosition();\n\n double deadzone = 0.2;\n\n double trnSpdMod = 0.5;\n\n float xValueRight = gamepad1.right_stick_x;\n float yValueLeft = -gamepad1.left_stick_y;\n\n xValueRight = Range.clip(xValueRight, -1, 1);\n yValueLeft = Range.clip(yValueLeft, -1, 1);\n\n // Pressing \"A\" opens and closes the claw\n if (gamepad1.a) {\n\n if (robot.Claw.getPosition() < 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(1);}\n else if (robot.Claw.getPosition() > 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(0.4);}\n else\n while(gamepad1.a)\n robot.Claw.setPosition(1);\n }\n\n // Pressing \"B\" changes the wrist position\n if (gamepad1.b) {\n\n if (robot.Wrist.getPosition() == 1)\n while(gamepad1.b)\n robot.Wrist.setPosition(0.5);\n else if (robot.Wrist.getPosition() == 0.5)\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n else\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n }\n\n // Turn left/right, overrides forward/back\n if (Math.abs(xValueRight) > deadzone) {\n\n robot.FL.setPower(xValueRight * trnSpdMod);\n robot.FR.setPower(-xValueRight * trnSpdMod);\n robot.BL.setPower(xValueRight * trnSpdMod);\n robot.BR.setPower(-xValueRight * trnSpdMod);\n\n\n } else {//Forward/Back On Solely Left Stick\n if (Math.abs(yValueLeft) > deadzone) {\n robot.FL.setPower(yValueLeft);\n robot.FR.setPower(yValueLeft);\n robot.BL.setPower(yValueLeft);\n robot.BR.setPower(yValueLeft);\n }\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n\n telemetry.addData(\"Drive Encoder Ticks\", robot.FL.getCurrentPosition());\n telemetry.addData(\"Winch Encoder Ticks\", robot.Winch.getCurrentPosition());\n telemetry.addData(\"ColorArm Position\", robot.ColorArm.getPosition());\n telemetry.addData(\"Wrist Position\", robot.Wrist.getPosition());\n telemetry.addData(\"Claw Position\", robot.Claw.getPosition());\n telemetry.addData(\"Grip Position\", robot.Grip.getPosition());\n telemetry.addData(\"Color Sensor Data Red\", robot.Color.red());\n telemetry.addData(\"Color Sensor Data Blue\", robot.Color.blue());\n\n /*\n\n // This is used for an Omniwheel base\n\n // Group a is Front Left and Rear Right, Group b is Front Right and Rear Left\n float a;\n float b;\n float turnPower;\n if(!gamepad1.x) {\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n\n a = Range.clip(yValueLeft + xValueLeft, -1, 1);\n b = Range.clip(yValueLeft - xValueLeft, -1, 1);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n } else {\n\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n a = Range.clip(yValueLeft + xValueLeft, -0.6f, 0.6f);\n b = Range.clip(yValueLeft - xValueLeft, -0.6f, 0.6f);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n }\n\n\n if (gamepad1.dpad_up) {\n\n robot.Swing.setPower(.6);\n\n } else if (gamepad1.dpad_down) {\n\n robot.Swing.setPower(-.6);\n\n } else {\n\n robot.Swing.setPower(0);\n }\n\n if(gamepad1.a){\n\n robot.Claw.setPosition(.4);\n\n } else if(gamepad1.b){\n\n robot.Claw.setPosition(0);\n }\n\n if(gamepad1.left_bumper) {\n\n robot.Pivot.setPosition(armRot+0.0005);\n\n } else if(gamepad1.right_bumper) {\n\n robot.Pivot.setPosition(armRot-0.0005);\n\n } else{\n\n robot.Pivot.setPosition(armRot);\n }\n\n telemetry.addData(\"position\", position);\n\n */\n\n /*\n * Code to run ONCE after the driver hits STOP\n */\n }",
"private void doUnchokes() { \n\n\t\t// logic below is either 1 second or 10 secondly, bail out early id neither\n\n\t\tif( !UploadSlotManager.AUTO_SLOT_ENABLE ) {\t\t //manual per-torrent unchoke slot mode\n\n\t\t\tif( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ) { \n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfinal int max_to_unchoke = adapter.getMaxUploads(); //how many simultaneous uploads we should consider\n\t\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\t\t//determine proper unchoker\n\t\t\tif( seeding_mode ) {\n\t\t\t\tif( unchoker == null || !(unchoker.isSeedingUnchoker()) ) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( true );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( unchoker == null || unchoker.isSeedingUnchoker()) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( false );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t//do main choke/unchoke update every 10 secs\n\t\t\t\n\t\t\tif ( mainloop_loop_count % MAINLOOP_TEN_SECOND_INTERVAL == 0 ){\n\n\t\t\t\tfinal boolean refresh = mainloop_loop_count % MAINLOOP_THIRTY_SECOND_INTERVAL == 0;\n\n\t\t\t\tunchoker.calculateUnchokes( max_to_unchoke, peer_transports, refresh, adapter.hasPriorityConnection());\n\n\t\t\t\tArrayList\tchokes \t\t= unchoker.getChokes();\n\t\t\t\tArrayList\tunchokes\t= unchoker.getUnchokes();\n\t\t\t\t\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( chokes, unchokes );\n\t\t\t\t\n\t\t\t}else if ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL == 0 ) { //do quick unchoke check every 1 sec\n\n\t\t\t\tArrayList unchokes = unchoker.getImmediateUnchokes( max_to_unchoke, peer_transports );\n\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( null, unchokes );\n\t\t\t}\n\t\t}\n\t}",
"public void runPuzzleMovement( Screw screw, float screwVal, Platform p );",
"@Override\n protected void initialize() {\n Robot.SCISSOR.extendLift(speed);\n }",
"@Override\n\tpublic void robotInit() {\n\t\tleftDriveBack = new VictorSP(0); // PWM Port, madke sure this is set correctly.\n\t\tleftDriveFront = new VictorSP(1);\n\t\t\n\t\trightDriveFront = new VictorSP(2);\n\t\trightDriveBack = new VictorSP(3);\n\t\t\n\t\tleftIntake = new Spark(5);\n\t\trightIntake = new Spark(6);\n\t\t\n\t\tarmMotor = new TalonSRX(10);\n\t\tarmMotor.setNeutralMode(NeutralMode.Brake);\n\t\tarmMotor.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Absolute, 0, 0);\n\t\tarmMotor.configPeakCurrentLimit(30, 0);\n\t\tarmMotor.configPeakCurrentDuration(250, 0);\n\t\tarmMotor.configContinuousCurrentLimit(20, 0);\n\t\tarmMotor.configClosedloopRamp(0.25, 0);\n\t\tarmMotor.configOpenloopRamp(0.375, 0);\n\t\tarmMotor.enableCurrentLimit(true);\n\t\t\n\t\tarmMotor.configPeakOutputForward(1.0, 0);\n\t\tarmMotor.configPeakOutputReverse(-1.0, 0);\n\t\t\n\t\tarmMotor.config_kP(0, 0.0, 0);\n\t\t\n\t\tarmSetpoint = armMotor.getSelectedSensorPosition(0);\n\t\t\n\t\tstick = new Joystick(0);\n\t\tstickReversed = false;\n\t\txbox = new XboxController(1); // USB port, set in driverstation.\n\t\t\n\t\tdriveCamera = CameraServer.getInstance().startAutomaticCapture(0);\n\t}",
"private void applyHint() {\r\n\t\tif (this.client.getTurn().getMoves().size() != 0) {\r\n\t\t\tthis.client.submitTurn();\r\n\t\t} else { \r\n\t\t\tUtil.println(\"This could not been applied to the server.\");\r\n\t\t}\r\n\t}",
"public void start() {\n rfMotor.setPower(1);\n rrMotor.setPower(1);\n lfMotor.setPower(1);\n lrMotor.setPower(1);\n }",
"public BallPickUp(){\n //pickUpCompressor.start();\n //pickUpCompressor.setClosedLoopControl(true);\n //climbLockLeftSolenoid(true);\n //climbLockRightSolenoid(true);\n\n // testing voltage compensation mode -- hopefully will not brown out \n // ballPickUpTalon.configVoltageCompSaturation(12); // \"full output\" will now scale to 11 Volts for all control modes when enabled.\n // ballPickUpTalon.enableVoltageCompensation(true); // turn on/off feature\n pickUpArmTalon.configFactoryDefault();\n pickUpArmTalon.setNeutralMode(NeutralMode.Brake);\n //configure sensor source for primary PID\n //colorWheelTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.kPIDLoopIDx, RobotMap.kTimeoutMs);\n pickUpArmTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n //set deadband to super small 0.001 (.1%)\n pickUpArmTalon.configNeutralDeadband(0.001, RobotMap.pickUpArmTimeoutMs);\n /* configure Talson SRX utput and sensor direction occordingly invert motor to\n *have green LEDs when driving Talon Forward / requesting positive utput phase sensor\n *to have positive increment when driving Talon Forward (Green LED) */\n pickUpArmTalon.setSensorPhase(false);\n //making this true or false does the same thing\n pickUpArmTalon.setInverted(true);\n /* set relevant frame periods to be at least as fast as periodic rate */\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10, RobotMap.pickUpArmTimeoutMs);\n /* set the peak and nominal outputs */\n pickUpArmTalon.configNominalOutputForward(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configNominalOutputReverse(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputForward(1, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputReverse(-1, RobotMap.pickUpArmTimeoutMs);\n /* set the Motion Magic gains in slot0 - see documentation */\n pickUpArmTalon.config_kF(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kF, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kP(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kP, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kI(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kI, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kD(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kD, RobotMap.pickUpArmTimeoutMs);\n \n pickUpArmTalon.selectProfileSlot(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmPIDLoopIDx);\n /* set acceleration and vcruise velocity - see documentation */\n //numbers should be experimentally derived once we have the color wheel system in place\n pickUpArmTalon.configMotionCruiseVelocity(RobotMap.pickUpArmCruiseVelocity, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configMotionAcceleration(RobotMap.pickUpArmAcceleration, RobotMap.pickUpArmTimeoutMs);\n /* zero the sensor once on robot boot up*/\n pickUpArmTalon.setSelectedSensorPosition(0, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n}",
"public void liftArm(){armLifty.set(-drivePad.getThrottle());}",
"public void repair(){\n if(health < 9) {\n this.health++;\n }\n }",
"protected void initialize() {\n \tRobot.gearIntake.setIsDown(true);\n }",
"private void placeKitOnDeliveryBoat(MyKit mk)\n\t{\n\t\tif(guiEnable){\n\t\t\tthis.boatGui.msgDoGetKit();\n\t\t\ttry {\n\t\t\t\tprint(\"Boat moving!!\");\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//e1.printStackTrace();\n\t\t\t}\n\t\t\tprint(\"Boat has finished moving.\");\n\t\t\tthis.kitRobotGUI.DoMoveFinishedKitToDeliveryStation (mk.kit.guikit);\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Boat. Finished moving. Telling Agent.\");\n\t\t\n\t\tmyStand.setSlotThreeAvailable();\n\t\tmk.slot = 0;\n\t\tprint(\"Kit Slot number : \"+3 +\" is available\");\n\t\tmk.status = KitStatus.Gone; \n\t\tif(guiEnable)\n\t\t\tboatGui.msgDoReceiveKit(mk.kit.guikit);//telling boat\n\t\tstateChanged();\n\t}",
"public void LaunchTorpedo() {\r\n if(this.CurrentTorpedoCount > 0) {\r\n System.out.println(this.ModelNumber + \" is firing off a torpedo!\");\r\n this.CurrentTorpedoCount -= 1;\r\n } else {\r\n System.out.println(\"Torpedoes Expended\");\r\n }\r\n }",
"@Override\n public void loop() {\n rightArm.setTargetPosition((int)(.125* TICKS_PER_WHEEL_ROTATION*8));\n leftArm.setTargetPosition((int)(.125* TICKS_PER_WHEEL_ROTATION*8));\nrightArm.setPower(.6);\nleftArm.setPower(.6);\nif(runtime.seconds()>4&& stage==-1){\n stage++;\n}\n// telemetry.addData(\"IsAligned\" , detector.getAligned()); // Is the bot aligned with the gold mineral?\n// telemetry.addData(\"X Pos\" , detector.getXPosition()); // Gold X position.\n\n //Point screenpos = detector.getScreenPosition();\n if(stage==0) {\n Rect bestRect = detector.getFoundRect();\n\n double xPos = bestRect.x + (bestRect.width / 2);\n\n if (xPos < alignXMax && xPos > alignXMin) {\n aligned = true;\n } else {\n aligned = false;\n }\n telemetry.addData(\"aligned \", aligned);\n\n telemetry.addData(\"xpos \", xPos);\n telemetry.addData(\"amax \", alignXMax);\n telemetry.addData(\"amin \", alignXMin);\n if(!(xPos>0)){\n rightWheel.setPower(0);\n leftWheel.setPower(0);\n telemetry.addLine(\"not detected\");\n }\n else if (xPos > alignXMax) {\n double power = ((xPos - alignXMax) / scale) * .3 + .4;\n rightWheel.setPower(power);\n leftWheel.setPower(-power);\n telemetry.addData(\"powL: \", power);\n telemetry.addLine(\"turning left\");\n runtime.reset();\n } else if (xPos < alignXMin) {\n double power = ((alignXMin - xPos) / scale) * .3 + .4;\n rightWheel.setPower(-power);\n leftWheel.setPower(power);\n telemetry.addData(\"powR: \", power);\n telemetry.addLine(\"turning right\");\n runtime.reset();\n } else {\n rightWheel.setPower(0);\n leftWheel.setPower(0);\n telemetry.addLine(\"found\");\n telemetry.addData(\"secks: \", runtime.seconds());\n if(runtime.seconds()>.1){\n runtime.reset();\n stage++;\n resetDriveEncoders();\n }\n }\n\n\n }\n else if (stage==1){\n rightWheel.setTargetPosition(-3*TICKS_PER_WHEEL_ROTATION);\n leftWheel.setTargetPosition(-3*TICKS_PER_WHEEL_ROTATION);\n leftWheel.setPower(.5);\n rightWheel.setPower(.5);\n if(runtime.seconds()>5){\n rightWheel.setPower(0);\n leftWheel.setPower(0);\n }\n\n }\n\n\n telemetry.addData(\"stage: \", stage);\n telemetry.update();\n }"
] | [
"0.72299767",
"0.59849244",
"0.5831381",
"0.5795758",
"0.57433057",
"0.5715285",
"0.5552116",
"0.54862815",
"0.541523",
"0.5399749",
"0.538119",
"0.53121716",
"0.52974385",
"0.5257424",
"0.5232062",
"0.5218225",
"0.5206913",
"0.5193749",
"0.5187422",
"0.5179717",
"0.51729774",
"0.5168497",
"0.5162352",
"0.5161644",
"0.51611453",
"0.51583177",
"0.51551205",
"0.5150991",
"0.5148231",
"0.51477563",
"0.51341736",
"0.51236445",
"0.51151395",
"0.5113803",
"0.51121974",
"0.5109792",
"0.5102823",
"0.5101379",
"0.5097753",
"0.5088136",
"0.5087528",
"0.50841135",
"0.5066835",
"0.5064289",
"0.50634164",
"0.5060642",
"0.5058698",
"0.50556093",
"0.5054871",
"0.5038725",
"0.50387204",
"0.50380695",
"0.50354725",
"0.50296044",
"0.5026533",
"0.50231373",
"0.50206304",
"0.5019898",
"0.5018754",
"0.5014734",
"0.5013297",
"0.50127405",
"0.50101453",
"0.5007759",
"0.5001586",
"0.49983793",
"0.49968815",
"0.4994337",
"0.49942765",
"0.4991849",
"0.4985417",
"0.49830887",
"0.4979765",
"0.49769422",
"0.49763888",
"0.49611384",
"0.49534512",
"0.49484473",
"0.49468136",
"0.4946208",
"0.49437815",
"0.494161",
"0.49408385",
"0.49389112",
"0.49383935",
"0.49298933",
"0.49287438",
"0.4926472",
"0.49256006",
"0.49224684",
"0.49218956",
"0.49158838",
"0.49156174",
"0.49107608",
"0.4900313",
"0.48966503",
"0.48954606",
"0.48932245",
"0.4891793",
"0.4884195"
] | 0.7684432 | 0 |
Make robot use repairKit (if possible). | @Override
public void useRepairKit(Robot robot, RepairKit repairKit)
{
try
{
if(robot.canUse(repairKit))
{
robot.use(repairKit);
}
else
{
System.out.println("This repair kit could not be used by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this repair kit is terminated; the robot cannot use the repair kit.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void pickUpRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot pick up the repair kit.\");\r\n\t\t}\r\n\t}",
"private void performHandShake() {\n try {\n boolean OK = false;\n // String rsp= new String( this.defaultComTool.WriteAndRead((String) command.get(\"restore_defaults\")));\n // while(!OK) { }\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_echo\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_linefeed\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_headers\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_spaces\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"protocol auto set\"));\n Thread.sleep(3000);\n\n this.CheckRequiredCommands_Availability(FIRSTLEVEL_CHECK);\n //Thread.sleep(2000);\n\n this.CheckRequiredCommands_Availability(SECONDLEVEL_CHECK);\n for (int i = 1; i < 6; i++) {\n switch (i) {\n case 1:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: RPM Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 2:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: SPEED Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 3:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: COOLANT TEMP Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 4:\n if (av_commands[i] == false) {\n int arbFuel;\n Random rnd = new Random();\n arbFuel = rnd.nextInt(100) + 1;\n Kernel.interfc.sim.log.append(\"WARNING: FUEL LVL Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbFuel + \") set!! \\n\");\n\n }\n break;\n case 5:\n if (av_commands[i] == false) {\n int arbCheck;\n Random rnd = new Random();\n arbCheck = rnd.nextInt(2);\n Kernel.interfc.sim.log.append(\"WARNING: CheckEngine Light Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbCheck + \") set!! \\n\");\n\n }\n break;\n\n }\n }\n {\n Kernel.interfc.sim.log.append(\"HANDSHAKE PERFORMED...Awaiting for SelfTest\\n\");\n\n }\n\n } catch (Exception e) {\n System.out.println(\"PERFORM HANDSHAKE:\" + e.getMessage() + \" \" + e.getLocalizedMessage());\n }\n }",
"protected abstract void fixChassis();",
"@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }",
"@Override\r\n\tpublic void dropRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot drop the repair kit.\");\r\n\t\t}\r\n\t}",
"protected void initialize() {\n \tRobot.intake.setHard(isHard);\n }",
"private void canRepair(boolean b) {\n\t\t\n\t}",
"public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"private void bypassIt(){\n rebootDialog();\n }",
"protected void initialize() {\n \tRobot.conveyor.stop();\n }",
"@Test\n\tpublic void riposteShieldTest() {\n\t\tDisplayWithShield();\n\t\t\n\t\tint cardPos = 0;\n\t\tint targetPlayer = 1;\n\t\tint targetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t/*\n\t\t * test to make sure the target has a maiden as the last played card\n\t\t*/\n\t\tassertTrue(game.getDisplay(1).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t */\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t\t\n\t\t\n\t\t//assertFalse(game.getDisplay(0).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t//test the size of discard deck before playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\tassertEquals(game.getDisplay(targetPlayer).deckSize(), 7);\n\t\t\n\t\t//play Riposte\n\t\tRulesEngine.riposte(game, cardPos, targetPlayer);\n\t\t\n\t\t//test the size of discard deck after playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\t//Update this variable after a card has been removed from the display\n\t\ttargetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t\n\t\t/*\n\t\t * test to make sure the target's last played card is still a maiden\n\t\t*/\n\t\tassertTrue(game.getDisplay(targetPlayer).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t*/\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t}",
"public static void fixCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select(new Filter<GameObject>() {\n @Override\n public boolean accept(GameObject gameObject) {\n return gameObject.name().toLowerCase().contains(\"broken\");\n }\n }).nearest().poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Repair\"));\n sleep(3000);\n }\n }",
"public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"public boolean use(RobotEngine r, NavigationModule nav){\n\t\tboolean usado = false;\n\t\tif(this.canBeUsed()){\n\t\t\tr.addRecycledMaterial(this.recycledMaterial);\n\t\t\tthis.isUsed = true;\n\t\t\tr.saySomething(\" * My power is \"+r.getFuel());\n\t\t\tr.saySomething(\" * My recycled material is: \"+r.getRecycledMaterial());\n\t\t\tusado = true;\n\t\t}\n\t\treturn usado;\n\t}",
"@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }",
"@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }",
"public void reConfigure();",
"protected void initialize() {\n \t//Robot.getFlywheel().setRunning(!Robot.getFlywheel().running());\n \t//Robot.getElevator().setRunning(!Robot.getElevator().running());\n \tif (run == false)\n \t{\n \t\tRobot.getFlywheel().setRunning(false);\n \t\t//Robot.getIndexer().setRunning(false);\n \t\tRobot.getFlywheel().setSetpoint(0.0);\n \t\tRobot.getFlywheel().disable();\n \t\t//Robot.getIndexer().disable();\n \t\tSystem.out.println(\"not running\");\n \t}\n \telse\n \t{\n \t\tRobot.getFlywheel().initialize();\n \t\tRobot.getFlywheel().enable();\n \t\tRobot.getFlywheel().setRunning(true);\n \t\tdouble m_motorLevel;\n \t\t//m_rpms = SmartDashboard.getNumber(\"FlywheelVelocity\", 1850);\n \t//m_motorLevel = m_rpms / 6750 * 1.35;//6750 = max rpms\n \tm_motorLevel =( m_rpms + 1000) / 6750 *1.1;//6750 = max rpms\n \tRobot.getFlywheel().setSetpoint(m_rpms);\n \tRobot.getFlywheel().setExpectedMotorLevel(m_motorLevel);\n \tSmartDashboard.putNumber(\"FlywheelVelocity\", m_rpms);\n \tSystem.out.println(m_rpms + \" \" + m_motorLevel + \" setpoint: \" + Robot.getFlywheel().getSetpoint());\n \t}\n }",
"public void autoMode4Red(int delay){\n \taddParallel(new LightCommand(0.25));\n// \taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddSequential(new AutoDriveCommand(6));\n \taddSequential(new TurnWithPIDCommand(-45)); \n \taddSequential(new WaitWithoutCheckCommand(.5));\n \taddSequential(new VisionGearTargetCommand(\"targets\"));\n \taddSequential(new TargetGearSortCommand());\n \taddSequential(new AutoTurnCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"),0.5);\n// \t\taddSequential(new TargetGearSortCommand(),0.5);\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}else{\n// \t\n// \t}\n }",
"void installIfNeeded()\n throws Exception;",
"protected void initialize()\n\t{\n\t\tenable = SmartDashboard.getBoolean(RobotMap.EnableRespoolWinch);\n\t}",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"protected abstract boolean useReasoner();",
"protected void initialize() {\n \tRobot.chassisSubsystem.setShootingMotors(0);\n }",
"@Override\n public void robotPeriodic() {\n // m_driveTrain.run(gulce);\n\n\n\n // workingSerialCom.StringConverter(ros_string, 2);\n // RoboticArm.run( workingSerialCom.StringConverter(ros_string, 2));\n }",
"@Override\n protected void initialize() {\n Robot.SCISSOR.extendLift(speed);\n }",
"protected void initialize() {\n\t\tRobot.conveyor.Forward();\n\n\t}",
"@Override\n public void robotInit() {\n m_driveTrain = new DriveTrain();\n m_oi = new OI(); \n encoder = new Encoder();\n JoystickDrive = new JoystickDrive();\n RoboticArm = new RoboticArm();\n Science = new Science();\n pid = new PID();\n inverse = new Inverse();\n\n // workingSerialCom = new serialComWorking();\n\n\n // while(true){\n // // ros_string = workingSerialCom.read();\n // // System.out.println(ros_string);\n // LeftFront = Robot.m_driveTrain.dr+iveTrainLeftFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // RightFront = Robot.m_driveTrain.driveTrainRightFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // LeftFront_ros = workingSerialCom.floattosString(LeftFront);\n // RigthFront_ros = workingSerialCom.floattosString(RightFront);\n\n // ros_string = workingSerialCom.read();\n // gulce = workingSerialCom.StringConverter(ros_string, 1);\n // System.out.println(gulce);\n // workingSerialCom.write(LeftFront_ros+RigthFront_ros+\"\\n\");\n // }\n // workingSerialCom.write(\"Yavuz\\n\");\n // // RoboticArm.run();\n // // m_driveTrain.run();\n // // workingSerialCom.StringConverter(ros_string, 3);\n }",
"@Override\n\tpublic void robotInit() {\n\t\tdt = new DriveTrain();\n\t\t//Initialize drive Talons\n\t\tRobotMap.vspLeft = new WPI_TalonSRX(RobotMap.dtLeft);\n\t\tRobotMap.vspRight = new WPI_TalonSRX(RobotMap.dtRight);\n\t\t//Initialize drive slave Victors\n\t\t//RobotMap.slaveLeft = new WPI_VictorSPX(RobotMap.slaveDriveLeft);\n\t\t//RobotMap.slaveRight = new WPI_VictorSPX(RobotMap.slaveDriveRight);\n\t\t//Set drive slaves to follower mode\n\t\t//RobotMap.slaveLeft.follow(RobotMap.vspLeft);\n\t\t//RobotMap.slaveRight.follow(RobotMap.vspRight);\n\t\t//Initialize drive train\n\t\tRobotMap.rd = new DifferentialDrive(RobotMap.vspLeft, RobotMap.vspRight);\n\t\t//Initialize drive joystick\n\t\tRobotMap.stick = new Joystick(RobotMap.joystickPort);\n\t\t//Disabled drive safety\n\t\tRobotMap.vspLeft.setSafetyEnabled(false);\n\t\tRobotMap.vspRight.setSafetyEnabled(false);\n\t\tRobotMap.rd.setSafetyEnabled(false);\n\t\t//Initialize lift Talon\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(5);\n\t\t//Initialize operator controller\n\t\tRobotMap.controller = new Joystick(RobotMap.controllerPort);\n\t\t//Initialize intake Victors\n\t\tRobotMap.intakeVictorLeft = new WPI_VictorSPX(RobotMap.intakeMaster);\n\t\tRobotMap.intakeVictorRight = new WPI_VictorSPX(RobotMap.intakeSlave);\n\t\t//Set right intake Victor to follow left intake Victor\n\t\tRobotMap.intakeVictorRight.follow(RobotMap.intakeVictorLeft);\n\t\t\n\t\tRobotMap.climberVictorLeft = new WPI_VictorSPX(RobotMap.climberLeftAddress);\n\t\tRobotMap.climberVictorRight = new WPI_VictorSPX(RobotMap.climberRightAddress);\n\t\t\n\t\tRobotMap.climberVictorRight.follow(RobotMap.climberVictorLeft);\n\t\t\n\t\tRobotMap.piston = new DoubleSolenoid(RobotMap.inChannel, RobotMap.outChannel);\n\t\t\n\t\tRobotMap.intakeLifter = new WPI_VictorSPX(2);\n\t\t\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(RobotMap.liftTalonAddress);\n\t\t\n\t\tautoChooser = new SendableChooser();\n\t\tautoChooser.addDefault(\"Drive to baseline\" , new DriveToBaseline());\n\t\tautoChooser.addObject(\"Null auto\", new NullAuto());\n\t\tautoChooser.addObject(\"Switch from right\", new SwitchFromRight());\n\t\tautoChooser.addObject(\"Switch from left\", new SwitchFromLeft());\n\t\tautoChooser.addObject(\"PID from left\", new PIDfromLeft());\n\t\tautoChooser.addObject(\"PID from right\", new PIDfromRight());\n\t\tautoChooser.addObject(\"Scale from right\", new ScaleAutoRight());\n\t\tautoChooser.addObject(\"Scale from left\", new ScaleAutoLeft());\n\t\tautoChooser.addObject(\"PID tester\", new PIDTESTER());\n\t\tautoChooser.addObject(\"Joe use this one\", new leftOnly());\n\t\tSmartDashboard.putData(\"Autonomous mode chooser\", autoChooser);\n\t\t\n\t\t//RobotMap.liftVictor.follow(RobotMap.climberTalon);\n\t\t\n\t\tRobotMap.vspLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\tRobotMap.vspRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\t\n\t\tRobotMap.intakeLifted = new DigitalInput(1);\n\t\tRobotMap.isAtTop = new DigitalInput(2);\n\t\tRobotMap.isAtBottom = new DigitalInput(0);\n\t\t\n\t\tRobotMap.vspLeft.configVelocityMeasurementPeriod(VelocityMeasPeriod.Period_100Ms, 1);\n\t\tRobotMap.vspRight.configVelocityMeasurementWindow(64, 1); \n\t\t\n\t\toi = new OI();\n\t}",
"public void autoMode1Red(int delay){\n \taddParallel(new LightCommand(0.5));\n//\t\taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.7, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"));\n// \t\taddSequential(new TargetGearSortCommand());\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}\n \taddParallel(new EnvelopeCommand(false));\n \taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 50));\n \taddSequential(new TurnWithPIDCommand(-100));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(1, 45));\n \taddSequential(new VisionBoilerTargetCommand(\"targets\"));\n\t\taddSequential(new TargetBoilerSortCommand());\n\t\taddSequential(new AutoTurnCommand());\n \taddSequential(new ShootCommand(true,0.85));\n \t\n }",
"public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }",
"public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }",
"@Override\n\tpublic void robotInit() {\n\t\tleftDriveBack = new VictorSP(0); // PWM Port, madke sure this is set correctly.\n\t\tleftDriveFront = new VictorSP(1);\n\t\t\n\t\trightDriveFront = new VictorSP(2);\n\t\trightDriveBack = new VictorSP(3);\n\t\t\n\t\tleftIntake = new Spark(5);\n\t\trightIntake = new Spark(6);\n\t\t\n\t\tarmMotor = new TalonSRX(10);\n\t\tarmMotor.setNeutralMode(NeutralMode.Brake);\n\t\tarmMotor.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Absolute, 0, 0);\n\t\tarmMotor.configPeakCurrentLimit(30, 0);\n\t\tarmMotor.configPeakCurrentDuration(250, 0);\n\t\tarmMotor.configContinuousCurrentLimit(20, 0);\n\t\tarmMotor.configClosedloopRamp(0.25, 0);\n\t\tarmMotor.configOpenloopRamp(0.375, 0);\n\t\tarmMotor.enableCurrentLimit(true);\n\t\t\n\t\tarmMotor.configPeakOutputForward(1.0, 0);\n\t\tarmMotor.configPeakOutputReverse(-1.0, 0);\n\t\t\n\t\tarmMotor.config_kP(0, 0.0, 0);\n\t\t\n\t\tarmSetpoint = armMotor.getSelectedSensorPosition(0);\n\t\t\n\t\tstick = new Joystick(0);\n\t\tstickReversed = false;\n\t\txbox = new XboxController(1); // USB port, set in driverstation.\n\t\t\n\t\tdriveCamera = CameraServer.getInstance().startAutomaticCapture(0);\n\t}",
"protected void interrupted() {\n \tRobot.claw.setClawMotor(0);\n }",
"public void repairOnWrench(IRobot robot) {\n TiledMapTileLayer wrenchLayer = (TiledMapTileLayer) tiledMap.getLayers().get(\"Wrench\");\n if (wrenchLayer.getCell((int) robot.getPos().x, (int) robot.getPos().y) != null) {\n robot.heal();\n }\n }",
"protected void initialize() {\r\n Robot.driveTrain.resetRangefinder();\r\n }",
"@Test\n\tpublic void testCarWithWankelEngine() {\n\t\t\n\t\tOldStyleCarFactory factory = new OldStyleCarFactory() {\n\t\t\t@Override\n\t\t\tpublic Car createPremiumCombustionCar() {\n\t\t\t\tCombustionEngine engine = new WankelEngine();\n\t\t\t\tInternalCombustionCar car = new InternalCombustionCar(engine);\n\t\t\t\treturn car;\n\t\t\t}\n\t\t};\n\t\t\n\t\tCar testCar = factory.createPremiumCombustionCar();\n\t\ttestCar.start();\n\t\tassertTrue(testCar.isRunning());\n\t\ttestCar.stop();\n\t\tassertFalse(testCar.isRunning());\n\t}",
"@Override\n protected void initialize() {\n Robot.powerCellManipulator.stopIntake();\n }",
"@Override\n public void robotInit() {\n\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drive = new Drive();\n pDP = new PDP();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n camera1 = CameraServer.getInstance().startAutomaticCapture(0);\n camera2 = CameraServer.getInstance().startAutomaticCapture(1);\n camera1.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n camera2.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n server = CameraServer.getInstance().getServer();\n flipped = true;\n server.setSource(camera1);\n vexGyro = new AnalogGyro(0);\n vexGyro.setSensitivity(.00175);\n //rightEncoder = new Encoder(0, 1, false);\n //leftEncoder = new Encoder(2, 3, true);\n // Add commands to Autonomous Sendable Chooser\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n chooser.setDefaultOption(\"Autonomous Command\", new AutonomousCommand());\n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n if(centerBlock == null)\n {\n SmartDashboard.putString(\"target good? \", \"no, is null\");\n }\n else{\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out);\n if (centerBlock.yCenter < 200){\n SmartDashboard.putString(\"target good?\", \"YES!!! ycenter less than 200\");\n }\n }\n \n \n\n\n \n \n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n SmartDashboard.putData(\"Auto mode\", chooser);\n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n }",
"@Override\n protected void initialize() {\n if (extend) {\n Robot.rearHatch.setRearHatchPiston(true);\n } else {\n Robot.rearHatch.setRearHatchMotorPercentOutput(-0.6);\n Robot.rearHatch.setRearHatchPiston(false);\n }\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}",
"public void applyGear() {\n\t\t\r\n\t}",
"@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }",
"protected void initialize() {\n \tclaw = Robot.getClaw();\n\n \tclaw.open();\n }",
"public void robotInit() {\n\t\t//Get preferences from robot flash memory\n\t\tprefs = Preferences.getInstance();\n\t\tarmCalMinPosition = prefs.getDouble(\"armCalMinPosition\", 0);\n\t\tarmCal90DegPosition = prefs.getDouble(\"armCal90DegPosition\", 0);\n\t\tif (armCalMinPosition==0 || armCal90DegPosition==0) {\n\t\t\tDriverStation.reportError(\"Error: Preferences missing from RoboRio for Shooter Arm position calibration. Shooter arm disabled.\", true);\n\t\t\tshooterArmEnabled = false;\n\t\t} else {\n\t\t\tshooterArmEnabled = true;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tdebugStream = new FileWriter(\"/home/lvuser/debug.log\", true);\n\t\t\tdebugStream.write(\"Robot program started\\n\");\n\t\t\tdebugStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not open debug file: \" + e);\n\t\t}\n\n\t\t//Instantiates the subsystems\n\t\tdriveTrain = new DriveTrain();\n\t\tshifter = new Shifter();\n\t\tshooterArm = new ShooterArm();\n\t\tshooter = new Shooter();\n\t\tintake = new Intake();\n\t\tvision = new Vision();\n\t\tpanel = new PowerDistributionPanel();\n\t\tarmPiston = new ArmPiston();\n\n\t\t// OI must be constructed after subsystems. If the OI creates Commands\n\t\t// (which it very likely will), subsystems are not guaranteed to be\n\t\t// constructed yet. Thus, their requires() statements may grab null\n\t\t// pointers. Bad news. Don't move it.\n\t\toi = new OI();\n\n intake.motorCurrentTrigger.whenActive(new IntakeMotorStop());\n\n timerLEDs.start();\n timerTilt.start();\n timerRumble.start();\n \n // instantiate the command used for the autonomous period\n\t\t//autonomousCommand = new AutonomousCommandGroup();\n\t\traiseArm90 = new ShooterArmMoveToSetLocation(90);\n\t\t\n\t\t// Display active commands and subsystem status on SmartDashboard\n\t\tSmartDashboard.putData(Scheduler.getInstance());\n\t\tSmartDashboard.putData(driveTrain);\n\t\tSmartDashboard.putData(shifter);\n\t\tSmartDashboard.putData(shooterArm);\n\t\tSmartDashboard.putData(shooter);\n\t\tSmartDashboard.putData(intake);\n\t\tSmartDashboard.putData(vision);\n\t\tSmartDashboard.putData(armPiston);\n\t}",
"public void runOpMode(){\n JAWLDrive3796 drive = new JAWLDrive3796(hardwareMap.dcMotor.get(\"left_drive\"), hardwareMap.dcMotor.get(\"right_drive\"));\n //Set the drive motors to run without encoders\n drive.setEncoders(false);\n //Create Grabber object\n JAWLGrabber3796 grabber = new JAWLGrabber3796(hardwareMap.servo.get(\"left_arm\"), hardwareMap.servo.get(\"right_arm\"));\n //Create Lift object\n JAWLLift3796 lift = new JAWLLift3796(hardwareMap.dcMotor.get(\"lift_motor\"));\n //Create color arm object\n JAWLColorArm3796 colorArm = new JAWLColorArm3796(hardwareMap.servo.get(\"color_arm\"));\n //Creates color sensor name\n ColorSensor colorSensorTemp = hardwareMap.get(ColorSensor.class, \"color_distance\");\n //Creates distance sensor name\n DistanceSensor distanceSensorTemp = hardwareMap.get(DistanceSensor.class, \"color_distance\");\n //Creates the color-distance sensor object\n JAWLColorSensor3796 colorDistanceSensor = new JAWLColorSensor3796(colorSensorTemp, distanceSensorTemp);\n //Creates the variable that will hold the color of the jewel\n String colorOfBall;\n //Creates relic arm objects\n //TTTTRelicArm3796 relicArm = new TTTTRelicArm3796(hardwareMap.dcMotor.get(\"relic_up_down\"), hardwareMap.dcMotor.get(\"relic_out_in\"), hardwareMap.dcMotor.get(\"relic_grab\"));\n //We never ended up having a relic arm!\n //The lift helper will set the idle power of the motor to a small double, keeping the lift from idly falling down\n boolean liftHelper = false;\n int i = 0;\n\n waitForStart();\n\n colorArm.armUp();\n\n while (opModeIsActive()) {\n //Here is where we define how the controllers should work\n //In theory, no logic retaining to controlling the components should be in here\n\n /*\n * Drive\n */\n\n //The left drive wheel is controlled by the opposite value of the left stick's y value on the first gamepad\n //The right drive is the same way except with the right drive wheel\n drive.leftDrive(-gamepad1.left_stick_y);\n drive.rightDrive(-gamepad1.right_stick_y);\n\n /*\n * Lift\n */\n telemetry.addData(\"Gamepad2 Right Stick Y\", -gamepad2.right_stick_y);\n\n if (-gamepad2.right_stick_y > 0) {\n //First checks to see if the right stick's negative y value is greater then zero.\n lift.moveMotor(-gamepad2.right_stick_y);\n //If it is, it sets the power for the motor to 1, and adds telemetry\n telemetry.addData(\"Lift Power\", 1);\n } else if (-gamepad2.right_stick_y < 0) {\n //Checks if the negative value of the right right stick's y position is less than zero\n lift.moveMotor(-0.1);\n //Sets the power for the motor to -0.1, and adds telemetry\n telemetry.addData(\"Lift Power\", -0.1);\n } else {\n //We check to see if the liftHelper is enabled\n if(liftHelper) {\n lift.moveMotor(0.1466 );\n } else {\n lift.moveMotor(0);\n }\n }\n\n\n\n /*\n * Lift helper control\n */\n\n if(gamepad2.a) {\n if(i == 0) {\n liftHelper = !liftHelper;\n }\n i = 5;\n }\n\n if(i != 0) {\n i--;\n }\n\n telemetry.addData(\"Lift Helper Enabled\", liftHelper);\n\n\n\n /*\n * Grabbers\n */\n if (gamepad2.left_trigger > 0) {\n //Closes the left arm, then displays the position in telemetry\n grabber.leftArmClose();\n double a = grabber.leftPosition();\n //Adds telemetry to display positions of grabbers, mostly for testing, but can be useful later on\n telemetry.addData(\"Left\", a);\n }\n\n if (gamepad2.left_bumper) {\n //Opens the left arm, then displays the position in telemetry\n grabber.leftArmOpen();\n double b = grabber.leftPosition();\n //We made the variables different as to avoid any and all possible errors\n telemetry.addData(\"Left\", b);\n }\n\n if (gamepad2.right_trigger > 0) {\n //Opens the right arm, then displays the position in telemetry\n grabber.rightArmClose();\n double c = grabber.rightPosition();\n telemetry.addData(\"Right\", c);\n }\n\n if (gamepad2.right_bumper) {\n //Closes the right arm, then displays the position in telemetry\n grabber.rightArmOpen();\n double d = grabber.rightPosition();\n telemetry.addData(\"Right\", d);\n }\n\n if (gamepad2.dpad_left){\n //Closes the left arm to a shorter distance\n grabber.leftArmShort();\n }\n\n if(gamepad2.dpad_right){\n //Closes the right arm to a shorter distance\n grabber.rightArmShort();\n\n }\n\n //Update all of our telemetries at once so we can see all of it at the same time\n telemetry.update();\n }\n }",
"public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }",
"public void initWithPelletReasoner()\r\n\t{\r\n\t\tcredits();\r\n\t\tONT_MODEL = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);\t\r\n\t}",
"public void enable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Brake);\n }",
"void useGodPower(boolean use);",
"public void activateShield() {\n shield.activate();\n }",
"@Override\r\n\tpublic RepairKit createRepairKit(double repairAmount, int weight)\r\n\t{\r\n\t\treturn new RepairKit(repairAmount, weight);\r\n\t}",
"private void installLocalOrRemote() {\n CommandPacket startCommandPacket = null;\n //直到成功为止,控制台可能重启、网络问题等原因\n //TODO\n int time = 0;\n while ((startCommandPacket = getStartCommandPacket()) == null){\n try {\n time ++;\n if(time == 20){\n String defaultRegister = \"zookeeper\";\n String register = agentConfig.getProperty(\"register.name\", defaultRegister);\n if(defaultRegister.equals(register)){\n logger.error(\"经过10s尝试启动simulator失败, 请确认控制台是否正常\");\n }\n break;\n }\n logger.error(\"启动simulator获取远程失败,休眠500ms重试,请确认控制台是否正常\");\n Thread.sleep(500 );\n } catch (InterruptedException ignore) {\n }\n }\n\n if(startCommandPacket == null){\n startCommandPacket = new CommandPacket();\n // 启动\n startCommandPacket.setId(HeartCommandConstants.startCommandId);\n Map<String, Object> extras = new HashMap<String, Object>();\n extras.put(HeartCommandConstants.PATH_TYPE_KEY, HeartCommandConstants.PATH_TYPE_LOCAL_VALUE);\n // 使用本地探针包\n startCommandPacket.setExtras(extras);\n }\n install(startCommandPacket);\n }",
"public interface ArmConnector {\n\tpublic enum ArmName {\n\t\t/**\n\t\t * running in simulation\n\t\t */\n\t\tSIMULATION,\n\t\t/**\n\t\t * using the katana 300\n\t\t */\n\t\tKATANA300,\n\t\t/**\n\t\t * using the katana 450\n\t\t */\n\t\tKATANA450\n\t}\n\n\t/**\n\t * reaches a position with the arm\n\t * \n\t * @param position\n\t * position to reach\n\t * @param rotation\n\t * rotation to reach\n\t * @throws ManipulatorException\n\t */\n\tpublic void reach(Vector3D position, Matrix rotation)\n\t\t\tthrows ManipulatorException;\n\n\t/**\n\t * reaches a position with the arm\n\t * \n\t * @param pose\n\t * Position to reach\n\t * @throws ManipulatorException\n\t */\n\tpublic void reach(Pose pose) throws ManipulatorException;\n\n\t/**\n\t * sends the arm to its home position\n\t * \n\t * @throws ManipulatorException\n\t */\n\tpublic void goHome() throws ManipulatorException;\n\n\t/**\n\t * stops the arm\n\t * \n\t * @throws ManipulatorException\n\t */\n\tpublic void stopArm() throws ManipulatorException;\n\n\t/**\n\t * returns if the goal position is reached or not\n\t * \n\t * @return <code>true</code> if the goal position is reached,\n\t * <code>false</code> if the goal position is not reached\n\t */\n\tpublic boolean isReached();\n\n\t/**\n\t * sets the reaching value of the arm\n\t * \n\t * @param reached\n\t * <code>true</code> if the goal is reached, <code>false</code>\n\t * if the goal is not reached\n\t */\n\tpublic void setReached(boolean reached);\n\n\t/**\n\t * opens the gripper\n\t * \n\t * @throws ManipulatorException\n\t */\n\tpublic void openGripper();\n\n\t/**\n\t * closes the gripper with a given force (small values light, high value\n\t * strong)\n\t * \n\t * @param force\n\t * force value (small values light, high value strong)\n\t * @throws ManipulatorException\n\t */\n\tpublic void closeGripper(int force);\n\n\t/**\n\t * freezes the gripper\n\t * \n\t * @throws ManipulatorException\n\t */\n\tpublic void freezeGripper();\n\n\t/**\n\t * receives the sensor data of the gripper\n\t * \n\t * @return received data\n\t */\n\tpublic HashMap<SensorPosition, Integer> receiveGripperSensorData();\n\n\t/**\n\t * gets the current position of the end-effector\n\t * \n\t * @return position value\n\t * @throws ManipulatorException\n\t */\n\tpublic Vector3D getCurrentPosition() throws ManipulatorException;\n\n\t/**\n\t * gets the current rotation of the end-effector\n\t * \n\t * @return rotation value\n\t * @throws ManipulatorException\n\t */\n\tpublic Matrix getCurrentRotation() throws ManipulatorException;\n\n\tpublic ArmError getPosError(Vector3D targetPosition, Matrix targetRotation)\n\t\t\tthrows ManipulatorException;\n\n\tpublic boolean isGraspingObject();\n\n\tpublic boolean isHome();\n\n\tpublic Pose simulateArmMovement(Pose target) throws ManipulatorException;\n\n\tpublic KatanaGripperEncoderData getEncoderData() throws ManipulatorException;\n}",
"public ResetClawArm() {\n\n\t\tif(Robot.kClawArm.isClawRetracted() == true) {\n\t\t\taddSequential(new DeployClawArm());\n\t\t}\n\t\telse {\n\t\t\taddSequential(new RetractClawArm());\n\t\t}\n\t\t\n\t}",
"public void enableKillSwitch(){\n isClimbing = false;\n isClimbingArmDown = false;\n Robot.isKillSwitchEnabled = true;\n }",
"@Override\n public void robotInit() {\n }",
"@Override\n public void robotInit() {\n }",
"@Override\n public void robotInit() {\n }",
"@Override\n protected void interrupted() {\n Robot.myLifter.setLeftSpeed(0);\n Robot.myLifter.setRightSpeed(0);\n }",
"public void robotInit() {\n\n }",
"public void robotInit() {\n\n }",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initializing\"); //display on the drivers phone that its working\n\n FLM = hardwareMap.get(DcMotor.class, \"FLM\"); //Go into the config and get the device named \"FLM\" and assign it to FLM\n FRM = hardwareMap.get(DcMotor.class, \"FRM\"); //device name doesn't have to be the same as the variable name\n BLM = hardwareMap.get(DcMotor.class, \"BLM\"); //DcMotor.class because that is what the object is\n BRM = hardwareMap.get(DcMotor.class, \"BRM\");\n\n BigSuck = hardwareMap.get(DcMotor.class, \"BigSUCK\");\n SmallSuck = hardwareMap.get(DcMotor.class, \"SmallSUCK\");\n SmallSuck.setDirection(DcMotor.Direction.REVERSE);\n \n UpLift = hardwareMap.get(DcMotor.class, \"LIFT\");\n UpLift.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n UpLift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n //Make it so we don't have to add flip the sign of the power we are setting to half the motors\n //FRM.setDirection(DcMotor.Direction.REVERSE); //Run the right side of the robot backwards\n FLM.setDirection(DcMotor.Direction.REVERSE);\n BRM.setDirection(DcMotor.Direction.REVERSE); //the right motors are facing differently than the left handed ones\n\n FLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n FRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n DragArm = hardwareMap.servo.get(\"drag_arm\");\n DragArm.setDirection(Servo.Direction.REVERSE);\n DragArm.setPosition(DragArmRestPosition);\n\n LiftGrab = hardwareMap.servo.get(\"GRAB\");\n LiftGrab.setPosition(LiftGrabRestPosition);\n\n LiftSwivel = hardwareMap.servo.get(\"SWIVEL\");\n LiftSwivel.setPosition(LiftSwivelRestPosition);\n\n Push = hardwareMap.get(Servo.class, \"PUSH\");\n Push.setDirection(Servo.Direction.FORWARD);\n Push.setPosition(PushRestPosition);\n\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n }",
"public abstract void interagir (Robot robot);",
"public ConfigureRobot()\n {\n Scheduler.getInstance().removeAll(); //remove all running commands\n addSequential(new BrakeOpen(),2);\n addSequential(new WaitCommand(1));\n addSequential(new LiftToBottom(),3);\n }",
"@Override\n public void runOpMode() {\n hw = new RobotHardware(robotName, hardwareMap);\n rd = new RobotDrive(hw);\n rs=new RobotSense(hw, telemetry);\n /*rd.moveDist(RobotDrive.Direction.FORWARD, .5, .3);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, .3);\n rd.moveDist(RobotDrive.Direction.FORWARD, .5, 1);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, 1);*/\n telemetry.addData(\"Ready! \", \"Go Flamangos!\"); \n telemetry.update();\n\n //Starting the servos in the correct starting position\n /*hw.armRight.setPosition(1-.3);\n hw.armLeft.setPosition(.3);\n hw.level.setPosition(.3+.05);*/\n hw.f_servoLeft.setPosition(1);\n hw.f_servoRight.setPosition(0.5);\n \n rd.moveArm(hw.startPos());\n waitForStart();\n while (opModeIsActive()) {\n \n /*Starting close to the bridge on the building side\n Move under the bridge and push into the wall*/\n rd.moveDist(RobotDrive.Direction.LEFT,2,.5);\n rd.moveDist(RobotDrive.Direction.FORWARD, 10, .5);\n break;\n }\n }",
"protected void execute() {\n//\t\tRobot.chassis.drive(0, .5, 0);\n//\t\tRobotMap.chassisfrontLeft.set(50);\n\t\tLiquidCrystal lcd = RobotMap.lcd;\n\n\t\t\n\t\t\n\n\t\t\n\t\tif(talonNum == 2){\n\t\t\tRobotMap.chassisfrontLeft.set(150);\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontLeft.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontLeft.getEncPosition());\n\t\t\t\n\t\t\t\n\n\t\t}else if(talonNum == 3){\n\t\t\tRobotMap.chassisfrontRight.set(150);\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontRight.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisfrontRight.getEncPosition());\n\t\t\t\n\n\t\t}else if(talonNum == 4){\n\t\t\tRobotMap.chassisrearLeft.set(150);\t\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearLeft.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearLeft.getEncPosition());\n\n\t\t}else if(talonNum == 5){\n\t\t\tRobotMap.chassisrearRight.set(150);\t\n\t\t\tlcd.setCursor(0, 1);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearRight.getEncVelocity());\n\t\t\tlcd.setCursor(0, 2);\n\t\t\tlcd.print(\"\" + RobotMap.chassisrearRight.getEncPosition());\n\n\t\t}else if(talonNum == 11){\n\t\t\tRobotMap.climberclimbMotor.set(.5);\t\n\n\t\t}else if(talonNum == 12){\n\t\t\tRobotMap.floorfloorLift.set(.75);\t\n\n\t\t}else if(talonNum == 13){\n\t\t\tRobotMap.acquisitionacquisitionMotor.set(.25);\t\n\n\t\t}\n\t\t\n\t\t\n\t}",
"protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }",
"Lift(final Robot ROBOT)\n {\n _robot = ROBOT;\n }",
"private void registToWX() {\n }",
"@Override\n protected void interrupted() {\n Robot.drive.setCoastMode();\n Robot.tapeAlignSys.disable();\n Robot.lidarAlignSys.disable();\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"protected void initialize() {\n \tif ((deploy && Robot.intake.getHopperTracker() == Status.deployed) || \n \t\t\t(!deploy && Robot.intake.getHopperTracker() == Status.stowed)) {\n \t\t// Hopper is already in desired position, so do nothing\n \t\twaitForMovement = false;\n \t} else if (deploy && (Robot.intake.getIntakeTracker() != Status.deployed)) {\n \t\t// Can't deploy hopper if intake is not deployed (ie., if stowed or unknown or moving)\n \t\twaitForMovement = false;\n \t} else {\n \t\t// OK, we can move the hopper\n \t\twaitForMovement = true;\n \t\tRobot.intake.setHopperTracker(Status.unknown);\t// put in unknown state while hopper is moving\n \tif (deploy) Robot.intake.deployHopper();\n \telse { Robot.intake.stowHopper(); }\n \t}\n }",
"public abstract void interagir(Robot robot);",
"@Test\n\t public void testOVerLoadWt12Kg(){\n\t\t robot = new Robot(12, 0);\n\t\t \n\t }",
"@Override\n public void start() {\n runtime.reset();\n arm.setPower(0);\n }",
"private void placeKitOnInspection(MyKit mk)\n\t{\n\t\tmyStand.setSlotThreeTaken();\n\t\tif(guiEnable){\n\t\t\tthis.kitRobotGUI.DoMoveKitToCameraInspection(mk.kit.guikit, mk.kit.position);\n\t\t\tprint(\"Moving Kit to Inspection Slot\");\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Camera Inspection. Finished moving. Telling Agent.\");\n\n\n\t\tmyStand.setSlotAvilable(mk.slot);\n\t\tmk.kit.position = KitPosition.POSITION3;\n\t\tprint(\"Kit Slot number : \"+mk.slot+\" is Available but slot 3 is taken\");\n\t\tmk.status = KitStatus.On_CameraInspection;\n\t\tkitCamera.msgInspectKit(mk.kit);\n\t\tstateChanged();\n\t}",
"public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }",
"public void markReused() {\n\t\tupdate(Phase.vm_creation, State.SKIPPED);\n\t\tupdate(Phase.installation, State.SKIPPED);\n\t\tupdate(Phase.configuration, State.SKIPPED);\n\t\tsetState(State.SKIPPED);\n\t}",
"@Override\n protected void initialize() {\n if (Robot.useDrive) {\n joy = Robot.oi.getJoystick();\n }\n Robot.drive.setBrakeMode();\n\n }",
"public void initialize() {\n leftfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n leftrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n\n leftfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n leftrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n \n\n // More Motor Tunes (to occur during each initialization period):\n leftfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n leftrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n\n turnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n turnController.setTolerance(Constants.DriveBase.Controllers.turntollerance);\n\n driveController.setSetpoint(Constants.DriveBase.Controllers.zero);\n driveController.setTolerance(Constants.DriveBase.Controllers.drivetollerance);\n\n ballTurnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n ballTurnController.setTolerance(Constants.DriveBase.Controllers.balltollerance);\n\n ballDriveController.setSetpoint(Constants.DriveBase.Controllers.balldrive);\n ballDriveController.setTolerance(Constants.DriveBase.Controllers.balldrivetollerance);\n \n reset();\n }",
"@Override\n public void execute() {\n intake.intakeMotor.set(-.8);\n }",
"@Override\n\tpublic void robotInit() {\n\t\tSmartDashboard.putData(new TestLIDARCommand());\n\n\t\tdriveSubsystem = new DriveSubsystem();\n\t\tshooterSubsystem = new ShooterSubsystem();\n\t\tfeederSubsystem = new FeederSubsystem();\n\t\tintakeSubsystem = new IntakeSubsystem();\n\t\tgearSubsystem = new GearSubsystem();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tcameraSubsystem = new CameraSubsystem();\n\n\t\tnavigator = new Navigator();\n\t\toi = new OI();\n\n\t\tm_chooser = new SendableChooser<>();\n\t\tm_chooser.addDefault(\"Do Nothing\", new PistonReleaseCommand());\n\t\t//m_chooser.addObject(\"Boiler Auto (side hopper)\", new SelectBoilerAutoCommand());\n\t\tm_chooser.addObject(\"Boiler Auto (front hopper)\", new SelectBoilerAutoFrontCommand());\n\t\tm_chooser.addObject(\"Test drive straight\", new MeasureDistanceCommand(1500, 100000));\n\t\tm_chooser.addObject(\"Test max speed\", new TimedDriveCommand(5.0, 1.00));\n\t\tm_chooser.addObject(\"Gear Auto (boiler)\", new SelectGearBoilerCommand());\n\t\tm_chooser.addObject(\"Gear Auto (feeder)\", new SelectGearFeederCommand());\n\t\tm_chooser.addObject(\"Gear Auto (middle)\", new SelectGearMiddleAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", m_chooser);\n\n\t\tRobot.navigator.startMeasuringDistance();\n\t}",
"protected void reInitialize() {\r\n currentPos.reInitialize();\r\n motorState.reInitialize();\r\n armState = KSGripperStates.ARM_UP;\r\n gripperState = KSGripperStates.GRIP_OPEN;\r\n objPresent = false;\r\n objHeld = false;\r\n resistivity = 0;\r\n }",
"@Override\n\tpublic void makeShoeComfortable() {\n\t\t\n\t}",
"boolean isForceRM();",
"public void run() {\r\n if (stateRegistry.getDriveDirection() == REVERSE) {\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, true);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);\r\n robotDrive.tankDrive(rightDriveJoystick, leftDriveJoystick);\r\n }\r\n else {\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, false);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);\r\n robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, false);\r\n robotDrive.tankDrive(leftDriveJoystick, rightDriveJoystick);\r\n }\r\n }",
"public boolean isRepairMode() {\n return false;\n }",
"@Override\n\tprotected void initialize() {\n\t\tRobot.drive.setToMode(CANTalon.TalonControlMode.PercentVbus);\n\t}",
"public static void main(String[] args){\n Robot robot = new DifferentialWheels();\n\n // Get the time step of the current world.\n int timeStep = (int) Math.round(robot.getBasicTimeStep());\n\n // Get references to, and enable, all required devices on the robot.\n Lidar lidar = robot.getLidar(\"lms291\");\n lidar.enable(timeStep);\n lidar.enablePointCloud();\n\n GPS gps = robot.getGPS(\"gps\");\n gps.enable(timeStep);\n\n Emitter emitter = robot.getEmitter(\"emitter\");\n emitter.setChannel(0);\n\n Compass compass = robot.getCompass(\"compass\");\n compass.enable(timeStep);\n\n Motor frontLeft = robot.getMotor(\"front_left_wheel\");\n frontLeft.setPosition(Double.POSITIVE_INFINITY);\n Motor frontRight = robot.getMotor(\"front_right_wheel\");\n frontRight.setPosition(Double.POSITIVE_INFINITY);\n Motor backLeft = robot.getMotor(\"back_left_wheel\");\n backLeft.setPosition(Double.POSITIVE_INFINITY);\n Motor backRight = robot.getMotor(\"back_right_wheel\");\n backRight.setPosition(Double.POSITIVE_INFINITY);\n\n TestTurnPB turnPBController = new TestTurnPB(gps, compass, emitter, frontLeft, frontRight, backLeft, backRight);\n System.out.println(\"current param : \" + turnPBController.toString());\n\n //Initialise Start and Goal Coordinates\n robot.step(timeStep);\n turnPBController.updateObstacleReadings(lidar.getPointCloud());\n turnPBController.isRunning = true;\n turnPBController.initMetrics();\n turnPBController.initPositions();\n //potBugController.initAlgorithm();\n turnPBController.runInit();\n\n //Iteration Count\n int itCount = 0;\n\n while (robot.step(timeStep*100) != -1) {\n //Check max iteration\n //while (itCount<DEFAULT_MAX_ITERATION_COUNT){\n //Update Turn Angles\n turnPBController.updateAngles();\n\n //Update Sensor Information\n turnPBController.updateObstacleReadings(lidar.getPointCloud());\n\n //Check if goal is reached and terminate as appropriate\n if (turnPBController.isGoalReached()){\n turnPBController.isRunning = false;\n turnPBController.setRobotSpeed(0,0);\n turnPBController.terminatePotBug();\n System.out.println(\"Goal Reached Successfully!\");\n }\n\n if(!turnPBController.isGoalReached() && turnPBController.isRunning){\n //Check for goal direction on forwards semi-circle\n if (!turnPBController.isObstruction()){\n\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_GOAL);\n //Move 'freely' to the next sample point, towards goal\n turnPBController.updateMetrics();\n\n } else {\n\n if (turnPBController.isClearToLeave()){\n\n if (turnPBController.isProgressAttained() &&\n turnPBController.isClearToLeave()){\n\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_GOAL);\n turnPBController.updateMetrics();\n\n }\n } else {\n\n if (turnPBController.hitPoint == null){\n\n turnPBController.setHitPoint();\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_CONTOUR);\n turnPBController.updateMetrics();\n\n } else {\n\n // engaged mode\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_ALONG_CONTOUR);\n turnPBController.updateMetrics();\n\n }\n }\n }\n }\n //}\n }\n }",
"public void classifyAndRepairUnsatisfiability() throws Exception{\n\t\n\t\t\n\t\tinit = Calendar.getInstance().getTimeInMillis();\n\t\t\n\n\t\t//Reason\n\t\tLogOutput.printAlways(\"\\nCLASSIFYING\");\n\t\t\n\t\t//Transform mappings 2 owl\n\t\tgetOWLAxioms4Mappings();\n\t\t\n\t\tsetUpReasoner(true);\t\t\n\t\tsetUpBlackBosExplanationManager();\n\t\t\n\t\t//Will be reused\n\t\tstrctReasoner = new StructuralReasonerExtended(reasoner_access.getOntology());\n\t\t\n\t\t//ONLY Statistics\n\t\t//LogOutput.printAlways(\"\\nSTATISTICS EXPLANATIONS (UNSAT: \" + reasoner_access.getUnsatisfiableClasses().size() + \").\");\n\t\t//repairUnsatisfiability(50);\n\t\t\n\t\t\n\t\tint it=0;\n\t\t\n\t\tLogOutput.printAlways(\"\\nREPAIR GREEDY ALGO:\");\n\t\t\n\t\twhile (reasoner_access.hasUnsatisfiableClasses()){\n\t\t\t\n\t\t\tLogOutput.printAlways(\"\\tUNSAT CLASSES iter \" + it + \": \" + reasoner_access.getUnsatisfiableClasses().size());\n\t\t\t\n\t\t\t//Split unsat and solve!!\n\t\t\tif (!repairUnsatisfiability())\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tapplyBestRepairPlan();\n\t\t\t\n\t\t\t//Clear previous structures\n\t\t\tclearStructures();\n\t\t\t\n\t\t\t//Trasnform mappings 2 owl\n\t\t\tgetOWLAxioms4Mappings();\n\t\t\t\n\t\t\t//Reason\n\t\t\t//setUpReasoner(false);\t\t\t\n\t\t\t//Any unsat\n\t\t\t//if (checkIfAnyUnsat()){ //classify and reinit blackbox\n\t\t\t//\treasoner_access.classifyOntology();\n\t\t\t//\tsetUpBlackBosExplanationManager();\n\t\t\t//}\n\t\t\t//else{ //We are done\n\t\t\t//\treasoner_access.getUnsatisfiableClasses().clear();\n\t\t\t//}\n\t\t\t\n\t\t\t//Reason\n\t\t\tLogOutput.printAlways(\"\\tCLASSIFYING\");\n\t\t\tsetUpReasoner(true);\n\t\t\tsetUpBlackBosExplanationManager();\n\t\t\t\n\t\t\tit++;\n\t\t\t\n\t\t}\n\t\t\n\t\tfin = Calendar.getInstance().getTimeInMillis();\n\t\t\n\t\tdouble time = (float)((double)fin-(double)init)/1000.0;\n\t\tLogOutput.printAlways(\"\\tTIME GREEDY Repair Algorithm (s): \" + time);\n\t\tLogOutput.printAlways(\"\\tUNSAT CLASSES after cleaning: \" + reasoner_access.getUnsatisfiableClasses().size());\n\t\t\n\t\t//We do not clean last reasoner\n\t\t//It is necessary for index\n\t\t\n\t}",
"private void configureRobot() {\n // Populating robot configuration\n m_robotConfiguration.setMasterUri(ROS_MASTER_URI);\n m_robotConfiguration.setHostname(JAVA_ROS_HOSTNAME);\n m_robotConfiguration.setNodeName(NODE_NAME);\n }",
"public void fixShield(CrewMember member) {\n\t\t\n\t\tmember.minusAction();\n\t\t\n\t\tRandom rand = new Random();\n\t\tint randomElement = rand.nextInt(100);\n\t\t\n\t\tif(randomElement <= member.getRepair()) {\n\t\t\t// Increases progress bar\n\t\t\tshieldLevel += 1;\n\t\t}\n\t\t\n\t\tif (! (member instanceof Engineer)) {\n\t\t\tmember.minusTiredness(20);\n\t\t\t} \n\t}",
"@Override\n public void robotInit() {\n SmartDashboard.putBoolean(\"CLIMB\", false);\n SmartDashboard.putNumber(\"servo\", 0);\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n //coast.\n if (RobotMap.DRIVE_TRAIN_DRAGON_FLY_IS_AVAILABLE)\n getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(false, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n\n getRobotContainer().configureButtonBindings();\n getRobotContainer().getTecbotSensors().initializeAllSensors();\n getRobotContainer().getTecbotSensors().getTecbotGyro().reset();\n\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_LEFT_CHASSIS_PORTS);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_RIGHT_CHASSIS_PORTS);\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n\n m_chooser.addOption(\"Move 3 m\", new SpeedReductionStraight(3, .75, 0));\n m_chooser.addOption(\"Rotate 90 degrees\", new SpeedReductionTurn(90, .5));\n m_chooser.setDefaultOption(\"El chido\", new DR01D3K4());\n m_chooser.addOption(\"Collect, go back and shoot\", new CollectPowerCellsGoBackShoot());\n m_chooser.addOption(\"Transport\", new SequentialCommandGroup(new FrontIntakeSetRaw(.75),\n new TransportationSystemSetRaw(.5)));\n m_chooser.addOption(\"Shoot 3PCs n' Move\", new SHOOT_3_PCs_N_MOVE());\n SmartDashboard.putData(\"Auto Mode\", m_chooser);\n\n //camera.setExposureManual(79);\n\n\n }",
"@Override\n protected void initialize() {\n ramper.reset();\n Robot.toteLifterSubsystem.setGateState(GateState.OPEN);\n }",
"@Override\n protected void initialize() {\n switch (Intake.intakeState) {\n case 2:\n case 1:\n case 0:\n default:\n //Robot.intake.setHarpoonExtend(false);\n break;\n }\n\n Intake.overridePassive = true;\n }",
"private void applyBestRepairPlan(){\n\t\t\n\t\tSet<OWLAxiom> best_repair=null;\n\t\t\t\t\n\t\tdouble min_conf = 10000;\n\t\tdouble conf;\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(false);//used in confidence\n\t\t\n\t\tfor (Set<OWLAxiom> repair : repair_plans){\n\t\t\t\n\t\t\tconf = getConfidence4Plan(repair);\n\t\t\t\n\t\t\tif (min_conf > conf){\n\t\t\t\tmin_conf = conf;\n\t\t\t\tbest_repair = repair;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmappingVisitor.setDeleteAxiom(true);\n\t\t\n\t\tfor (OWLAxiom ax : best_repair){\t\t\t\n\t\t\tax.accept(mappingVisitor);\n\t\t\t//It also deletes axiom from structures\n\t\t\t//TODO add to conflicts\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public void agregarRobot(Robot robot);"
] | [
"0.66592133",
"0.5768771",
"0.57654727",
"0.57531136",
"0.5587795",
"0.5483957",
"0.54819316",
"0.54807174",
"0.53475976",
"0.5251415",
"0.5197066",
"0.51696026",
"0.5147688",
"0.5144684",
"0.51359767",
"0.51289296",
"0.51192814",
"0.5113134",
"0.51036525",
"0.510324",
"0.50979805",
"0.50772196",
"0.50600994",
"0.5043709",
"0.50351596",
"0.50115687",
"0.5010271",
"0.50087523",
"0.50064",
"0.50037456",
"0.49999118",
"0.49986663",
"0.49890283",
"0.49833316",
"0.49802458",
"0.4980069",
"0.49754858",
"0.49742702",
"0.4967122",
"0.49660134",
"0.4965796",
"0.49655616",
"0.49609193",
"0.49570176",
"0.4941857",
"0.4939495",
"0.49353567",
"0.49318284",
"0.4922643",
"0.49213007",
"0.49212655",
"0.49185485",
"0.49115244",
"0.49112383",
"0.49072003",
"0.4906546",
"0.48930186",
"0.48904562",
"0.48883492",
"0.48883492",
"0.48883492",
"0.48866498",
"0.4885782",
"0.4885782",
"0.48855162",
"0.48797885",
"0.4878914",
"0.48734862",
"0.48728508",
"0.48717827",
"0.48673484",
"0.48665774",
"0.48654336",
"0.48588553",
"0.48523325",
"0.48500067",
"0.4847598",
"0.4847537",
"0.4844161",
"0.48414806",
"0.48395053",
"0.4838219",
"0.48369744",
"0.48319918",
"0.48242155",
"0.48205844",
"0.4819428",
"0.48172238",
"0.4817032",
"0.4816613",
"0.48144418",
"0.4814059",
"0.481364",
"0.48073885",
"0.48042053",
"0.4803268",
"0.47975886",
"0.4797166",
"0.47903135",
"0.47898623"
] | 0.76275456 | 0 |
Make robot drop repairKit (if possible). | @Override
public void dropRepairKit(Robot robot, RepairKit repairKit)
{
try
{
if(robot.canDrop(repairKit))
{
robot.drop(repairKit);
}
else
{
System.out.println("This repair kit could not be dropped by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this repair kit is terminated; the robot cannot drop the repair kit.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void useRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.use(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot use the repair kit.\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void pickUpRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot pick up the repair kit.\");\r\n\t\t}\r\n\t}",
"protected abstract void fixChassis();",
"public abstract boolean dropMaterial(ShortPoint2D pos, EMaterialType materialType, boolean offer, boolean forced);",
"private void canRepair(boolean b) {\n\t\t\n\t}",
"@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }",
"public void liftArm(){armLifty.set(-drivePad.getThrottle());}",
"public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public void runOpMode() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n intake = hardwareMap.get (DcMotor.class, \"intake\");\n dropServo = hardwareMap.get(Servo.class, \"drop_Servo\");\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n dropServo.setPosition(1.0);\n waitForStart();\n dropServo.setPosition(0.6);\n sleep(500);\n VuforiaOrientator();\n encoderSequence(\"dumbDrive\");\n\n\n }",
"private void unintelligentDecideMove() {\n\t\twander();\r\n\t}",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public void repairOnWrench(IRobot robot) {\n TiledMapTileLayer wrenchLayer = (TiledMapTileLayer) tiledMap.getLayers().get(\"Wrench\");\n if (wrenchLayer.getCell((int) robot.getPos().x, (int) robot.getPos().y) != null) {\n robot.heal();\n }\n }",
"public static void fixCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select(new Filter<GameObject>() {\n @Override\n public boolean accept(GameObject gameObject) {\n return gameObject.name().toLowerCase().contains(\"broken\");\n }\n }).nearest().poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Repair\"));\n sleep(3000);\n }\n }",
"public void manageDropping(Rectangle r){\n\t\t\tif (!dropping){ //does the random number part\n\t\t\t\tb.reset(x+ 35, y+50);\n\t\t\t\tint d = rand.nextInt(50);\n\t\t\t\t//System.out.println(randamount);\n\t\t\t\tif ((d == 1) && exists) {\n\t\t\t\t\tdropping =true; \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { //resets the bomb after it has been dropped\n\t\t\t\tif(b.y < 1000) b.dropBomb(dropamount);\n\t\t\t\tbombtimer = 0;\n\t\t\t\t//dropamount += .1;\n\t\t\t\t//dropamount = 5;\n\t\t\t\t\n\t\t\t\tif (b.y >= 700 || b.collided(r)) {\n\t\t\t\t\tif (b.collided(r)) tstartredtimer = true;\n\t\t\t\t\tif (exists) dropping = false;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }",
"@Test\n\tpublic void riposteShieldTest() {\n\t\tDisplayWithShield();\n\t\t\n\t\tint cardPos = 0;\n\t\tint targetPlayer = 1;\n\t\tint targetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t/*\n\t\t * test to make sure the target has a maiden as the last played card\n\t\t*/\n\t\tassertTrue(game.getDisplay(1).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t */\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t\t\n\t\t\n\t\t//assertFalse(game.getDisplay(0).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t//test the size of discard deck before playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\tassertEquals(game.getDisplay(targetPlayer).deckSize(), 7);\n\t\t\n\t\t//play Riposte\n\t\tRulesEngine.riposte(game, cardPos, targetPlayer);\n\t\t\n\t\t//test the size of discard deck after playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\t//Update this variable after a card has been removed from the display\n\t\ttargetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t\n\t\t/*\n\t\t * test to make sure the target's last played card is still a maiden\n\t\t*/\n\t\tassertTrue(game.getDisplay(targetPlayer).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t*/\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t}",
"@Override\n public void loop() {\n// double left;\n robot.colorDrop.setPosition(0.45);\n\n double Righty, Lefty, sideRight, sideLeft;\n double phaseUp;\n double phaseDown;\n boolean straffeL,straffeR,straffeL2,straffeR2;\n double turnR,turnL;\n double Righty2, Lefty2, sideRight2, sideLeft2;\n double phaseUp2;\n double phaseDown2;\n\n // Run wheels in tank mode (note: The joystick goes negative when pushed forwards, so negate it)\n Lefty = gamepad1.right_stick_y;\n Righty = gamepad1.left_stick_y;\n sideRight= gamepad1.left_stick_x;\n sideLeft=gamepad1.right_stick_x;\n phaseUp = gamepad2.right_trigger;\n phaseDown = gamepad2.left_trigger;\n straffeL = gamepad1.right_bumper;\n straffeR = gamepad1.left_bumper;\n straffeL2 = gamepad2.right_bumper;\n straffeR2 = gamepad2.left_bumper;\n //turnL = gamepad1.left_trigger;\n //turnR= gamepad1.left_trigger;\n\n Lefty2 = gamepad1.right_stick_y;\n Righty2 = gamepad1.left_stick_y;\n sideRight2= gamepad1.left_stick_x;\n sideLeft2=gamepad1.right_stick_x;\n //phaseUp2 = gamepad1.right_trigger;\n //phaseDown2 = gamepad1.left_trigger;\n\n\n\n\n if(sideRight!=0&&sideLeft<0) {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft);\n robot.leftRearDrive.setPower(sideLeft * -1);\n robot.rightRearDrive.setPower(sideLeft);\n }\n else if(sideRight!=0&&sideLeft>0)\n {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft*-1);\n robot.leftRearDrive.setPower(sideLeft);\n robot.rightRearDrive.setPower(sideLeft);\n }\n else if(sideLeft!=0)\n {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft*-1);\n robot.leftRearDrive.setPower(sideLeft*-1);\n robot.rightRearDrive.setPower(sideLeft);\n\n }\n else if(Righty<0&&sideRight<0)\n {\n robot.leftFrontDrive.setPower(-.5);\n robot.rightFrontDrive.setPower(-.9);\n robot.leftRearDrive.setPower(-.5);\n robot.rightRearDrive.setPower(-.9);\n }\n else if(Righty<0&&sideRight>0) {\n robot.leftFrontDrive.setPower(-.9);\n robot.rightFrontDrive.setPower(-.5);\n robot.leftRearDrive.setPower(-.9);\n robot.rightRearDrive.setPower(-.5);\n }\n else if(Righty==0&&sideRight!=0)\n {\n robot.leftFrontDrive.setPower(sideRight*-.7);\n robot.rightFrontDrive.setPower(sideRight*.7);\n robot.leftRearDrive.setPower(sideRight*-.7);\n robot.rightRearDrive.setPower(sideRight*.7);\n }\n else if(Righty<0&&sideRight==0)\n {\n robot.leftFrontDrive.setPower(Righty);\n robot.rightFrontDrive.setPower(Righty);\n robot.leftRearDrive.setPower(Righty);\n robot.rightRearDrive.setPower(Righty);\n\n }\n else if(Righty>0)\n {\n robot.leftFrontDrive.setPower(Righty);\n robot.rightFrontDrive.setPower(Righty);\n robot.leftRearDrive.setPower(Righty);\n robot.rightRearDrive.setPower(Righty);\n\n }\n else if(Lefty!=0&&sideLeft==0)\n {\n robot.leftFrontDrive.setPower(Lefty);\n robot.rightFrontDrive.setPower(Lefty);\n robot.leftRearDrive.setPower(Lefty);\n robot.rightRearDrive.setPower(Lefty);\n }\n else if(straffeL==true||straffeL2==true)\n {\n robot.leftFrontDrive.setPower(.2);\n robot.rightFrontDrive.setPower(-.2);\n robot.leftRearDrive.setPower(-.2);\n robot.rightRearDrive.setPower(.2);\n }\n\n else if(straffeR==true||straffeR2==true)\n {\n robot.leftFrontDrive.setPower(-.2);\n robot.rightFrontDrive.setPower(.2);\n robot.leftRearDrive.setPower(.2);\n robot.rightRearDrive.setPower(-.2);\n }\n else\n {\n robot.leftFrontDrive.setPower(0);\n robot.rightFrontDrive.setPower(0);\n robot.leftRearDrive.setPower(0);\n robot.rightRearDrive.setPower(0);\n\n }\n\n\n ///player 1\n if ((phaseDown >0)) {\n robot.leftStageOne.setPower(1);\n robot.rightStageOne.setPower(1);\n }\n\n else if ((phaseUp >0)) {\n robot.leftStageOne.setPower(-1);\n robot.rightStageOne.setPower(-1);\n }\n\n else {\n robot.rightStageOne.setPower(0);\n robot.leftStageOne.setPower(0);\n }\n\n/*\n if (gamepad1.y){\n robot.leftStageTwo.setPosition(1);\n robot.rightStageTwo.setPosition(0.1);\n }\n if(gamepad1.x)\n {\n robot.leftStageTwo.setPosition(.4);\n robot.rightStageTwo.setPosition(.7);\n }\n if (gamepad1.a){\n robot.leftStageTwo.setPosition(0.12);\n robot.rightStageTwo.setPosition(.98);\n }\n */\n if(gamepad1.a) {\n robot.align.setPosition(.57);\n }\n if(gamepad1.x)\n {\n robot.align.setPosition(0.95);\n }\n if (gamepad1.b){\n robot.colorDrop.setPosition(.35);\n }\n\n\n\n\n if (gamepad2.a){\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n }\n if(gamepad2.x)\n {\n // robot.leftStageTwo.setPosition(.4);\n // robot.rightStageTwo.setPosition(.7);\n }\n if (gamepad2.y){//lift up\n // robot.leftStageTwo.setPosition(0.12);\n //robot.rightStageTwo.setPosition(.98);\n }\n if (gamepad2.b){\n robot.colorDrop.setPosition(.35);\n }\n\n\n\n\n\n\n /*\n if (gamepad1.right_bumper == true){\n // robot.leftBumper.setPosition(robot.leftBumper.getPosition()+.05);\n sleep(2000);\n }\n else if (gamepad1.left_bumper == true){\n /// robot.leftBumper.setPosition(robot.leftBumper.getPosition()-.05);\n\n }\n else{\n ///robot.leftBumper.setPosition(robot.leftBumper.getPosition());\n }\n */\n /*\n\n */\n // if (gamepad2.dpad_down){\n // robot.relicServo.setPosition(robot.relicServo.getPosition()+.025);\n // }\n //else if(gamepad2.dpad_up){\n // robot.relicServo.setPosition(robot.relicServo.getPosition()-.025);\n // }\n // else{\n // robot.relicServo.setPosition(robot.relicServo.getPosition());\n //}\n\n// if (gamepad2.dpad_left){\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition()+.025);\n // }\n // else if (gamepad2.dpad_right){\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition()-.025);\n // }\n // else {\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition());\n //}\n // if (gamepad2.left_trigger>5){\n // robot.relicMotor.setPower(.5);\n // }\n //else if (gamepad2.left_bumper){\n // robot.relicMotor.setPower(-.5);\n //}\n //else{\n // robot.relicMotor.setPower(0);\n // }\n\n // Send telemetry message to signify robot running;\n // telemetry.addData(\"claw\", \"Offset = %.2f\", clawOffset);\n // telemetry.addData(\"sideright\", \"%.2f\", sideRight);\n // telemetry.addData(\"right\", \"%.2f\", Left);\n // telemetry.addData(\"sideright\", \"%.2f\", sideRight);\n // telemetry.addData(\"left\", \"%.2f\", sideLeft);\n/*\n //distance = robot.sensorDistance.getDistance(DistanceUnit.CM);\n // send the info back to driver station using telemetry function.\n telemetry.addData(\"Distance (cm)\",\n String.format(Locale.US, \"%.02f\", robot.sensorDistance.getDistance(DistanceUnit.CM)));\n telemetry.addData(\"Alpha\", robot.sensorColor.alpha());\n telemetry.addData(\"Red \", robot.sensorColor.red());\n telemetry.addData(\"Green\", robot.sensorColor.green());\n telemetry.addData(\"Blue \", robot.sensorColor.blue());\n */\n telemetry.addData(\"phaseUp \", phaseUp);\n telemetry.addData(\"sideRight \", sideRight);\n // telemetry.addData(\"right bumper: \", robot.rightBumper.getPosition());\n // telemetry.addData(\"left bumper: \", robot.leftBumper.getPosition());\n telemetry.update();\n }",
"@Override\r\n\tpublic void wipeWindShield() {\n\t\t\r\n\t}",
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"public void fixShield(CrewMember member) {\n\t\t\n\t\tmember.minusAction();\n\t\t\n\t\tRandom rand = new Random();\n\t\tint randomElement = rand.nextInt(100);\n\t\t\n\t\tif(randomElement <= member.getRepair()) {\n\t\t\t// Increases progress bar\n\t\t\tshieldLevel += 1;\n\t\t}\n\t\t\n\t\tif (! (member instanceof Engineer)) {\n\t\t\tmember.minusTiredness(20);\n\t\t\t} \n\t}",
"private void halt() {\n robot.leftFront.setPower(0);\n robot.leftBack.setPower(0);\n robot.rightFront.setPower(0);\n robot.rightBack.setPower(0);\n }",
"public void runRoover() throws IOException\n { \n String drivingInstr = rooverSetUp();\n if (drivingInstr == null)\n return;\n \n //check to see if roover's original position has a dirt patch\n if (dirtSet.contains(Integer.toString(currXPos) + Integer.toString(currYPos)))\n {\n dirtSet.remove(Integer.toString(currXPos) + Integer.toString(currYPos));\n numPatchesCleaned++;\n }\n \n //at this point, currline will be the last line in our input, which is driving instructions\n char[] instructions = drivingInstr.toUpperCase().toCharArray();\n for (int i = 0; i < instructions.length; i++)\n {\n switch(instructions[i]) {\n case 'N':\n if (currYPos + 1 < numRows)\n {\n currYPos++;\n }\n break;\n case 'S':\n if (currYPos - 1 >= 0)\n {\n currYPos--;\n }\n break;\n case 'W':\n if (currXPos - 1 >= 0)\n {\n currXPos--;\n }\n break;\n case 'E':\n if (currXPos + 1 < numCols)\n {\n currXPos++;\n }\n break;\n default:\n System.err.println(\"Invalid driving instruction, please enter N, S, W, or E only.\");\n break;\n }\n \n if (dirtSet.contains(Integer.toString(currXPos) + Integer.toString(currYPos)))\n {\n dirtSet.remove(Integer.toString(currXPos) + Integer.toString(currYPos));\n numPatchesCleaned++;\n }\n }\n \n System.out.println(currXPos + \" \" + currYPos);\n System.out.println(numPatchesCleaned);\n }",
"private void performHandShake() {\n try {\n boolean OK = false;\n // String rsp= new String( this.defaultComTool.WriteAndRead((String) command.get(\"restore_defaults\")));\n // while(!OK) { }\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_echo\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_linefeed\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_headers\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"disable_spaces\"));\n this.defaultComTool.WriteAndRead((String) command.get(\"protocol auto set\"));\n Thread.sleep(3000);\n\n this.CheckRequiredCommands_Availability(FIRSTLEVEL_CHECK);\n //Thread.sleep(2000);\n\n this.CheckRequiredCommands_Availability(SECONDLEVEL_CHECK);\n for (int i = 1; i < 6; i++) {\n switch (i) {\n case 1:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: RPM Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 2:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: SPEED Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 3:\n if (av_commands[i] == false) {\n Kernel.interfc.sim.log.append(\"WARNING: COOLANT TEMP Reading is NOT SUPPORTED\\n APP forcestopped!!\\n\");\n synchronized (this) {\n Kernel.forcedstopped = true;\n\n }\n\n }\n break;\n case 4:\n if (av_commands[i] == false) {\n int arbFuel;\n Random rnd = new Random();\n arbFuel = rnd.nextInt(100) + 1;\n Kernel.interfc.sim.log.append(\"WARNING: FUEL LVL Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbFuel + \") set!! \\n\");\n\n }\n break;\n case 5:\n if (av_commands[i] == false) {\n int arbCheck;\n Random rnd = new Random();\n arbCheck = rnd.nextInt(2);\n Kernel.interfc.sim.log.append(\"WARNING: CheckEngine Light Reading is NOT SUPPORTED\\n Arbitrary value (\" + arbCheck + \") set!! \\n\");\n\n }\n break;\n\n }\n }\n {\n Kernel.interfc.sim.log.append(\"HANDSHAKE PERFORMED...Awaiting for SelfTest\\n\");\n\n }\n\n } catch (Exception e) {\n System.out.println(\"PERFORM HANDSHAKE:\" + e.getMessage() + \" \" + e.getLocalizedMessage());\n }\n }",
"@Override\n protected void interrupted() {\n Robot.myLifter.setLeftSpeed(0);\n Robot.myLifter.setRightSpeed(0);\n }",
"public static void stopCase(Robot r)\n {\n while(r.frontIsClear() == false)\n while(r.canPickThing() == false)\n break;\n }",
"@Override\n public void stop() {\n leftFrontDrive.setPower(0.0);\n rightFrontDrive.setPower(0.0);\n leftRearDrive.setPower(0.0);\n rightRearDrive.setPower(0.0);\n\n // Disable Tracking when we are done;\n targetsUltimateGoal.deactivate();\n\n //closes object detection to save system resouces\n if (tfod != null) {\n tfod.shutdown();\n }\n }",
"public void damageDevice() {\n\t\t\r\n\t}",
"public void dropItLikeItsHot(){\n\t\tint score_increment = 0;\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\twhile(true){\n\t\t\ttest_location.y += 1;\n\t\t\tif(!collides(test_location, currentPiece)){\n\t\t\t\tpieceOrigin.y += 1;\n\t\t\t\tscore_increment += 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tscore += score_increment*100;\n\t\tgossipGirl();\n\t\trepaint();\n\t}",
"public void arm_kill() {\n arm_analog(0);\n }",
"void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}",
"@Override\n\tprotected void execute() {\n\t\tRobot.arm.armDown();\n\t}",
"@Override\n public void loop() {\n\n //double armRot = robot.Pivot.getPosition();\n\n double deadzone = 0.2;\n\n double trnSpdMod = 0.5;\n\n float xValueRight = gamepad1.right_stick_x;\n float yValueLeft = -gamepad1.left_stick_y;\n\n xValueRight = Range.clip(xValueRight, -1, 1);\n yValueLeft = Range.clip(yValueLeft, -1, 1);\n\n // Pressing \"A\" opens and closes the claw\n if (gamepad1.a) {\n\n if (robot.Claw.getPosition() < 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(1);}\n else if (robot.Claw.getPosition() > 0.7)\n while(gamepad1.a){\n robot.Claw.setPosition(0.4);}\n else\n while(gamepad1.a)\n robot.Claw.setPosition(1);\n }\n\n // Pressing \"B\" changes the wrist position\n if (gamepad1.b) {\n\n if (robot.Wrist.getPosition() == 1)\n while(gamepad1.b)\n robot.Wrist.setPosition(0.5);\n else if (robot.Wrist.getPosition() == 0.5)\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n else\n while(gamepad1.b)\n robot.Wrist.setPosition(1);\n }\n\n // Turn left/right, overrides forward/back\n if (Math.abs(xValueRight) > deadzone) {\n\n robot.FL.setPower(xValueRight * trnSpdMod);\n robot.FR.setPower(-xValueRight * trnSpdMod);\n robot.BL.setPower(xValueRight * trnSpdMod);\n robot.BR.setPower(-xValueRight * trnSpdMod);\n\n\n } else {//Forward/Back On Solely Left Stick\n if (Math.abs(yValueLeft) > deadzone) {\n robot.FL.setPower(yValueLeft);\n robot.FR.setPower(yValueLeft);\n robot.BL.setPower(yValueLeft);\n robot.BR.setPower(yValueLeft);\n }\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n\n telemetry.addData(\"Drive Encoder Ticks\", robot.FL.getCurrentPosition());\n telemetry.addData(\"Winch Encoder Ticks\", robot.Winch.getCurrentPosition());\n telemetry.addData(\"ColorArm Position\", robot.ColorArm.getPosition());\n telemetry.addData(\"Wrist Position\", robot.Wrist.getPosition());\n telemetry.addData(\"Claw Position\", robot.Claw.getPosition());\n telemetry.addData(\"Grip Position\", robot.Grip.getPosition());\n telemetry.addData(\"Color Sensor Data Red\", robot.Color.red());\n telemetry.addData(\"Color Sensor Data Blue\", robot.Color.blue());\n\n /*\n\n // This is used for an Omniwheel base\n\n // Group a is Front Left and Rear Right, Group b is Front Right and Rear Left\n float a;\n float b;\n float turnPower;\n if(!gamepad1.x) {\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n\n a = Range.clip(yValueLeft + xValueLeft, -1, 1);\n b = Range.clip(yValueLeft - xValueLeft, -1, 1);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n\n } else {\n\n if (Math.abs(xValueRight) <= deadzone && Math.abs(yValueRight) <= deadzone) {\n\n // And is used here because both the y and x values of the right stick should be less than the deadzone\n a = Range.clip(yValueLeft + xValueLeft, -0.6f, 0.6f);\n b = Range.clip(yValueLeft - xValueLeft, -0.6f, 0.6f);\n\n\n robot.FL.setPower(a);\n robot.FR.setPower(b);\n robot.BL.setPower(b);\n robot.BR.setPower(a);\n\n telemetry.addData(\"a\", \"%.2f\", a);\n telemetry.addData(\"b\", \"%.2f\", b);\n\n } else if (Math.abs(xValueRight) > deadzone || Math.abs(yValueRight) > deadzone) {\n\n // Or is used here because only one of the y and x values of the right stick needs to be greater than the deadzone\n turnPower = Range.clip(xValueRight, -1, 1);\n\n robot.FL.setPower(-turnPower);\n robot.FR.setPower(turnPower);\n robot.BL.setPower(-turnPower);\n robot.BR.setPower(turnPower);\n\n } else {\n\n robot.FL.setPower(0);\n robot.FR.setPower(0);\n robot.BL.setPower(0);\n robot.BR.setPower(0);\n }\n }\n\n\n if (gamepad1.dpad_up) {\n\n robot.Swing.setPower(.6);\n\n } else if (gamepad1.dpad_down) {\n\n robot.Swing.setPower(-.6);\n\n } else {\n\n robot.Swing.setPower(0);\n }\n\n if(gamepad1.a){\n\n robot.Claw.setPosition(.4);\n\n } else if(gamepad1.b){\n\n robot.Claw.setPosition(0);\n }\n\n if(gamepad1.left_bumper) {\n\n robot.Pivot.setPosition(armRot+0.0005);\n\n } else if(gamepad1.right_bumper) {\n\n robot.Pivot.setPosition(armRot-0.0005);\n\n } else{\n\n robot.Pivot.setPosition(armRot);\n }\n\n telemetry.addData(\"position\", position);\n\n */\n\n /*\n * Code to run ONCE after the driver hits STOP\n */\n }",
"@Override\npublic Action actionChoosed(Player joueur) {\n WarPlayer player = this.castPlayer(joueur);\n int index = ((WarStrategy)(player.getStrategy())).skipOrDeploy();\n Action action = new SkipAction(player);\n if (index == 0) {\n Army army = this.inputArmy(player);\n Tile tile = ((WarStrategy)player.getStrategy()).inputTileStrategy();\n if(army != null && tile != null) {\n if (army.getArmySize() > 3 && tile.equals(new MountainTile(0, 0, 1, 0))) {\n System.out.println(\" Army of size \" + army.getArmySize() + \" can't be deployed on a mountain tile ! \");\n player.addWarrior(army.getArmySize());\n } else {\n action = new WarActionDeploy(player, this.board, tile.getPosX(), tile.getPosY(), army);\n }\n } else if (army != null && tile == null) {\n player.addWarrior(army.getArmySize());\n }\n }\n return action;\n}",
"@Override\n protected void interrupted() {\n Robot.drive.setCoastMode();\n Robot.tapeAlignSys.disable();\n Robot.lidarAlignSys.disable();\n }",
"public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }",
"@Override\n public void loop() {\n\n double drive = gamepad1.left_stick_y;\n double strafe = gamepad1.left_stick_x;\n double rotate = -gamepad1.right_stick_x;\n\n findRobotPosition(); // Call Vuforia routines, get robot position\n\n // Intake Operator Actions\n if (gamepad1.a || gamepad1.b || gamepad1.x){ // Operator wants to control the intake\n if (gamepad1.a){ // A turns the intake on for bringing in rings\n intakeMotor.setPower(1);\n }\n else if (gamepad1.b) { // B reverses the intake\n intakeMotor.setPower(-1);\n\n } else if (gamepad1.x){ // X stops the intake\n intakeMotor.setPower(0);\n }\n }\n\n // Ring Shooter Operator Actions\n /*if (gamepad1.dpad_up || gamepad1.dpad_down){\n if (gamepad1.dpad_up) {\n if (ringVel <= 170000) {\n ringVel = ringVel + 10000;\n }\n } else if (gamepad1.dpad_down){\n if (ringVel >= 10000){\n ringVel = ringVel - 10000;\n } else{\n ringVel = 0;\n }\n }\n }\n */\n\n if (gamepad1.right_bumper){\n fireServo.setPosition(FIRE_SERVO);\n } else{\n fireServo.setPosition(STANDBY_SERVO);\n }\n if (gamepad1.left_trigger > 0.5){\n ringShooterMotor.setVelocity(ringVel);\n }else {\n ringShooterMotor.setPower(0);\n }\n\n // Wobble Goal acions here\n if (gamepad1.dpad_left || gamepad1.dpad_right || gamepad1.left_bumper){\n if(gamepad1.dpad_left){\n wobbleMotor.setTargetPosition(WOBBLE_GRAB);\n wobbleMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n wobbleMotor.setPower(.4);\n } else if (gamepad1.dpad_right){\n wobbleMotor.setTargetPosition(WOBBLE_CARRY);\n wobbleMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n wobbleMotor.setPower(.4);\n } else if (gamepad1.left_bumper) {\n wobbleMotor.setTargetPosition(WOBBLE_OVER_WALL);\n wobbleMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n wobbleMotor.setPower(.4);\n }\n }\n // Insert operator driving actions here\n if ((targetVisible) && (gamepad1.y)) {\n // Allow the operator to position the robot to shoot a ring if a target is visible\n alignRobotToShoot();\n }\n else {\n moveBot(drive, rotate, strafe, power); //Basic Robot-centric Frame Driving\n }\n\n // Telemetry Section\n //telemetry.addData(\"Ring Velocity\", ringVel);\n //telemetry.addData(\"Actual Velocity\", ringShooterMotor.getVelocity());\n telemetry.addData(\"Ring Motor Encoder\", ringShooterMotor.getCurrentPosition());\n telemetry.addData(\"Wobble Goal Encoder\", wobbleMotor.getCurrentPosition());\n telemetry.update();\n }",
"@Override\n\tprotected void takeOff(){\n\t\tgvh.log.i(TAG, \"Drone taking off\");\n\t\tsetControlInput(0, 0, 0, 1);\n\t}",
"static boolean settleDown() throws GameActionException {\n\t\treturn !rc.isCircleOccupiedExceptByThisRobot(rc.getLocation(), SETTLERADIUS);\n\t}",
"@Override\n protected void end() {\n Robot.SCISSOR.extendLift(0);\n }",
"@Override\n protected void dropRareDrop(int superRare) {\n ItemStack drop = new ItemStack(Items.fishing_rod);\n EffectHelper.setItemName(drop, \"Whip of Destruction\", 0xd);\n drop.addEnchantment(Enchantment.sharpness, 1);\n drop.addEnchantment(Enchantment.unbreaking, 10);\n this.entityDropItem(drop, 0.0F);\n }",
"@Override\n protected void dropRareDrop(int superRare) {\n Item drop = null;\n switch (this.rand.nextInt(5)) {\n case 0:\n drop = Items.redstone;\n break;\n case 1:\n drop = Items.glowstone_dust;\n break;\n case 2:\n drop = Items.ghast_tear;\n break;\n case 3:\n drop = Items.blaze_powder;\n break;\n case 4:\n drop = Items.magma_cream;\n break;\n }\n if (drop != null) {\n this.dropItem(drop, 1);\n }\n }",
"public void repair(){\n if(health < 9) {\n this.health++;\n }\n }",
"public void fruitDrop()\n {\n fruit.slowMoveVertical(60);\n }",
"private void bypassIt(){\n rebootDialog();\n }",
"public void resetFuelWarning();",
"public void doItemEffect(RobotPeer robot){\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\trobot.updateEnergy(-15);\n\t\t//System.out.println(\"Poison item USED\");\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\t\n\t}",
"@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }",
"protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"public void doDrugRun() {\n\t\tthis.pickThing();\n\t\t// for loop that makes runner go and climb wall\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tthis.moveToWall();\n\t\t\tthis.climbWall();\n\t\t}\n\t\tthis.putThing();\n\t}",
"public ClimbAlt(Joystick joystick) {\n requires(sClimber);\n requires(sElevator);\n requires(sIntake);\n stick = joystick;\n }",
"void turnOffPads() throws ToyPadException;",
"@Override\n\tpublic int takeStep() {\n\t\tif (porteroDerecho){\n\t\t\t\n\t\t\t// Si me alejor de la porteria, volver\n\t\t\tif (myRobotAPI.getPosition().x < 0.9)\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getOpponentsGoal().t);\n\t\t\t// Sino, ir a bloquear al portero\n\t\t\telse{\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getClosestOpponent().t);\n\t\t\t\t//myRobotAPI.blockGoalKeeper(); // JA! No bloquea, solo marea los robots!\n\t\t\t\t\n\t\t\t\t// Aņadido para que si tiene la pelota cerca, deje de bloquear e intente chutar\n\t\t\t\tif (myRobotAPI.closestToBall()){\n\t\t\t\t\tmyRobotAPI.setSteerHeading(balon.t);\n\t\t\t\t\tmyRobotAPI.setBehindBall(myRobotAPI.getOpponentsGoal());\n\t\t\t\t\tif (myRobotAPI.alignedToBallandGoal())\n\t\t\t\t\t\tmyRobotAPI.kick();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// Sino, el portero a bloquear es el del campo izquierdo...\n\t\telse {\n\t\t\t// Si me alejor de la porteria, volver\n\t\t\tif (myRobotAPI.getPosition().x > -0.9)\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getOpponentsGoal().t);\n\t\t\t// Sino, ir a bloquear al portero\n\t\t\telse {\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getClosestOpponent().t);\n\t\t\t\t//myRobotAPI.blockGoalKeeper(); // JA! No bloquea, solo marea los robots!\n\t\t\t\t\n\t\t\t\t// Aņadido para que si tiene la pelota cerca, deje de bloquear e intente chutar\n\t\t\t\tif (myRobotAPI.closestToBall()){\n\t\t\t\t\tmyRobotAPI.setSteerHeading(balon.t);\n\t\t\t\t\tmyRobotAPI.setBehindBall(myRobotAPI.getOpponentsGoal());\n\t\t\t\t\tif (myRobotAPI.alignedToBallandGoal())\n\t\t\t\t\t\tmyRobotAPI.kick();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmyRobotAPI.setSpeed(1.0);\t\t// Empotramos para bloquear xD\n\t\t\n\t\treturn 0;\n\t}",
"public void duelmode(ScannedRobotEvent e) {\r\n //run predictive_shooter()\r\n if(e.getEnergy() <= 20) {\r\n //shoot things\r\n engage(e);\r\n } runaway(e);\r\n }",
"protected void execute() {\n \tRobot.logger.log(\"Gear Detected?\", (int)Robot.gearX);\n \tturn = Robot.gearX - 173; //centered is 160\n \tturn*= .0215; //.05\n \tif(Math.abs(turn)>.6 && turn <0) //.51 omni\n \t\tturn = -.6; //.61\n \tif(Math.abs(turn)>.6 && turn >0)\n \t\tturn = .6;\n \tif(Math.abs(turn)<.575 && turn >0) //.5 traction\n \t\tturn = .575; //.55\n \tif(Math.abs(turn)<.575 && turn <0)\n \t\tturn = -.575;\n \tRobot.drivetrain.tankDrive(turn, -turn);\n }",
"private void triggerDropItem(double percentage) {\n if (isDropped(percentage)) {\n String name;\n int tar = rd.nextInt(6);\n switch (tar) { // 7 is the total type of building card\n case 0:\n name = \"Sword\";\n break;\n case 1:\n name = \"Stake\";\n break;\n case 2:\n name = \"Staff\";\n break;\n case 3:\n name = \"Shield\";\n break;\n case 4:\n name = \"Helmet\";\n break;\n case 5:\n name = \"Armour\";\n break;\n default:\n return;\n }\n loadItem(name);\n }\n }",
"public void pleaseStop()\n {\n\t this.doorgaan_thread = false;\n\t this.doorgaan_wheel = true;\n draad = null; // waarom? \n }",
"public void runOpMode(){\n JAWLDrive3796 drive = new JAWLDrive3796(hardwareMap.dcMotor.get(\"left_drive\"), hardwareMap.dcMotor.get(\"right_drive\"));\n //Set the drive motors to run without encoders\n drive.setEncoders(false);\n //Create Grabber object\n JAWLGrabber3796 grabber = new JAWLGrabber3796(hardwareMap.servo.get(\"left_arm\"), hardwareMap.servo.get(\"right_arm\"));\n //Create Lift object\n JAWLLift3796 lift = new JAWLLift3796(hardwareMap.dcMotor.get(\"lift_motor\"));\n //Create color arm object\n JAWLColorArm3796 colorArm = new JAWLColorArm3796(hardwareMap.servo.get(\"color_arm\"));\n //Creates color sensor name\n ColorSensor colorSensorTemp = hardwareMap.get(ColorSensor.class, \"color_distance\");\n //Creates distance sensor name\n DistanceSensor distanceSensorTemp = hardwareMap.get(DistanceSensor.class, \"color_distance\");\n //Creates the color-distance sensor object\n JAWLColorSensor3796 colorDistanceSensor = new JAWLColorSensor3796(colorSensorTemp, distanceSensorTemp);\n //Creates the variable that will hold the color of the jewel\n String colorOfBall;\n //Creates relic arm objects\n //TTTTRelicArm3796 relicArm = new TTTTRelicArm3796(hardwareMap.dcMotor.get(\"relic_up_down\"), hardwareMap.dcMotor.get(\"relic_out_in\"), hardwareMap.dcMotor.get(\"relic_grab\"));\n //We never ended up having a relic arm!\n //The lift helper will set the idle power of the motor to a small double, keeping the lift from idly falling down\n boolean liftHelper = false;\n int i = 0;\n\n waitForStart();\n\n colorArm.armUp();\n\n while (opModeIsActive()) {\n //Here is where we define how the controllers should work\n //In theory, no logic retaining to controlling the components should be in here\n\n /*\n * Drive\n */\n\n //The left drive wheel is controlled by the opposite value of the left stick's y value on the first gamepad\n //The right drive is the same way except with the right drive wheel\n drive.leftDrive(-gamepad1.left_stick_y);\n drive.rightDrive(-gamepad1.right_stick_y);\n\n /*\n * Lift\n */\n telemetry.addData(\"Gamepad2 Right Stick Y\", -gamepad2.right_stick_y);\n\n if (-gamepad2.right_stick_y > 0) {\n //First checks to see if the right stick's negative y value is greater then zero.\n lift.moveMotor(-gamepad2.right_stick_y);\n //If it is, it sets the power for the motor to 1, and adds telemetry\n telemetry.addData(\"Lift Power\", 1);\n } else if (-gamepad2.right_stick_y < 0) {\n //Checks if the negative value of the right right stick's y position is less than zero\n lift.moveMotor(-0.1);\n //Sets the power for the motor to -0.1, and adds telemetry\n telemetry.addData(\"Lift Power\", -0.1);\n } else {\n //We check to see if the liftHelper is enabled\n if(liftHelper) {\n lift.moveMotor(0.1466 );\n } else {\n lift.moveMotor(0);\n }\n }\n\n\n\n /*\n * Lift helper control\n */\n\n if(gamepad2.a) {\n if(i == 0) {\n liftHelper = !liftHelper;\n }\n i = 5;\n }\n\n if(i != 0) {\n i--;\n }\n\n telemetry.addData(\"Lift Helper Enabled\", liftHelper);\n\n\n\n /*\n * Grabbers\n */\n if (gamepad2.left_trigger > 0) {\n //Closes the left arm, then displays the position in telemetry\n grabber.leftArmClose();\n double a = grabber.leftPosition();\n //Adds telemetry to display positions of grabbers, mostly for testing, but can be useful later on\n telemetry.addData(\"Left\", a);\n }\n\n if (gamepad2.left_bumper) {\n //Opens the left arm, then displays the position in telemetry\n grabber.leftArmOpen();\n double b = grabber.leftPosition();\n //We made the variables different as to avoid any and all possible errors\n telemetry.addData(\"Left\", b);\n }\n\n if (gamepad2.right_trigger > 0) {\n //Opens the right arm, then displays the position in telemetry\n grabber.rightArmClose();\n double c = grabber.rightPosition();\n telemetry.addData(\"Right\", c);\n }\n\n if (gamepad2.right_bumper) {\n //Closes the right arm, then displays the position in telemetry\n grabber.rightArmOpen();\n double d = grabber.rightPosition();\n telemetry.addData(\"Right\", d);\n }\n\n if (gamepad2.dpad_left){\n //Closes the left arm to a shorter distance\n grabber.leftArmShort();\n }\n\n if(gamepad2.dpad_right){\n //Closes the right arm to a shorter distance\n grabber.rightArmShort();\n\n }\n\n //Update all of our telemetries at once so we can see all of it at the same time\n telemetry.update();\n }\n }",
"@Override\n\t\tpublic void driveRobot(double power, double pivot) {\n\t\t\tclosedLoopArcade(power, pivot);\n\t\t}",
"public void undock() {\n if (getSpeed() == 0) {\n inDock = false;\n }\n }",
"public void liftOff() {\n\t\tL.trace(\"liftOff\");\n\t\tif (canFly()) {\n\t\t\tjump();\n\t\t}\n\t}",
"@Override\n public void execute() {\n intake.intakeMotor.set(-.8);\n }",
"protected void initialize() {\n \tRobot.conveyor.stop();\n }",
"public void runPuzzleMovement( Screw screw, float screwVal, Platform p );",
"public static void plaatsComputerVloot(){\n\t\tfor (int iPlaats = 0; iPlaats < 5; iPlaats++){\n\t\t\tboolean shipOrientation = Math.random() < 0.5;\n\t\t\tGame.computer1.fleet.get(iPlaats).horizontal = shipOrientation;\n\t\t\tif (Game.computer1.fleet.get(iPlaats).horizontal) {\n\t\t\t\tGame.computer1.fleet.get(iPlaats).switchlb();\n\t\t\t}\n\t\t\tRandom random = new Random();\n\t\t\tboolean conflict = false;\n\t\t\tif(Game.computer1.fleet.get(iPlaats).horizontal){ //horizontaal\n\t\t\t\tint randomx = random.nextInt(11 - Game.computer1.fleet.get(iPlaats).getBreedte());\n\t\t\t\tint randomy = random.nextInt(10);\n\t\t\t\tfor(int xLoper=0; xLoper < Game.computer1.fleet.get(iPlaats).getBreedte();xLoper++){ //controleer coordinaten die huidige schip wil hebben op conflicten\n\t\t\t\t\tfor(int iConflictIndex=0; iConflictIndex < iPlaats; iConflictIndex++){// deze lus pakt alle eerder geplaatste schepen (heeft geen zin om nog niet geplaatste schepen te controleren)\n\t\t\t\t\t\tfor(int iConflictCo=0;iConflictCo < Game.computer1.fleet.get(iConflictIndex).coordinates.length;iConflictCo++){ //doorloopt coordinaten van een eerder geplaatst schip en controleert op overeenkomsten.\n\t\t\t\t\t\t\tif(Game.computer1.fleet.get(iConflictIndex).coordinates[0][iConflictCo] == randomx+xLoper && Game.computer1.fleet.get(iConflictIndex).coordinates[1][iConflictCo] == randomy){\n\t\t\t\t\t\t\t\tconflict = true; //indien overeenkomst, is er een conflict.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!conflict){\n\t\t\t\t\tfor(int l = 0; l < Game.computer1.fleet.get(iPlaats).getBreedte(); l++){ \n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[0][l] = randomx + l;\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[1][l] = randomy;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{ //verticaal. komt grotendeels overeen met horizontaal, commentaar: zie daar.\n\t\t\t\tint randomx = random.nextInt(10);\n\t\t\t\tint randomy = random.nextInt(11 - Game.computer1.fleet.get(iPlaats).getLengte());\n\t\t\t\tfor(int yLoper=0; yLoper < Game.computer1.fleet.get(iPlaats).getLengte();yLoper++){\n\t\t\t\t\tfor(int iConflictIndex=0; iConflictIndex < iPlaats; iConflictIndex++){\n\t\t\t\t\t\tfor(int iConflictCo=0;iConflictCo < Game.computer1.fleet.get(iConflictIndex).coordinates.length;iConflictCo++){\n\t\t\t\t\t\t\tif(Game.computer1.fleet.get(iConflictIndex).coordinates[0][iConflictCo] == randomx && Game.computer1.fleet.get(iConflictIndex).coordinates[1][iConflictCo] == randomy+yLoper){\n\t\t\t\t\t\t\t\tconflict = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!conflict){\n\t\t\t\t\tfor(int l = 0; l < Game.computer1.fleet.get(iPlaats).getLengte(); l++){\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[0][l] = randomx;\n\t\t\t\t\t\tGame.computer1.fleet.get(iPlaats).coordinates[1][l] = randomy + l;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(conflict){\n\t\t\t\tiPlaats--;\n\t\t\t}\n\t\t}\n\t\tspelen(); //alles geplaatst, dan spelen.\n\t}",
"@Test\n public void test_chooseBadTargetOnSacrifice_WithoutTargets_User() {\n addCard(Zone.HAND, playerA, \"Redcap Melee\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Atarka Monument\", 1); // {T}: Add {R} or {G}.\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\", 1);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Redcap Melee\", \"Silvercoat Lion\");\n //addTarget(playerA, \"Mountain\"); no lands to sacrifice\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerA, \"Redcap Melee\", 1);\n assertGraveyardCount(playerB, \"Silvercoat Lion\", 1);\n }",
"void makeDragon() {\n new BukkitRunnable() {\n int i = 555;\n\n @Override\n public void run() {\n Set<BlockData> set = create.get(i);\n for (BlockData blockData : set) {\n blockData.setBlock();\n }\n\n i++;\n if (i > 734) {\n cancel();\n }\n }\n }.runTaskTimer(Main.plugin, 0, 2);\n // Location end = new Location(Bukkit.getWorld(\"world\"), 3, 254, 733);\n }",
"@Override\n public void start() {\n robot.shooterPower(1);\n runtime.reset();\n }",
"public void planted(){\r\n\t\tenable = false; \r\n\t\tcount = 0; \r\n\t}",
"void easy_ride_old (double min_lift, double start_speed) { \n double pitch = 0;\n double min_drag = 10000.0;\n double min_drag_speed = -1;\n for (double speed = start_speed; speed < v_max; speed += 0.5) {\n velocity = speed;\n trace(\"velocity: \" + velocity);\n for (pitch = 0; pitch <= aoa_max; pitch += 0.1) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n // if (total_drag() >= max_drag) {\n // trace(\"warning speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift());\n // return;\n // }\n if (foil_lift() >= min_lift) {\n double drag = total_drag();\n if (min_drag > drag) {\n min_drag = drag;\n min_drag_speed = velocity;\n break;\n } else {\n // drag goes up now. can be done now, but\n // as a heuristic, now try from the upepr limit, and then find range:\n max_speed(min_lift, min_drag + 2, false);\n if (velocity < min_drag_speed) {\n // something went wrong (iteration stepped over the sweets spot etc)\n // so we take min_lift, min_drag, and min_drag_speed as is\n make_cruising_info(min_lift, min_drag, min_drag_speed); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n } else {\n // done, report with average of min_drag_speed and velocity\n make_cruising_info(min_lift, min_drag+1, (min_drag_speed+velocity)/2); \n trace(\"done with refinement! \");\n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }\n return;\n }\n }\n }\n }\n }",
"@Override\n public void loop() { //Starts this loop after you press the START Button\n /**\n * Functional control of up down lift with no limit switches Meet 0 ready\n */\n double liftposition = robot.liftUpDown.getCurrentPosition();\n double liftrotposition = robot.liftRotate.getCurrentPosition();\n telemetry.addData(\"Lift Position\",\"%5.2f\",liftposition);\n telemetry.addData(\"LiftRot Position\", \"%5.2f\", liftrotposition);\n // telemetry.addData(\"Block Stack\", BlockStack);\n telemetry.update();\n\n/**Main drive controls\n * Driver 1\n */\n\n/**\n * Drag servos\n */\n if (gamepad1.a){ //release\n robot.drag1.setPosition(0);\n robot.drag2.setPosition(1);\n } else if (gamepad1.b){//grab\n robot.drag1.setPosition(1);\n robot.drag2.setPosition(0);\n }\n\n/**Mast and Lift controls\n *\n *\n * Driver Two\n *\n *\n*/\n\n/**\n * Need controls to\n * Maybe predetermined locations based on number of pushes of a button.\n */\n\n /**\n * Functional arm rotation with limit switches and encoder limits. Meet 2 ready\n */\n\n //Twists lift up after verifying that rotate up limit switch is not engaged and that step count is less than 5400\n if ( gamepad2.dpad_up && robot.rotateup.getState() == true){\n robot.liftRotate.setPower(1.0);\n }\n else if (gamepad2.dpad_down && robot.rotatedown.getState() == true){ //Twists lift down\n robot.liftRotate.setPower(-1.0);\n }\n //required or lift rotate motor continues to run in last direction (breaks the motor shaft)\n else robot.liftRotate.setPower(0);\n\n /**\n * claw controls a= open b= close\n * FUNCTIONAL Meet 2 ready\n */\n if (gamepad2.a){\n robot.claw1.setPosition(0);\n robot.claw2.setPosition(1);\n } else if (gamepad2.b){\n robot.claw1.setPosition(1);\n robot.claw2.setPosition(0);\n }\n\n /**\n * Lift controls with limit switches and encoder position Meet 2 ready\n * right_trigger = lift\n * left_trigger = down\n */\n\n if ( gamepad2.right_trigger>= 0.2 && robot.liftup.getState()) {\n triggerpress=true;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftUpDown.setPower(.9);\n robot.liftRotate.setPower(.15);\n }\n if (gamepad2.left_trigger>=0.2){\n triggerpress=true;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftUpDown.setPower(-0.9);\n robot.liftRotate.setPower(-0.15);\n }\n if (gamepad2.left_trigger<.2 && gamepad2.right_trigger<.2 && triggerpress ){\n robot.liftUpDown.setPower(0);\n robot.liftRotate.setPower(0);\n triggerpress=false;\n }\n\n int x;\n int y;\n double motorDelayTime;\n //Necessary Debounce to keep bumper from being seen as multiple touches\n/* motorDelayTime=.1;\n if (robot.liftUpDown.getCurrentPosition()<50){\n BlockStack =0;\n }\n //skips servos unless runtime is greater than 20 ms.\n if( runtime.time() > motorDelayTime ) {\n //Need to move 5.5 inches on position 2, subsequent blocks will only need to move up 4 inches.\n x = robot.liftUpDown.getCurrentPosition();\n y= robot.liftRotate.getCurrentPosition();\n if (gamepad2.right_bumper ) {\n\n BlockStack= BlockStack + 1;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.liftUpDown.setTargetPosition(x + robot.floorheight);\n robot.liftUpDown.setPower(.9);\n robot.liftRotate.setTargetPosition(y + robot.floorheightrotate);\n robot.liftRotate.setPower(.1);\n bumperpress=true;\n\n //don't want to drive the cable too far loose checks that we can move a full block down\n } else if (gamepad2.left_bumper && x >= robot.floorheight ) {\n BlockStack= BlockStack - 1;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.liftUpDown.setTargetPosition(x - robot.floorheight);\n robot.liftUpDown.setPower(-.5);\n}\n\n runtime.reset();\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }*/\n\n /**\n * Limit switch tests that reset the encoders Meet 1 ready\n * * liftdown also allows the X button to work\n * * rotatedown also allows the Y button to work\n */\n\n if (robot.rotatedown.getState() == false) {\n robot.liftRotate.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.liftRotate.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }\n }",
"public void applyGear() {\n\t\t\r\n\t}",
"private static void resetVehicle() {\n Vehicle vehicle = MavDemo1.getVehicle();\n VehicleControl engineBody = vehicle.getVehicleControl();\n\n float[] angles = new float[3];\n engineBody.getPhysicsRotation().toAngles(angles);\n Vector3f location = engineBody.getPhysicsLocation();\n\n vehicle.removeFromPhysicsSpace();\n vehicle.warpAllBodies(location, angles[1]);\n if (vehicle.contactTest()) {\n Vector3f newLocation = location.add(0f, 1f, 0f);\n for (int iteration = 0; iteration < 9; ++iteration) {\n vehicle.warpAllBodies(newLocation, angles[1]);\n if (vehicle.contactTest()) {\n break;\n }\n Vector3f offset = generator.nextVector3f();\n offset.multLocal(0.1f * (iteration + 1));\n newLocation.addLocal(offset);\n }\n }\n vehicle.addToPhysicsSpace();\n }",
"public void onHarvestPart(qx player, int part)\r\n/* 77: */ {\r\n/* 78: 64 */ boolean change = false;\r\n/* 79: 65 */ if (part == 29)\r\n/* 80: */ {\r\n/* 81: 66 */ CoreLib.dropItem(this.k, this.l, this.m, this.n, new ur(RedPowerMachine.blockFrame, 1));\r\n/* 82: 69 */ if (this.CoverSides > 0)\r\n/* 83: */ {\r\n/* 84: 70 */ replaceWithCovers();\r\n/* 85: 71 */ updateBlockChange();\r\n/* 86: */ }\r\n/* 87: */ else\r\n/* 88: */ {\r\n/* 89: 72 */ deleteBlock();\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ else\r\n/* 93: */ {\r\n/* 94: 74 */ super.onHarvestPart(player, part);\r\n/* 95: 75 */ return;\r\n/* 96: */ }\r\n/* 97: */ }",
"void driveStop() {\n flMotor.setPower(0);\n frMotor.setPower(0);\n blMotor.setPower(0);\n brMotor.setPower(0);\n }",
"public void stop()\n {\n robot.FL_drive.setPower(0);\n robot.FR_drive.setPower(0);\n robot.BL_drive.setPower(0);\n robot.BR_drive.setPower(0);\n }",
"static void defending() throws GameActionException {\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tif (rc.canBuildRobot(RobotType.SOLDIER, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SOLDIER) < Constants.MAX_COUNT_SOLDIER) {\n\t\t\trc.buildRobot(RobotType.SOLDIER, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SOLDIER);\n\t\t}\n\n\t}",
"@Override\r\n\tprotected boolean canDropLoot() {\r\n\t\treturn false;\r\n\t}",
"public void dropNapalm() {\n\t\t// Has player waited cooldown before trying to fire again?\n\t\tif (System.currentTimeMillis() - this.lastFired > Config.WEAPON_COOLDOWN_TIME * 1000) {\n\t\t\tSystem.out.println(player.getDisplayName() + \" is attempting to launch napalm\");\n\t\t\t// Can this airship drop napalm?\n\t\t\tif (this.properties.DROPS_NAPALM) {\n\t\t\t\tBlock[] cannons = getCannons();\n\t\t\t\tint numfiredcannons = 0;\n\t\t\t\tfor (int i = 0; i < cannons.length; i++) {\n\t\t\t\t\tif (cannons[i] != null && cannons[i].getRelative(0, -1, 0).getType().equals(Material.AIR) && cannonHasTnt(cannons[i], Config.NUM_TNT_TO_DROP_NAPALM)) {\n\t\t\t\t\t\tboolean missingMaterial = false;\n\t\t\t\t\t\tfor (int id : Config.MATERIALS_NEEDED_FOR_NAPALM) {\n\t\t\t\t\t\t\tif (!cannonHasItem(cannons[i], id, 1))\n\t\t\t\t\t\t\t\tmissingMaterial = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!missingMaterial && numfiredcannons < this.properties.MAX_NUMBER_OF_CANNONS) {\n\t\t\t\t\t\t\tnumfiredcannons++;\n\t\t\t\t\t\t\tlastFired = System.currentTimeMillis();\n\t\t\t\t\t\t\twithdrawTnt(cannons[i], Config.NUM_TNT_TO_DROP_NAPALM);\n\t\t\t\t\t\t\tfor (int id : Config.MATERIALS_NEEDED_FOR_NAPALM) {\n\t\t\t\t\t\t\t\twithdrawItem(cannons[i], id, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Fire some napalms TODO: maybe add sound effects for napalm dropping? :P\n\t\t\t\t\t\t\tnew Napalm(cannons[i]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// More cannons on ship than allowed. Not all fired - can break out of loop now.\n\t\t\t\t\t\t\tplayer.sendMessage(ChatColor.AQUA + \"Some napalm-cannons did not fire. Max cannon limit is \" + ChatColor.GOLD + this.properties.MAX_NUMBER_OF_CANNONS);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tplayer.sendMessage(ChatColor.GOLD + this.properties.SHIP_TYPE + \" CANNOT DROP NAPALM\");\n\t\t} else\n\t\t\tplayer.sendMessage(ChatColor.GOLD + \"COOLING DOWN FOR \" + ChatColor.AQUA + (int)(Math.round(6 - (System.currentTimeMillis() - this.lastFired) / 1000)) + ChatColor.GOLD + \" MORE SECONDS\");\n\t}",
"public void loop() {\n\n double driveMult = gamepad1.left_bumper ? 0.5 : (gamepad1.right_bumper ? 0.2 : 1.0);\n\n double x = gamepad1.left_stick_x;\n double y = gamepad1.left_stick_y;\n\n switch (state) {\n case DRIVE:\n left.setPower(driveMult * (y - x));\n right.setPower(driveMult * (y + x));\n break;\n case REVERSE:\n left.setPower(driveMult * -(y + x));\n right.setPower(driveMult * -(y - x));\n break;\n case TANK:\n left.setPower(driveMult * gamepad1.left_stick_y);\n right.setPower(driveMult * gamepad1.right_stick_y);\n break;\n }\n\n if (gamepad1.dpad_up) {\n state = State.DRIVE;\n } else if (gamepad1.dpad_down) {\n state = State.REVERSE;\n } else if (gamepad1.dpad_left) {\n state = State.TANK;\n }\n\n // AUX CONTROLS\n\n double auxMult = gamepad2.left_bumper ? 0.5 : (gamepad2.right_bumper ? 0.2 : 1.0);\n\n rack.setPower(auxMult * ((gamepad2.dpad_up ? 1 : 0) + (gamepad2.dpad_down ? -1 : 0)));\n\n // extend.setPower(auxMult * gamepad2.left_stick_y);\n slurp.setPower(auxMult * gamepad2.right_stick_y);\n\n\n// if (gamepad2.a) {\n// rack.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n// rack.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n// }\n\n // TELEMETRY\n\n telemetry.addData(\"Drive Mode: \", state);\n telemetry.addData(\"Rack Encoder: \", rack.getCurrentPosition());\n telemetry.addData(\"G2 RS Y: \", gamepad2.right_stick_y);\n }",
"public void autoMode1Red(int delay){\n \taddParallel(new LightCommand(0.5));\n//\t\taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.7, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"));\n// \t\taddSequential(new TargetGearSortCommand());\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}\n \taddParallel(new EnvelopeCommand(false));\n \taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 50));\n \taddSequential(new TurnWithPIDCommand(-100));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(1, 45));\n \taddSequential(new VisionBoilerTargetCommand(\"targets\"));\n\t\taddSequential(new TargetBoilerSortCommand());\n\t\taddSequential(new AutoTurnCommand());\n \taddSequential(new ShootCommand(true,0.85));\n \t\n }",
"private void cleaningBallot() {\n\t\tturnLeft();\n\t\tmove();\n\t\tgrabStrayBeepers();\n\t\tturnAround();\n\t\tmove();\n\t\tmove();\n\t\tgrabStrayBeepers();\n\t}",
"public void shoot() {\n _shooterMotor1.set(_targetRPM);\n }",
"public DropPower(Brick owner, Breakout game) {\n\t\tsuper(owner, game);\n\t\tthis.falling = false;\n\t}",
"@Override\n\tpublic void swim() {\n\t\tthis.fly();\n\t}",
"public void autoMode4Red(int delay){\n \taddParallel(new LightCommand(0.25));\n// \taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddSequential(new AutoDriveCommand(6));\n \taddSequential(new TurnWithPIDCommand(-45)); \n \taddSequential(new WaitWithoutCheckCommand(.5));\n \taddSequential(new VisionGearTargetCommand(\"targets\"));\n \taddSequential(new TargetGearSortCommand());\n \taddSequential(new AutoTurnCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"),0.5);\n// \t\taddSequential(new TargetGearSortCommand(),0.5);\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}else{\n// \t\n// \t}\n }",
"private boolean UpdateWithoutCarriedBlock()\r\n {\r\n if ( rand.nextInt(20) == 0 )\r\n {\r\n int i = MathHelper.floor_double( ( posX - 3D ) + rand.nextDouble() * 6D );\r\n int j = MathHelper.floor_double( posY - 1D + rand.nextDouble() * 7D );\r\n int k = MathHelper.floor_double( ( posZ - 3D ) + rand.nextDouble() * 6D );\r\n \r\n int l1 = worldObj.getBlockId( i, j, k );\r\n\r\n if ( CanPickUpBlock( i, j, k ) )\r\n {\r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderBlockCollectAuxFXID, i, j, k, l1 + ( worldObj.getBlockMetadata( i, j, k ) << 12 ) );\r\n\t\t \r\n setCarried( worldObj.getBlockId( i, j, k ) );\r\n setCarryingData( worldObj.getBlockMetadata( i, j, k ) );\r\n worldObj.setBlockToAir( i, j, k );\r\n }\r\n }\r\n else if ( worldObj.provider.dimensionId == 1 )\r\n {\r\n \t// Endermen in the end without a block in hand will eventually teleport back to the overworld\r\n \t\r\n \t\tif ( rand.nextInt( 9600 ) == 0 )\r\n \t\t{\r\n \t\t\t// play dimensional travel effects\r\n \t\t\t\r\n int i = MathHelper.floor_double( posX );\r\n int j = MathHelper.floor_double( posY ) + 1;\r\n int k = MathHelper.floor_double( posZ );\r\n \r\n\t\t worldObj.playAuxSFX( FCBetterThanWolves.m_iEnderChangeDimensionAuxFXID, i, j, k, 0 );\r\n\t\t \r\n setDead();\r\n \r\n return false;\r\n \t\t}\r\n }\r\n \r\n return true;\r\n }",
"protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }",
"public void reinforceAction(){\n\t\tint u = MainPlayScreen.this.game.getCurrentPlayer().getUnplacedArmies();\n\t\t\n\t\tif( u == 0){\n\t\t\tnumberOfArmies[1].removeAllItems();\n\t\t}\t// end of if statement\n\t\t\n\t\telse{\t\t\t\t\t\n\t\t\tnumberOfArmies[1].removeAllItems();\n\t\t\tfor( int i = 1; i <= u; i++){\n\t\t\t\tSystem.out.print(i);\n\t\t\t\t\n\t\t\t\tnumberOfArmies[1].addItem(i);\n\t\t\t\t\n\t\t\t}// end of else\n\t\t} // end of else\n\t\t\n\t\tnumberOfArmies[1].repaint();\n\t}",
"@Test\n public void test_chooseBadTargetOnSacrifice_WithoutTargets_AI() {\n addCard(Zone.HAND, playerA, \"Redcap Melee\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Atarka Monument\", 1); // {T}: Add {R} or {G}.\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\", 1);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Redcap Melee\", \"Silvercoat Lion\");\n //addTarget(playerA, \"Mountain\"); no lands to sacrifice\n\n //setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerA, \"Redcap Melee\", 1);\n assertGraveyardCount(playerB, \"Silvercoat Lion\", 1);\n }",
"public void panic() {\n energy = 0;\n redBull = 0;\n gun = 1;\n target = 2;\n }",
"public ResetClawArm() {\n\n\t\tif(Robot.kClawArm.isClawRetracted() == true) {\n\t\t\taddSequential(new DeployClawArm());\n\t\t}\n\t\telse {\n\t\t\taddSequential(new RetractClawArm());\n\t\t}\n\t\t\n\t}",
"private void safeStop() {\n getRobotDrive().stop();\n //pneumatics.stop();\n }",
"public void donnerArtefact() {\r\n\t\tZone z = j.getZone();\r\n\t\tif (z.getElement() == modele.Element.Neutre) {\r\n\t\t\tSystem.out.println(\"Cette zone ne contient pas d'artefact !\");\r\n\t\t}\r\n\t\tif (this.clefsMinimum <= j.combienCles(z.getElement())) {\r\n\t\t\tj.recupereObjet(new Artefact(z.getElement()));\r\n\t\t\tj.enleveCles(new Clef(z.getElement()), clefsMinimum);\r\n\t\t\t\r\n\t\t\tthis.incrNbAction();\r\n\t\t\tthis.notifyObservers();\r\n\t\t\tj.getIle().notifyObservers(); // Pour l'affichage d'inventaire.\r\n\t\t}\r\n\t}",
"private void triggerDropCard(double percentage) {\n if (isDropped(percentage)) {\n String name;\n int tar = rd.nextInt(7);\n switch (tar) { // 7 is the total type of building card\n case 0:\n name = \"Tower\";\n break;\n case 1:\n name = \"Barracks\";\n break;\n case 2:\n name = \"Campfire\";\n break;\n case 3:\n name = \"Trap\";\n break;\n case 4:\n name = \"VampireCastle\";\n break;\n case 5:\n name = \"ZombiePit\";\n break;\n case 6:\n name = \"Village\";\n break;\n default:\n return;\n }\n loadCard(name);\n }\n }",
"private void controlLift()\n {\n if (gamepad1.dpad_up) {\n liftMotor.setPower(-0.5);\n } else if (gamepad1.dpad_down) {\n liftMotor.setPower(0.5);\n } else {++backInc;\n liftMotor.setPower(0);\n }\n }",
"public abstract void drop();",
"@Override\n protected void end() {\n Robot.myLifter.setLeftSpeed(0);\n Robot.myLifter.setRightSpeed(0);\n }",
"public void killAndHunt() {\n\t\tRandom random = new Random();\n\t\tint currentIndex = random.nextInt(N);\t\n\t\tkill(currentIndex);\n\t}",
"protected void interrupted() {\n \tRobot.claw.setClawMotor(0);\n }"
] | [
"0.65580666",
"0.65445435",
"0.5920476",
"0.5643171",
"0.5608907",
"0.5532191",
"0.55310994",
"0.5524818",
"0.55179584",
"0.55160105",
"0.54975724",
"0.5477975",
"0.5477174",
"0.5467595",
"0.5436681",
"0.54218584",
"0.5416671",
"0.5413156",
"0.5370084",
"0.5335627",
"0.5331432",
"0.5330825",
"0.5327115",
"0.53223586",
"0.53190154",
"0.52968085",
"0.52929527",
"0.5292663",
"0.52803826",
"0.5261655",
"0.5251603",
"0.5248587",
"0.5247637",
"0.52447975",
"0.52420914",
"0.5238969",
"0.52387",
"0.52063453",
"0.52052456",
"0.52027303",
"0.5199099",
"0.51966745",
"0.5187516",
"0.51738054",
"0.5156063",
"0.5155696",
"0.515174",
"0.5145739",
"0.5143056",
"0.51313627",
"0.51269317",
"0.51214284",
"0.51179457",
"0.51166743",
"0.51135844",
"0.51131135",
"0.5106221",
"0.5105718",
"0.5101637",
"0.50985855",
"0.50981724",
"0.509769",
"0.5093395",
"0.50872284",
"0.5084275",
"0.5082605",
"0.5081149",
"0.5074392",
"0.50704736",
"0.5068607",
"0.5065217",
"0.5064883",
"0.50640166",
"0.5062362",
"0.5058894",
"0.5056214",
"0.5055001",
"0.5049078",
"0.5044752",
"0.5044673",
"0.50444907",
"0.5040794",
"0.50391513",
"0.5038743",
"0.50353783",
"0.503022",
"0.5029498",
"0.5027931",
"0.5017101",
"0.5016224",
"0.50144",
"0.501396",
"0.5013854",
"0.50123554",
"0.5010054",
"0.50096506",
"0.50095934",
"0.50072086",
"0.500494",
"0.5002223"
] | 0.68751895 | 0 |
Make robot pick up surpriseBox (if possible). | @Override
public void pickUpSurpriseBox(Robot robot, SurpriseBox surpriseBox)
{
try
{
if(robot.canPickUp(surpriseBox))
{
robot.pickUp(surpriseBox);
}
else
{
System.out.println("This surprise box could not be picked up by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this surprise box is terminated; the robot cannot pick up the surprise box.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void useSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.use(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot use the surprise box.\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void dropSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot drop the surprise box.\");\r\n\t\t}\r\n\t}",
"public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }",
"public void pickUp(Player player) {\n player.setBox(this);\n }",
"@Override\r\n\tpublic void pickUpRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot pick up the repair kit.\");\r\n\t\t}\r\n\t}",
"public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }",
"private void jRadioButtonShootAlternativelyActionPerformed() {\r\n\t\tjRadioButtonShootAlternatively.setSelected(true);\r\n\t\tjRadioButtonShootUntilWater.setSelected(false);\r\n\t\tgame.setGameMode(GameMode.ALTERNATIVELY);\r\n\t}",
"public static void pickUpCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select().id(6).poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Pick-up\"), cannon.name());\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.inventory.select().id(Items.CANNON_BASE_6).count() == 1;\n }\n }, 250, 20);\n }\n }",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"protected void processButton1(Robot robot ){\n robot.getIntake().intakeSuckIn(1);\n\n }",
"private static void pickAllThings(Robot r)\n {\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }",
"void pickGarb() {\n if (model.hasObject(GARB, getAgPos(0))) {\n // sometimes the \"picking\" action doesn't work\n // but never more than MErr times\n if (random.nextBoolean() || nerr == MErr) {\n remove(GARB, getAgPos(0));\n nerr = 0;\n r1HasGarb = true;\n } else {\n nerr++;\n }\n }\n }",
"private void testGrab()\n {\n if(gamepad1.y) {\n //move to position where it touches block ----might have to change angle based on trial----\n //Drastic angles at the moment for testing\n servoLeft.setPosition(0.5);\n //servoRight.setPosition(0.5);\n }\n }",
"private void asignRegularSandwich() {\n\t\tbaguette = new RegularSandwich();\n\t\tSystem.out.println(\"\\nYou have selected regular bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }",
"public void victory() {\n fieldInerface.setPleasedSmile();\n fieldInerface.timestop();\n int result = fieldInerface.timeGet();\n /*try {\n if (result < Integer.parseInt(best.getProperty(type))) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }*/\n\n gamestart = true; // new game isn't started yet!\n for (int j = 0; j < heightOfField; j++)\n for (int i = 0; i < widthOfField; i++)\n if (fieldManager.isCellMined(i, j))\n if (!fieldManager.isCellMarked(i, j)) {\n fieldInerface.putMarkToButton(i, j);\n fieldInerface.decrement();\n }\n gameover = true; // game is over!!\n }",
"public void xboxHatchControl()\n {\n if (RobotMap.assistantDriverController.getStartButtonPressed())\n {\n RobotMap.hatchHolderTalon.set(0);\n }\n if (RobotMap.assistantDriverController.getBumperPressed(Hand.kLeft))\n {\n if (RobotMap.hatchHolderHasHatch)\n new ReleaseHatchCommand().start();\n else\n new GrabHatchCommand().start();\n RobotMap.hatchHolderHasHatch = !RobotMap.hatchHolderHasHatch;\n }\n }",
"private void cs5() {\n\t\t\tif(ctx.widgets.widget(519).component(1).text().contains(\"You get some\")){\n\t\t\t\tctx.widgets.widget(519).component(2).click();\n\t\t\t}\n\t\t\tif(ctx.inventory.selectedItem().valid()){\n\t\t\t\tMethod.interactInventory(2511, \"Use\", \"Logs\");\n\t\t\t}else Method.interactInventory(590, \"Use\", \"Tinder box\");\n\t\t\t\n\t\t}",
"public void toggleGrab(){\n \tif (isClosed == true){\n \t\ttriggerTimer.reset();\n \t\tisClosed = false;\n \t\tClawAct.set(false);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t} else {\n \t\tisClosed = true;\n \t\tClawAct.set(true);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t}\n }",
"void setBox();",
"public void addBox()\n {\n if(Student.sittingRia==false) {\n box = new BoxRia(\"chalkboard.png\",4,2);\n addObject(box,box.myRow,box.mySeat);\n chalk = new BoxRia(\"chalk.png\",0,0);\n addObject(chalk,2,3);\n }\n }",
"private void newPowerUp() {\r\n int row = 0;\r\n int column = 0;\r\n do {\r\n row = Numbers.random(0,maxRows-1);\r\n column = Numbers.random(0,maxColumns-1);\r\n } while(isInSnake(row,column,false));\r\n powerUp = new Location(row,column,STOP);\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }",
"public static void stopCase(Robot r)\n {\n while(r.frontIsClear() == false)\n while(r.canPickThing() == false)\n break;\n }",
"private void bust() {\n //Dialog box pop-up\n JOptionPane.showMessageDialog(this, this.getPlayerName() + \" busted with a value of: \" + this.getValue(), \"BUSTED!\", JOptionPane.INFORMATION_MESSAGE);\n busted = true; //Hand busted\n }",
"@Override\r\n\tpublic void putSurpriseBox(Board board, long x, long y, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tsurpriseBox.setPosition(new Position(x,y));\r\n\t\t\tsurpriseBox.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this surprise box or this board is terminated; the surprise box cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public static void main( String[] args )\n {\n //usage: move bar below down 1 line at a time to test functionality...\n\n Slots machine01 = new Slots();\n Slots machine02 = new Slots();\n\n //test to verify slot machines function indepently\n\n System.out.println( \"Machine01 initial state:\\t\" + machine01 );\n System.out.println( \"Machine02 initial state:\\t\" + machine02 );\n\n System.out.println( \"\\nSpinning machine01...\\n\" );\n\n machine01.spinOnce();\n\n System.out.println();\n System.out.println( \"Machine01 state:\\t\" + machine01 );\n System.out.println( \"Machine02 state:\\t\" + machine02 );\n System.out.println();\n\n\n //test gamble-until-you-win mechanism\n\n System.out.println( \"Preparing to spin until a mini win! . . .\" );\n System.out.println( \"------------------------------------\" );\n\n //if you haven't won, spin again until you win!\n while( machine01.miniWin() == false ) {\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"LOSE\\n\" );\n machine01.spinOnce();\n }\n\n System.out.println( \"====================================\" );\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"WIN\\n\" );\n\n\n\n System.out.println( \"Preparing to spin until...jackpot! . . .\" );\n System.out.println( \"------------------------------------\" );\n\n\n //if you haven't won, spin again until you win!\n int x = 0;\n while( machine01.jackpot() == false ) {\n\t System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n\t System.out.println( \"LOSE\\n\" );\n\t machine01.spinOnce();\n\t x += 1;\n }\n \n System.out.println( \"====================================\" );\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"JACKPOT!\\n\" );\n System.out.println(\"Number of tries: \" + x);\n \n }",
"public void xboxIntakeOuttake()\n {\n //Whether or not we are intaking from the bottom or front. If from front, value is negative.\n double intakeDirection = 1.0;\n if (RobotMap.assistantDriverController.getBumper(Hand.kRight))\n intakeDirection = -1.0;\n\n //Spins the motors when the button is pressed. THIS IS ONLY RUN ONCE UNTIL THE BUTTON IS RELEASED AND PRESSED AGAIN\n if (RobotMap.assistantDriverController.getXButtonPressed())\n {\n spinIntake( RobotMap.manipulatorSpeedModifier * intakeDirection); //Spin the intake\n RobotMap.ballInIntake = !RobotMap.ballInIntake;\n }\n //Only stop the motors when the button is released\n else if (RobotMap.assistantDriverController.getXButtonReleased())\n {\n spinIntake(RobotMap.MOTOR_FULL_STOP); //Stop the intake from spinning\n RobotMap.manipulatorSpeedModifier = RobotMap.MANIPULATOR_SLOW_SPEED;\n }\n else if (!RobotMap.ballIntakeStopSwitch.get() && RobotMap.ballInIntake)\n {\n System.out.println(\"stop\");\n spinIntake(RobotMap.MOTOR_FULL_STOP); //Stop the intake from spinning when the ball is inside\n RobotMap.manipulatorSpeedModifier = RobotMap.MOTOR_FULL_SPEED;\n }\n }",
"public void gearBoxTest(){\n\t\tif (counter < 6) {\n\t\t\ttimerTest.start();\n\t\t\tif (480 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(1);\n\t\t\t\tmotorRF.set(1);\n\t\t\t\tmotorLB.set(1);\n\t\t\t\tmotorLF.set(1);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 480 && 600 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(0);\n\t\t\t\tmotorRF.set(0);\n\t\t\t\tmotorLB.set(0);\n\t\t\t\tmotorLF.set(0);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 600) {\n\t\t\t\ttimerTest.reset();\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t}",
"public void faceUp(){\r\n changePlace(hand);\r\n //do a magical work\r\n changePlace(graveYard);\r\n }",
"void pickUp();",
"public void rumbleInYourPants() {\n double accel_z = RobotMap.helmsman.getAcceleromoterZ();\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\n }",
"private void SpinActionPerformed(ActionEvent evt) {\n\t\t//player has to bet before spinning the reels\n\t\tif (obj.getBet() > 0) {\n\t\t\tisSpining = true;\n\t\t\tnew SlotMachineController().startSpining();\n\t\t} else {\n\t\t\tJOptionPane.showMessageDialog(null, \"You should bet first.\");\n\t\t}\n\t}",
"public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }",
"@Override\n public void kickBox() {\n\n System.out.println(\"kangaroo with name \"+name+\" is boxing\");\n }",
"public void implement(){\n this.rb.moveForward(1);\n \n \n if(this.rb.canPickThing()){\n this.rb.pickThing();\n }\n\n //turn the rb 90 degree to the south\n this.rb.turnLeft();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the east\n this.rb.turnRight();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the north\n this.rb.turnLeft();\n\n //move the navigator\n this.rb.moveForward(2);\n\n //turn Right the robot\n this.rb.turnRight();\n\n //stop at the starting position per move()\n this.rb.moveForward(1); \n \n this.rb.putThing();\n \n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n \n //turn the navigator 90 degree to the west\n this.rb.turnRight();\n \n this.rb.moveForward(1);\n \n this.rb.turnLeft();\n \n this.rb.moveForward(1);\n \n this.rb.turnRight();\n \n this.rb.moveForward(2);\n \n this.rb.turnLeft();\n }",
"private void placeKitOnInspection(MyKit mk)\n\t{\n\t\tmyStand.setSlotThreeTaken();\n\t\tif(guiEnable){\n\t\t\tthis.kitRobotGUI.DoMoveKitToCameraInspection(mk.kit.guikit, mk.kit.position);\n\t\t\tprint(\"Moving Kit to Inspection Slot\");\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Camera Inspection. Finished moving. Telling Agent.\");\n\n\n\t\tmyStand.setSlotAvilable(mk.slot);\n\t\tmk.kit.position = KitPosition.POSITION3;\n\t\tprint(\"Kit Slot number : \"+mk.slot+\" is Available but slot 3 is taken\");\n\t\tmk.status = KitStatus.On_CameraInspection;\n\t\tkitCamera.msgInspectKit(mk.kit);\n\t\tstateChanged();\n\t}",
"public abstract void recolocarHitbox();",
"public Box pickUp() {\n //System.out.println(\"Nincs mit felvenni.\");\n return null;\n }",
"private void rouletteSelection() {\n parentChromosomes = new Chromosome[2];\n parentIndices = new int[2];\n Arrays.fill(parentChromosomes, null);\n parentIndices[0] = getFittestChromosomeIndex();\n parentChromosomes[0] = chromosomes[parentIndices[0]];\n parentIndices[1] = getFittestChromosomeIndex();\n parentChromosomes[1] = chromosomes[parentIndices[1]];\n System.out.println(\"Individuals selected from Roulette Wheel for crossover: \\n\" +\n Arrays.toString(parentChromosomes[0].getGenes()) + \"\\n\" +\n Arrays.toString(parentChromosomes[1].getGenes()));\n }",
"@Override\n public void mousePressed(MouseEvent e) {\n if (game.getSelected() != null && game.getLast5Built().contains(game.getSelected())){\n for (Gem gem: game.getLast5Built()) {\n if (!gem.equals(game.getSelected())){\n Rock rock = new Rock(gem.getxPos(), gem.getyPos());\n game.getRocks().add(rock);\n grid.addRock(rock);\n }\n else {\n game.getTowers().add(gem);\n grid.addTower(gem);\n }\n }\n game.getLast5Built().clear();\n }\n game.setIsWaveOver(false);\n }",
"public void askSpawn() throws RemoteException{\n respawnPopUp = new RespawnPopUp();\n respawnPopUp.setSenderRemoteController(senderRemoteController);\n respawnPopUp.setMatch(match);\n\n Platform.runLater(\n ()-> {\n try{\n respawnPopUp.start(new Stage());\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }\n );\n }",
"@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }",
"public int pickUpBall() {\n\t\tif (ballPickupStage == 1) {\r\n\t\t\tif (!robot.chassis.arms.moveArmsDown()) {\r\n\t\t\t\trobot.chassis.arms.moveRollers(1);\r\n\t\t\t} else {\r\n\t\t\t\tballPickupStage = 2;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (ballPickupStage == 2) {\r\n\t\t\tif (!robot.chassis.arms.moveArmsUp()) {\r\n\t\t\t\trobot.chassis.arms.moveRollers(1);\r\n\t\t\t} else {\r\n\t\t\t\tballPickupStage = 1;\r\n\t\t\t\tif (robot.chassis.arms.isBallInPlace()) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"private void crossPressed() {\n\t\tif (!talkmode) {\n\t\t\tif (checkLoot() || checkNearbyVillagers() || checkDoors(doors, player.direction) || checkSigns()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tif (question) {\n\t\t\t\texitQuestionDialog();\n\t\t\t}\n\n\t\t\tLoot g = dialog.getGift();\n\t\t\tif (g != null) {\n\t\t\t\tLoad.collectLoot(g);\n\t\t\t}\n\t\t\tString takeName = dialog.getTakeName();\n\t\t\tif (takeName != null) {\n\t\t\t\tint takeAmount = dialog.getTakeAmount();\n\t\t\t\tif (takeName.equals(\"gold\")) {\n\t\t\t\t\tLoad.getPartyItems().addGold(-takeAmount);\n\t\t\t\t} else {\n\t\t\t\t\tLoad.getPartyItems().take(takeName, takeAmount);\n\t\t\t\t}\n\t\t\t}\n\t\t\tHashMap<String, Integer> t = dialog.getBeforeTriggers();\n\t\t\tHashMap<String, Integer> triggerAdds = dialog.getTriggerAdds();\n\t\t\tboolean finished = dialog.isFinished();\n\t\t\tdoTriggers(t);\n\t\t\tif (triggerAdds != null) {\n\t\t\t\tDatabase.incrementStatus(triggerAdds);\n\t\t\t}\n\t\t\tif (finished) {\n\t\t\t\tsetTalking(false);\n\t\t\t\tif (dialog.shouldTrigger()) {\n\t\t\t\t\tt = dialog.getTriggers();\n\t\t\t\t\tdoTriggers(t);\n\t\t\t\t\texecuteTrigger(talkingVillager);\n\t\t\t\t} else {\n\t\t\t\t\tdialog.resetDialog();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (dialog.isQuestion()) {\n\t\t\t\t\tinitQuestionDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic SurpriseBox createSurpriseBox(int weight)\r\n\t{\r\n\t\treturn new SurpriseBox(weight);\r\n\t}",
"@Override\r\n\tpublic void pick() {\r\n\t\tSystem.out.println(\"Stay away from Jessica ya dweeb.\");\r\n\t\r\n\t}",
"public void levelUp() {\n\t\t\tpauseGame(500);//pause the game, play a nice song, and make more bricks!\n\t\t\tmakeBricks(12,8);\n\t\t\tlevelUp.play();\n\t\t}",
"public BallPickUp(){\n //pickUpCompressor.start();\n //pickUpCompressor.setClosedLoopControl(true);\n //climbLockLeftSolenoid(true);\n //climbLockRightSolenoid(true);\n\n // testing voltage compensation mode -- hopefully will not brown out \n // ballPickUpTalon.configVoltageCompSaturation(12); // \"full output\" will now scale to 11 Volts for all control modes when enabled.\n // ballPickUpTalon.enableVoltageCompensation(true); // turn on/off feature\n pickUpArmTalon.configFactoryDefault();\n pickUpArmTalon.setNeutralMode(NeutralMode.Brake);\n //configure sensor source for primary PID\n //colorWheelTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.kPIDLoopIDx, RobotMap.kTimeoutMs);\n pickUpArmTalon.configSelectedFeedbackSensor(FeedbackDevice.IntegratedSensor, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n //set deadband to super small 0.001 (.1%)\n pickUpArmTalon.configNeutralDeadband(0.001, RobotMap.pickUpArmTimeoutMs);\n /* configure Talson SRX utput and sensor direction occordingly invert motor to\n *have green LEDs when driving Talon Forward / requesting positive utput phase sensor\n *to have positive increment when driving Talon Forward (Green LED) */\n pickUpArmTalon.setSensorPhase(false);\n //making this true or false does the same thing\n pickUpArmTalon.setInverted(true);\n /* set relevant frame periods to be at least as fast as periodic rate */\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10, RobotMap.pickUpArmTimeoutMs);\n /* set the peak and nominal outputs */\n pickUpArmTalon.configNominalOutputForward(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configNominalOutputReverse(0, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputForward(1, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configPeakOutputReverse(-1, RobotMap.pickUpArmTimeoutMs);\n /* set the Motion Magic gains in slot0 - see documentation */\n pickUpArmTalon.config_kF(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kF, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kP(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kP, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kI(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kI, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.config_kD(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmGains.kD, RobotMap.pickUpArmTimeoutMs);\n \n pickUpArmTalon.selectProfileSlot(RobotMap.kPickUpArmSlotIDx, RobotMap.pickUpArmPIDLoopIDx);\n /* set acceleration and vcruise velocity - see documentation */\n //numbers should be experimentally derived once we have the color wheel system in place\n pickUpArmTalon.configMotionCruiseVelocity(RobotMap.pickUpArmCruiseVelocity, RobotMap.pickUpArmTimeoutMs);\n pickUpArmTalon.configMotionAcceleration(RobotMap.pickUpArmAcceleration, RobotMap.pickUpArmTimeoutMs);\n /* zero the sensor once on robot boot up*/\n pickUpArmTalon.setSelectedSensorPosition(0, RobotMap.pickUpArmPIDLoopIDx, RobotMap.pickUpArmTimeoutMs);\n}",
"@SuppressWarnings(\"unused\")\r\n private void snakeSubcutaneousVOI() {\r\n \r\n // set the subcutaneous VOI as active\r\n subcutaneousVOI.setActive(true);\r\n subcutaneousVOI.getCurves().elementAt(0).setActive(true);\r\n \r\n float[] sigmas = new float[2];\r\n sigmas[0] = 1.0f;\r\n sigmas[1] = 1.0f;\r\n \r\n AlgorithmSnake snake = new AlgorithmSnake(srcImage, sigmas, 50, 2, subcutaneousVOI, AlgorithmSnake.OUT_DIR);\r\n snake.run();\r\n\r\n subcutaneousVOI = snake.getResultVOI();\r\n subcutaneousVOI.setName(\"Subcutaneous area\");\r\n \r\n }",
"private void buildWaitScene(){\n\t\t//Nothing to do\n\t}",
"boolean addEasyVictory();",
"public void interactWhenSteppingOn() {\r\n\t\t\r\n\t}",
"public void triggerPickedUp(boolean b);",
"public static void pickUp(double speed)\n\t{\n\t\trunIntake(0, 0, true, -speed, -speed, false);\n\t}",
"private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"@Override\r\n\tpublic void onBoxPickedUp(Box box, MapElement mapElement) {\r\n\t\tControllerEventSource.notifyBoxPickedUp(box, mapElement);\r\n\t}",
"@Override\n public void run() {\n ElapsedTime time = new ElapsedTime();\n time.reset();\n sleep(3000);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n //sh.pivotStop.setPosition(.55);\n sh.hitRing();\n sleep(500);\n //sh.pivotDown();\n sh.hitRing();\n sleep(500);\n sh.withdraw();\n sh.lift.setPower(0);\n sh.lift.setPower(0);\n wobble.wobbleUp();\n sh.pivotStop.setPosition(1);\n loop.end();\n\n\n }",
"public void grab() {\n\t\tif (climbMode == false) {\n\t\t\tif (bumperL) {\n\t\t\t\tmotorGL.set(-1);\n\t\t\t\tmotorGR.set(1);\n\t\t\t} \n\t\t\telse if (bumperR) {\n\t\t\t\tmotorGL.set(1);\n\t\t\t\tmotorGR.set(-1);\n\t\t\t}\t\n\t\t\telse {\n\t\t\t\tmotorGL.set(0);\n\t\t\t\tmotorGR.set(0);\n\t\t\t}\n\t\t}\n\t}",
"@Test\r\n\tpublic void testButtonPressedPopRackDisabled() {\r\n\t\tCoin coin = new Coin(200);\r\n\t\ttry {\r\n\t\t\tvend.getPopCanRack(0).disable();\r\n\t\t\tvend.getCoinSlot().addCoin(coin);\r\n\t\t\tvend.getSelectionButton(0).press();\t\r\n\t\t\tassertTrue((vend.getPopCanRack(0).isDisabled()) && (vend.getDeliveryChute().removeItems().length==0));\r\n\t\t} catch (DisabledException e) {\r\n\t\t\tassertTrue(false);\r\n\t\t}\r\n\t}",
"@Then(\"^select camera batteries$\")\r\n\tpublic void select_camera_batteries() throws Throwable {\n\t\tverbose(\"***********************************************************\");\r\n\t\tAssert.assertTrue(navigate_rsc.camerabatteries());\r\n\t\tverbose(\"***********************************************************\");\r\n\t \r\n\t}",
"public void pressNewGame() {\n }",
"private void action() {\r\n moveSnake();\r\n if (hasEatenPowerUp() == false) checkForCollisionWithSelf();\r\n if (hasHitBoundry() == false) redraw();\r\n }",
"public void survivorEscapeHunterPickup(DPlayer survivor, boolean atWill){\n survivor.getPlayerState().setCarried(false);\n if (atWill){\n survivorHitToInjured(survivor);\n\n }else{\n survivorHitToCrawling(survivor);\n }\n }",
"public void takeCup() {\n updateMessageToUser();\n BufferedImage emptyPicture = null;\n try {\n emptyPicture = ImageIO.read(new File(\"./picts/vide2.jpg\"));\n } catch (IOException ee) {\n ee.printStackTrace();\n }\n currentPicture.setIcon(new ImageIcon(emptyPicture));\n if (currentWaterVolume > 1) {\n currentWaterVolume = 0;\n theFSM.raiseCupGrabbed();\n } else {\n addCupButton.setVisible(true);\n }\n takeCupButton.setVisible(false);\n theFSM.setCupPlaced(false);\n System.out.println(\"Cup taken\");\n }",
"public static void main(String[] args) {\n\t\t\n\t//2. create an array of 5 robots.\n\tRobot[] robs = new Robot[5];\n\t//3. use a for loop to initialize the robots.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\t\trobs[i] = new Robot();\n\t\t\trobs[i].setX(100 * i + 100);\n\t\t\trobs[i].setY(500);\n\t\t\trobs[i].setSpeed(10);\n\t}\n\t\t//4. make each robot start at the bottom of the screen, side by side, facing up\n\t\t\n\t//5. use another for loop to iterate through the array and make each robot move \n\t// a random amount less than 50.\n\tfor (int i = 0; i < robs.length; i++) {\n\t\tRandom rnd = new Random();\n\t\trobs[i].move(rnd.nextInt(50)+1);\n\t}\n\t//6. use a while loop to repeat step 5 until a robot has reached the top of the screen.\n\tboolean notwon = true;\n\tint winner = -250;\n\twhile(notwon) {\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tRandom rnd = new Random();\n\t\t\trobs[i].move(rnd.nextInt(50)+1);\n\t\t}\n\t\tfor (int i = 0; i < robs.length; i++) {\n\t\t\tif (notwon && winner == -250 && robs[i].getY() <= 72) {\n\t\t\t\twinner = i;\n\t\t\t\tnotwon = false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\trobs[winner].sparkle();\n\t//7. declare that robot the winner and throw it a party!\n\t\n\t//8. try different races with different amounts of robots.\n\n\t//9. make the robots race around a circular track.\n}",
"@Override\n public void onPutCupRaised() {\n if (!theFSM.getCupPlaced()) {\n BufferedImage myPicture = null;\n try {\n myPicture = ImageIO.read(new File(\"./picts/gobeletPolluant.jpg\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n currentPicture.setIcon(new ImageIcon(myPicture));\n takeCupButton.setVisible(false);\n }\n }",
"public void pickUpOrPutDownBox(PlayerType playerType) {\r\n\t\tPlayer player = players.get(playerType);\r\n\r\n\t\tif (player == null) {\r\n\t\t\tGameLogger.logError(\"Trying to pick up a box with a player that does not exist\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (player.getBox() == null) {\r\n\t\t\tplayer.pickUpBox();\r\n\r\n\t\t\t// If the player did not pick up a box, return\r\n\t\t\tif (player.getBox() == null)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t// Check if the players are still alive\r\n\t\t\tfor (Player p : players.values()) {\r\n\t\t\t\tif (p != null && !p.isAlive()) {\r\n\t\t\t\t\t// Send notification that a player has been killed\r\n\t\t\t\t\tControllerEventSource.notifyMovableDestroyed(p);\r\n\r\n\t\t\t\t\tgame.stop(false);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tplayer.putDownBox();\r\n\t\t}\r\n\r\n\t\t// Send notification to the listeners\r\n\t\tControllerEventSource.notifyMovableChanged(player);\r\n\t}",
"public void setNewGame() throws InterruptedException, InterceptionException {\n\t\tgameLoaded = false;\n\t\t\n\t\trobot.delay(3000);\n\t\tcheckUserIntervention();\n\t\t\n\t\t// close Chrome:\n\t\tclickPicture(Pictures.chromeClose);\n\t\t\n\t\tThread.sleep(60000); // 1 mins\n\t\t\n\t\tcheckUserIntervention();\n\t\trobot.mouseMove(0, 0);\n\t\trobot.mouseMove(110, 100);\n\t\trobot.mouseMove(0, 0);\n\t\tlastCoords = MouseInfo.getPointerInfo().getLocation();\n\t\trobot.delay(1000);\n\t\tcheckUserIntervention();\n\n\t}",
"public void grabStone() {\n }",
"@Test\n\tpublic void test4_verifyImage_VRI() throws GeneralLeanFtException {\n\t\t\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI Started\");\n\t\t\t\n\t\t\t//App should exist \n\t\t\tassertTrue(mySet.appExistsorNot());\t\t\n\t\t\tWindow mainWindow = Desktop.describe(Window.class, new WindowDescription.Builder()\n\t\t\t.title(\"SwingSet2\").index(0).build());\n\n\t\t\t// Create a description for the top-level menu item: File\n\t\t\tMenu fileMenu = mainWindow.describe(Menu.class, new MenuDescription.Builder().label(\"File\").build());\n\n\t\t\t//Select About Menu option\n\t\t\tfileMenu.selectSubMenu(\"About\");\n\t\t\t\n\t\t\tDialog about = mainWindow.describe(Dialog.class, new DialogDescription.Builder()\n\t\t\t.title(\"About Swing!\").build());\n\t\t\t\n\t\t\t//Access the Swing Image in the Resources folder\n\t\t\t//ClassLoader classLoader = getClass().getClassLoader();\n\t\t\t//File imgFile = new File(classLoader.getResource(\"SwingImage.PNG\").getFile());\n\t\t\tFile imgFile = new File(\"resources\\\\SwingImage.PNG\");\n\t RenderedImage image = ImageIO.read(imgFile);\n\t \n\t //Create Insight Object with 100% similarity\n\t InsightObject swingImage = about.describe(InsightObject.class, new InsightDescription(image,90));\n\t \n\t //Highlight the Object if present\n\t assertTrue(swingImage.exists(5));\n\t swingImage.highlight();\n\t \n\t //Close the Dialog\n\t about.close();\n\t \n\t ToolBar toolbar = mainWindow.describe(ToolBar.class, new ToolBarDescription.Builder()\n\t\t\t.nativeClass(\"SwingSet2$ToggleButtonToolBar\").build());\n\t \n\t toolbar.getButton(\"JDesktop\").press();\n\t \n\t\t\t\n\t //Maximizable checkbox in the Internal Frame\n\t CheckBox maximizable = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").index(0).build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.attachedText(\"Maximizable\").build());\n\t \n\t //Create Visual Relation Object and Set the Relation with the Test Object\n\t VisualRelation vr = new VisualRelation();\n\t vr.setTestObject(maximizable);\n\t vr.setVerticalRelation(VerticalVisualRelation.BELOW_AND_INLINE);\n\t \n\t //Create Description for Checkbox which is above the Maximizable checkbox\n\t CheckBox above = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.label(\"Internal Frame Generator\").build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JCheckBox\").vri(vr).build());\n\t \n\t //Check for Existence\n\t assertTrue(\"Checkbox above Maximizable should exist\",above.exists(5));\t \n\t above.highlight();\n\t \n\t //Get name of the Checkbox\n\t System.out.println(\"Name of the Checkbox above Maximizable CheckBox = \" + above.getAttachedText());\n\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage());\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI finished\");\n\t\t}\n\t\t\n\t}",
"private void jRadioButtonShootUntilWaterActionPerformed() {\r\n\t\tjRadioButtonShootAlternatively.setSelected(false);\r\n\t\tjRadioButtonShootUntilWater.setSelected(true);\r\n\t\tgame.setGameMode(GameMode.UNTILWATER);\r\n\t}",
"public void toggleSelected(){\n if(!selected) {\n this.graphicsGroup.toFront();\n// System.out.println(\"selecting\");\n transparentBoxImages = new Image[(int)this.getWidth()/32][(int) this.getHeight()/32];\n //add the box to the proper position for each row this world addition covers\n for(int x = 0; x< this.getWidth() / game.BLOCK_SIZE; x++){\n for(int y = 0; y<this.getHeight()/game.BLOCK_SIZE;y++){\n Image nextImage = new Image(new TextureRegion(game.atlas.findRegion(\"GreenTransparent\")));\n nextImage.setSize(game.BLOCK_SIZE, game.BLOCK_SIZE);\n nextImage.setPosition(this.getX() + (x * game.BLOCK_SIZE), this.getY() + (y * game.BLOCK_SIZE));\n\n graphicsGroup.addActorBefore(this, nextImage);\n transparentBoxImages[x][y]= nextImage;\n\n }\n }\n\n //pick the item up\n this.setY(this.getY() + 10);\n selected = true;\n }\n else{\n\n //put the item back down\n this.setY(this.getY() - 10);\n\n for(int x = 0; x< this.getWidth() / game.BLOCK_SIZE; x++){\n for(int y = 0; y<this.getHeight()/game.BLOCK_SIZE;y++){\n graphicsGroup.removeActor(transparentBoxImages[x][y]);\n\n }\n }\n\n\n selected = false;\n\n //if we can't place it there, then we will just run everything again\n if(!game.placeable){\n Timer.schedule(new Timer.Task(){\n @Override\n public void run() {\n game.selectEnemy(worldAddition);\n }\n }, 0.1f);\n }\n\n\n }\n }",
"void unsetBox();",
"public void\nrayPickBoundingBox(SoRayPickAction action, final SbBox3f bbox)\n//\n////////////////////////////////////////////////////////////////////////\n{\n // Save the state so we don't affect the real complexity\n action.getState().push();\n\n // Change the complexity\n SoComplexityElement.set(action.getState(), 0.0f);\n SoComplexityTypeElement.set(action.getState(),\n SoComplexityTypeElement.Type.OBJECT_SPACE);\n\n // Change the current matrix to scale and translate the cube to the\n // correct spot. (We can't just use an extra matrix passed to\n // computeObjectSpaceRay(), since the points generated by\n // generatePrimitives() have to be transformed, not just the ray.)\n final SbVec3fSingle size = new SbVec3fSingle();\n bbox.getSize(size);\n\n // If any of the dimensions is 0, beef it up a little bit to avoid\n // scaling by 0\n if (size.getValueRead()[0] == 0.0)\n size.getValue()[0] = 0.00001f;\n if (size.getValueRead()[1] == 0.0)\n size.getValue()[1] = 0.00001f;\n if (size.getValueRead()[2] == 0.0)\n size.getValue()[2] = 0.00001f;\n\n SoModelMatrixElement.translateBy(action.getState(), this,\n bbox.getCenter());\n SoModelMatrixElement.scaleBy(action.getState(), this,\n size.operator_mul(0.5f));\n\n // Compute the picking ray in the space of the shape\n computeObjectSpaceRay(action);\n\n // Pick using primitive generation. Make sure we know that we are\n // picking on just a bounding box of another shape, so details\n // won't be created.\n pickingBoundingBox = true;\n generatePrimitives(action);\n\n // Restore the state\n action.getState().pop();\n}",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"private void turnAround() {\n d = Math.random();\n if (d < 0.1) {\n changeAppearance();\n }\n }",
"public static void main(String[] args) {\n\t\t Robot Damian = new Robot();\n\t\t//3. Ask the user what color they would like the robot to draw\n\t\tString color = JOptionPane.showInputDialog(null, \"What color should my robot draw? Red, Blue, or Green\");\n\t\t//5. Use an if/else statement to set the pen color that the user requested\n\t\n\n //6. If the user doesn’t enter anything, choose a random color\nif (color == \" \") {\n\tDamian.setPenColor(255, 255, 0);\n}\n //7. Put a loop around your code so that you keep asking the user for more colors & drawing them\n\t\t\n\t\t//4. Set the pen width to 10\n\t\tDamian.setPenWidth(10);\n\t //2. Make the robot draw a shape (this will take more than one line of code)------------------\n\t\tif (color.equalsIgnoreCase(\"red\")) {\n\t\t\tDamian.setPenColor(255, 0, 0);\n\t\t}\n\t\tif (color.equalsIgnoreCase(\"green\")) {\n\t\t\tDamian.setPenColor(0, 255, 0);\n\t\t}\n\t\tif (color.equalsIgnoreCase(\"blue\")) {\n\t\t\tDamian.setPenColor(0, 0, 255);\n\t\t}\n\tDamian.setSpeed(100);\n\tDamian.penDown();\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\t\n\t}",
"@Test\n public void BackstagePass_HandleSpecialCase() {\n GildedRose sut = new GildedRose(createItemArray(BACKSTAGE_PASS, 5, 40));\n sut.updateQuality();\n assertEquals(42, sut.items[0].quality);\n }",
"@Override\n public boolean gainBerryEffect(Battle b, ActivePokemon user, CastSource source) {\n List<Stat> stats = user.getStages().getNonMaxStats();\n\n // You probably don't need the berry at this point anyhow...\n if (stats.isEmpty()) {\n return false;\n }\n\n // Sharply raise random battle stat\n Stat stat = RandomUtils.getRandomValue(stats);\n return new StageModifier(2*ripen(user), stat).modify(b, user, user, source);\n }",
"public void confirmLightning() {\n selectedLightning = true;\n }",
"public void round(){\n if (player2.getName().equals(\"Computer\")) {\n battle(JOptionPane.showInputDialog(\"Player 1 enter: paper; rock; or scissors\"),\n new Computer().choice());\n } else {\n battle(JOptionPane.showInputDialog(\"Player 1 enter: paper; rock; or scissors\"),\n JOptionPane.showInputDialog(\"Player 2 enter: paper; rock; or scissors\"));\n }\n }",
"public void changeGuesses (int k, int p){\n for (int i = 0; i<9; i++){\n if(bSquares.get(i).checkhasFocus()){//finds out which square user is playing in. \"i\" is that square //but all the squares have focus in begginning?\n System.out.println(i + \" has focus\");\n for (int j = 0; j<9; j++){\n if (!bSquares.get(i).getSmallSquare(j).isCommitted()&&bSquares.get(i).getSmallSquare(j).getOwnership()>0){\n bSquares.get(i).getSmallSquare(j).setOwnership(0);//j is square that the user guessed last time.\n madeChoice = false; //since we just took away the user's last guess, then there is no choice made.\n //unless the next guess is valid.\n }\n }\n if(bSquares.get(k).getSmallSquare(p).getOwnership()==0&&!bSquares.get(k).getSmallSquare(p).isCommitted()){\n bSquares.get(k).getSmallSquare(p).setOwnership(2);\n madeChoice = true;//this guess is valid, so the user \"made a choice\" and the ENTER button can now be pushed.\n }\n }\n }\n \n }",
"void toyPlacingfStuff(){\n //nu stiu daca asta ramane\n gettingBackToInitial();\n nearingTheWallBefore();\n parallelToTheWall();\n actualToyPlacing();\n }",
"void unsetPowerBox();",
"public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}",
"public void makeScoringOptions() {\n ScoringOptionsGUI scoringOptionsGUI = new ScoringOptionsGUI(player);\n scoringOptionsGUI.setTitle(\"Yahtzee!\");\n scoringOptionsGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n scoringOptionsGUI.setSize(new Dimension(900, 750));\n scoringOptionsGUI.setVisible(true);\n dispose();\n }",
"private void remindGoal()\n {\n System.out.println(\"you have to Pick up all three items and get back outside!\");\n }",
"public static void main(String[] args) {\r\n\tOlympicRings_Threaded ort = new OlympicRings_Threaded();\r\n\tort.setup();\r\n//\tRobot rob = new Robot(600,500);\r\n//\trob.hide();\r\n//\trob.setPenColor(Color.BLUE);\r\n//\tRobot rob1 = new Robot(700, 500);\r\n//\trob1.hide();\r\n//\trob1.setPenColor(Color.BLACK);\r\n//\tRobot rob2 = new Robot(800, 500);\r\n//\trob2.hide();\r\n//\trob2.setPenColor(Color.RED);\r\n//\tRobot rob3 = new Robot(650, 550);\r\n//\trob3.hide();\r\n//\trob3.setPenColor(Color.YELLOW);\r\n//\tRobot rob4 = new Robot(750,550);\r\n//\trob4.hide();\r\n//\trob4.setPenColor(Color.GREEN);\r\n//\trob.setSpeed(1000000);\r\n//\trob1.setSpeed(1000000);\r\n//\trob2.setSpeed(1000000);\r\n//\trob3.setSpeed(1000000);\r\n//\trob4.setSpeed(1000000);\r\n//\t\r\n//\t\r\n//\trob.penDown();\r\n//\trob1.penDown();\r\n//\trob2.penDown();\r\n//\trob3.penDown();\r\n//\trob4.penDown();\r\n//\t\r\n//\t\r\n//\tfor (int i = 0; i < 360; i++) {\r\n//\trob.move(1);\r\n//\trob.turn(1);\r\n//\t\t\r\n//\trob1.move(1);\r\n//\trob1.turn(1);\r\n//\t\r\n//\trob2.move(1);\r\n//\trob2.turn(1);\r\n//\t\r\n//\trob3.move(1);\r\n//\trob3.turn(1);\r\n//\t\r\n//\trob4.move(1);\r\n//\trob4.turn(1);\r\n//\t\r\n//\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n//\trob1.move(400);\r\n//\trob1.turn(90);\r\n//\trob1.move(400);\r\n//\trob2.move(400);\r\n//\trob2.turn(90);\r\n//\trob2.move(400);\r\n//\trob3.move(400);\r\n//\trob3.turn(90);\r\n//\trob3.move(400);\r\n//\trob4.move(400);\r\n//\trob4.turn(90);\r\n//\trob4.move(400);\r\n//\t\r\n//\trob1.moveTo(150, 700);\r\n//\trob2.moveTo(550, 700);\r\n//\trob3.moveTo(950, 700);\r\n//\trob4.moveTo(1350, 700);\r\n//\t\r\n//\t\r\n//\t\r\n//\t\r\n//\t\r\n//Thread r1 = new Thread(()->rob1.move(400));\r\n//\tThread r2 = new Thread(()->rob2.move(400));\r\n//\tThread r3 = new Thread(()->rob3.move(400));\r\n//\tThread r4 = new Thread(()->rob4.move(400));\r\n//\t\r\n//\tr1.start();\r\n//\tr2.start();\r\n//\tr3.start();\r\n//\tr4.start();\r\n\r\n}",
"public void grab();",
"public void fruitRegrow()\n {\n fruit.makeInvisible();\n fruit.moveVertical(-60);\n fruit.makeVisible();\n }",
"private void pickObject(UsableActor actor) {\n \n System.out.println(\"USABLEACTORCONTAINER.Picking object\");\n //Reset the object that the actor currently is using\n UsableActor currentObject = actor.getOwner().getCurrentObject();\n if (currentObject != null){\n currentObject.resetPosition();\n if (currentObject instanceof Cookie){\n this.cookies.add((Cookie) currentObject);\n }\n else if (currentObject instanceof Whistle){\n this.whistles.add((Whistle) currentObject);\n }\n }\n \n //Give the given actor to the owner\n actor.resetPosition();\n actor.getOwner().selectObject(actor);\n if (actor.getOwner() instanceof MousePlayer){\n ((MousePlayer) actor.getOwner()).setIsDraggingObject(true);\n }\n \n //Remove the object from the usable actor container\n removeObjectFromContainer(actor);\n }",
"@Test\n public void spawnPowerUpSelectedEventTest() {\n try {\n PowerUpsDeck powerUpsDeck = new PowerUpsDeck();\n PowerUpCardClient toKeep = new PowerUpCardClient(powerUpsDeck.drawCard());\n PowerUpCardClient spawnCard = new PowerUpCardClient(powerUpsDeck.drawCard());\n SpawnPowerUpSelectedEvent spawnPu = new SpawnPowerUpSelectedEvent(3, \"graz\", toKeep, spawnCard, true);\n try {\n turnController.handleEvent(spawnPu);\n } catch(HandlerNotImplementedException e) {\n e.printStackTrace();\n }\n } catch(URISyntaxException e) {\n e.printStackTrace();\n fail();\n }\n }",
"public abstract void pickUp();",
"public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}",
"public void shape() {\n\t\tSystem.out.println(\"super robot입니다. 팔, 다리, 몸통, 머리가 있습니다.\");\r\n\t}",
"private void makeSnack() {\n\t\teating = true;\n\t\ttama.setLayoutX(200);\n\t\t\n\t\tsnack = new Sprite(3, 3, 22, 25, new Image(\"file:./res/images/snack.png\"), 1, 1000);\n\t\tsnack.setLayoutX(150);\n\t\tsnack.setLayoutY(150);\n\t\tsnack.setScaleX(0.3);\n\t\tsnack.setScaleY(0.3);\n\t\tgrid.getChildren().addAll(snack);\n\t\tPauseTransition pause = new PauseTransition(Duration.millis(1500));\n\t\tpause.setOnFinished(e -> {\n\t\t\tgrid.getChildren().remove(snack);\n\t\t\ttama.setLayoutX(190);\n\t\t\teating = false;\n\t\t\tmodel.getController().eatSnack();\n//\t\t\tif(!model.isHealthy()){\n//\t\t\t\tsetSickImg();\n//\t\t\t}\n\t\t});\n\t\tpause.play();\n\t\t\n\t}",
"public void atrapar() {\n if( una == false) {\n\t\tif ((app.mouseX > 377 && app.mouseX < 591) && (app.mouseY > 336 && app.mouseY < 382)) {\n\t\t\tint aleotoridad = (int) app.random(0, 4);\n\n\t\t\tif (aleotoridad == 3) {\n\n\t\t\t\tSystem.out.print(\"Lo atrapaste\");\n\t\t\t\tcambioEnemigo = 3;\n\t\t\t\tsuerte = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\t\t\tif (aleotoridad == 1 || aleotoridad == 2 || aleotoridad == 0) {\n\n\t\t\t\tSystem.out.print(\"Mala Suerte\");\n\t\t\t\tcambioEnemigo = 4;\n\t\t\t\tmal = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\n\t\t}\n }\n\t}",
"@Then(\"^I choose the park on combobox$\")\n public void i_choose_the_park_on_combobox() {\n onViewWithId(R.id.spinnerParks).click();\n onViewWithText(\"Parque D\").isDisplayed();\n onViewWithText(\"Parque D\").click();\n }",
"public void set_box_conveyor(boolean b)\n\t\t{\n\t\tbox_conveyor = b;\n\t\t}",
"public void checkPrize()\n {\n for(PrizeMulti prize : prizes.getPrizes())\n {\n if(prize.isActive())\n {\n if (((locX - prize.getX()) * (locX - prize.getX()) + (locY - prize.getY()) * (locY - prize.getY())) <= 35 * 35) {\n if (prizeOwn == null)\n {\n status.setUsePrize(true);\n prize.deActive();\n prizeOwn = prize;\n if (prize.getType().equals(\"Health\")) {\n stamina += (stamina / 10);\n }\n if (prize.getType().equals(\"Power2\")) {\n canonPower *= 2;\n }\n if (prize.getType().equals(\"Power3\")) {\n canonPower *= 3;\n }\n if (prize.getType ().equals (\"Laser\")) {\n setBulletType (\"Laser\");\n }\n\n if (prize.getType ().equals (\"Protect\")) {\n setProtection (true);\n }\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Thread.sleep(10000);\n prizeOwn = null;\n if (prize.getType().equals(\"Power2\")) {\n canonPower /= 2;\n }\n if (prize.getType().equals(\"Power3\")) {\n canonPower /= 3;\n }\n if (prize.getType ().equals (\"Laser\")) {\n setBulletType (\"Normal\");\n }\n Thread.sleep (5000);\n if (prize.getType ().equals (\"Protect\")) {\n setProtection (false);\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }).start();\n }\n }\n }\n }\n }"
] | [
"0.71784484",
"0.6201923",
"0.6038483",
"0.5962026",
"0.5955142",
"0.59022766",
"0.58610594",
"0.58125323",
"0.57462525",
"0.57384807",
"0.57168263",
"0.5630888",
"0.5625025",
"0.55953777",
"0.5593662",
"0.5576668",
"0.55564636",
"0.553259",
"0.5531975",
"0.55021715",
"0.5477577",
"0.54761213",
"0.5469246",
"0.54687023",
"0.5457732",
"0.54574895",
"0.5441458",
"0.5436763",
"0.54235905",
"0.5415363",
"0.5398772",
"0.53894097",
"0.5388706",
"0.53743374",
"0.53724",
"0.5369674",
"0.5368411",
"0.53665996",
"0.5365982",
"0.5364585",
"0.5330219",
"0.5328952",
"0.5312055",
"0.5310679",
"0.53059113",
"0.52973723",
"0.528977",
"0.5282844",
"0.52717376",
"0.5248031",
"0.524535",
"0.5229674",
"0.522099",
"0.5218319",
"0.5214366",
"0.52139217",
"0.52046305",
"0.5201871",
"0.51991105",
"0.5197625",
"0.5194429",
"0.5190526",
"0.51779735",
"0.5175309",
"0.516245",
"0.5157007",
"0.5155614",
"0.5155599",
"0.51538897",
"0.5149278",
"0.5148375",
"0.51456606",
"0.5142558",
"0.5139915",
"0.51263666",
"0.51211333",
"0.51199466",
"0.51138705",
"0.5111887",
"0.5110035",
"0.5109213",
"0.51086754",
"0.5107805",
"0.51032716",
"0.5101573",
"0.5100954",
"0.50997335",
"0.50967705",
"0.5096242",
"0.509328",
"0.50843257",
"0.5079944",
"0.50755864",
"0.5072974",
"0.5072081",
"0.5071321",
"0.50687075",
"0.50673705",
"0.5063736",
"0.5063147"
] | 0.8148005 | 0 |
Make robot use surpriseBox (if possible). | @Override
public void useSurpriseBox(Robot robot, SurpriseBox surpriseBox)
{
try
{
if(robot.canUse(surpriseBox))
{
robot.use(surpriseBox);
}
else
{
System.out.println("This surprise box could not be used by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this surprise box is terminated; the robot cannot use the surprise box.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void pickUpSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot pick up the surprise box.\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void dropSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canDrop(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.drop(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be dropped by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot drop the surprise box.\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic SurpriseBox createSurpriseBox(int weight)\r\n\t{\r\n\t\treturn new SurpriseBox(weight);\r\n\t}",
"@Override\r\n\tpublic void putSurpriseBox(Board board, long x, long y, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tsurpriseBox.setPosition(new Position(x,y));\r\n\t\t\tsurpriseBox.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this surprise box or this board is terminated; the surprise box cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"void setBox();",
"public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }",
"@Test\n\tpublic void test4_verifyImage_VRI() throws GeneralLeanFtException {\n\t\t\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI Started\");\n\t\t\t\n\t\t\t//App should exist \n\t\t\tassertTrue(mySet.appExistsorNot());\t\t\n\t\t\tWindow mainWindow = Desktop.describe(Window.class, new WindowDescription.Builder()\n\t\t\t.title(\"SwingSet2\").index(0).build());\n\n\t\t\t// Create a description for the top-level menu item: File\n\t\t\tMenu fileMenu = mainWindow.describe(Menu.class, new MenuDescription.Builder().label(\"File\").build());\n\n\t\t\t//Select About Menu option\n\t\t\tfileMenu.selectSubMenu(\"About\");\n\t\t\t\n\t\t\tDialog about = mainWindow.describe(Dialog.class, new DialogDescription.Builder()\n\t\t\t.title(\"About Swing!\").build());\n\t\t\t\n\t\t\t//Access the Swing Image in the Resources folder\n\t\t\t//ClassLoader classLoader = getClass().getClassLoader();\n\t\t\t//File imgFile = new File(classLoader.getResource(\"SwingImage.PNG\").getFile());\n\t\t\tFile imgFile = new File(\"resources\\\\SwingImage.PNG\");\n\t RenderedImage image = ImageIO.read(imgFile);\n\t \n\t //Create Insight Object with 100% similarity\n\t InsightObject swingImage = about.describe(InsightObject.class, new InsightDescription(image,90));\n\t \n\t //Highlight the Object if present\n\t assertTrue(swingImage.exists(5));\n\t swingImage.highlight();\n\t \n\t //Close the Dialog\n\t about.close();\n\t \n\t ToolBar toolbar = mainWindow.describe(ToolBar.class, new ToolBarDescription.Builder()\n\t\t\t.nativeClass(\"SwingSet2$ToggleButtonToolBar\").build());\n\t \n\t toolbar.getButton(\"JDesktop\").press();\n\t \n\t\t\t\n\t //Maximizable checkbox in the Internal Frame\n\t CheckBox maximizable = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").index(0).build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.attachedText(\"Maximizable\").build());\n\t \n\t //Create Visual Relation Object and Set the Relation with the Test Object\n\t VisualRelation vr = new VisualRelation();\n\t vr.setTestObject(maximizable);\n\t vr.setVerticalRelation(VerticalVisualRelation.BELOW_AND_INLINE);\n\t \n\t //Create Description for Checkbox which is above the Maximizable checkbox\n\t CheckBox above = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.label(\"Internal Frame Generator\").build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JCheckBox\").vri(vr).build());\n\t \n\t //Check for Existence\n\t assertTrue(\"Checkbox above Maximizable should exist\",above.exists(5));\t \n\t above.highlight();\n\t \n\t //Get name of the Checkbox\n\t System.out.println(\"Name of the Checkbox above Maximizable CheckBox = \" + above.getAttachedText());\n\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage());\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI finished\");\n\t\t}\n\t\t\n\t}",
"public void addBox()\n {\n if(Student.sittingRia==false) {\n box = new BoxRia(\"chalkboard.png\",4,2);\n addObject(box,box.myRow,box.mySeat);\n chalk = new BoxRia(\"chalk.png\",0,0);\n addObject(chalk,2,3);\n }\n }",
"@Test /* US4080 - Dev not completed - Enable verifications of Lisa/Indication when it is done */\n\tpublic void TC1070_SurveyViewInSatelliteView_PicarroSupport() throws Exception {\n\t\tLog.info(\"\\nRunning TC1070_SurveyViewInSatelliteView_PicarroSupport ...\");\n\t\tgetLoginPageAction().open(EMPTY, NOTSET);\n\t\tgetLoginPageAction().login(EMPTY, USER_ROW_ID_PICARRO_SUPPORT); /* Picarro Support */\n\n\t\tfinal String analyzerId = Analyzer.getAnalyzerBySerialNumber(SIMAUTO_EQANALYZER_ETH1).getId().toString();\n\t\tfinal String surveyEQId = Survey.getSurveys(TEST_SURVEY_EQ_TAG).stream().filter(s -> s.getAnalyzerId().equals(analyzerId)).findFirst().orElse(null).getId();\n\n\t\tgetSurveyViewPageAction().open(surveyEQId, NOTSET);\n\t\tgetSurveyViewPageAction().verifyPageLoaded(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().clickOnZoomOutButton(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().clickOnDisplayButton(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().turnOnFOVs(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().turnOnEightHourHistory(EMPTY, NOTSET);\n\n\t\tassertTrue(getSurveyViewPageAction().verifyDisplaySwitchConcentrationChartButtonIsNotVisible(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifyDisplaySwitchIsotopicAnalysisButtonIsNotVisible(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifyDisplaySwitchWindroseButtonIsNotVisible(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifyDisplaySwitchIndicationsButtonIsVisible(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifyDisplaySwitchLisasButtonIsVisible(EMPTY, NOTSET));\n\n\t\tgetSurveyViewPageAction().clickOnGisButton(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().turnOnAllAssetsAndBoundaries(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().clickOnMapButton(EMPTY, NOTSET);\n\t\tgetSurveyViewPageAction().turnOnSatelliteView(EMPTY, NOTSET);\n\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyModeWarningCorrect(Resources.getResource(ResourceKeys.Dialog_EQModeActive), NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoTagLabelEquals(TEST_SURVEY_EQ_TAG, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoModeLabelEquals(SURVEY_INFO_MODE_PREFIX + TEST_SURVEY_EQ_TYPE, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoDriverLabelEquals(SURVEY_INFO_DRIVER_PREFIX + TEST_SURVEY_EQ_USERNAME, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoStartTimeLabelHasCorrectTimeFormat(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoEndTimeLabelHasCorrectTimeFormat(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoAnalyzerLabelEquals(SURVEY_INFO_ANALYZER_4, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoSurveyorLabelEquals(SURVEY_INFO_SURVEYOR_4, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifySurveyInfoStabilityClassLabelEquals(SURVEY_INFO_STABILITY_CLASS_F, NOTSET));\n\n\t\tassertTrue(getSurveyViewPageAction().verifyBreadcrumbIsShownOnMap(EMPTY, NOTSET));\n\t\tassertTrue(getSurveyViewPageAction().verifyFOVIsShownOnMap(EMPTY, NOTSET));\n//\t\tassertTrue(getSurveyViewPageAction().verifyIndicationsIsShownOnMap(EMPTY, NOTSET));\n//\t\tassertTrue(getSurveyViewPageAction().verifyLISAIsShownOnMap(EMPTY, NOTSET));\n\n\t\tassertTrue(getSurveyViewPageAction().verifyBoundariesIsShownOnMap(EMPTY, NOTSET));\n\t\tgetSurveyViewPageAction().getSurveyViewPage().setZoomLevelForAssets();\n\t\tassertTrue(getSurveyViewPageAction().verifyAssetIsShownOnMap(EMPTY, NOTSET));\n\t}",
"public void victorTest(){\n\n victorTestController.set(0.5);\n }",
"private void asignRegularSandwich() {\n\t\tbaguette = new RegularSandwich();\n\t\tSystem.out.println(\"\\nYou have selected regular bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"public void makeScoringOptions() {\n ScoringOptionsGUI scoringOptionsGUI = new ScoringOptionsGUI(player);\n scoringOptionsGUI.setTitle(\"Yahtzee!\");\n scoringOptionsGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n scoringOptionsGUI.setSize(new Dimension(900, 750));\n scoringOptionsGUI.setVisible(true);\n dispose();\n }",
"@Override\n public void robotInit() {\n\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drive = new Drive();\n pDP = new PDP();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n camera1 = CameraServer.getInstance().startAutomaticCapture(0);\n camera2 = CameraServer.getInstance().startAutomaticCapture(1);\n camera1.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n camera2.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n server = CameraServer.getInstance().getServer();\n flipped = true;\n server.setSource(camera1);\n vexGyro = new AnalogGyro(0);\n vexGyro.setSensitivity(.00175);\n //rightEncoder = new Encoder(0, 1, false);\n //leftEncoder = new Encoder(2, 3, true);\n // Add commands to Autonomous Sendable Chooser\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n chooser.setDefaultOption(\"Autonomous Command\", new AutonomousCommand());\n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n if(centerBlock == null)\n {\n SmartDashboard.putString(\"target good? \", \"no, is null\");\n }\n else{\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out);\n if (centerBlock.yCenter < 200){\n SmartDashboard.putString(\"target good?\", \"YES!!! ycenter less than 200\");\n }\n }\n \n \n\n\n \n \n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n SmartDashboard.putData(\"Auto mode\", chooser);\n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n }",
"public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }",
"@Override\n public void kickBox() {\n\n System.out.println(\"kangaroo with name \"+name+\" is boxing\");\n }",
"public void quickSimulation() {\n\t\tnew SimulationControleur();\n\t}",
"private void cs5() {\n\t\t\tif(ctx.widgets.widget(519).component(1).text().contains(\"You get some\")){\n\t\t\t\tctx.widgets.widget(519).component(2).click();\n\t\t\t}\n\t\t\tif(ctx.inventory.selectedItem().valid()){\n\t\t\t\tMethod.interactInventory(2511, \"Use\", \"Logs\");\n\t\t\t}else Method.interactInventory(590, \"Use\", \"Tinder box\");\n\t\t\t\n\t\t}",
"public ConfigureRobot()\n {\n Scheduler.getInstance().removeAll(); //remove all running commands\n addSequential(new BrakeOpen(),2);\n addSequential(new WaitCommand(1));\n addSequential(new LiftToBottom(),3);\n }",
"public void set_box_conveyor(boolean b)\n\t\t{\n\t\tbox_conveyor = b;\n\t\t}",
"private void drawBox(Graphics window, int hsBtoRGB, int x, int y) {\n\t\t\n\t}",
"public RobotContainer() {\n m_pathChooser = new SendableChooser<String>();\n m_pathChooser.addOption(\"Drive 10\", \"drive_ten_\");\n // Setup the Shuffleboard Tab for testing\n m_ProfileTab = Shuffleboard.getTab(\"ProfileTest\");\n\n \n \n // Set the default commands for the subsystems\n m_drive_train.setDefaultCommand(new DefaultDriveTrainCommand(m_drive_train, m_driver_controller));\n\n // Configure the button bindings\n // NOTE -- This should not be called until all the subsystems have been instantiated and the \n // default commands for them have been set.\n configureButtonBindings();\n\n // Setup Shuffleboard layouts\n setupShuffleboardComponents();\n }",
"public void gearBoxTest(){\n\t\tif (counter < 6) {\n\t\t\ttimerTest.start();\n\t\t\tif (480 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(1);\n\t\t\t\tmotorRF.set(1);\n\t\t\t\tmotorLB.set(1);\n\t\t\t\tmotorLF.set(1);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 480 && 600 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(0);\n\t\t\t\tmotorRF.set(0);\n\t\t\t\tmotorLB.set(0);\n\t\t\t\tmotorLF.set(0);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 600) {\n\t\t\t\ttimerTest.reset();\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t try {\n\t\t\t\t\tUIManager.setLookAndFeel(\"com.seaglasslookandfeel.SeaGlassLookAndFeel\");\n\t\t\t\t} catch (ClassNotFoundException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (InstantiationException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (IllegalAccessException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (UnsupportedLookAndFeelException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tsetupLibVLC();\n\t\t\t\t} catch (LibraryNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tNative.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);\n\t\t\t\t\n\t\t\t\tExtendedFrame frame = new ExtendedFrame();\n\t\t\t\tframe.setResizable(true);\n\t\t\t\tframe.setSize(800, 600);\n\t\t\t\tframe.setMinimumSize(new Dimension(500, 400));\n\t\t\t\tDimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\t\tframe.setLocationRelativeTo(null);\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\tframe.setVisible(true);\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Welcome to Vamix!\\n\\nHope you enjoy using vamix!\\nFor help, please click in the Help menu.\\nRefer to user manual for detailed help.\\n\");\n\t\t\t}",
"default void interactWith(Lever lever) {\n\t}",
"public static void main(String[] args){\n\t\tSystem.loadLibrary(Core.NATIVE_LIBRARY_NAME);\n\t\t\n\t\tif(args.length < 1){\n\t\t\tSystem.out.println(\"You must pass in the robbit's name!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tConfigFileReader.fileName = \"simConfig.txt\";\n\t\tConstantsFileReader.fileName = \"simConstants.csv\";\n\t\tRobotProvider.instance = new SimRobotProvider();\n\t\t\n\t\tSystem.out.println(\"========= Loading Robbit Code =========\");\n\t\tMyRobot robot = null;\n\t\ttry {\n\t\t\trobot = (MyRobot)Class.forName(args[0]).asSubclass(MyRobot.class).newInstance();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Robot couldn't be instantiated\\t :(\");\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"========== Starting up connector ==========\");\n\t\tnew Thread(VRConnector.getInstance()).start();\n\t\tVRConnector.getInstance().putCommandBool(VRConnector.RESET_SIM, true);\t\t\n\n\t\t\n\t\t/*\n\t\t * RESETING SIMULATOR\n\t\tSystem.out.println(\"Waiting for Simulator to restart...\");\n\t\tfor(int i = WAIT_TIME; i > 0; i--){\n\t\t\tSystem.out.println(i + \" seconds left...\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e1) {}\n\t\t}\n\t\t*/\n\t\t\n\t\trobot.robotInit();\n\t\t\n\t\twhile(true){\n\t\t\t//Update GameState\n//\t\t\tif(state_ != VRConnector.getInstance().getFeedback(VRConnector.Game_State))\n//\t\t\t\tinit = true;\n\t\t\t\n\t\t\tswitch(state_){\n\t\t\t\tcase Auton:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.autonomousInit();\n\t\t\t\t\trobot.autonomousPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Disabled:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.disabledInit();\n\t\t\t\t\trobot.disabledPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Teleop:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.teleopInit();\n\t\t\t\t\trobot.teleopPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Test:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.testInit();\n\t\t\t\t\trobot.teleopPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.err.println(\"GAME STATE NOT RECOGNIZED:\\t\" + state_);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tinit = false;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tThread.sleep(15);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"public abstract void recolocarHitbox();",
"@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }",
"protected void initialize() {\n \tRobot.conveyor.stop();\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"public RobotContainer() {\n \n camServer = CameraServer.getInstance();\n driveCam = camServer.startAutomaticCapture(\"Driver View\", 0);\n driveCam.setResolution(160, 120);\n driveCam.setFPS(15);\n driveCam.setBrightness(50);\n // cameraThreader.start();\n\n leftJoy = new Joystick(LEFT_JOY_PORT);\n rightJoy = new Joystick(RIGHT_JOY_PORT);\n xbox = new XboxController(XBOX_PORT);\n\n //Set default drivetrain command to DriveWithJoysticks or xbox\n drivetrain.setDefaultCommand(xboxCommand);\n \n //For testing purposes, this will control simple one- or two-motor subsystems.\n genericSubsystem.setDefaultCommand(genericJoysticksCommand);\n \n //shooter.setDefaultCommand(shootCommand);\n //shooter.setDefaultCommand(turretCommand);\n\n\n // Configure the button bindings\n configureButtonBindings();\n }",
"public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }",
"void unsetBox();",
"public abstract void swim() {}",
"public void rumbleInYourPants() {\n double accel_z = RobotMap.helmsman.getAcceleromoterZ();\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kLeftRumble, (float) Math.abs(accel_z - 1));\n Robot.oi.getXBoxJoystick2().setRumble(RumbleType.kRightRumble, (float) Math.abs(accel_z - 1));\n }",
"void setPowerBox(boolean powerBox);",
"public RobotContainer() {\n // Configure the button bindings\n configureButtonBindings();\n\n drivetrain.setDefaultCommand(new RunCommand(\n () -> drivetrain.setTank(Math.pow(-joystick1.getY(), 3), Math.pow(joystick2.getY(), 3)), drivetrain));\n\n }",
"public ShootBall() {\n addRequirements(Robot.shooterBall);\n }",
"private void testGrab()\n {\n if(gamepad1.y) {\n //move to position where it touches block ----might have to change angle based on trial----\n //Drastic angles at the moment for testing\n servoLeft.setPosition(0.5);\n //servoRight.setPosition(0.5);\n }\n }",
"public void vision()\n {\n NIVision.IMAQdxGrab(session, colorFrame, 1);\t\t\t\t\n RETRO_HUE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro hue min\", RETRO_HUE_RANGE.minValue);\n\t\tRETRO_HUE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro hue max\", RETRO_HUE_RANGE.maxValue);\n\t\tRETRO_SAT_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro sat min\", RETRO_SAT_RANGE.minValue);\n\t\tRETRO_SAT_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro sat max\", RETRO_SAT_RANGE.maxValue);\n\t\tRETRO_VAL_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro val min\", RETRO_VAL_RANGE.minValue);\n\t\tRETRO_VAL_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro val max\", RETRO_VAL_RANGE.maxValue);\n\t\tAREA_MINIMUM = SmartDashboard.getNumber(\"Area min %\");\n\t\t//MIN_RECT_WIDTH = SmartDashboard.getNumber(\"Min Rect Width\", MIN_RECT_WIDTH);\n\t\t//MAX_RECT_WIDTH = SmartDashboard.getNumber(\"Max Rect Width\", MAX_RECT_WIDTH);\n\t\t//MIN_RECT_HEIGHT = SmartDashboard.getNumber(\"Min Rect Height\", MIN_RECT_HEIGHT);\n\t\t//MAX_RECT_HEIGHT= SmartDashboard.getNumber(\"Max Rect Height\", MAX_RECT_HEIGHT);\n\t\t\n\t\t//SCALE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Scale Range Min\");\n\t\t//SCALE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Scale Range Max\");\n\t\t//MIN_MATCH_SCORE = (int)SmartDashboard.getNumber(\"Min Match Score\");\n //Look at the color frame for colors that fit the range. Colors that fit the range will be transposed as a 1 to the binary frame.\n\t\t\n\t\tNIVision.imaqColorThreshold(binaryFrame, colorFrame, 255, ColorMode.HSV, RETRO_HUE_RANGE, RETRO_SAT_RANGE, RETRO_VAL_RANGE);\n\t\t//Send the binary image to the cameraserver\n\t\tif(cameraView.getSelected() == BINARY)\n\t\t{\n\t\t\tCameraServer.getInstance().setImage(binaryFrame);\n\t\t}\n\n\t\tcriteria[0] = new NIVision.ParticleFilterCriteria2(NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA, AREA_MINIMUM, 100.0, 0, 0);\t\t\n\t\t\n NIVision.imaqParticleFilter4(binaryFrame, binaryFrame, criteria, filterOptions, null);\n\n // NIVision.RectangleDescriptor rectangleDescriptor = new NIVision.RectangleDescriptor(MIN_RECT_WIDTH, MAX_RECT_WIDTH, MIN_RECT_HEIGHT, MAX_RECT_HEIGHT);\n// \n// //I don't know\n// NIVision.CurveOptions curveOptions = new NIVision.CurveOptions(NIVision.ExtractionMode.NORMAL_IMAGE, 0, NIVision.EdgeFilterSize.NORMAL, 0, 1, 1, 100, 1,1);\n// NIVision.ShapeDetectionOptions shapeDetectionOptions = new NIVision.ShapeDetectionOptions(1, rectAngleRanges, SCALE_RANGE, MIN_MATCH_SCORE);\n// NIVision.ROI roi = NIVision.imaqCreateROI();\n//\n// NIVision.DetectRectanglesResult result = NIVision.imaqDetectRectangles(binaryFrame, rectangleDescriptor, curveOptions, shapeDetectionOptions, roi);\n// //Dummy rectangle to start\n// \n// NIVision.RectangleMatch bestMatch = new NIVision.RectangleMatch(new PointFloat[]{new PointFloat(0.0, 0.0)}, 0, 0, 0, 0);\n// \n// //Find the best matching rectangle\n// for(NIVision.RectangleMatch match : result.array)\n// {\n// \tif(match.score > bestMatch.score)\n// \t{\n// \t\tbestMatch = match;\n// \t}\n// }\n// SmartDashboard.putNumber(\"Rect height\", bestMatch.height);\n// SmartDashboard.putNumber(\"Rect Width\", bestMatch.width);\n// SmartDashboard.putNumber(\"Rect rotation\", bestMatch.rotation);\n// SmartDashboard.putNumber(\"Rect Score\", bestMatch.score);\n \n //Report how many particles there are\n\t\tint numParticles = NIVision.imaqCountParticles(binaryFrame, 1);\n\t\tSmartDashboard.putNumber(\"Masked particles\", numParticles);\n\t\t\n \n\t\tif(numParticles > 0)\n\t\t{\n\t\t\t//Measure particles and sort by particle size\n\t\t\tVector<ParticleReport> particles = new Vector<ParticleReport>();\n\t\t\tfor(int particleIndex = 0; particleIndex < numParticles; particleIndex++)\n\t\t\t{\n\t\t\t\tParticleReport par = new ParticleReport();\n\t\t\t\tpar.Area = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA);\n\t\t\t\tpar.AreaByImageArea = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA);\n\t\t\t\tpar.BoundingRectTop = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_TOP);\n\t\t\t\tpar.BoundingRectLeft = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT);\n\t\t\t\tpar.BoundingRectHeight = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_HEIGHT);\n\t\t\t\tpar.BoundingRectWidth = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH);\n\t\t\t\tparticles.add(par);\n\n\t\t\t}\n\t\t\tparticles.sort(null);\n\n\t\t\t//This example only scores the largest particle. Extending to score all particles and choosing the desired one is left as an exercise\n\t\t\t//for the reader. Note that this scores and reports information about a single particle (single L shaped target). To get accurate information \n\t\t\t//about the location of the tote (not just the distance) you will need to correlate two adjacent targets in order to find the true center of the tote.\n//\t\t\tscores.Aspect = AspectScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Aspect\", scores.Aspect);\n//\t\t\tscores.Area = AreaScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Area\", scores.Area);\n//\t\t\tboolean isTote = scores.Aspect > SCORE_MIN && scores.Area > SCORE_MIN;\n//\n\t\t\tParticleReport bestParticle = particles.elementAt(0);\n\t\t NIVision.Rect particleRect = new NIVision.Rect((int)bestParticle.BoundingRectTop, (int)bestParticle.BoundingRectLeft, (int)bestParticle.BoundingRectHeight, (int)bestParticle.BoundingRectWidth);\n\t\t \n\t\t //NIVision.imaqOverlayRect(colorFrame, particleRect, new NIVision.RGBValue(0, 0, 0, 255), DrawMode.PAINT_VALUE, \"a\");//;(colorFrame, colorFrame, particleRect, DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 20);\n\t\t NIVision.imaqDrawShapeOnImage(colorFrame, colorFrame, particleRect, NIVision.DrawMode.DRAW_VALUE, ShapeMode.SHAPE_RECT, 0.0f);\n\t\t SmartDashboard.putNumber(\"Rect Top\", bestParticle.BoundingRectTop);\n\t\t SmartDashboard.putNumber(\"Rect Left\", bestParticle.BoundingRectLeft);\n\t\t SmartDashboard.putNumber(\"Rect Width\", bestParticle.BoundingRectWidth);\n\t\t SmartDashboard.putNumber(\"Area by image area\", bestParticle.AreaByImageArea);\n\t\t SmartDashboard.putNumber(\"Area\", bestParticle.Area);\n\t\t double bestParticleMidpoint = bestParticle.BoundingRectLeft + bestParticle.BoundingRectWidth/2.0;\n\t\t double bestParticleMidpointAimingCoordnates = pixelCoordnateToAimingCoordnate(bestParticleMidpoint, CAMERA_RESOLUTION_X);\n\t\t angleToTarget = aimingCoordnateToAngle(bestParticleMidpointAimingCoordnates, VIEW_ANGLE);\n\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\tangleToTarget = 0.0;\n\t\t}\n\n if(cameraView.getSelected() == COLOR)\n {\n \tCameraServer.getInstance().setImage(colorFrame);\n }\n\t SmartDashboard.putNumber(\"Angle to target\", angleToTarget);\n\n }",
"public RIAComboboxPanel()\n {\n super();\n initialize();\n }",
"public AllSystemsClimbCenter() {\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PARAMETERS\n // Add Commands here:\n // e.g. addSequential(new Command1());\n // addSequential(new Command2());\n // these will run in order.\n\n // To run multiple commands at the same time,\n // use addParallel()\n // e.g. addParallel(new Command1());\n // addSequential(new Command2());\n // Command1 and Command2 will run in parallel.\n\n // A command group will require all of the subsystems that each member\n // would require.\n // e.g. if Command1 requires chassis, and Command2 requires arm,\n // a CommandGroup containing them would require both the chassis and the\n // arm.\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS\n\n // if (!Robot.getKillClimber()) constantly checks if climber was killed by driver\n\n // if (!Robot.getKillClimber())\n // {\n // // set drive direction to correct orientation for climbing (front of robot direction)\n // Robot.chassis.setDriveDirection(-1);\n // }\n\n // if (!Robot.getKillClimber())\n // {\n // // ensure robot intake is in start position\n // addParallel(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_CLIMB_START_POSITION));\n // // ensure robot is against platform\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_INITIAL_POWER, \n // Constants.ALL_CENTER_CHASSIS_INITIAL_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n \n // extends front and back climber at the same time\n if (!Robot.getKillClimber())\n {\n addParallel(new ClimberFrontSetPosition(Constants.ALL_CENTER_FRONT_CLIMBER_EXTEND_POSITION));\n addParallel(new ClimberBackSetPosition(Constants.ALL_CENTER_BACK_CLIMBER_EXTEND_POSITION));\n // delay only 2 seconds in order to rotate shooter angle to pull in position faster\n addSequential(new Delay(2));\n }\n\n // // rotate shooter angle in order to pull robot onto platform\n // if (!Robot.getKillClimber())\n // {\n // addParallel(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_PULL_IN_POSITION));\n // addSequential(new Delay(2));\n // }\n \n // if (!Robot.getKillClimber())\n // {\n // // start shooter climber wheels in order to pull in\n // addParallel(new SetShooterSpeedStraight(Constants.ALL_CENTER_SHOOTER_PULL_IN_RPM));\n // // drive forward onto the platform\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n\n // // bring up back climber\n // if (!Robot.getKillClimber())\n // {\n // addParallel(new ClimberBackSetPosition(Constants.ALL_CENTER_BACK_CLIMBER_RETRACT_POSITION));\n // addSequential(new Delay(2));\n // }\n\n // // drive forward onto the platform\n // if (!Robot.getKillClimber())\n // {\n // addSequential(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // }\n\n // if (!Robot.getKillClimber())\n // {\n // // bring up front climber\n // addParallel(new ClimberFrontSetPosition(Constants.ALL_CENTER_FRONT_CLIMBER_RETRACT_POSITION));\n // addSequential(new Delay(2));\n // }\n // if (!Robot.getKillClimber())\n // {\n // // drive forward onto the platform\n // addParallel(new DriveWithPower(Constants.ALL_CENTER_CHASSIS_PLATFORM_POWER, \n // Constants.ALL_CENTER_CHASSIS_PLATFORM_TIME), Constants.ALL_CENTER_CHASSIS_TIMEOUT);\n // // bring shooter angle rotate to home position so it doesn't hit driver station\n // addSequential(new ShooterAngleRotate(Constants.ALL_CENTER_SHOOTER_HOME_POSITION));\n // }\n }",
"public static void main( String[] args )\n {\n //usage: move bar below down 1 line at a time to test functionality...\n\n Slots machine01 = new Slots();\n Slots machine02 = new Slots();\n\n //test to verify slot machines function indepently\n\n System.out.println( \"Machine01 initial state:\\t\" + machine01 );\n System.out.println( \"Machine02 initial state:\\t\" + machine02 );\n\n System.out.println( \"\\nSpinning machine01...\\n\" );\n\n machine01.spinOnce();\n\n System.out.println();\n System.out.println( \"Machine01 state:\\t\" + machine01 );\n System.out.println( \"Machine02 state:\\t\" + machine02 );\n System.out.println();\n\n\n //test gamble-until-you-win mechanism\n\n System.out.println( \"Preparing to spin until a mini win! . . .\" );\n System.out.println( \"------------------------------------\" );\n\n //if you haven't won, spin again until you win!\n while( machine01.miniWin() == false ) {\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"LOSE\\n\" );\n machine01.spinOnce();\n }\n\n System.out.println( \"====================================\" );\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"WIN\\n\" );\n\n\n\n System.out.println( \"Preparing to spin until...jackpot! . . .\" );\n System.out.println( \"------------------------------------\" );\n\n\n //if you haven't won, spin again until you win!\n int x = 0;\n while( machine01.jackpot() == false ) {\n\t System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n\t System.out.println( \"LOSE\\n\" );\n\t machine01.spinOnce();\n\t x += 1;\n }\n \n System.out.println( \"====================================\" );\n System.out.println( \"Your spin...\" + \"\\t\" + machine01 );\n System.out.println( \"JACKPOT!\\n\" );\n System.out.println(\"Number of tries: \" + x);\n \n }",
"@Override\n\tpublic void robotInit() {\n\t\t\n\t\t//CameraServer.getInstance().startAutomaticCapture(); //Minimum required for camera\n\t\t\n\t\t//new Thread(() -> {\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n camera.setWhiteBalanceAuto();\n camera.setFPS(20);\n \n //CvSink cvSink = CameraServer.getInstance().getVideo();\n //CvSource outputStream = CameraServer.getInstance().putVideo(\"Blur\", 640, 480);\n /* \n Mat source = new Mat();\n Mat output = new Mat();\n \n while(!Thread.interrupted()) {\n cvSink.grabFrame(source);\n Imgproc.cvtColor(source, output, Imgproc.COLOR_BGR2GRAY);\n outputStream.putFrame(output);\n }*/\n //}).start();\n\t\t\n\t\t\n\t\t\n\t\t/**\n\t\t * 7780 long run\n\t\t */\n\t\t\n\t\tdriverStation = DriverStation.getInstance();\n\t\t// Initialize all subsystems\n\t\tm_drivetrain = new DriveTrain();\n\t\tm_pneumatics = new Pneumatics();\n\t\t\n\t\tm_pneumatics.createSolenoid(RobotMap.PNEUMATICS.GEARSHIFT_SOLENOID, \n\n\t\t\t\tRobotMap.PNEUMATICS.SOLENOID_ID_1, \n\n\t\t\t\tRobotMap.PNEUMATICS.SOLENOID_ID_2);\n\t\t\n\t\tm_pneumatics.createSolenoid(RobotMap.PNEUMATICS.FORKLIFT_SOLENOID, RobotMap.PNEUMATICS.SOLENOID_ID_3, RobotMap.PNEUMATICS.SOLENOID_ID_4);\n\t\t\n\t\tm_forklift = new ForkLift();\n\t\tm_intake = new Intake();\n\t\tm_oi = new OI();\n\n\t\t// instantiate the command used for the autonomous period\n\t\tm_autonomousCommand = new Autonomous();\n\t\tdriverXbox = m_oi.getDriverXboxControl();\n\t\toperatorXbox = m_oi.getDriverXboxControl();\n\t\tsetupAutoCommands();\n\t\t\n\t\t//chooser.addDefault(\"Left Long\",new LeftLong());\n\t\t\n\t\t//SmartDashboard.putData(\"Auto\",chooser);\n\n\t\t// Show what command your subsystem is running on the SmartDashboard\n\t\tSmartDashboard.putData(m_drivetrain);\n\t\tSmartDashboard.putData(m_forklift);\n\t\t\n\t}",
"public void agregarRobot(Robot robot);",
"public static void IAmFalconBot() {\n // How many encoder clicks per revolution (change to 2048 for falcon 500\n // encoders)\n encoderUnitsPerShaftRotation = 2048;\n // with 6 in wheels estimate 10 feet = 13038 encoder ticks\n\n // The difference between the left and right side encoder values when the robot\n // is rotated 180 degrees\n encoderUnitsPerRobotRotation = 3925;// thats the SUM of the two (this is just a rough guess)\n //these values are just guesses at the moment\n cruiseVelocity = 2250;\n acceleration = 2250;\n // Allowable error to exit movement methods\n defaultAcceptableError = 250;\n\n shooterPanMotorEncoderTicksPerRotation = 3977;\n //TODO: may need to be negative if turns the wrong way\n shooterPanSpeed = 1;\n System.out.println(\"I AM FALCONBOT! CACAW! CACAAAAAWWWWW!\");\n }",
"@Test\n public void software_technology() {\n goToSoftVision();\n HomePage home = new HomePage(driver);\n home.acceptCookieMethod();\n home.hoverApproachBtn();\n\n openMenuPage(\"Guilds\");\n GuildsPage guilds = new GuildsPage(driver);\n softwareTechnologyCategoryPage soft = guilds.softTech();\n }",
"public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }",
"public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }",
"private void jRadioButtonShootAlternativelyActionPerformed() {\r\n\t\tjRadioButtonShootAlternatively.setSelected(true);\r\n\t\tjRadioButtonShootUntilWater.setSelected(false);\r\n\t\tgame.setGameMode(GameMode.ALTERNATIVELY);\r\n\t}",
"public static void main(String[] args) {\n Gearbox auto = GearboxFactory.create(GearboxFactory.Type.AUTOMATIC);\r\n // Create a manual gearbox\r\n Gearbox manual = GearboxFactory.create(GearboxFactory.Type.MANUAL);\r\n }",
"public void fruitRegrow()\n {\n fruit.makeInvisible();\n fruit.moveVertical(-60);\n fruit.makeVisible();\n }",
"boolean testMakeScene(Tester t) {\n return t.checkExpect(new NBullets(10).makeScene(),\n new WorldScene(500, 300).placeImageXY(\n new TextImage(\"Bullets left: 10, ships destroyed: 0\", 15, Color.BLACK), 130, 290))\n && t.checkExpect(new NBullets(this.lob1, this.los1, 9, 2, 0).makeScene(),\n this.bullet1.place(this.ship1.place(new WorldScene(500, 300))).placeImageXY(\n new TextImage(\"Bullets left: 9, ships destroyed: 2\", 15, Color.BLACK), 130, 290));\n }",
"protected void lowerBot() {\n lowerBot(-.3);\n }",
"void unsetPowerBox();",
"@Before\r\n\tpublic void launchClient() throws FindFailed {\r\n\t\ts = new Screen();\r\n\t\tapp = SystemActions.launchClient();\r\n\t}",
"private static void go_play()throws AWTException {\n\t\ttry{\r\n\t\t\t//Robot robot = new Robot();\r\n\r\n\t\t\trobot.keyPress(KeyEvent.VK_SPACE);\r\n\t\t\trobot.keyRelease(KeyEvent.VK_SPACE);\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e1) {\r\n\t\t\tSystem.err.println(\"Use: java Renderer <Local IPAddress> <Localport> <Remote IPAddress> <Remote Port>\");\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\t Robot Damian = new Robot();\n\t\t//3. Ask the user what color they would like the robot to draw\n\t\tString color = JOptionPane.showInputDialog(null, \"What color should my robot draw? Red, Blue, or Green\");\n\t\t//5. Use an if/else statement to set the pen color that the user requested\n\t\n\n //6. If the user doesn’t enter anything, choose a random color\nif (color == \" \") {\n\tDamian.setPenColor(255, 255, 0);\n}\n //7. Put a loop around your code so that you keep asking the user for more colors & drawing them\n\t\t\n\t\t//4. Set the pen width to 10\n\t\tDamian.setPenWidth(10);\n\t //2. Make the robot draw a shape (this will take more than one line of code)------------------\n\t\tif (color.equalsIgnoreCase(\"red\")) {\n\t\t\tDamian.setPenColor(255, 0, 0);\n\t\t}\n\t\tif (color.equalsIgnoreCase(\"green\")) {\n\t\t\tDamian.setPenColor(0, 255, 0);\n\t\t}\n\t\tif (color.equalsIgnoreCase(\"blue\")) {\n\t\t\tDamian.setPenColor(0, 0, 255);\n\t\t}\n\tDamian.setSpeed(100);\n\tDamian.penDown();\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\tDamian.turn(90);\n\tDamian.move(150);\n\t\n\t}",
"public abstract void interagir (Robot robot);",
"private void drawBox() {\n GLES20.glEnable(GLES20.GL_SCISSOR_TEST);\n GLES20.glScissor(0, 0, 100, 100);\n GLES20.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);\n GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);\n GLES20.glDisable(GLES20.GL_SCISSOR_TEST);\n }",
"void showRealSenseCongratulations() {\n\t\tshowInput3DCongratulations(\n\t\t\t\tgetLocalization().getMenu(\"RealSense.DetectedMessage\"),\n\t\t\t\tREALSENSE_TUTORIAL);\n\t}",
"public static void main(String[] args) {\n \n // interface looks pretty\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n } catch (Exception e) {\n log.warn(\"Could not set the look and feel to nimbus. \"\n + \"Hopefully you're on a mac so the window isn't ugly as crap.\");\n }\n \n // set up the model\n TestbedModel model = new TestbedModel();\n final RobotProjectController controller =\n new RobotProjectController(model, UpdateBehavior.UPDATE_CALLED, MouseBehavior.NORMAL,\n new TestbedErrorHandler() {\n @Override\n public void serializationError(Exception e, String message) {\n JOptionPane.showMessageDialog(null, message, \"Serialization Error\",\n JOptionPane.ERROR_MESSAGE);\n }\n });\n TestPanelJ2D panel = new TestPanelJ2D(model, controller);\n model.setPanel(panel);\n model.setDebugDraw(new DebugDrawJ2D(panel, true));\n \n // add the tests\n MyTestList.populateModel(model);\n\n // add the GUI components\n JFrame testbed = new JFrame();\n testbed.setTitle(\"JBox2D Testbed\");\n testbed.setLayout(new BorderLayout());\n TestbedSidePanel side = new TestbedSidePanel(model, controller);\n testbed.add((Component) panel, \"Center\");\n testbed.add(new JScrollPane(side), \"East\");\n testbed.pack();\n testbed.setVisible(true);\n testbed.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n // start the tests\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n controller.playTest(0);\n controller.start();\n }\n });\n }",
"@Test\n\tpublic void testCarWithWankelEngine() {\n\t\t\n\t\tOldStyleCarFactory factory = new OldStyleCarFactory() {\n\t\t\t@Override\n\t\t\tpublic Car createPremiumCombustionCar() {\n\t\t\t\tCombustionEngine engine = new WankelEngine();\n\t\t\t\tInternalCombustionCar car = new InternalCombustionCar(engine);\n\t\t\t\treturn car;\n\t\t\t}\n\t\t};\n\t\t\n\t\tCar testCar = factory.createPremiumCombustionCar();\n\t\ttestCar.start();\n\t\tassertTrue(testCar.isRunning());\n\t\ttestCar.stop();\n\t\tassertFalse(testCar.isRunning());\n\t}",
"public void launchExplorer() {\n SimulatedEnvironment env = new SimulatedEnvironment(this.domain, this.initialState);\n VisualExplorer exp = new VisualExplorer(this.domain, env, this.v, 800, 800);\n exp.addKeyAction(\"w\", GridWorldDomain.ACTION_NORTH, \"\");\n exp.addKeyAction(\"s\", GridWorldDomain.ACTION_SOUTH, \"\");\n exp.addKeyAction(\"d\", GridWorldDomain.ACTION_EAST, \"\");\n exp.addKeyAction(\"a\", GridWorldDomain.ACTION_WEST, \"\");\n\n //exp.enableEpisodeRecording(\"r\", \"f\", \"irlDemo\");\n\n exp.initGUI();\n }",
"@Override\n\tpublic void swim() {\n\t\t\n\t}",
"public void askSpawn() throws RemoteException{\n respawnPopUp = new RespawnPopUp();\n respawnPopUp.setSenderRemoteController(senderRemoteController);\n respawnPopUp.setMatch(match);\n\n Platform.runLater(\n ()-> {\n try{\n respawnPopUp.start(new Stage());\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }\n );\n }",
"@Override\n\tpublic void swim() {\n\t\tSystem.out.println(\"Pawan started swimming\");\n\t}",
"@Override\r\n\tpublic void useRepairKit(Robot robot, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(repairKit))\r\n\t\t\t{\r\n\t\t\t\trobot.use(repairKit);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This repair kit could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this repair kit is terminated; the robot cannot use the repair kit.\");\r\n\t\t}\r\n\t}",
"protected void initialize() {\n\t\tRobot.conveyor.Forward();\n\n\t}",
"default void interactWith(PressurePlate pressurePlate) {\n\t}",
"boolean addEasyVictory();",
"public void start(){\r\n \t\ttry{\r\n \t\t\t_auditorium = new VoteBoxAuditoriumConnector(_mySerial,\r\n \t\t\t\t\tAuditoriumParams.Singleton,\r\n \t\t\t\t\tCommitBallotEvent.getMatcher(),\r\n \t\t\t\t\tCastCommittedBallotEvent.getMatcher(),\r\n \t\t\t\t\tChallengeEvent.getMatcher(),\r\n \t\t\t\t\tAuthorizedToCastWithNIZKsEvent.getMatcher(),\r\n \t\t\t\t\tAdderChallengeEvent.getMatcher()\r\n \t\t\t\t\t);\r\n \t\t}catch(NetworkException e){\r\n \t\t\tthrow new RuntimeException(\"Unable to connect to Auditorium: \"+e.getMessage(), e);\r\n \t\t}//catch\r\n \t\t\r\n \t\t_auditorium.addListener(new VoteBoxEventListener(){\r\n \t\t\tpublic void ballotCounted(BallotCountedEvent e){\r\n \t\t//NO-OP\r\n \t}\r\n \t\t\t\r\n \t\t\tpublic void castBallot(CastBallotEvent e) {\r\n \t\t\t\tforward(e);\r\n \t\t\t}\r\n \t\t\tpublic void challenge(ChallengeEvent e) {\r\n \t\t\t\tforward(e);\r\n \t\t\t}\r\n \t\t\tpublic void commitBallot(CommitBallotEvent e) {\r\n \t\t\t\tforward(e);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//Ignored events\r\n \t\t\tpublic void activated(ActivatedEvent e) {}\r\n \t\t\tpublic void assignLabel(AssignLabelEvent e) {}\r\n \t\t\tpublic void authorizedToCast(AuthorizedToCastEvent e) {}\r\n \t\t\tpublic void ballotReceived(BallotReceivedEvent e) {}\r\n \t\t\tpublic void challengeResponse(ChallengeResponseEvent e) {}\r\n \t\t\tpublic void joined(JoinEvent e) {}\r\n \t\t\tpublic void lastPollsOpen(LastPollsOpenEvent e) {}\r\n \t\t\tpublic void left(LeaveEvent e) {}\r\n \t\t\tpublic void overrideCancel(OverrideCancelEvent e) {}\r\n \t\t\tpublic void overrideCancelConfirm(OverrideCancelConfirmEvent e) {}\r\n \t\t\tpublic void overrideCancelDeny(OverrideCancelDenyEvent e) {}\r\n \t\t\tpublic void overrideCast(OverrideCastEvent e) {}\r\n \t\t\tpublic void overrideCastConfirm(OverrideCastConfirmEvent e) {}\r\n \t\t\tpublic void overrideCastDeny(OverrideCastDenyEvent e) {}\r\n \t\t\tpublic void pollsClosed(PollsClosedEvent e) {}\r\n \t\t\tpublic void pollsOpen(PollsOpenEvent e) {}\r\n \t\t\tpublic void pollsOpenQ(PollsOpenQEvent e) {}\r\n \t\t\tpublic void supervisor(SupervisorEvent e) {}\r\n \t\t\tpublic void votebox(VoteBoxEvent e) {}\r\n public void ballotscanner(BallotScannerEvent e) {}\r\n public void ballotScanned(BallotScannedEvent e) {}\r\n\t\t});\r\n \t\t\r\n \t\ttry{\r\n \t\t\tSystem.out.println(\"Connecting to auditorium...\");\r\n \t\t\t_auditorium.connect();\r\n \t\t}catch(NetworkException e){\r\n \t\t\tthrow new RuntimeException(\"Unable to connect to Auditorium network: \"+e.getMessage(), e);\r\n \t\t}//catch\r\n \t}",
"private void placeKitOnInspection(MyKit mk)\n\t{\n\t\tmyStand.setSlotThreeTaken();\n\t\tif(guiEnable){\n\t\t\tthis.kitRobotGUI.DoMoveKitToCameraInspection(mk.kit.guikit, mk.kit.position);\n\t\t\tprint(\"Moving Kit to Inspection Slot\");\n\t\t\ttry {\n\t\t\t\t//guiControl = new Semaphore(0,true);//TODO: take away after gui fixes it\n\t\t\t\tguiControl.acquireUninterruptibly();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tprint(\"GUI moving Kit to Camera Inspection. Finished moving. Telling Agent.\");\n\n\n\t\tmyStand.setSlotAvilable(mk.slot);\n\t\tmk.kit.position = KitPosition.POSITION3;\n\t\tprint(\"Kit Slot number : \"+mk.slot+\" is Available but slot 3 is taken\");\n\t\tmk.status = KitStatus.On_CameraInspection;\n\t\tkitCamera.msgInspectKit(mk.kit);\n\t\tstateChanged();\n\t}",
"@LargeTest\n public void testVibrance() {\n TestAction ta = new TestAction(TestName.VIBRANCE);\n runTest(ta, TestName.VIBRANCE.name());\n }",
"void addBoxObject() {\n\t\tint boxObjectX = random.nextInt(ScreenManager.getWindowWidth());\n\t\tint boxObjectY = random.nextInt(ScreenManager.getWindowHeight());\n\t\tint boxObjectWidth = ScreenManager.getSizeFromPercentageOfWindowY((float) 24);\n\t\tint boxObjectHeight = ScreenManager.getSizeFromPercentageOfWindowY(18);\n\t\tint boxObjectHitsToDestroy = random.nextInt(9)+1;\n\t\t\n\t\tboxObjects.add(new BoxObject(boxObjectX, boxObjectY, boxObjectWidth, boxObjectHeight, boxObjectHitsToDestroy, true));\n\t}",
"void setBox(boolean box);",
"public HBox initializeHBox() {\n\t\t// Container for the control buttons\n\t\tHBox controlButtons = new HBox();\n\t\tcontrolButtons.setPadding(new Insets(10.0, 0.0, 10.0, 10.0));\n controlButtons.setSpacing(80);\n\n // Container for the Play/Pause and Reset buttons\n HBox simulationStateButtons = new HBox();\n\t\tsimulationStateButtons.setSpacing(5);\n\n Button playButton = new Button(\"Play\");\n simulationStateButtons.getChildren().add(playButton);\n\n playButton.setOnAction((event) -> {\n this.play = !this.play;\n if (this.play) {\n playButton.setText(\"Pause\");\n } else {\n playButton.setText(\"Play\");\n }\n simulation.setPlayState(this.play);\n });\n\n Button resetButton = new Button(\"Reset\");\n simulationStateButtons.getChildren().add(resetButton);\n\n resetButton.setOnAction((event) -> {\n \tthis.settingsScene.setSettingsSet(true);\n });\n\n controlButtons.getChildren().add(simulationStateButtons);\n\n // Container for the probability of death and reproduction sliders\n\t\tHBox probabilitySliders = new HBox();\n\t\tprobabilitySliders.setSpacing(20);\n\n\t\t// Container for the probability of reproduction slider\n\t\tVBox probabilityOfReproductionSlider = new VBox();\n\n // probability of Reproduction\n Slider probabilityOfReproduction = new Slider(1, 100, 100);\n probabilityOfReproduction.setMinWidth(200);\n probabilityOfReproduction.setMaxWidth(200);\n\t\tprobabilityOfReproduction.setShowTickMarks(true);\n\t\tprobabilityOfReproductionSlider.getChildren().add(probabilityOfReproduction);\n\n\t\tLabel probabilityOfReproductionCurrentValue = new Label(\"probability of reproduction: \" + Double.toString(Math.round(probabilityOfReproduction.getValue())) + \"%\");\n\t\tprobabilityOfReproductionCurrentValue.setPadding(new Insets(0, 15, 0, 15));\n\t\tprobabilityOfReproductionSlider.getChildren().add(probabilityOfReproductionCurrentValue);\n\n\t\tprobabilityOfReproduction.setOnMouseDragged((event) -> {\n\t\t\tthis.probabilityOfReproductionValue = Math.round(probabilityOfReproduction.getValue());\n\t\t\tthis.simulation.setprobabilityOfReproduction(this.probabilityOfReproductionValue);\n\t\t\tprobabilityOfReproductionCurrentValue.setText(\"probability of reproduction \" + Double.toString(Math.round(probabilityOfReproduction.getValue())) + \"%\");\n\t\t});\n\n\t\tprobabilitySliders.getChildren().add(probabilityOfReproductionSlider);\n\n\t\t// Container for the probability of dying slider\n\t\tVBox probabilityOfDyingSlider = new VBox();\n\n\t\t// probability of dying in the event of under, or overpopulation\n Slider probabilityOfDying = new Slider(1, 100, 100);\n probabilityOfDying.setMinWidth(200);\n probabilityOfDying.setMaxWidth(200);\n probabilityOfDying.setShowTickMarks(true);\n probabilityOfDyingSlider.getChildren().add(probabilityOfDying);\n\n\t\tLabel probabilityOfDyingCurrentValue = new Label(\"probability of dying: \" + Double.toString(Math.round(probabilityOfDying.getValue())) + \"%\");\n\t\tprobabilityOfDyingCurrentValue.setPadding(new Insets(0, 35, 0, 35));\n\t\tprobabilityOfDyingSlider.getChildren().add(probabilityOfDyingCurrentValue);\n\n\t\tprobabilityOfDying.setOnMouseDragged((event) -> {\n\t\t\tthis.probabilityOfDyingValue = Math.round(probabilityOfDying.getValue());\n\t\t\tthis.simulation.setprobabilityOfDying(this.probabilityOfDyingValue);\n\t\t\tprobabilityOfDyingCurrentValue.setText(\"probability of dying: \" + Double.toString(Math.round(probabilityOfDying.getValue())) + \"%\");\n\t\t});\n\n\t\tprobabilitySliders.getChildren().add(probabilityOfDyingSlider);\n\t\tcontrolButtons.getChildren().add(probabilitySliders);\n\n this.countOfGenerations = new Label(\"Generation: \" + 0);\n controlButtons.getChildren().add(countOfGenerations);\n\t\t\n\t\treturn controlButtons;\n\t}",
"private void vibrate() {\n this.sexyVibrator.vibrate(400);\n }",
"private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"public boolean checkSystem() {\n print(\"Testing ELEVATOR.--------------------------------------------------\");\n final double kCurrentThres = 0.5;\n if(getPosition() < 0){\n zeroPosition();\n }\n spx.set(ControlMode.PercentOutput, -0.1);\n srx.set(ControlMode.PercentOutput, -0.1);\n Timer.delay(0.2);\n srx.set(ControlMode.PercentOutput, 0.0);\n spx.set(ControlMode.PercentOutput, 0.0);\n Timer.delay(0.1);\n; srx.setNeutralMode(NeutralMode.Coast);\n spx.setNeutralMode(NeutralMode.Coast);\n\n double testSpeed = .75;\n double testDownSpeed = -0.05;\n double testUpTime = 1;\n\n\n if(getPosition() < 0){\n zeroPosition();\n }\n // test climber srx\n final double SRXintialEncoderPos = Math.abs(getPosition());\n srx.set(ControlMode.PercentOutput, testSpeed);\n Timer.delay(testUpTime);\n srx.set(ControlMode.PercentOutput, 0.0);\n final double currentSRX = RobotContainer.PDP.getCurrent(Constants.ELEVATOR_SRX_PDP);\n final double positionSRX = getPosition();\n //srx.set(ControlMode.PercentOutput, testDownSpeed);\n //Timer.delay(0.1);\n \n Timer.delay(2.0);\n\n if(getPosition() < 0){\n zeroPosition();\n }\n\n // Test climber spx\n final double SPXintialEncoderPos = Math.abs(getPosition());\n spx.set(ControlMode.PercentOutput, testSpeed);\n Timer.delay(testUpTime);\n final double currentSPX = RobotContainer.PDP.getCurrent(Constants.ELEVATOR_SPX_PDP);\n final double positionSPX = getPosition();\n spx.set(ControlMode.PercentOutput, testDownSpeed);\n Timer.delay(0.1);\n spx.set(ControlMode.PercentOutput, 0.0);\n\n Timer.delay(1.0);\n //Reset Motors\n spx.follow(srx); \n srx.setNeutralMode(NeutralMode.Brake);\n spx.setNeutralMode(NeutralMode.Brake);\n\n print(\"ELEVATOR SRX CURRENT: \" + currentSRX + \" SPX CURRENT: \" + currentSPX);\n print(\"ELEVATOR SRX ENCODER INIT POS: \" + SRXintialEncoderPos + \" END POS: \" + positionSRX);\n print(\"ELEVATOR SPX ENCODER INIT POS: \" + SRXintialEncoderPos + \" END POS: \" + positionSPX);\n\n boolean failure = false;\n\n print(\"!%!%#$!%@ - WRITE A TEST FOR THE ELEVATOR LIMIT SWITCHES!!!!!!!!!\");\n\n if (currentSRX < kCurrentThres) {\n failure = true;\n print(\"!!!!!!!!!!!!!!!!! ELEVATOR SRX Current Low !!!!!!!!!!!!!!!!!\");\n }\n\n if (currentSPX < kCurrentThres) {\n failure = true;\n print(\"!!!!!!!!!!!!!!!! ELEVATOR SPX Current Low !!!!!!!!!!!!!!!!!!!\");\n }\n\n if (!Util.allCloseTo(Arrays.asList(currentSRX, currentSPX), currentSRX, 5.0)) {\n failure = true;\n print(\"!!!!!!!!!!!!!!!! ELEVATOR Currents Different !!!!!!!!!!!!!!!!!\");\n }\n\n if (Math.abs(positionSRX - SRXintialEncoderPos) <= 0){\n failure = true;\n print(\"!!!!!!!!!!!! ELEVATOR Encoder didn't change position SRX !!!!!!!!!!!!!\");\n }\n\n if (Math.abs(positionSPX - SPXintialEncoderPos) <= 0){\n failure = true;\n print(\"!!!!!!!!!!!! ELEVATOR Encoder didn't change position SPX !!!!!!!!!!!!!\");\n }\n\n return failure;\n }",
"@Test\n public void BackstagePass_HandleSpecialCase() {\n GildedRose sut = new GildedRose(createItemArray(BACKSTAGE_PASS, 5, 40));\n sut.updateQuality();\n assertEquals(42, sut.items[0].quality);\n }",
"static private void forceDialog() throws InterruptedException {\n if (hasTalkedWithEvilGuy == false) {\n if (josephSchnitzel.getCurrentRoom() == currentRoom) {\n forcedTextBox = true;\n System.out.println(josephSchnitzel.getDescription() + \"\\n\" + josephSchnitzel.getDialog(0, false));\n evilGuyDialog();\n hasTalkedWithEvilGuy = true;\n }\n }\n }",
"@Override\n public void robotInit() {\n SmartDashboard.putBoolean(\"CLIMB\", false);\n SmartDashboard.putNumber(\"servo\", 0);\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n //coast.\n if (RobotMap.DRIVE_TRAIN_DRAGON_FLY_IS_AVAILABLE)\n getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(false, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n\n getRobotContainer().configureButtonBindings();\n getRobotContainer().getTecbotSensors().initializeAllSensors();\n getRobotContainer().getTecbotSensors().getTecbotGyro().reset();\n\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_LEFT_CHASSIS_PORTS);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_RIGHT_CHASSIS_PORTS);\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n\n m_chooser.addOption(\"Move 3 m\", new SpeedReductionStraight(3, .75, 0));\n m_chooser.addOption(\"Rotate 90 degrees\", new SpeedReductionTurn(90, .5));\n m_chooser.setDefaultOption(\"El chido\", new DR01D3K4());\n m_chooser.addOption(\"Collect, go back and shoot\", new CollectPowerCellsGoBackShoot());\n m_chooser.addOption(\"Transport\", new SequentialCommandGroup(new FrontIntakeSetRaw(.75),\n new TransportationSystemSetRaw(.5)));\n m_chooser.addOption(\"Shoot 3PCs n' Move\", new SHOOT_3_PCs_N_MOVE());\n SmartDashboard.putData(\"Auto Mode\", m_chooser);\n\n //camera.setExposureManual(79);\n\n\n }",
"public RobotContainer() {\n // Configure the button bindings\n configureButtonBindings();\n\n }",
"public abstract void interagir(Robot robot);",
"private void updateHitbox() {\n\t\tthis.hitbox = new collisionSphere(2 * scale, this.location);\n\t}",
"public void foundationGrab(){\n\n }",
"public void shape() {\n\t\tSystem.out.println(\"super robot입니다. 팔, 다리, 몸통, 머리가 있습니다.\");\r\n\t}",
"public void instantiate(String managedSystemURI, ObjRef xArchRef, int engineType) throws InvalidArchitectureDescriptionException{\n\t\tSecureManagedSystem managedSystem = new SecureManagedSystem(managedSystemURI, xarch, engineType);\n\t\tmanagedSystem.addMessageListener(\n\t\t\tnew MessageListener(){\n\t\t\t\tpublic void messageSent(Message m){\n\t\t\t\t\tsendToAll(m, bottomIface);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tmanagedSystem.bind(xArchRef);\n\t\tmanagedSystem.startSystem();\n\t\tmanagedSystems.put(managedSystemURI, managedSystem);\n\t\t//managedSystem.createInstanceModel(\"Instance00\");\n\n\t\tSet bindIssues = new HashSet();\n\t\tSet\tinsecureBrickRefs = managedSystem.getInsecureBrickRefs();\n\t\tSet insecureLinkRefs = managedSystem.getInsecureLinkRefs();\n\t\tSet rejectedLinkRefs = managedSystem.getRejectedLinkRefs();\n\t\tfor (Iterator i = insecureBrickRefs.iterator(); i.hasNext(); ) {\n\t\t\tObjRef\tb = (ObjRef)i.next();\n\t\t\tTronElementIdentifier\ttei = new TronElementIdentifier(b, null);\n\t\t\tTronIssue ti = new TronIssue(\"Security\", xArchRef, \"SecureManagedSystem\", TronIssue.SEVERITY_ERROR,\n\t\t\t\t\t\"Insecure brick: \" + XadlUtils.getID(xarch, b), \"Cannot instantiate bricks\", null, new TronElementIdentifier[]{tei});\n\t\t\tbindIssues.add(ti);\n\t\t}\n\t\tfor (Iterator i = insecureLinkRefs.iterator(); i.hasNext(); ) {\n\t\t\tObjRef\tl = (ObjRef)i.next();\n\t\t\tTronElementIdentifier\ttei = new TronElementIdentifier(l, null);\n\t\t\tTronIssue ti = new TronIssue(\"Security\", xArchRef, \"SecureManagedSystem\", TronIssue.SEVERITY_ERROR,\n\t\t\t\t\t\"Link to insecure brick: \" + XadlUtils.getID(xarch, l), \"Cannot weld insecure bricks\", null, new TronElementIdentifier[]{tei});\n\t\t\tbindIssues.add(ti);\n\t\t}\n\t\tfor (Iterator i = rejectedLinkRefs.iterator(); i.hasNext(); ) {\n\t\t\tObjRef\tl = (ObjRef)i.next();\n\t\t\tTronElementIdentifier\ttei = new TronElementIdentifier(l, null);\n\t\t\tTronIssue ti = new TronIssue(\"Security\", xArchRef, \"SecureManagedSystem\", TronIssue.SEVERITY_ERROR,\n\t\t\t\t\t\"Rejected link: \" + XadlUtils.getID(xarch, l), \"Cannot add insecure weld\", null, new TronElementIdentifier[]{tei});\n\t\t\tbindIssues.add(ti);\n\t\t}\n\t\tTronTestResultMessage ttrm = new TronTestResultMessage(\n\t\t\tnull, xArchRef, (TronIssue[])bindIssues.toArray(new TronIssue[0]));\n\t\tsendToAll(ttrm, topIface);\n\t}",
"void updateStrongbox(String username, LightStrongbox strongbox);",
"public void startGearCam() {\n }",
"public static void init() {\n driveLeft = new VictorSP(1);\r\n LiveWindow.addActuator(\"Drive\", \"Left\", (VictorSP) driveLeft);\r\n \r\n driveRight = new VictorSP(0);\r\n LiveWindow.addActuator(\"Drive\", \"Right\", (VictorSP) driveRight);\r\n \r\n driveMotors = new RobotDrive(driveLeft, driveRight);\r\n \r\n driveMotors.setSafetyEnabled(false);\r\n driveMotors.setExpiration(0.1);\r\n driveMotors.setSensitivity(0.5);\r\n driveMotors.setMaxOutput(1.0);\r\n\r\n driveEncoderLeft = new Encoder(0, 1, true, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderLeft\", driveEncoderLeft);\r\n driveEncoderLeft.setDistancePerPulse(0.053855829);\r\n driveEncoderLeft.setPIDSourceType(PIDSourceType.kRate);\r\n driveEncoderRight = new Encoder(2, 3, false, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderRight\", driveEncoderRight);\r\n driveEncoderRight.setDistancePerPulse(0.053855829);\r\n driveEncoderRight.setPIDSourceType(PIDSourceType.kRate);\r\n driveFrontSonar = new Ultrasonic(4, 5);\r\n LiveWindow.addSensor(\"Drive\", \"FrontSonar\", driveFrontSonar);\r\n \r\n shooterMotor = new VictorSP(3);\r\n LiveWindow.addActuator(\"Shooter\", \"Motor\", (VictorSP) shooterMotor);\r\n \r\n climberMotor = new Spark(2);\r\n LiveWindow.addActuator(\"Climber\", \"Motor\", (Spark) climberMotor);\r\n \r\n gearGrabReleaseSolonoid = new DoubleSolenoid(0, 0, 1);\r\n LiveWindow.addActuator(\"Gear\", \"GrabReleaseSolonoid\", gearGrabReleaseSolonoid);\r\n \r\n powerPanel = new PowerDistributionPanel(0);\r\n LiveWindow.addSensor(\"Power\", \"Panel\", powerPanel);\r\n \r\n cameraMountpan = new Servo(4);\r\n LiveWindow.addActuator(\"CameraMount\", \"pan\", cameraMountpan);\r\n \r\n cameraMounttilt = new Servo(5);\r\n LiveWindow.addActuator(\"CameraMount\", \"tilt\", cameraMounttilt);\r\n \r\n\r\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\r\n\t\tdriveSonarFront = new SonarMB1010(0);\r\n\t\tLiveWindow.addSensor(\"Drive\", \"SonarFront\", driveSonarFront);\r\n\r\n\t\t//driveGyro = new GyroADXRS453();\r\n\t\tdriveGyro = new ADXRS450_Gyro();\r\n\t\tLiveWindow.addSensor(\"Drive\", \"Gyro\", driveGyro);\r\n\t\tdriveGyro.calibrate();\r\n\t}",
"@Override\n public void initialize() {\n // Robot.Climber.setLimits();\n SmartDashboard.putBoolean(\"Climb:\", true);\n \n }",
"public void implement(){\n this.rb.moveForward(1);\n \n \n if(this.rb.canPickThing()){\n this.rb.pickThing();\n }\n\n //turn the rb 90 degree to the south\n this.rb.turnLeft();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the east\n this.rb.turnRight();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the north\n this.rb.turnLeft();\n\n //move the navigator\n this.rb.moveForward(2);\n\n //turn Right the robot\n this.rb.turnRight();\n\n //stop at the starting position per move()\n this.rb.moveForward(1); \n \n this.rb.putThing();\n \n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n \n //turn the navigator 90 degree to the west\n this.rb.turnRight();\n \n this.rb.moveForward(1);\n \n this.rb.turnLeft();\n \n this.rb.moveForward(1);\n \n this.rb.turnRight();\n \n this.rb.moveForward(2);\n \n this.rb.turnLeft();\n }",
"@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }",
"private void setupChangeVoice() {\n\t\tFestivalVoice[] voices={FestivalVoice.Kiwi, FestivalVoice.British, FestivalVoice.American};\n\t\tfinal JComboBox voice_chooser = new JComboBox(voices);\n\t\tvoice_chooser.setFont(new Font(\"Arial\", Font.PLAIN, 20));\n\t\tvoice_chooser.setForeground(Color.BLACK);\n\t\tvoice_chooser.setBackground(Color.WHITE);\n\n\t\t//set shown item to be the current voice\n\t\tvoice_chooser.setSelectedItem(parent_frame.getFestival().getFestivalVoice());\n\t\tvoice_chooser.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t\tif((FestivalVoice)voice_chooser.getSelectedItem()!=null){\n\t\t\t\t\tparent_frame.getFestival().setFestivalVoice((FestivalVoice)voice_chooser.getSelectedItem());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tvoice_chooser.setBounds(919, 600, 154, 40);\n\t\tadd(voice_chooser);\n\t}",
"public void onScreenUp() {\n faceUp = true;\n requestForValidationOfQibla();\n }",
"public HeittelyFrame luoHeittelyraami(Heittely heittely) {\n raami.setLayout(null);\n heittelyFrame = new JInternalFrame(\"Heittely\");\n heittelyFrame.setVisible(true);\n heittelyFrame.setBounds(100, 50, 600, 400);\n raami.add(heittelyFrame,0);\n \n heittelyraami = new HeittelyFrame(heittelyFrame, heittely);\n heittelyraami.luoKomponentit();\n return heittelyraami;\n }",
"@Test\r\n void testPavlovAlwaysCooperate() {\r\n AlwaysCooperate testStrat = new AlwaysCooperate();\r\n Pavlov testStrat2 = new Pavlov();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 9, \"Pavlov strategy not functioning correctly\");\r\n }",
"public void VuforiaOrientator() {\n }"
] | [
"0.72289187",
"0.6135169",
"0.55470663",
"0.54371583",
"0.5405781",
"0.51755446",
"0.5126086",
"0.51075065",
"0.5075394",
"0.50753117",
"0.50653267",
"0.50449646",
"0.50338864",
"0.5032266",
"0.5028615",
"0.49873325",
"0.49863443",
"0.4954113",
"0.49532273",
"0.49405965",
"0.49270198",
"0.4906969",
"0.48986876",
"0.4896886",
"0.4889323",
"0.48875532",
"0.48737276",
"0.4862575",
"0.4857666",
"0.48575118",
"0.48488522",
"0.48261273",
"0.4818844",
"0.48167995",
"0.48121595",
"0.48036262",
"0.4786456",
"0.47824496",
"0.4780115",
"0.47797808",
"0.477441",
"0.4774256",
"0.47720703",
"0.47686538",
"0.47677082",
"0.4765053",
"0.47630206",
"0.47622415",
"0.4750364",
"0.47462383",
"0.47460908",
"0.4742699",
"0.47358367",
"0.47356406",
"0.4735337",
"0.47289705",
"0.4724284",
"0.47224197",
"0.47221884",
"0.47176093",
"0.47136378",
"0.47086272",
"0.47080714",
"0.47077283",
"0.4706519",
"0.47065148",
"0.47021544",
"0.47017556",
"0.4700305",
"0.4697239",
"0.4695673",
"0.46938294",
"0.46935007",
"0.469195",
"0.46875966",
"0.46810803",
"0.46792492",
"0.46761066",
"0.46695325",
"0.46649006",
"0.4662813",
"0.465965",
"0.46592242",
"0.46570414",
"0.46546972",
"0.46526054",
"0.46500388",
"0.46490046",
"0.4643282",
"0.46420026",
"0.4639441",
"0.46391153",
"0.4639011",
"0.46357647",
"0.46334034",
"0.4627682",
"0.46252963",
"0.46191293",
"0.46174586",
"0.46134728"
] | 0.790446 | 0 |
Make robot drop surpriseBox (if possible). | @Override
public void dropSurpriseBox(Robot robot, SurpriseBox surpriseBox)
{
try
{
if(robot.canDrop(surpriseBox))
{
robot.drop(surpriseBox);
}
else
{
System.out.println("This surprise box could not be dropped by this robot.");
}
}
catch(IllegalStateException exc)
{
System.out.println("Either this robot or this surprise box is terminated; the robot cannot drop the surprise box.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void pickUpSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canPickUp(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.pickUp(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be picked up by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot pick up the surprise box.\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void useSurpriseBox(Robot robot, SurpriseBox surpriseBox)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canUse(surpriseBox))\r\n\t\t\t{\r\n\t\t\t\trobot.use(surpriseBox);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"This surprise box could not be used by this robot.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this surprise box is terminated; the robot cannot use the surprise box.\");\r\n\t\t}\r\n\t}",
"public void fruitDrop()\n {\n fruit.slowMoveVertical(60);\n }",
"private void testGrab()\n {\n if(gamepad1.y) {\n //move to position where it touches block ----might have to change angle based on trial----\n //Drastic angles at the moment for testing\n servoLeft.setPosition(0.5);\n //servoRight.setPosition(0.5);\n }\n }",
"private void shootLaser() {\n\t\tfor(int i = 0; i<lasers.size(); i++) {\n\t\t\tif(lasers.get(i).getLayoutY() > -lasers.get(i).getBoundsInParent().getHeight() ) { //-37 wenn unterhalb des windows \n\t\t\t\tlasers.get(i).relocate(lasers.get(i).getLayoutX(), lasers.get(i).getLayoutY() - 3); //um 3 pixel nach oben bewegen\n\t\t\t}\n\t\t\telse { //wenn oberhalb des windows \n\t\t\t\t\n\t\t\t\tgamePane.getChildren().remove(lasers.get(i));\n\t\t\t\tlasers.remove(i);\n\t\t\t\tSystem.out.println(lasers.size());\n\t\t\t}\n\t\t}\n\t}",
"public void fruitRegrow()\n {\n fruit.makeInvisible();\n fruit.moveVertical(-60);\n fruit.makeVisible();\n }",
"public void dropItLikeItsHot(){\n\t\tint score_increment = 0;\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\twhile(true){\n\t\t\ttest_location.y += 1;\n\t\t\tif(!collides(test_location, currentPiece)){\n\t\t\t\tpieceOrigin.y += 1;\n\t\t\t\tscore_increment += 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tscore += score_increment*100;\n\t\tgossipGirl();\n\t\trepaint();\n\t}",
"public void pickUp(Player player) {\n player.setBox(this);\n }",
"void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}",
"@Override\n public void run() {\n ElapsedTime time = new ElapsedTime();\n time.reset();\n sleep(3000);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n sh.hitRing();\n sleep(600);\n //sh.pivotStop.setPosition(.55);\n sh.hitRing();\n sleep(500);\n //sh.pivotDown();\n sh.hitRing();\n sleep(500);\n sh.withdraw();\n sh.lift.setPower(0);\n sh.lift.setPower(0);\n wobble.wobbleUp();\n sh.pivotStop.setPosition(1);\n loop.end();\n\n\n }",
"void unsetBox();",
"private void jRadioButtonShootAlternativelyActionPerformed() {\r\n\t\tjRadioButtonShootAlternatively.setSelected(true);\r\n\t\tjRadioButtonShootUntilWater.setSelected(false);\r\n\t\tgame.setGameMode(GameMode.ALTERNATIVELY);\r\n\t}",
"public static void stopCase(Robot r)\n {\n while(r.frontIsClear() == false)\n while(r.canPickThing() == false)\n break;\n }",
"private void asignRegularSandwich() {\n\t\tbaguette = new RegularSandwich();\n\t\tSystem.out.println(\"\\nYou have selected regular bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"public void manageDropping(Rectangle r){\n\t\t\tif (!dropping){ //does the random number part\n\t\t\t\tb.reset(x+ 35, y+50);\n\t\t\t\tint d = rand.nextInt(50);\n\t\t\t\t//System.out.println(randamount);\n\t\t\t\tif ((d == 1) && exists) {\n\t\t\t\t\tdropping =true; \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { //resets the bomb after it has been dropped\n\t\t\t\tif(b.y < 1000) b.dropBomb(dropamount);\n\t\t\t\tbombtimer = 0;\n\t\t\t\t//dropamount += .1;\n\t\t\t\t//dropamount = 5;\n\t\t\t\t\n\t\t\t\tif (b.y >= 700 || b.collided(r)) {\n\t\t\t\t\tif (b.collided(r)) tstartredtimer = true;\n\t\t\t\t\tif (exists) dropping = false;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"public void deleteLaser() {\n shotVisible = false;\n shot.setVisible(false);\n }",
"private void cleaningBallot() {\n\t\tturnLeft();\n\t\tmove();\n\t\tgrabStrayBeepers();\n\t\tturnAround();\n\t\tmove();\n\t\tmove();\n\t\tgrabStrayBeepers();\n\t}",
"public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }",
"void toyPlacingfStuff(){\n //nu stiu daca asta ramane\n gettingBackToInitial();\n nearingTheWallBefore();\n parallelToTheWall();\n actualToyPlacing();\n }",
"public static void chop() {\n RSObject[] tree = Objects.findNearest(7, Yew); //finds the nearest Yew in which we had earlier set the ID of\n if (tree.length > 0)\n if (tree[0].isOnScreen()) { //if tree is on the screen it will move onto clickObject which will be called from the rMouse class.\t\t\t \n\t\t\t Mouse.setSpeed(rMouse.mouseSpeed);\n\t\t\t\trMouse.clickObject(7, \"Yew\", \"Chop down\"); //finds/clicks the an interactive object with the name Yew\n\t\t\t\t\tGeneral.sleep(1500 + rand1);\n\n }else{\n\t\t\t Mouse.setSpeed(rMouse.mouseSpeed);\n Walking.walkTo(tree[0].getPosition());\n while (Player.isMoving())\n General.sleep(800 + rand1);\n }\n\t\t\n }",
"private void changeToPhotoBurstView(Boolean bl) {\n this.changeLayoutTo(DefaultLayoutPattern.BURST_SHOOTING);\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.setSceneNotificationIndicatorsInvisible(false);\n if (bl == false) return;\n this.startCaptureFeedbackAnimation();\n }",
"void removeRobot(Position pos);",
"public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }",
"public abstract void swim() {}",
"public void toggleGrab(){\n \tif (isClosed == true){\n \t\ttriggerTimer.reset();\n \t\tisClosed = false;\n \t\tClawAct.set(false);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t} else {\n \t\tisClosed = true;\n \t\tClawAct.set(true);\n \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\n \t}\n }",
"public void stoperJeux() {\n\t\t\n\t\tliaison.stopper();\n\t}",
"protected void processButton1(Robot robot ){\n robot.getIntake().intakeSuckIn(1);\n\n }",
"public void grabBlock(double timeout) {\n {\n\n robot.grabber.setTargetPosition(GRABBING_POSITION);\n // Turn On RUN_TO_POSITION\n robot.grabber.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n // reset the timeout time and start motion.\n runtime.reset();\n robot.grabber.setPower(0.7);\n\n // keep looping while we are still active, and there is time left, and both motors are running.\n // Note: We use (isBusy() && isBusy()) in the loop test, which means that when EITHER motor hits\n // its target position, the motion will stop. This is \"safer\" in the event that the robot will\n // always end the motion as soon as possible.\n // However, if you require that BOTH motors have finished their moves before the robot continues\n // onto the next step, use (isBusy() || isBusy()) in the loop test.\n while (\n (runtime.seconds() < timeout) &&\n (robot.grabber.isBusy()))\n // Display it for the driver.\n\n telemetry.addData(\"Path2\", \"grabber position: %7d target position: %7d\",\n robot.grabber.getCurrentPosition(),\n GRABBING_POSITION);\n telemetry.update();\n }\n\n // Stop all motion;\n robot.grabber.setPower(0);\n\n\n robot.grabber.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // sleep(250); // optional pause after each move\n }",
"public void faceUp(){\r\n changePlace(hand);\r\n //do a magical work\r\n changePlace(graveYard);\r\n }",
"public void stopShooting() {\n\t\tgetWeapon().releaseMain();\n\t\tsetShooting(false);\n\t}",
"void unsetPowerBox();",
"public abstract void recolocarHitbox();",
"public void swim() {\n\t\tSystem.out.println(\"All the ducks can swim. This is an unchanged behavior for all ducks\");\n\t}",
"@Override\n public void doAction() {\n checkRep();\n if (!storedBalls.isEmpty()) {\n Ball ballToShootOut = storedBalls.remove();\n ballToShootOut.setVelocity(new Vect(0,STOREDBALLVELOCITY));\n ballToShootOut.setActive(true);\n }\n checkRep();\n }",
"public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}",
"public void stopShoot(){\n\t\tshoot.set(0);\n\t}",
"public void ballShoot() {\n\n ballRight.setPower(-1);\n ballLeft.setPower(1);\n\n wait(2.0);\n\n flipper.setPosition(0.7);\n\n wait(0.5);\n\n flipper.setPosition(0.9);\n ballLeft.setPower(0);\n ballRight.setPower(0);\n\n\n }",
"public void dropDown(){\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\ttest_location.y += 1;\n\t\tif(!collides(test_location, currentPiece))\n\t\t\tpieceOrigin.y += 1;\n\t\telse\n\t\t\tgossipGirl();\n\t\trepaint();\n\t}",
"public static void pickUpCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select().id(6).poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Pick-up\"), cannon.name());\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.inventory.select().id(Items.CANNON_BASE_6).count() == 1;\n }\n }, 250, 20);\n }\n }",
"private void action() {\r\n moveSnake();\r\n if (hasEatenPowerUp() == false) checkForCollisionWithSelf();\r\n if (hasHitBoundry() == false) redraw();\r\n }",
"private void bust() {\n //Dialog box pop-up\n JOptionPane.showMessageDialog(this, this.getPlayerName() + \" busted with a value of: \" + this.getValue(), \"BUSTED!\", JOptionPane.INFORMATION_MESSAGE);\n busted = true; //Hand busted\n }",
"public void gearBoxTest(){\n\t\tif (counter < 6) {\n\t\t\ttimerTest.start();\n\t\t\tif (480 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(1);\n\t\t\t\tmotorRF.set(1);\n\t\t\t\tmotorLB.set(1);\n\t\t\t\tmotorLF.set(1);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 480 && 600 >= timerTest.get()) {\n\t\t\t\tmotorRB.set(0);\n\t\t\t\tmotorRF.set(0);\n\t\t\t\tmotorLB.set(0);\n\t\t\t\tmotorLF.set(0);\n\t\t\t}\n\t\t\telse if (timerTest.get() > 600) {\n\t\t\t\ttimerTest.reset();\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void touchUp(InputEvent event, float x, float y, int pointer, int button) {\n if (n < limite){\n for(Block b:comp){\n b.remove();\n b.detach();\n }\n\n }\n else if (n == limite){\n\n // SETTEAR DINAMICO TODOS LOS BLOQUES CREADOS\n\n for (Block b:comp) {\n b.setType();\n }\n\n // ACTUALIZA EL LIMITE\n\n GameScreen.limite.setLimite();\n GameScreen.limite.mostrar();\n }\n\n comp.clear();\n\n GameScreen.plop.stop();\n\n created = false;\n sig = false;\n }",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"@Override\n protected void end() {\n Robot.SCISSOR.extendLift(0);\n }",
"private void makeSnack() {\n\t\teating = true;\n\t\ttama.setLayoutX(200);\n\t\t\n\t\tsnack = new Sprite(3, 3, 22, 25, new Image(\"file:./res/images/snack.png\"), 1, 1000);\n\t\tsnack.setLayoutX(150);\n\t\tsnack.setLayoutY(150);\n\t\tsnack.setScaleX(0.3);\n\t\tsnack.setScaleY(0.3);\n\t\tgrid.getChildren().addAll(snack);\n\t\tPauseTransition pause = new PauseTransition(Duration.millis(1500));\n\t\tpause.setOnFinished(e -> {\n\t\t\tgrid.getChildren().remove(snack);\n\t\t\ttama.setLayoutX(190);\n\t\t\teating = false;\n\t\t\tmodel.getController().eatSnack();\n//\t\t\tif(!model.isHealthy()){\n//\t\t\t\tsetSickImg();\n//\t\t\t}\n\t\t});\n\t\tpause.play();\n\t\t\n\t}",
"public void releasePackwave(){\n libManhattanCommonFunctions.clickAnyElement(getPageElement(\"AllCheckBox\"), \"Select Wave\");\n libManhattanCommonFunctions.clickAnyElement(getPageElement(\"BtnMore\"), \"More Button\");\n libManhattanCommonFunctions.clickAnyElement(getPageElement(\"BtnPackWaves\"), \"Pack Waves Option\");\n libManhattanCommonFunctions.clickAnyElement(getPageElement(\"Packwavecheckbox\"), \"Select Pack Wave\");\n libManhattanCommonFunctions.clickAnyElement(getPageElement(\"BtnRelease\"), \"Release Button\");\n\n }",
"private void tankWillShoot(Graphics2D g2d, GameState state) {\n if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() > 0 && state.getGunType() % 2 == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfCannonBullet(tankObject.getNumOfCannonBullet() - 1);\n if (tankObject.getCannonLevel() == 1) {\n state.getMissiles().add(new Missile(state, 15));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (tankObject.getCannonLevel() == 2) {\n state.getMissiles().add(new Missile(state, 30));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n } else if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() == 0 && state.getGunType() % 2 == 1) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n state.setMouseClicked(false);\n }\n for (Missile missile : state.getMissiles()) {\n missile.paint(g2d, state);\n }\n if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() > 0 && state.getGunType() % 2 == 0) {\n if (numOfRenderBullet1 == 0 && tankObject.getMachineGunLevel() == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 20));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet2 == 0 && tankObject.getMachineGunLevel() == 2) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 30));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet1 <= 7) {\n numOfRenderBullet1++;\n }\n if (numOfRenderBullet1 == 7) {\n numOfRenderBullet1 = 0;\n }\n if (numOfRenderBullet2 <= 3) {\n numOfRenderBullet2++;\n }\n if (numOfRenderBullet2 == 3) {\n numOfRenderBullet2 = 0;\n }\n }\n else if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() == 0 && state.getGunType() % 2 == 0) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n }\n for (Bullet bullet : state.getBullets()) {\n bullet.paint(g2d, state);\n }\n }",
"@SuppressWarnings(\"unused\")\r\n private void snakeSubcutaneousVOI() {\r\n \r\n // set the subcutaneous VOI as active\r\n subcutaneousVOI.setActive(true);\r\n subcutaneousVOI.getCurves().elementAt(0).setActive(true);\r\n \r\n float[] sigmas = new float[2];\r\n sigmas[0] = 1.0f;\r\n sigmas[1] = 1.0f;\r\n \r\n AlgorithmSnake snake = new AlgorithmSnake(srcImage, sigmas, 50, 2, subcutaneousVOI, AlgorithmSnake.OUT_DIR);\r\n snake.run();\r\n\r\n subcutaneousVOI = snake.getResultVOI();\r\n subcutaneousVOI.setName(\"Subcutaneous area\");\r\n \r\n }",
"private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}",
"public void interactWhenSteppingOn() {\r\n\t\t\r\n\t}",
"public void silverDropPoint()\r\n {\r\n System.out.println(\"silverDropPoint\");\r\n if (isCollectionPlane)\r\n {\r\n savePreviousPosition();\r\n setIsCollectionPlane(false);\r\n }\r\n if (motorJ1.getCurrentPosition() > SILVER_DROP_J1)\r\n {\r\n j1Power = -J1_POWER;\r\n }\r\n else if (motorJ1.getCurrentPosition() < SILVER_DROP_J1)\r\n {\r\n j1Power = J1_POWER;\r\n }\r\n\r\n if (motorJ2.getCurrentPosition() > SILVER_DROP_J2)\r\n {\r\n j2Power = -J2_POWER;\r\n }\r\n else if (motorJ2.getCurrentPosition() < SILVER_DROP_J2)\r\n {\r\n j2Power = J2_POWER;\r\n }\r\n\r\n if (motorJ3.getCurrentPosition() > SILVER_DROP_J3)\r\n {\r\n j3Power = -UP_POWER_J3;\r\n }\r\n else if (motorJ3.getCurrentPosition() < SILVER_DROP_J3)\r\n {\r\n j3Power = UP_POWER_J3;\r\n }\r\n toPosition(j1Power, j2Power, j3Power, SILVER_DROP_J1, SILVER_DROP_J2, SILVER_DROP_J3);\r\n j1Power = 0;\r\n j2Power = 0;\r\n j3Power = 0;\r\n }",
"@Override\r\n\tpublic void shoot(Robot robot) throws UnsupportedOperationException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(robot.canShoot())\r\n\t\t\t{\r\n\t\t\t\trobot.shoot();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A terminated robot cannot shoot.\");\r\n\t\t}\r\n\t}",
"public void grab() {\n\t\tif (climbMode == false) {\n\t\t\tif (bumperL) {\n\t\t\t\tmotorGL.set(-1);\n\t\t\t\tmotorGR.set(1);\n\t\t\t} \n\t\t\telse if (bumperR) {\n\t\t\t\tmotorGL.set(1);\n\t\t\t\tmotorGR.set(-1);\n\t\t\t}\t\n\t\t\telse {\n\t\t\t\tmotorGL.set(0);\n\t\t\t\tmotorGR.set(0);\n\t\t\t}\n\t\t}\n\t}",
"public void levelUp() {\n\t\t\tpauseGame(500);//pause the game, play a nice song, and make more bricks!\n\t\t\tmakeBricks(12,8);\n\t\t\tlevelUp.play();\n\t\t}",
"void placeTower();",
"public void goldDropPoint()\r\n {\r\n System.out.println(\"goldDropPoint\");\r\n setManual(false);\r\n if (isCollectionPlane)\r\n {\r\n savePreviousPosition();\r\n setIsCollectionPlane(false);\r\n }\r\n if (motorJ1.getCurrentPosition() > GOLD_DROP_J1)\r\n {\r\n j1Power = -J1_POWER;\r\n }\r\n else if (motorJ1.getCurrentPosition() < GOLD_DROP_J1)\r\n {\r\n j1Power = J1_POWER;\r\n }\r\n\r\n if (motorJ2.getCurrentPosition() > GOLD_DROP_J2)\r\n {\r\n j2Power = -J2_POWER;\r\n }\r\n else if (motorJ2.getCurrentPosition() < GOLD_DROP_J2)\r\n {\r\n j2Power = J2_POWER;\r\n }\r\n\r\n if (motorJ3.getCurrentPosition() > GOLD_DROP_J3)\r\n {\r\n j3Power = -UP_POWER_J3;\r\n }\r\n else if (motorJ3.getCurrentPosition() < GOLD_DROP_J3)\r\n {\r\n j3Power = UP_POWER_J3;\r\n }\r\n toPosition(j1Power, j2Power, j3Power, GOLD_DROP_J1, GOLD_DROP_J2, GOLD_DROP_J3);\r\n j1Power = 0;\r\n j2Power = 0;\r\n j3Power = 0;\r\n }",
"private void jRadioButtonShootUntilWaterActionPerformed() {\r\n\t\tjRadioButtonShootAlternatively.setSelected(false);\r\n\t\tjRadioButtonShootUntilWater.setSelected(true);\r\n\t\tgame.setGameMode(GameMode.UNTILWATER);\r\n\t}",
"private void turnAround() {\n d = Math.random();\n if (d < 0.1) {\n changeAppearance();\n }\n }",
"public void xboxIntakeOuttake()\n {\n //Whether or not we are intaking from the bottom or front. If from front, value is negative.\n double intakeDirection = 1.0;\n if (RobotMap.assistantDriverController.getBumper(Hand.kRight))\n intakeDirection = -1.0;\n\n //Spins the motors when the button is pressed. THIS IS ONLY RUN ONCE UNTIL THE BUTTON IS RELEASED AND PRESSED AGAIN\n if (RobotMap.assistantDriverController.getXButtonPressed())\n {\n spinIntake( RobotMap.manipulatorSpeedModifier * intakeDirection); //Spin the intake\n RobotMap.ballInIntake = !RobotMap.ballInIntake;\n }\n //Only stop the motors when the button is released\n else if (RobotMap.assistantDriverController.getXButtonReleased())\n {\n spinIntake(RobotMap.MOTOR_FULL_STOP); //Stop the intake from spinning\n RobotMap.manipulatorSpeedModifier = RobotMap.MANIPULATOR_SLOW_SPEED;\n }\n else if (!RobotMap.ballIntakeStopSwitch.get() && RobotMap.ballInIntake)\n {\n System.out.println(\"stop\");\n spinIntake(RobotMap.MOTOR_FULL_STOP); //Stop the intake from spinning when the ball is inside\n RobotMap.manipulatorSpeedModifier = RobotMap.MOTOR_FULL_SPEED;\n }\n }",
"public void shape() {\n\t\tSystem.out.println(\"super robot입니다. 팔, 다리, 몸통, 머리가 있습니다.\");\r\n\t}",
"private void halt() {\n robot.leftFront.setPower(0);\n robot.leftBack.setPower(0);\n robot.rightFront.setPower(0);\n robot.rightBack.setPower(0);\n }",
"public ConfigureRobot()\n {\n Scheduler.getInstance().removeAll(); //remove all running commands\n addSequential(new BrakeOpen(),2);\n addSequential(new WaitCommand(1));\n addSequential(new LiftToBottom(),3);\n }",
"public void addBox()\n {\n if(Student.sittingRia==false) {\n box = new BoxRia(\"chalkboard.png\",4,2);\n addObject(box,box.myRow,box.mySeat);\n chalk = new BoxRia(\"chalk.png\",0,0);\n addObject(chalk,2,3);\n }\n }",
"private void dropped(HeroItem item, Unit unit) {\n if (ItemMaster.isBreakable(item)) {\n item.broken(); // remove from game?\n if (item instanceof QuickItem) {\n QuickItem quickItemObj = (QuickItem) item;\n if (quickItemObj.isConcoction()) {\n quickItemObj.activate(Ref.getSelfTargetingRefCopy(unit)); // setForceTarget(true)\n }\n }\n } else {\n unit.getGame().getDroppedItemManager().itemFalls(unit.getCoordinates(), item);\n }\n }",
"@Override //Stopped being constant. Would only call when mouse released\r\n\tprotected void mouseMovedOrUp(int x, int y, int b) {\n\t\tif(buttonUpDelay > 0) buttonUpDelay --;\r\n\t\t\r\n\t\tif(b != -1 && buttonUpDelay <= 0){\r\n\t\t\tbutton = b;\r\n\t\t\tisDown = false;\r\n\t\t}\r\n\t\tif(!insc.canEdit()) return;\r\n\t\tif(isDown){\r\n\t int sx = this.guiLeft;\r\n\t int sy = this.guiTop;\r\n\t\t\tx -= 42 + sx;\r\n\t\t\ty -= 19 + sy;\r\n\t\t\tx/=6;\r\n\t\t\ty/=6;\r\n\t\t\t\r\n\t\t\tif(x < 0 || y < 0 || x >= 16 || y >= 16){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(button == 1) {\r\n\t\t\t\tsetDust(x,y,0);\r\n\t\t\t}\r\n\t\t\tif(button == 0 && this.inventorySlots.getSlot(0).getStack() != null) {\r\n\t\t\t\tint slot = this.inventorySlots.getSlot(0).getStack().getItemDamage();\r\n\t\t\t\tint id = this.inventorySlots.getSlot(0).getStack().stackSize;\r\n\t\t\t\tItemStack stack = this.playerInv.getStackInSlot(slot);\r\n\t\t\t\tif(getDust(x,y) != id && ItemInk.reduce(this.player,stack, 1)){\r\n\t\t\t\t\tsetDust(x,y,id);\r\n\t\t\t\t\tFMLClientHandler.instance().sendPacket(PacketHandler.getUseInkPacket(slot, 1));\r\n//\t\t\t\t\tthis.inventorySlots.putStackInSlot(slot, stack);\r\n\t\t\t\t\tthis.playerInv.setInventorySlotContents(slot, stack);\r\n\t\t\t\t\tthis.inventorySlots.putStackInSlot(slot+1, stack);\r\n\t\t\t\t\tif(stack.itemID != DustMod.ink.shiftedIndex){\r\n//\t\t\t\t\t\tthis.inventorySlots.putStackInSlot(0, new ItemStack(DustMod.ink.shiftedIndex, 0, -1));\r\n\t\t\t\t\t\t //Loop through player's hotbar for inks\r\n//\t\t\t\t\t\t for(int i = 1; i < 10; i++){\r\n//\t\t\t\t\t\t\t ItemStack item = this.playerInv.getStackInSlot(i-1);\r\n//\t\t\t\t\t\t\t if(item != null && item.itemID == DustMod.ink.shiftedIndex){\r\n//\t\t\t\t\t\t \tint dustId = ItemInk.getDustID(item);\r\n//\t\t\t\t\t\t \tthis.inventorySlots.putStackInSlot(0, new ItemStack(DustMod.ink.shiftedIndex, dustId, i-1));\r\n//\t\t\t\t\t\t\t\t break;\r\n//\t\t\t\t\t\t\t }\r\n//\t\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n//\t\tsuper.mouseMovedOrUp(x, y, b);\r\n\t}",
"public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void atrapar() {\n if( una == false) {\n\t\tif ((app.mouseX > 377 && app.mouseX < 591) && (app.mouseY > 336 && app.mouseY < 382)) {\n\t\t\tint aleotoridad = (int) app.random(0, 4);\n\n\t\t\tif (aleotoridad == 3) {\n\n\t\t\t\tSystem.out.print(\"Lo atrapaste\");\n\t\t\t\tcambioEnemigo = 3;\n\t\t\t\tsuerte = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\t\t\tif (aleotoridad == 1 || aleotoridad == 2 || aleotoridad == 0) {\n\n\t\t\t\tSystem.out.print(\"Mala Suerte\");\n\t\t\t\tcambioEnemigo = 4;\n\t\t\t\tmal = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\n\t\t}\n }\n\t}",
"public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}",
"@Override\n public void kickBox() {\n\n System.out.println(\"kangaroo with name \"+name+\" is boxing\");\n }",
"public void move() {\n\t\t\tRandom rand = new Random();//random number generator\n\t\t\tint value = rand.nextInt(500000);//there is a 1 in 500000 chance there will be a new powerup every frame.\n\t\t\tif (value==0) {//if the value is 0\n\t\t\t\tRandom ran = new Random();//make a random number generator and a power up vairable\n\t\t\t\tPowerUp currentPowerUp = null;\n\t\t\t\tint type = ran.nextInt(3);//switch the 1 for the amount of types made.\n\t\t\t\tif (type==0) {//add the powerup depending on the random number. There are 3 types\n\t\t\t\t\tcurrentPowerUp = new PowerUp(healthPowerUp, 0);//this adds a life\n\t\t\t\t}\n\t\t\t\telse if (type==1) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(longPowerUp, 1);//this makes the slider wider\n\t\t\t\t} else if (type==2) {\n\t\t\t\t\tcurrentPowerUp = new PowerUp(bonusPointsPowerUp, 2);//this just adds points\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//set x and y\n\t\t\t\t//make a random x\n\t\t\t\tint newX = ran.nextInt(401) - 201 + GamePlay.getScreenWidth()/2; //-200 to 200 variance from center\n\t\t\t\tint newY = ran.nextInt(201) - 101 + GamePlay.getScreenHeight()/4;//-100 to 100 variance from the 25% of top distance line.\n\t\t\t\tif (currentPowerUp!=null) {\n\t\t\t\t\tcurrentPowerUp.setX(newX);\n\t\t\t\t\tcurrentPowerUp.setY(newY);\n\t\t\t\t\tpowerUps.add(currentPowerUp);//add the powerups to an array list\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"PowerUp error.\");//if the variable is null, something went wrong.\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//move all powerUps down by ball speed\n\t\t\tfor (PowerUp power: powerUps) {\n\t\t\t\tpower.setY(power.getY() + ballSpeed);\n\t\t\t}\n\t\t\t\n\t\t\t//check if the powerups are off the screen. remove if they are. \n\t\t\tfor (int r = powerUps.size()-1; r>=0; r--) {\n\t\t\t\tif (powerUps.get(r).getY() > GamePlay.getScreenHeight()-h) {\n\t\t\t\t\tpowerUps.remove(r);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//death of a ball\n\t\t\tif (ball.getY()>GamePlay.getScreenHeight() && pause==false) {\n\t\t\t\tdeath();\n\t\t\t}\n\t\t\t\n\t\t\t//no bricks left\n\t\t\tif (blocks.size()==0) {\n\t\t\t\t//you leveled up!\n\t\t\t\tlevelUp();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//wall collision check for ball\n\t\t\t//right wall\n\t\t\tif (ball.rightCollide(GamePlay.getScreenWidth())) {//seperated for later use if wanted.\n\t\t\t\tballVX*=-1;\n\t\t\t} else if (ball.leftCollide(0)) {//left wall\n\t\t\t\tballVX*=-1;\n\t\t\t}\n\t\t\t\n\t\t\tif (ball.topCollide(0)) {//top wall\n\t\t\t\tballVY*=-1;\n\t\t\t} //dont check bottom wall because that is the death of a ball.\n\t\t\t\n\t\t\t//collision with the slider.\n\t\t\tif (ball.getRect().intersects(slider.getRect()) && ball.getY()+ball.getHeight() <= slider.getY()+ballSpeed) {//intersected bool needed\n\t\t\t\tballVY*=-1;\n\t\t\t\tballVX+=sliderVX;//add the slider velocity to the ball velocity, giving user some control over angle. \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//collision with the powerups\n\t\t\t\n\t\t\tfor (int a = powerUps.size()-1; a>=0; a--) {//iterate thrpough the powerups\n\t\t\t\tPowerUp power = powerUps.get(a);\n\t\t\t\tif (power.getRect().intersects(slider.getRect())) {//if the powerups rect intersects, the slider caught it. Remove from screen\n\t\t\t\t\t//THIS MEANS THEY CAUGHT THE POWERUP\n\t\t\t\t\tif (power.getType()==\"HEALTH\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tif (lives<5)\n\t\t\t\t\t\t\tlives+=1;//add a life up to 5\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"LONG\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\textended = true;//extended flag to say the slider is extended. extend the slider's width by the adjust amount preset globally\n\t\t\t\t\t\tslider.resize(slider.getWidth()+adjust, slider.getHeight());\n\t\t\t\t\t\tslider.setX(slider.getX()-adjust/2);\n\t\t\t\t\t\textendTimer.restart();//restart the entend timer\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t} else if (power.getType()==\"BONUS\" && power.getIntersected()==false) {\n\t\t\t\t\t\tpower.setIntersected(true);\n\t\t\t\t\t\tscore+=100;//add a 100 points.\n\t\t\t\t\t\tpowerUps.remove(a);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//collision with blocks\n\t\t\t\n\t\t\tboolean changed = false;//this is a flag to see if any collisions occured this frame\n\t\t\tfor (Block block:blocks) {\n\t\t\t\tRectangle r = block.getRect();\t\t\n\t\t\t\tif (r.intersects(ball.getRect())) {//if the rects intersected, something hit something. However, we don't know from what direction\n\t\t\t\t\t//since the vy is always going to be by 1, we can check if it is equal. There is no multiples to deal with. \n\t\t\t\t\t\n\t\t\t\t\t//this checks if it was colliding from the bottom. Check the bottom edge of block and top of the ball\n\t\t\t\t\tif (ball.getY() + 2 >= block.getBottom() && ball.getY() -2 <= block.getBottom() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//bottom collision\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (ball.getY() + ball.getHeight() + 2 >=block.getTop() && ball.getY() + ball.getHeight() -2 <=block.getTop() && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this checks if it was colliding on the top. Check bottom edge of ball and top of block.\n\t\t\t\t\t\tballVY*=-1;//reflect back\n\t\t\t\t\t\tscore += block.downColor();//change the color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag so it will not trigger again for the same stimuli\n\t\t\t\t\t\tball.setY(ball.getY() + ballVY);//set the y to remove the ball from collision\n\t\t\t\t\t\tchanged=true;//set the changed flag to true\n\t\t\t\t\t\thitSound.play();//play a sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (changed==false && ball.getIntersected()==false) {\n\t\t\t\t\t\t//this must mean it is on the left or right\n\t\t\t\t\t\t//it doesn't matter which one, the change is the exact same!\n\t\t\t\t\t\tballVX*=-1;//flip the x direction\n\t\t\t\t\t\tscore+=block.downColor();//change color, adjust score\n\t\t\t\t\t\tball.setIntersected(true);//set the intersected flag\n\t\t\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\t\t\tchanged=true;//set the changed flag\n\t\t\t\t\t\thitSound.play();//play the sound\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}//end the for.\n\t\t\tif (changed==false) {//if no changes, reset the flag.\n\t\t\t\tball.setIntersected(false);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//move everything as per velocity\n\t\t\tif (slider.getX() > 10 && sliderVX<0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);//the slider can move twice as fast as the ball.\n\t\t\t} else if ((slider.getX()+slider.getWidth()) < GamePlay.getScreenWidth()-10 && sliderVX>0) {\n\t\t\t\tslider.setX(slider.getX() + sliderVX*ballSpeed*2);\n\t\t\t}\n\t\t\tif (ready) {\n\t\t\t\tball.setX(ball.getX() + ballVX);\n\t\t\t\tball.setY(ball.getY() + ballVY);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"public ClimbAlt(Joystick joystick) {\n requires(sClimber);\n requires(sElevator);\n requires(sIntake);\n stick = joystick;\n }",
"private void climbWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.goUpWall();\n\t\tthis.goAcrossWall();\n\t\tthis.goDownWall();\n\t}",
"public void actionPerformed(ActionEvent e){\n\t\t\tt.rotateStick(mx, my);\n\t\t\tfor (int i = 0; i < bombers.size(); i ++){ //manages the dropping of the bombs of the bombers\n\t\t\t\t if (bombers.get(i).exists) bombers.get(i).moveBomber();\n\t\t\t\t bombers.get(i).manageDropping(t);\n\t\t \t}\n\t\t\tfor(int i = 0; i < bombers.size(); i ++){ //manages the removing of the bombers from the array\n\t\t\t\tif (bombers.get(i).exists == false && bombers.get(i).startboomtimer == false) bombers.remove(i);\n\t\t\t}\n\t\t\t\n\t\t\tif (bombers.isEmpty()){ //manages what happens after waveclear is complete\n\t\t\t\tnumplanes ++;\n\t\t\t\t\n\t\t\t\tif (numplanes <= 4){ //if the waves have not maxed out and you have not beat the game, crete question panel to move on\n\t\t\t\t\tmoveframe = new JFrame (\"Move on\");\n\t\t\t\t\t\n\t\t\t\t\tRandom rand = new Random();\n\t\t\t\t\tmoveframe.setSize(500,320);\n\t\t\t\t\tQuestion question1 = questions.get(rand.nextInt(questions.size()));\n\t\t\t\t\tQuestion question2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tquestion2 = questions.get(rand.nextInt(questions.size()));\n\t\t\t\t\t} while(question2.equals(question1));\n\t\t\t\t\tmoveframe.getContentPane().add(new QuestionPanelLoss(question1, question2, 1), BorderLayout.CENTER);\n\t\t\t\t\tmoveframe.setLocationRelativeTo(null);\n\t\t\t\t\tmoveframe.setVisible(true);\n\n\t\t\t\t\t\n\t\t\t\t\ttime.stop();\n\t\t\t\t}\n\t\t\t\telse{ //make a congragulatory frame if you clear all the waves\n\t\t\t\t\tmoveframe = new JFrame (\"gratz u won\");\n\t\t\t\t\tmoveframe.setSize(300,200);\n\t\t\t\t\tmoveframe.getContentPane().add(new JLabel(\"YAYYY U WON\"), BorderLayout.CENTER);\n\t\t\t\t\tmoveframe.setLocationRelativeTo(null);\n\t\t\t\t\tmoveframe.setVisible(true);\n\t\t\t\t\tJButton exit = new JButton(\"exit\");\n\t\t\t\t\texit.addActionListener(new TwoTime());\n\t\t\t\t\tmoveframe.getContentPane().add(exit, BorderLayout.SOUTH);\n\t\t\t\t\ttime.stop();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\trepaint();\n\t\t\t \n\t\t}",
"@Override\n\tpublic void swim() {\n\t\t\n\t}",
"public static void testNegate()\n {\n\t Picture thrudoor = new Picture(\"thruDoor.jpg\");\n\t thrudoor.toNegative();\n\t thrudoor.explore();\n }",
"private void shoot() {\n }",
"private void shoot() {\n }",
"public void shoot(){\r\n\t\tif(numberOfArrows>0){\r\n\t\t\tnumberOfArrows--;\r\n\t\t\tPosition positionWumpus = b.getWumpus().getPosition();\r\n\t\t\tif (position.checkShoot(positionWumpus))\r\n\t\t\t\tb.getWumpus().kill();\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"There are no more arrows.\");\r\n\t}",
"@Override\n public void execute() {\n //\"Making dough\"\n Component pastryDough = ctx.widgets.component(1371,44).component(5);\n Component mix = ctx.widgets.component(1370, 38);\n\n //Makes sure that pastry dough is highlighted, if not it clicks it\n if(pastryDough.textureId() != 15201) {\n ctx.widgets.component(1371, 44).component(4).click();\n }\n\n ctx.input.send(\"{VK_SPACE}\");\n ctx.backpack.select().id(ItemIds.PASTRY_DOUGH);\n int doughCountBefore = ctx.backpack.count();\n\n Condition.sleep(Random.nextInt(500,1500));\n Condition.wait(new Callable<Boolean>() {\n public Boolean call() throws Exception {\n System.out.println(\"Within Loop...\");\n return !ctx.widgets.component(1251, 0).component(0).visible();\n }\n }, 1000, 19);\n\n ctx.backpack.select().id(ItemIds.PASTRY_DOUGH);\n Vars.PASTRY_DOUGH_MIXED += ctx.backpack.count() - doughCountBefore;\n System.out.println(\"We have made it, created pastry dough.\");\n\n }",
"@Test\r\n\tpublic void testButtonPressedPopRackDisabled() {\r\n\t\tCoin coin = new Coin(200);\r\n\t\ttry {\r\n\t\t\tvend.getPopCanRack(0).disable();\r\n\t\t\tvend.getCoinSlot().addCoin(coin);\r\n\t\t\tvend.getSelectionButton(0).press();\t\r\n\t\t\tassertTrue((vend.getPopCanRack(0).isDisabled()) && (vend.getDeliveryChute().removeItems().length==0));\r\n\t\t} catch (DisabledException e) {\r\n\t\t\tassertTrue(false);\r\n\t\t}\r\n\t}",
"private static void shooting() {\n if (m_gamepad.getStartButton() || shootOverride) { //If the start button is pressed\n if (Math.abs(kVelocitySetpoint - -flywheelMaster.getSelectedSensorVelocity()) <= kFlywheelTolerance) { // ... and we're close enough to the desired RPM ...\n SmartDashboard.putBoolean(\"AUTO SHOOT READY\", true); //Alert driver that the shooting is ready\n runConveyor(); //Convey balls into the flywheel\n } else { //If we are NOT within our tolerance\n SmartDashboard.putBoolean(\"AUTO SHOOT READY\", false); //Alert the operator\n }\n if (velocityDipped && -flywheelMaster.getSelectedSensorVelocity() >= kVelocitySetpoint) {\n powerCellCount--;\n velocityDipped = false;\n }\n\n if (-flywheelMaster.getSelectedSensorVelocity() <= kDip /*Placeholder value*/) {\n velocityDipped = true;\n }\n PID(); //Calculate PIDF loop\n flywheelMaster.set(ControlMode.PercentOutput, -speed); //Run the motor at the calculated level\n } else { //If start button is NOT pressed\n flywheelMaster.set(ControlMode.PercentOutput, m_gamepad.getY(GenericHID.Hand.kLeft)); //Set flywheel manually with joystick\n SmartDashboard.putBoolean(\"AUTO SHOOT READY\", false); //Alert operator\n }\n }",
"public void control(Spawn spawn) {}",
"@Override\n public void tearDown() {\n if(wasPassive){\n ((AskGodsFromListPassiveController)savedScene.controller).stopAnimation();\n }\n }",
"public void xboxHatchControl()\n {\n if (RobotMap.assistantDriverController.getStartButtonPressed())\n {\n RobotMap.hatchHolderTalon.set(0);\n }\n if (RobotMap.assistantDriverController.getBumperPressed(Hand.kLeft))\n {\n if (RobotMap.hatchHolderHasHatch)\n new ReleaseHatchCommand().start();\n else\n new GrabHatchCommand().start();\n RobotMap.hatchHolderHasHatch = !RobotMap.hatchHolderHasHatch;\n }\n }",
"@Override\n\tpublic void setChaseTarget(){\n\t\tthis.setTarget(_pacman.getX()+Constants.SQUARE_SIDE,_pacman.getY()-(4*Constants.SQUARE_SIDE));\n\t}",
"public void breakWall() {\r\n\tbustedWall = true;\r\n}",
"public static void fixCannon(ClientContext ctx) {\n GameObject cannon = ctx.objects.select(new Filter<GameObject>() {\n @Override\n public boolean accept(GameObject gameObject) {\n return gameObject.name().toLowerCase().contains(\"broken\");\n }\n }).nearest().poll();\n\n if (cannon.inViewport()) {\n cannon.interact((\"Repair\"));\n sleep(3000);\n }\n }",
"protected void dropIt() {\n\t\tshowUnselected();\n\n\t\tfirePropertyChange(\n\t\t\t\"insertQuestion\",\n\t\t\tSwingUtilities.getAccessibleIndexInParent(this),\n\t\t\t-1);\n\t}",
"public void runPuzzleMovement( Screw screw, float screwVal, Platform p );",
"void despawnHitbox() {\n\t\tif (hitbox == null) return;\n\t\thitbox.remove();\n\t\thitbox = null;\n\t}",
"public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }",
"public PaperDrop(){\n level = 1;\n world = new Level1();\n world.populate(this);\n //starts the game\n world.start();\n \n try {\n gameMusicL1 = new SoundClip(\"data/music.wav\");\n gameMusicL1.loop();\n } catch (UnsupportedAudioFileException|IOException|LineUnavailableException e) {\n System.out.println(e);\n }\n \n // make a view\n view = new UserView(world, 500, 500);\n // allows string information to be displayed e.g. lives\n view = new GUI(world, this, 500, 500);\n view.setWorld(world); \n \n // display the view in a frame\n final JFrame frame = new JFrame(\"Paper Drop\");\n \n // creates new MenuOptions class to allow buttons to be used\n menu = new MenuOptions(this);\n \n // displays buttons north of the screen\n frame.add(menu, BorderLayout.NORTH);\n // quit the application when the game window is closed\n frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frame.setLocationByPlatform(true);\n // display the world in the window\n frame.add(view);\n // don't let the game window be resized\n frame.setResizable(false);\n // size the game window to fit the world view\n frame.pack();\n // make the window visible\n frame.setVisible(true);\n // get keyboard focus\n frame.requestFocus();\n \n \n // add controls to the game for positioning first obstacle\n move = new MoveObstacle(world.getObstacle());\n frame.addKeyListener(move); \n \n // add controls to the game for positioning second obstacle\n move2 = new MoveObstacle2(world.getObstacle2());\n frame.addKeyListener(move2);\n \n // add control to remove ball paltform to allow drop\n drop = new BallDrop(world.getBallPlatform());\n frame.addKeyListener(drop);\n\n //JFrame debugView = new DebugViewer(world, 500, 500);\n }",
"private void brakeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_brakeActionPerformed\n\n roboLogic.brake();\n if (l.isRunning()) {\n l.stop();\n }\n if (r.isRunning()) {\n r.stop();\n }\n\n\n }",
"void makeDragon() {\n new BukkitRunnable() {\n int i = 555;\n\n @Override\n public void run() {\n Set<BlockData> set = create.get(i);\n for (BlockData blockData : set) {\n blockData.setBlock();\n }\n\n i++;\n if (i > 734) {\n cancel();\n }\n }\n }.runTaskTimer(Main.plugin, 0, 2);\n // Location end = new Location(Bukkit.getWorld(\"world\"), 3, 254, 733);\n }",
"void addBoxObject() {\n\t\tint boxObjectX = random.nextInt(ScreenManager.getWindowWidth());\n\t\tint boxObjectY = random.nextInt(ScreenManager.getWindowHeight());\n\t\tint boxObjectWidth = ScreenManager.getSizeFromPercentageOfWindowY((float) 24);\n\t\tint boxObjectHeight = ScreenManager.getSizeFromPercentageOfWindowY(18);\n\t\tint boxObjectHitsToDestroy = random.nextInt(9)+1;\n\t\t\n\t\tboxObjects.add(new BoxObject(boxObjectX, boxObjectY, boxObjectWidth, boxObjectHeight, boxObjectHitsToDestroy, true));\n\t}",
"public void absorbSoul()\n\t{\n\t\tabsorbed = true;\n\t\t\n\t}",
"private void remindGoal()\n {\n System.out.println(\"you have to Pick up all three items and get back outside!\");\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"public void main() {\n\tvor();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tnimm();\n\t\n\t/* get hamster to pick up four grains\n\t(continuation of previous code) */\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\t\n\t/* get hamster to pick up all grains\n\t(continuation of previous code) */\n\t\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\tvor();\n\tnimm();\n\t\n\t/* drop all grains in top left corner\n\tand go back to initial position (facing south)\n\t(continuation of previous code) */\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tvor();\n\tgib(); // drop all 11 grains\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tgib();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n\tvor();\n\tvor();\n\tlinksUm();\n\tlinksUm();\n\tlinksUm();\n\tvor();\n}"
] | [
"0.690517",
"0.646985",
"0.5927126",
"0.58935034",
"0.5832075",
"0.5792542",
"0.5692224",
"0.561131",
"0.56067634",
"0.5603558",
"0.55813634",
"0.5574912",
"0.55503374",
"0.55320495",
"0.5499696",
"0.54479355",
"0.54365903",
"0.54357517",
"0.54267824",
"0.54116064",
"0.5392085",
"0.5387581",
"0.53813636",
"0.5381334",
"0.5380879",
"0.53742075",
"0.53685707",
"0.5364772",
"0.5358922",
"0.53579915",
"0.53559065",
"0.5355389",
"0.5334805",
"0.5328884",
"0.5303242",
"0.5297766",
"0.52974284",
"0.529675",
"0.52958316",
"0.5286601",
"0.5276474",
"0.5275848",
"0.5265351",
"0.5253195",
"0.52525103",
"0.5251931",
"0.5251899",
"0.5248833",
"0.5245355",
"0.523222",
"0.5226862",
"0.52166647",
"0.52082807",
"0.5205225",
"0.52043873",
"0.52018017",
"0.5198473",
"0.51977783",
"0.5197025",
"0.51942533",
"0.5190237",
"0.5188702",
"0.51865095",
"0.5180387",
"0.5175771",
"0.5171546",
"0.5170536",
"0.51696175",
"0.5167703",
"0.51657695",
"0.51648414",
"0.5164669",
"0.5159857",
"0.5159614",
"0.51574033",
"0.51559114",
"0.5154269",
"0.5154269",
"0.5154121",
"0.51522374",
"0.5149886",
"0.5149561",
"0.5138242",
"0.5135068",
"0.51326823",
"0.5132414",
"0.5125979",
"0.5125274",
"0.5124611",
"0.512181",
"0.5119393",
"0.51193863",
"0.51090324",
"0.51075137",
"0.5102079",
"0.50977767",
"0.50963366",
"0.50899845",
"0.5087896",
"0.50855154"
] | 0.71637625 | 0 |
Transfer all items possessed by from to to. | @Override
public void transferItems(Robot from, Robot to)
{
from.transferItems(to);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void moveAllItems() {\n for (BaseObject object : getAllItems()) {\n object.move();\n }\n }",
"void onItemMove(int fromPosition, int toPosition) {\n Collections.swap(mItems, fromPosition, toPosition);\n notifyItemMoved(fromPosition, toPosition);\n }",
"private void moveTiles(ArrayList<MahjongSolitaireTile> from, ArrayList<MahjongSolitaireTile> to)\n {\n // GO THROUGH ALL THE TILES, TOP TO BOTTOM\n for (int i = from.size()-1; i >= 0; i--)\n {\n MahjongSolitaireTile tile = from.remove(i);\n \n // ONLY ADD IT IF IT'S NOT THERE ALREADY\n if (!to.contains(tile))\n to.add(tile);\n } \n }",
"public int move(int from, int to) {\n // Gracefully handle items beyond end\n final int size = mItems.size();\n from = constrain(from, 0, size - 1);\n to = constrain(to, 0, size - 1);\n\n final Path item = mItems.remove(from);\n mItems.add(to, item);\n return to;\n }",
"@Override\n public boolean onItemMove(int fromPosition, int toPosition) {\n if (fromPosition < toPosition){\n for(int i = fromPosition;i<toPosition;i++){\n Collections.swap(cartList, i, i+1);\n }\n }else{\n for (int i = fromPosition; i > toPosition; i--){\n Collections.swap(cartList, i, i-1);\n }\n }\n notifyItemMoved(fromPosition,toPosition);\n return true;\n }",
"public void move(int from, int to) {\n // Peek the top element without popping it, to remain in\n // consistent state if push throws an exception\n towers[to].push(towers[from].peek());\n towers[from].pop();\n numMoves++;\n }",
"public void move(@IntRange(from = 0) final int fromPosition,\n @IntRange(from = 0) final int toPosition) {\n final E e = mItems.remove(fromPosition);\n mItems.add(toPosition, e);\n mDatasourceObservable.notifyItemMoved(fromPosition, toPosition);\n }",
"@Override\n public void onRowMoved(int fromPosition, int toPosition) {\n if (fromPosition < toPosition) {\n for (int i = fromPosition; i < toPosition; i++) {\n Collections.swap( listManageHome, i, i + 1);\n }\n } else {\n for (int i = fromPosition; i > toPosition; i--) {\n Collections.swap( listManageHome, i, i - 1);\n }\n }\n notifyItemMoved(fromPosition, toPosition);\n notifyItemChanged(fromPosition);\n notifyItemChanged(toPosition);\n }",
"void saveItemMove(int fromPosition, int toPosition) {\n int fromItemPos = mItems.get(toPosition).getPosition();\n int toItemPos;\n\n if (fromPosition < toPosition) {\n // moved down\n toItemPos = mItems.get(toPosition - 1).getPosition();\n } else {\n // moved up\n toItemPos = mItems.get(toPosition + 1).getPosition();\n }\n\n mDisposable.add(mViewModel.movePositions(fromItemPos, toItemPos)\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe());\n }",
"public void drop(int from, int to) {\n ArrayList<String> buttons = PowerWidgetUtil.getButtonListFromString(\n PowerWidgetUtil.getCurrentButtons(PowerWidgetOrderActivity.this));\n\n // move the button\n if(from < buttons.size()) {\n String button = buttons.remove(from);\n\n if(to <= buttons.size()) {\n buttons.add(to, button);\n\n // save our buttons\n PowerWidgetUtil.saveCurrentButtons(PowerWidgetOrderActivity.this,\n PowerWidgetUtil.getButtonStringFromList(buttons));\n\n // tell our adapter/listview to reload\n mButtonAdapter.reloadButtons();\n mButtonList.invalidateViews();\n }\n }\n }",
"@Override\n public boolean onItemMove(int fromPosition, int toPosition) {\n if (fromPosition < toPosition) {\n for (int i = fromPosition; i < fromPosition; i++) {\n Collections.swap(dummyDataList, i, i + 1);\n }\n } else {\n for (int i = fromPosition; i > toPosition; i--) {\n Collections.swap(dummyDataList, i, i - 1);\n }\n }\n notifyItemMoved(fromPosition, toPosition);\n\n return true;\n }",
"public void transferItem(Items item) throws Exception {\n\t\tif (item.getHolder() instanceof Monsters) {\n\t\t\titem.setHolder(null);\n\t\t\tthis.addAnchor(item);\n\t\t}\n\t\telse if (item.getHolder() instanceof Backpacks) {\n\t\t\titem.setHolder(null);\n\t\t\tthis.addAnchor(item);\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"The transaction is only possible between monsters and/or backpacks.\");\n\t}",
"public void swapItemFromInventoryToOther(@NotNull Usable item, Usable other) {\n for (int i = 0; i < size; i++) {\n if (item == items[i]) {\n this.removeItem(i);\n if (other != null) {\n this.setItem(other, i);\n }\n return;\n }\n }\n }",
"@SuppressWarnings(\"All\")\n public <T> void copy(MyList<? super T> to, MyList<? extends T> from) {\n\n System.out.println(\"from size \" + from.size);\n for (int i = 0; i < from.getSize(); i++) {\n to.add(from.getByIndex(i));\n }\n }",
"private int transferItemsToLTS(Item item)\r\n {\r\n int redundantItems = this.getItemCount(item.getType()) -\r\n (int)(PERCENT_20 * this.getCapacity() / item.getVolume()); // items to be transfer to LTS\r\n if(Locker.commonLTS.addItem(item, redundantItems) == VALID_VALUE) // items passed to LTS successfully\r\n {\r\n this.removeItem(item, redundantItems);\r\n System.out.println(\"Warning: Action successful, but has caused items to be moved to storage\");\r\n return SPECIAL_VALID_VALUE;\r\n }\r\n nItemsCantBeInsertedMSG(item, redundantItems);\r\n return INVALID_VALUE;\r\n }",
"@Override\n public void run() {\n for (int amount : amounts) {\n synchronized (from) {\n synchronized (to) {\n from.addMoney(-amount);\n to.addMoney(amount);\n }\n }\n }\n }",
"public void takeItemsFromChest() {\r\n currentRoom = player.getCurrentRoom();\r\n for (int i = 0; i < currentRoom.getChest().size(); i++) {\r\n player.addToInventory(currentRoom.getChest().get(i));\r\n currentRoom.getChest().remove(i);\r\n }\r\n\r\n }",
"public void moveTo(Inventory inventory) {\n for (ItemStack itemStack : this.getItemStacks()) {\n int added = inventory.addItemStack(itemStack);\n this.ITEMS.get(this.getItemStack(itemStack)).addAmount(-added);\n }\n }",
"@Override\n public void moveBetweenShelves(Shelf from, Shelf to, int amount) throws IllegalCupboardException{\n if(from == null || to == null)\n throw new NullPointerException();\n if(amount <= 0)\n throw new IllegalArgumentException();\n\n if(!shelves.contains(from) || !shelves.contains(to))\n throw new NoSuchElementException();\n\n if(from.getCurrentType() == null)\n throw new IllegalCupboardException(\"Trying to remove resources from an empty shelf\");\n\n try{\n from.moveTo(to, from.getCurrentType(), amount);\n }catch(IllegalResourceTransferException e){\n throw new IllegalCupboardException(\"Can't transfer the resources\");\n }\n\n //if the new configuration is not valid, initial state is restored and the IllegalCupboardException is thrown\n if(!isValid()){\n try{\n to.moveTo(from, to.getCurrentType(), amount);\n }catch(IllegalResourceTransferException e){\n throw new IllegalArgumentException();\n }\n throw new IllegalCupboardException(\"Cupboard configuration would not be valid\");\n }\n }",
"@Override\n\t\tvoid putTo(ByteBuffer dst, TcpTxContext tx) {\n\t\t\tfor(ByteChunk bc: byteChunks)\n\t\t\t\tbc.putTo(dst);\n\t\t}",
"public static <T> void drain(Stack<T> from, Stack<T> to) {\n while (!from.isEmpty()) {\n to.push(from.pop());\n }\n }",
"@Override\r\n protected void setItems(ObservableList otherTreeItems) {\r\n setAllItems(otherTreeItems);\r\n }",
"public void unRegAll(){\n \t\t\n \t\tfor(ShopItem shopItem : itemList){\n \t\t\t//TODO: process more then one item at the same time.\n \t\t\t/*\n \t\t\tint position = shopItem.getShopPosition().getSlot();\n \t\t\tif(processedPositions.contains(position))\n \t\t\t\tcontinue;\n \t\t\tprocessedPositions.add(position);\n \t\t\tint amount = getItemAmount(position);\n \t\t\t*/\n \t\t\tint amount = 1;\n \t\t\tgetOwner().getClient().sendPacket(Type.U_SHOP, \"unreg\", 1, shopItem.getShopPosition().getSlot(), amount);\n \t\t\t\n \t\t\t//int[] freePosition = getOwner().getInventory().getFreeSlots(shopItem.getItem(), -1);\n \t\t\t//InventoryPosition inventoryPosition = new InventoryPosition(freePosition[1],freePosition[2],freePosition[0]);\n \t\t\t//InventoryItem inventoryItem = new InventoryItem(shopItem.getItem(),\tinventoryPosition);\n \t\t\t//getOwner().getInventory().addInventoryItem(inventoryItem);\n \t\t\tInventoryItem inventoryItem = getOwner().getInventory().storeItem(shopItem.getItem(), -1);\n \t\t\tgetOwner().getClient().sendPacket(Type.INVEN, inventoryItem, getOwner().getClient().getVersion());\n \t\t}\n \t\titemList.clear();\n \t}",
"private void copyItems(Connection conn, String items, User user,\n Long listId) throws AccessDeniedException, Exception\n {\n logger.debug(\"+\");\n if (items != null) {\n StringTokenizer st = new StringTokenizer(items, \";\");\n while (st.hasMoreTokens()) {\n Long listItemId = Long.valueOf(st.nextToken());\n copyItem(conn, listItemId, user, listId);\n }\n }\n logger.debug(\"-\");\n }",
"public static void doMoveitems ( RunData data)\n\t{\n\t\tParameterParser params = data.getParameters ();\n\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\tList items = (List) state.getAttribute(STATE_MOVED_IDS);\n\n\t\tString collectionId = params.getString (\"collectionId\");\n\n\t\tIterator itemIter = items.iterator();\n\t\twhile (itemIter.hasNext())\n\t\t{\n\t\t\t// get the copied item to be pasted\n\t\t\tString itemId = (String) itemIter.next();\n\n\t\t\tString originalDisplayName = NULL_STRING;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\tResourceProperties properties = ContentHostingService.getProperties (itemId);\n\t\t\t\toriginalDisplayName = properties.getPropertyFormatted (ResourceProperties.PROP_DISPLAY_NAME);\n\n\t\t\t\t// copy, cut and paste not operated on collections\n\t\t\t\tif (properties.getProperty (ResourceProperties.PROP_IS_COLLECTION).equals (Boolean.TRUE.toString()))\n\t\t\t\t{\n\t\t\t\t\tString alert = (String) state.getAttribute(STATE_MESSAGE);\n\t\t\t\t\tif (alert == null || ((alert != null) && (alert.indexOf(RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING) == -1)))\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, RESOURCE_INVALID_OPERATION_ON_COLLECTION_STRING);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t*/\n\t\t\t\t{\n\t\t\t\t\tContentHostingService.moveIntoFolder(itemId, collectionId);\n\t\t\t\t}\t// if-else\n\t\t\t}\n\t\t\tcatch (PermissionException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"notpermis8\") + \" \" + originalDisplayName + \". \");\n\t\t\t}\n\t\t\tcatch (IdUnusedException e)\n\t\t\t{\n\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t}\n\t\t\tcatch (InUseException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"someone\") + \" \" + originalDisplayName);\n\t\t\t}\n\t\t\tcatch (TypeException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"pasteitem\") + \" \" + originalDisplayName + \" \" + rb.getString(\"mismatch\"));\n\t\t\t}\n\t\t\tcatch (InconsistentException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"recursive\") + \" \" + itemId);\n\t\t\t}\n\t\t\tcatch(IdUsedException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"toomany\"));\n\t\t\t}\n\t\t\tcatch(ServerOverloadException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t}\n\t\t\tcatch (OverQuotaException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"overquota\"));\n\t\t\t}\t// try-catch\n\t\t\tcatch(RuntimeException e)\n\t\t\t{\n\t\t\t\tlogger.debug(\"ResourcesAction.doMoveitems ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t}\n\n\t\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t\t{\n\t\t\t\t// delete sucessful\n\t\t\t\tString mode = (String) state.getAttribute(STATE_MODE);\n\t\t\t\tif(MODE_HELPER.equals(mode))\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute(STATE_RESOURCES_HELPER_MODE, MODE_ATTACHMENT_SELECT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\t\t\t\t}\n\n\t\t\t\t// try to expand the collection\n\t\t\t\tSortedSet expandedCollections = (SortedSet) state.getAttribute(STATE_EXPANDED_COLLECTIONS);\n\t\t\t\tif(! expandedCollections.contains(collectionId))\n\t\t\t\t{\n\t\t\t\t\texpandedCollections.add(collectionId);\n\t\t\t\t}\n\n\t\t\t\t// reset the copy flag\n\t\t\t\tif (((String)state.getAttribute (STATE_MOVE_FLAG)).equals (Boolean.TRUE.toString()))\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute (STATE_MOVE_FLAG, Boolean.FALSE.toString());\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}",
"public void set(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n\n //first collapse all items\n getFastAdapter().collapse();\n\n //get sizes\n int newItemsCount = items.size();\n int previousItemsCount = mItems.size();\n int itemsBeforeThisAdapter = getFastAdapter().getItemCount(getOrder());\n\n //make sure the new items list is not a reference of the already mItems list\n if (items != mItems) {\n //remove all previous items\n if (!mItems.isEmpty()) {\n mItems.clear();\n }\n\n //add all new items to the list\n mItems.addAll(items);\n }\n\n //map the types\n mapPossibleTypes(items);\n\n //now properly notify the adapter about the changes\n if (newItemsCount > previousItemsCount) {\n if (previousItemsCount > 0) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);\n }\n getFastAdapter().notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);\n } else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {\n getFastAdapter().notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);\n } else if (newItemsCount == 0) {\n getFastAdapter().notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);\n } else {\n getFastAdapter().notifyAdapterDataSetChanged();\n }\n }",
"private void streamCopy(InputStream from, OutputStream to) {\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\tbyte[] buffer = new byte[16*1024];\r\n\t\t\twhile ((count = from.read(buffer)) > 0) {\r\n\t\t\t\tto.write(buffer, 0, count);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tEventLogger.logConnectionException(logger, socket, e);\r\n\t\t}\r\n\t}",
"boolean transfer(UUID from, UUID to, double amount);",
"private void transferChildren(int fromRowPos, int toRowPos)\n {\n if(fromRowPos >= compositeRowStack.size()) return;\n RowComposite fromRowComposite = compositeRowStack.get(fromRowPos);\n RowComposite toRowComposite = compositeRowStack.get(toRowPos);\n for(int i = 0; i < fromRowComposite.childrenArrayList.size(); i++)\n {\n FontFace.FontFaceType fontFaceType = fromRowComposite.getFontFace(i);\n FontSize.FontSizeType fontSizeType = fromRowComposite.getFontSize(i);\n toRowComposite.addChild(fromRowComposite.childrenArrayList.get(i));\n toRowComposite.setFontFace(fontFaceType, fontSizeType,\n toRowComposite.childrenArrayList.size() - 1);\n }\n }",
"public Transfer(Account from, int[] amounts, Account to) {\n this.from = from;\n this.amounts = amounts;\n this.to = to;\n }",
"@Override\n public void transferLockingAccounts(int fromId, int toId, long amount) throws InsufficientFundsException {\n Account fromAccount = accounts.get(fromId);\n Account toAccount = accounts.get(toId);\n synchronized (fromAccount) {\n fromAccount.withdraw(amount);\n }\n synchronized (toAccount) {\n toAccount.deposit(amount);\n }\n }",
"@Override\n public void moveAllToShoe(ArrayList<Card> cardsToAdd) {\n this.cards.addAll(cardsToAdd);\n }",
"public void dropItems() {\n\t\tlocation.getChunk().load();\n\t\tArrays.stream(inventory.getContents())\n\t\t\t.filter(ItemStackUtils::isValid)\n\t\t\t.forEach((item) -> location.getWorld().dropItemNaturally(location, item));\n\t\tinventory.clear();\n\t}",
"private void swap(int from, int to) {\n E tmp = array[from];\n array[from] = array[to];\n array[to] = tmp;\n }",
"private static void moveCity(ArrayList<City> routine, int from, int to) {\n City temp = routine.get(from);\n routine.remove(from);\n routine.add(to, temp);\n }",
"@Override\n public void transferLockingAccounts(int fromId, int toId, long amount) throws InsufficientFundsException {\n Account fromAcct = accountMap.get(fromId);\n Account toAcct = accountMap.get(toId);\n Account lock1, lock2;\n\n if(fromAcct.getId() < toAcct.getId()){\n lock1 = fromAcct;\n lock2 = toAcct;\n } else {\n lock1 = toAcct;\n lock2 = fromAcct;\n }\n\n synchronized (lock1){\n synchronized (lock2){\n fromAcct.withdraw(amount);\n toAcct.deposit(amount);\n }\n }\n }",
"public synchronized void elementCopied(Object source, int fromIndex,\n\t\t\tint fromNewSize, Object to, int toIndex) {\n\n\t}",
"public void perform() {\n if (valid) {\n if (isUndo) {\n ObjArrayUtil.addItems(itemSlots, this.items, true);\n Editor.setClipboard(savedClipboard);\n } else {\n // undo operation constructs modified items for us\n getUndo();\n Editor.setClipboard(oppOper.items);\n ObjArrayUtil.deleteItems(itemSlots);\n }\n }\n }",
"public void move() {\n for (int i = 0; i < Vampiro.getNumVamp(); i++) {\n\n lista[i].move();\n }\n }",
"public final void swap(int from, int to) {\n Collections.swap(children, from, to);\n }",
"@Override\n\tpublic List<Transfer> populate(Account account, Account other) {\n\t\treturn new ArrayList<Transfer>();\n\t}",
"public void withdrawAll() {\r\n for (int i = 0; i < container.capacity(); i++) {\r\n Item item = container.get(i);\r\n if (item == null) {\r\n continue;\r\n }\r\n int amount = owner.getInventory().getMaximumAdd(item);\r\n if (item.getCount() > amount) {\r\n item = new Item(item.getId(), amount);\r\n container.remove(item, false);\r\n owner.getInventory().add(item, false);\r\n } else {\r\n container.replace(null, i, false);\r\n owner.getInventory().add(item, false);\r\n }\r\n }\r\n container.update();\r\n owner.getInventory().update();\r\n }",
"@Override\n\tpublic void transferTo(File dest) throws IOException, IllegalStateException {\n\n\t}",
"public void transfer(InputStream in, OutputStream out) throws IOException {\n int byteIn;\n while ((byteIn = in.read()) != -1) {\n out.write(byteIn);\n }\n out.flush();\n }",
"@Override\n public void transfer(int fromId, int toId, long amount) {\n synchronized (accounts.get(fromId)){\n synchronized (accounts.get(toId)){\n try {\n accounts.get(fromId).withdraw(amount);\n accounts.get(toId).deposit(amount);\n } catch (InsufficientFundsException e) {\n //Swallow the error and do nothing\n }\n\n }\n }\n }",
"@Override\n public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {\n int fromPosition = viewHolder.getAdapterPosition();\n int toPosition = target.getAdapterPosition();\n Collections.swap(mAdapter.mItems, fromPosition, toPosition);\n mAdapter.notifyItemMoved(fromPosition, toPosition);\n\n // Move in underlying list used by loader\n SelectedBuses.moveBusInList(\n getContext(),\n ((BusViewHolder) viewHolder).mBusIdInApi,\n ((BusViewHolder) target).mBusIdInApi\n );\n\n // Dismiss Snackbar\n if (mSnackbar != null) {\n mSnackbar.dismiss();\n }\n return true;\n }",
"@Override\n public void writeToParcel(Parcel dest, int flags)\n {\n dest.writeTypedList(mItems);\n }",
"public static void shift(RandomAccessFile file, long from, long to) throws IOException {\n long total = file.length();\n if (from < 0 || from >= total || to < 0)\n throw new IOException();\n else if (from == to) {\n file.seek(0);\n return;\n }\n final byte buf[] = new byte[4096];\n int res;\n if (from > to) {\n while (true) {\n file.seek(from);\n if ((res = file.read(buf)) <= 0) {\n file.setLength(to);\n file.seek(0);\n return;\n }\n file.seek(to);\n file.write(buf, 0, res);\n from = from + res;\n to = to + res;\n }\n } else {\n file.seek(total);\n for (long todo = to - from; todo > 0;) {\n if (todo >= buf.length) {\n file.write(buf);\n todo = todo - buf.length;\n } else {\n file.write(buf, 0, (int) todo);\n break;\n }\n }\n for (long todo = total - from; todo > 0; total = total - res, todo = todo - res) {\n if (todo > buf.length)\n res = buf.length;\n else\n res = (int) todo;\n file.seek(total - res);\n for (int done = 0; done < res;) {\n int r = file.read(buf, done, res - done);\n if (r <= 0)\n throw new IOException();\n else\n done += r;\n }\n file.seek(total - res + (to - from));\n file.write(buf, 0, res);\n }\n }\n file.seek(0);\n }",
"private static void moveCity2(ArrayList<City> routine, int from, int to, int num) {\n int i = 0;\n ArrayList<City> tempCity = new ArrayList<>();\n while(i < num){\n City temp = routine.get(from);\n routine.remove(from);\n tempCity.add(temp);\n i++;\n }\n i = 0;\n while(i < num){\n routine.add(to + i,tempCity.get(i));\n i++;\n }\n }",
"public void handleItemMovements() {\n\t\tfor (MovingItem item : currentScene.getMovingItems()) {\n\t\t\tmoveItemX(item);\n\t\t\tmoveItemY(item);\n\t\t\tif (nextScene != null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\titem.simulateGravity();\n\n\t\t\tif (item.getTranslateXProperty().get() < 0 || item.getTranslateYProperty().get() > currentScene.getHeight() || item.getTranslateYProperty().get() < 0 || item.getTranslateXProperty().get() > currentScene.getWidth()) {\n\t\t\t\titemsToDelete.add(item);\n\t\t\t}\n\t\t\tif (item instanceof Projectile) {\n\t\t\t\tif (((Projectile) item).traveledFullDistance()) itemsToDelete.add(item);\n\t\t\t}\n\t\t\tif (item instanceof Enemy) {\n\t\t\t\tif (((Enemy) item).shouldJump() && item.canJump()) {\n\t\t\t\t\titem.jump();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (item instanceof ProjectileHurler) {\n\t\t\t\tProjectileHurler hurler = (ProjectileHurler) item;\n\t\t\t\tif (hurler.canFire()) {\n\t\t\t\t\titemsToAdd.add(hurler.fire());\n\t\t\t\t\thurler.resetProjectileCooldown();\n\t\t\t\t} else\n\t\t\t\t\thurler.decrementProjectileCooldownTimer();\n\t\t\t}\n\t\t}\n\t\titemsToDelete.forEach(item -> currentScene.removeItem(item));\n\t\titemsToDelete.clear();\n\t\titemsToAdd.forEach(item -> currentScene.addItem(item));\n\t\titemsToAdd.clear();\n\t\tif (nextScene != null) setCurrentScene();\n\t}",
"@Override\r\n\tpublic void move(String from, String to) {\n\t\t\r\n\t}",
"private boolean processChestDrop(String fromType, String toType, Inventory inventFrom, Inventory inventTo, String source, String target, Item toMove, Item toSwap){\n\t\tif (source.startsWith(fromType) && target.startsWith(toType)){\n\t\t\tif (toSwap == null){\n\t\t\t\tinventFrom.removeItem(toMove);\n\t\t\t\tinventTo.addDirect(toMove);\n\n\t\t\t\ttoMove.setInventoryPosition(target);\n\n\t\t\t\t// network\n\t\t\t\tfor (GUIObserver g : observers) {\n\t\t\t\t\tg.onItemTransfer(\n\t\t\t\t\t\t\tinventFrom,\n\t\t\t\t\t\t\tinventTo,\n\t\t\t\t\t\t\ttoMove);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tif (source.startsWith(fromType) && target.startsWith(fromType)){\n\t\t\treturn inventToInvent(source, target, toMove, toSwap);\n\t\t}\n\t\treturn false;\n\t}",
"void transferOwnerShipToUser(List<String> list, String toEmail);",
"protected void moveToDestination(){\n\t\tqueue.clear();\n\t\twhile (destination[0] < 0){\n\t\t\tqueue.add(\"MOVE S\");\n\t\t\tdestination[0] += 1;\n\t\t}\n\t\twhile (destination[0] > 0){\n\t\t\tqueue.add(\"MOVE N\");\n\t\t\tdestination[0] -= 1;\n\t\t}\n\t\twhile (destination[1] < 0){\n\t\t\tqueue.add(\"MOVE E\");\n\t\t\tdestination[1] += 1;\n\t\t}\n\t\twhile (destination[1] > 0){\n\t\t\tqueue.add(\"MOVE W\");\n\t\t\tdestination[1] -= 1;\n\t\t}\n\t\tdestination = null;\n\t}",
"public void onTransferWS() {\n log.debug(\"Transf WS...\");\n targetWSList.clear();\n targetPROCList.clear();\n CommunicationBridge communicationBridge;\n String strTarget = communicationBridgeWs.getTarget().toString();\n strTarget = strTarget.substring(1, strTarget.length() - 1);\n if (!strTarget.isEmpty()) {\n String[] split = strTarget.split(\",\");\n for (String cb : split) {\n log.debug(\"CB : \" + cb);\n communicationBridge = communicationBridgeMap.get(cb.trim());\n if (communicationBridge != null)//Identificar el componente WS o Proc\n targetWSList.add(communicationBridge);\n\n }\n\n }\n log.debug(\"List target : \" + targetWSList.size());\n }",
"private void updateInventory(List<Item> items) {\r\n for(Item item : items) {\r\n inventory.put(item, STARTING_INVENTORY);\r\n inventorySold.put(item, 0);\r\n itemLocations.put(item.getSlot(), item);\r\n }\r\n }",
"public boolean appendFromTo(int from, int to){\n //TODO 04: Die Objekte einer Liste an eine andere anhängen und dabei die erste Liste leeren.\n if (0 <= from && from < allShelves.length && 0 <= to && to < allShelves.length && !allShelves[from].i) {\n List<File> list1 = allShelves[from];\n List<File> list2 = allShelves[to];\n\n list2.concat(list1);\n return true;\n }\n return false;\n }",
"protected void unLockItems() throws NbaBaseException {\n Iterator it = getMatchingWorkItems().iterator();\n NbaDst nbaDst; \n\t\t//NBA213 deleted code\n\t\t//process transactions\n\t\twhile (it.hasNext()) {\n\t\t\tnbaDst = (NbaDst) it.next();\n\t\t\tunlockWork(getUser(), nbaDst); //NBA213\n\t\t}\n\t\tit = getCaseWorkItems().values().iterator();\n\t\t//process cases\n\t\twhile (it.hasNext()) {\n\t\t\tnbaDst = (NbaDst) it.next();\n\t\t\tunlockWork(getUser(), nbaDst); //NBA213\n\t\t}\n\t\t//NBA213 deleted code\n }",
"@Override\r\n\tpublic void receiveItems(Stanza stanza, String node, List<String> items) {\n\t\t\r\n\t}",
"boolean transfer(Recycler.Stack<?> dst)\r\n/* 302: */ {\r\n/* 303:328 */ Link head = this.head;\r\n/* 304:329 */ if (head == null) {\r\n/* 305:330 */ return false;\r\n/* 306: */ }\r\n/* 307:333 */ if (head.readIndex == Recycler.LINK_CAPACITY)\r\n/* 308: */ {\r\n/* 309:334 */ if (head.next == null) {\r\n/* 310:335 */ return false;\r\n/* 311: */ }\r\n/* 312:337 */ this.head = (head = head.next);\r\n/* 313: */ }\r\n/* 314:340 */ int srcStart = head.readIndex;\r\n/* 315:341 */ int srcEnd = head.get();\r\n/* 316:342 */ int srcSize = srcEnd - srcStart;\r\n/* 317:343 */ if (srcSize == 0) {\r\n/* 318:344 */ return false;\r\n/* 319: */ }\r\n/* 320:347 */ int dstSize = dst.size;\r\n/* 321:348 */ int expectedCapacity = dstSize + srcSize;\r\n/* 322:350 */ if (expectedCapacity > dst.elements.length)\r\n/* 323: */ {\r\n/* 324:351 */ int actualCapacity = dst.increaseCapacity(expectedCapacity);\r\n/* 325:352 */ srcEnd = Math.min(srcStart + actualCapacity - dstSize, srcEnd);\r\n/* 326: */ }\r\n/* 327:355 */ if (srcStart != srcEnd)\r\n/* 328: */ {\r\n/* 329:356 */ Recycler.DefaultHandle[] srcElems = head.elements;\r\n/* 330:357 */ Recycler.DefaultHandle[] dstElems = dst.elements;\r\n/* 331:358 */ int newDstSize = dstSize;\r\n/* 332:359 */ for (int i = srcStart; i < srcEnd; i++)\r\n/* 333: */ {\r\n/* 334:360 */ Recycler.DefaultHandle element = srcElems[i];\r\n/* 335:361 */ if (Recycler.DefaultHandle.access$1500(element) == 0) {\r\n/* 336:362 */ Recycler.DefaultHandle.access$1502(element, Recycler.DefaultHandle.access$1100(element));\r\n/* 337:363 */ } else if (Recycler.DefaultHandle.access$1500(element) != Recycler.DefaultHandle.access$1100(element)) {\r\n/* 338:364 */ throw new IllegalStateException(\"recycled already\");\r\n/* 339: */ }\r\n/* 340:366 */ srcElems[i] = null;\r\n/* 341:368 */ if (!dst.dropHandle(element))\r\n/* 342: */ {\r\n/* 343:372 */ Recycler.DefaultHandle.access$502(element, dst);\r\n/* 344:373 */ dstElems[(newDstSize++)] = element;\r\n/* 345: */ }\r\n/* 346: */ }\r\n/* 347:376 */ if ((srcEnd == Recycler.LINK_CAPACITY) && (head.next != null))\r\n/* 348: */ {\r\n/* 349:378 */ reclaimSpace(Recycler.LINK_CAPACITY);\r\n/* 350: */ \r\n/* 351:380 */ this.head = head.next;\r\n/* 352: */ }\r\n/* 353:383 */ head.readIndex = srcEnd;\r\n/* 354:384 */ if (dst.size == newDstSize) {\r\n/* 355:385 */ return false;\r\n/* 356: */ }\r\n/* 357:387 */ dst.size = newDstSize;\r\n/* 358:388 */ return true;\r\n/* 359: */ }\r\n/* 360:391 */ return false;\r\n/* 361: */ }",
"public void popItems() {\n\t\t\n\t\tItemList.add(HPup);\n\t\tItemList.add(SHPup);\n\t\tItemList.add(DMGup);\n\t\tItemList.add(SDMGup);\n\t\tItemList.add(EVup);\n\t\tItemList.add(SEVup);\n\t\t\n\t\trandomDrops.add(HPup);\n\t\trandomDrops.add(SHPup);\n\t\trandomDrops.add(DMGup);\n\t\trandomDrops.add(SDMGup);\n\t\trandomDrops.add(EVup);\n\t\trandomDrops.add(SEVup);\n\t\t\n\t\tcombatDrops.add(SHPup);\n\t\tcombatDrops.add(SDMGup);\n\t\tcombatDrops.add(SEVup);\n\t}",
"private void transferCards(Player player) {\r\n\t\twhile(warPile.size() > 0) {\r\n\t\t\tplayer.addToWinningsPile(warPile.remove(0));\r\n\t\t}\r\n\t}",
"final protected void sendAll() {\n\t\tsendAllBut(null);\n\t}",
"@Override\n public void transferWithoutLocking(int fromId, int toId, long amount) throws InsufficientFundsException {\n Account fromAcct = accountMap.get(fromId);\n Account toAcct = accountMap.get(toId);\n fromAcct.withdraw(amount);\n toAcct.deposit(amount);\n }",
"public void copyFromSAOItems(SAOItems otherSAO){\n\t\tthis.addEntities(\"S\", otherSAO.getEntities(\"S\"));\n\t\tthis.addEntities(\"O\", otherSAO.getEntities(\"O\"));\n\t\tthis.setSubjectReln(otherSAO.getSubjectReln());\n\t\tthis.checkValid();\n\t}",
"void distributeKeys() {\n // System.out.println(\"Mapper.distributeKeys() :: 1\");\n while (!toDistribute.empty()) {\n Entry e = toDistribute.pop();\n sendEntry(e);\n printAct(\">sent Entry \" + e.hash);\n\n }//while\n }",
"public synchronized void processAll()\r\n {\r\n if (!myItems.isEmpty())\r\n {\r\n myProcessor.accept(New.list(myItems));\r\n myItems.clear();\r\n }\r\n }",
"public static void giveItems(Player p, List<ItemStack> lis) {\r\n for(ItemStack i : lis) {\r\n HashMap<Integer, ItemStack> ret = p.getInventory().addItem(i);\r\n if(ret != null) {\r\n for(ItemStack i2 : ret.values()) {\r\n p.getLocation().getWorld().dropItemNaturally(p.getLocation(), i2);\r\n }\r\n }\r\n }\r\n }",
"private void moveAnts() {\n IntStream.range(currentIndex, numberOfCities - 1)\n .forEach(i -> {\n ants.forEach(ant -> ant.visitCity(currentIndex, selectNextCity(ant)));\n currentIndex++;\n });\n }",
"@Override\n public void migrate(OccupiedLocations ols) {\n for (Population pop:ols.copyList()) {\n setCoordinate(pop.getCoordinate());\n\n Population migrating_pop = pop.collectMigrants(getRate());\n if (migrating_pop.getSize() > 0) {\n migrating_pop.setCoordinate(getPicker().pick());\n migrating_pop.setResource(0.0);\n\n // alter *actual* populations\n ols.addOrMix(migrating_pop);\n }\n }\n }",
"public void migrateToMultiTransport();",
"@SuppressWarnings(\"unused\")\n\tpublic void shift() {\n\t\tint totalItems = 0;\n\t\tint highestSlot = 0;\n\t\tfor (int i = 0; i < summonedFamiliar.storeCapacity; i++) {\n\t\t\tif (burdenedItems[i] != 0) {\n\t\t\t\ttotalItems++;\n\t\t\t\tif (highestSlot <= i) {\n\t\t\t\t\thighestSlot = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i <= highestSlot; i++) {\n\t\t\tif (burdenedItems[i] == 0) {\n\t\t\t\tboolean stop = false;\n\t\t\t\tfor (int k = i; k <= highestSlot; k++) {\n\t\t\t\t\tif (burdenedItems[k] != 0 && !stop) {\n\t\t\t\t\t\tint spots = k - i;\n\t\t\t\t\t\tfor (int j = k; j <= highestSlot; j++) {\n\t\t\t\t\t\t\tburdenedItems[j - spots] = burdenedItems[j];\n\t\t\t\t\t\t\tstop = true;\n\t\t\t\t\t\t\tburdenedItems[j] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public synchronized void elementMoved(Object source, int fromIndex,\n\t\t\tint fromNewSize, Object to, int toIndex) {\n\n\t}",
"@Override\n\t@RequestMapping(value=\"/rest/item/reshelf\")\n\tpublic ZuelResult upItem2(Long[] ids) throws ServiceException {\n\t\treturn service.upItem2(ids);\n\t}",
"private void movePackages(){\n\t\t//get the package set\n\t\tSet<Drone> droneSet = this.getDroneSet();\n\t\tPackageService packageService = this.getPackageService();\n\t\t//get all the packages that need to be delivered and are assigned a drone (these are the only\n\t\t//ones that need to be loaded and unloaded\n//\t\tSet<WorldDelivery> packages = packageService.getAllUndeliveredAssignedWorldDeliveries();\n\t\tSet<WorldDelivery> packages = packageService.getSubmittedWorldDeliveries();\n\t\t//first check if all the drones can unload their packages\n\n\t\tunloadPackages(droneSet);\n\t\t//then load all the packages\n\t\tloadPackages(droneSet, packages);\n\n\t}",
"public static void listSwitchItem(String itemToSwitch,ArrayList<String> switchFrom,ArrayList<String> switchTo){\n\t\tint saveFilePosition=getItemPosition(itemToSwitch);\n\t\t\tswitchFrom.remove(itemToSwitch);\n\t\t\tswitchTo.add(itemToSwitch);\n\t\t\titemList.get(saveFilePosition).updateArchived(\n\t\t\t\t\t\t\t!itemList.get(saveFilePosition).getArchived());\n\t\t}",
"public void transferCarrera(TransferEvent event) {\r\n try {\r\n for (Object item : event.getItems()) {\r\n int v = item.toString().indexOf(\":\");\r\n Integer id = Integer.parseInt(item.toString().substring(0, v));\r\n Carrera c = carreraService.find(id);\r\n ProyectoCarreraOferta proyectoCarreraOferta = new ProyectoCarreraOferta();\r\n proyectoCarreraOferta.setCarreraId(c.getId());\r\n if (event.isRemove()) {\r\n sessionProyecto.getCarrerasSeleccionadasTransfer().remove(proyectoCarreraOferta);\r\n sessionProyecto.getCarrerasRemovidasTransfer().add(proyectoCarreraOferta);\r\n } else {\r\n sessionProyecto.getCarrerasSeleccionadasTransfer().add(proyectoCarreraOferta);\r\n if (contieneCarrera(sessionProyecto.getCarrerasRemovidasTransfer(), proyectoCarreraOferta)) {\r\n sessionProyecto.getCarrerasRemovidasTransfer().remove(proyectoCarreraOferta);\r\n }\r\n }\r\n }\r\n } catch (NumberFormatException e) {\r\n Log.info(e.getMessage());\r\n }\r\n }",
"@Override\r\n\tpublic ItemStack transferStackInSlot(EntityPlayer playerIn, int index)\r\n {\r\n ItemStack itemstack = ItemStackTools.getEmptyStack();\r\n Slot slot = this.inventorySlots.get(index);\r\n\r\n if (slot != null && slot.getHasStack())\r\n {\r\n ItemStack itemstack1 = slot.getStack();\r\n itemstack = itemstack1.copy();\r\n\r\n if (index == 0)\r\n {\r\n if (!this.mergeItemStack(itemstack1, 10, 46, false))\r\n {\r\n return ItemStackTools.getEmptyStack();\r\n }\r\n\r\n slot.onSlotChange(itemstack1, itemstack);\r\n }\r\n else if (index >= 10 && index < 37)\r\n {\r\n if (!this.mergeItemStack(itemstack1, 37, 46, false))\r\n {\r\n return ItemStackTools.getEmptyStack();\r\n }\r\n }\r\n else if (index >= 37 && index < 46)\r\n {\r\n if (!this.mergeItemStack(itemstack1, 10, 37, false))\r\n {\r\n return ItemStackTools.getEmptyStack();\r\n }\r\n }\r\n else if (!this.mergeItemStack(itemstack1, 10, 46, false))\r\n {\r\n return ItemStackTools.getEmptyStack();\r\n }\r\n\r\n if (ItemStackTools.isEmpty(itemstack1))\r\n {\r\n slot.putStack(ItemStackTools.getEmptyStack());\r\n }\r\n else\r\n {\r\n slot.onSlotChanged();\r\n }\r\n\r\n if (ItemStackTools.getStackSize(itemstack1) == ItemStackTools.getStackSize(itemstack))\r\n {\r\n return ItemStackTools.getEmptyStack();\r\n }\r\n\r\n slot.onTake(playerIn, itemstack1);\r\n }\r\n\r\n return itemstack;\r\n }",
"public void tick() {\r\n assert (ic != null);\r\n \r\n Iterator<Item> it = items.iterator();\r\n while (it.hasNext()) {\r\n ic.setItem(it.next());\r\n ic.tick();\r\n if (ic.isItemPickedUp()) {\r\n it.remove();\r\n }\r\n }\r\n }",
"public static void copy(final ByteBuffer from, final int fromIndex, final int size, final ByteBuffer dest, final int toIndex) {\n final byte[] buf = new byte[size];\n\n // need an absolute bulk get\n int oldPosition = from.position();\n from.position(fromIndex);\n from.get(buf);\n from.position(oldPosition);\n\n // need an absolute bulk put\n oldPosition = dest.position();\n dest.position(toIndex);\n dest.put(buf);\n dest.position(oldPosition);\n }",
"protected void forwardData(String from, byte[] data)\n\t\t\tthrows QueueBlockedException {\n\t\tthis.writer.write(from, data);\n\t}",
"void copyValues(AgileItem agileItem);",
"@Secured({\"ROLE_ADMIN\"})\r\n\t@RequestMapping(value=\"/transfer\", method=RequestMethod.POST)\r\n\tList<AccountMovement> transferMoneyBetweenAccountsWithObjects(@Valid @RequestBody(required=true) MoneyTransferDTOInput moneyTransferDTOIn) throws Exception{\r\n\t\t\r\n\t\t//Validate accounts\r\n\t\tAccount sourceAccount = accountRepository.findOne(moneyTransferDTOIn.getSourceAccountNo());\r\n\t\tif(sourceAccount == null)\r\n\t\t\tthrow new Exception(\"Source account not found\");\r\n\t\t\r\n\t\tAccount destinationAccount = accountRepository.findOne(moneyTransferDTOIn.getDestinationAccountNo());\r\n\t\tif(destinationAccount == null)\r\n\t\t\tthrow new Exception(\"Destination account not found\");\r\n\t\t\r\n\t\tif(sourceAccount.equals(destinationAccount))\r\n\t\t\tthrow new Exception(\"Source and destination accounts must be different\");\r\n\t\t\r\n\t\tList<AccountMovement> accountMovements = new ArrayList<AccountMovement>();\r\n\t\tAccountMovement sourceMovement = new AccountMovement(sourceAccount, destinationAccount, moneyTransferDTOIn.getAmount().negate());\r\n\t\trepository.save(sourceMovement);\r\n\t\t\r\n\t\tAccountMovement destinationMovement = new AccountMovement(destinationAccount, sourceAccount, moneyTransferDTOIn.getAmount());\r\n\t\trepository.save(destinationMovement);\r\n\t\t\r\n\t\taccountMovements.add(sourceMovement);\r\n\t\taccountMovements.add(destinationMovement);\r\n\t\t\r\n\t\treturn accountMovements;\r\n\t}",
"private static void copy(List<? super Number> dest, List<? extends Number> src) {\n for (int i = 0; i < src.size(); i++) {\n dest.set(i, src.get(i));\n //dest.add(src.get(i));\n }\n }",
"@Override\n public void transferWithoutLocking(int fromId, int toId, long amount) throws InsufficientFundsException {\n accounts.get(fromId).withdraw(amount);\n accounts.get(toId).deposit(amount);\n }",
"private void rightTransfer(TFNode node) {\r\n int WCIT = WCIT(node);\r\n TFNode parent = node.getParent();\r\n TFNode rightSibling = parent.getChild(WCIT + 1);\r\n\r\n // 1. Copy item in parent to empty node\r\n node.insertItem(0, parent.getItem(WCIT));\r\n\r\n // 2. Move the siblings child (at numItems() slot) over to node\r\n TFNode child = rightSibling.getChild(0);\r\n node.setChild(1, child);\r\n if (child != null) {\r\n child.setParent(node);\r\n }\r\n\r\n // 3. Replace in parent item at (WCIT) with sibling's leftmost item\r\n parent.replaceItem(WCIT, rightSibling.removeItem(0));\r\n }",
"@Override\n public ItemStack transferStackInSlot(EntityPlayer player, int index) {\n ItemStack result = ItemStack.EMPTY;\n Slot slot = inventorySlots.get(index);\n ItemStack stack = slot.getStack();\n if (slot != null && slot.getHasStack()) {\n SlotRange destRange = transferSlotRange(index, stack);\n if (destRange != null) {\n if (index >= destRange.numSlots) {\n result = stack.copy();\n if (!mergeItemStackIntoRange(stack, destRange))\n return ItemStack.EMPTY;\n if (stack.getCount() == 0)\n slot.putStack(ItemStack.EMPTY);\n else\n slot.onSlotChanged();\n }\n else\n player.inventory.addItemStackToInventory(stack);\n }\n }\n return result;\n }",
"private void copy(int numBytes) {\n for (int i = 0; i < numBytes; i++) {\n dest[destPos + i] = src[srcPos + i];\n }\n srcPos += numBytes;\n destPos += numBytes;\n }",
"public void pasteFrom(Flow other)\n\t\t{\n\t\tunits.addAll(other.units);\n\t\tconns.addAll(other.conns);\n\t\t}",
"default ItemStack moveOneItemTo(IInventoryComposite dest) {\n return moveOneItemTo(dest, Predicates.alwaysTrue());\n }",
"@Override\n public int itemsToSend() {\n return itemsToSend;\n }",
"@Override\r\n public void transferFromDiscard(int plDeckPosition, int player){\r\n PlayingCard card;\r\n while(!this.players.get(player).getDeck(plDeckPosition+1).isDeckEmpty()){\r\n card = (PlayingCard) this.getPlayerCard(player, plDeckPosition+1);\r\n this.giveCardToPlayer(card, player, plDeckPosition);\r\n } \r\n }",
"public void resolveItems(View view){\n\t\t\n\t\tItem newItem1 = new Item(lostItem.getItemName(),lostItem.getItemDes(),lostItem.getReward(),\n\t\t\t\t\"Resolved\",lostItem.getDate(),lostItem.getCatagory(),lostItem.getLocation(),\n\t\t\t\tlostItem.getOwner());//recreate lost item\n\t\tItem newItem2 = new Item(matchedItem.getItemName(),matchedItem.getItemDes(),matchedItem.getReward(),\n\t\t\t\t\"Resolved\",matchedItem.getDate(),matchedItem.getCatagory(),matchedItem.getLocation(),\n\t\t\t\tmatchedItem.getOwner());//recreate found item\n\t\t\n\t\titemCollection.deleteItem(lostItem);\n\t\titemCollection.deleteItem(matchedItem);\n\t\t\n\t\titemCollection.addItem(newItem1);\n\t\titemCollection.addItem(newItem2);\n\t\t\n\t\tIntent intent = new Intent(this, TabsActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent); \n\t\t\n\t}",
"private void copyWebDaveItem(final ArrayList<WebDavItemEntity> copyWebDavItemEntities){\n\t\tboolean isHaveSameFolderPath = isHaveSameFolderPath(copyWebDavItemEntities, currentPath);\n\t\tif (isHaveSameFolderPath) {\n\t\t\tisStopCopy = true;\n\t\t\tToast.makeText(getActivity().getApplicationContext(),\n\t\t\t\t\t\"Can not copy self folder into self folder...\", Toast.LENGTH_LONG).show();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tshowHandleWebDavItemProgressDialog(\"Coping files...\");\n\t\tcurrentNumber = 0;\n\t\ttotalTextView.setText(Integer.toString(copyWebDavItemEntities.size()));\n\t\thandleProgressBar.setMax(copyWebDavItemEntities.size());\n\t\tisStopCopy = false;\n\t\t\n\t\tcopyWebDavItemThread = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\thandleProgressBar.setProgress(0);\n\n\t\t\t\tfor (WebDavItemEntity copyWebDavItemEntity : copyWebDavItemEntities) {\n\t\t\t\t\t\n\t\t\t\t\t// Stop copy \n\t\t\t\t\tif (isStopCopy) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfinal String webDavItemName = copyWebDavItemEntity.getName();\n\t\t\t\t\t\n\t\t\t\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tcurrentNumber++;\n\t\t\t\t\t\t\tcurrentNumberTextView.setText(Integer.toString(currentNumber));\n\t\t\t\t\t\t\tcurrentFileNameTextView.setText(webDavItemName);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\thandleProgressBar.setProgress(currentNumber);\n\t\t\t\t\t\n\t\t\t\t\tString destinationName = webDavItemName;\n\n\t\t\t\t\tfor (WebDavItemEntity webDavItemEntity : webDavItemEntities) {\n\t\t\t\t\t\tif (webDavItemName.equals(webDavItemEntity.getName())) {\n\t\t\t\t\t\t\tdestinationName = \"copy_\" + webDavItemName;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tWebDavManager.getInstance().setAbort(false);\n\t\t\t\t\tWebDavManager.getInstance().copyWebDavItem(\n\t\t\t\t\t\t\tcopyWebDavItemEntity.getUrl(), currentPath,\n\t\t\t\t\t\t\tdestinationName);\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tcloudFileListAdapter.cleanAllSelected();\n\t\t\t\t\t\tdismissHandleWebDavItemProgressDialog();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\t\t\n\t\t\n\t\tcopyWebDavItemThread.start();\n\t\t\n\t}",
"public void moveAllAgents() {\n\t\tPoint moveTo \t\t= null;\n\t\tGameClient client \t= null;\n\t\t\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == PlayerType.Agent) {\n\t\t\t\tclient = HandleCommunication.findClient(p.getName(), server.getConnectedClientList());\n\t\t\t\tmoveTo = getSafeTeleportPosition();\n\t\t\t\tmovePlayer(p.getName(), p.getPosition(), moveTo, false);\n\t\t\t\tserver.sendMessageToClient(client.getClientSocket(), \"@124@\" + moveTo.x + \"@\" + moveTo.y + \"@\");\n\t\t\t}\n\t\t}\n\t}",
"public void swapInventoryItems(int i, int j) {\n\t\tint k = inv[i];\n\t\tinv[i] = inv[j];\n\t\tinv[j] = k;\n\t\tk = invStackSizes[i];\n\t\tinvStackSizes[i] = invStackSizes[j];\n\t\tinvStackSizes[j] = k;\n\t}",
"public void insertOrderedItems(TireList orderedItems){\n for(int i=0; i<orderedItems.listSize(); i++){\n int temp = Integer.parseInt(orderedItems.getTire(i).getStock()) - orderedItems.getTire(i).getQuantity();\n orderedItems.getTire(i).setStock(temp + \"\");\n orderedItems.getTire(i).updateTire();\n sql=\"Insert into OrderedItems (OrderID, TireID, Quantity) VALUES ('\"+newID+\"','\"+orderedItems.getTire(i).getStockID()+\"',\"+orderedItems.getTire(i).getQuantity()+\")\";\n db.insertDB(sql); \n }\n }",
"public void transferPlaylist(ArrayList<Song> list) {\r\n\t\t//ObservableList<Song> = \r\n\t\ttableView.setItems(FXCollections.observableArrayList(list));\r\n\t}",
"public boolean move(Case from, Case to)\n {\n if (to.getValue() == 0 && from.getValue() != 0)\n {\n to.setValue(to.getValue()+from.getValue());\n from.setValue(0);\n return true;\n }\n return false;\n }",
"public void syncToDataStore(String exchangeCode, Collection<MarketData> items);"
] | [
"0.6565013",
"0.6348059",
"0.6332833",
"0.61840206",
"0.6115049",
"0.6098079",
"0.60066426",
"0.5881162",
"0.58500975",
"0.57457733",
"0.5741868",
"0.5730792",
"0.5628945",
"0.55974543",
"0.5528438",
"0.5512448",
"0.5479607",
"0.54459465",
"0.53823984",
"0.53535247",
"0.5352209",
"0.53501695",
"0.53280383",
"0.5320725",
"0.5306197",
"0.52755004",
"0.52677596",
"0.52494156",
"0.5246955",
"0.5242466",
"0.5237495",
"0.52160317",
"0.521403",
"0.51459014",
"0.5143085",
"0.5139979",
"0.51016164",
"0.5086584",
"0.50822145",
"0.5061648",
"0.50591636",
"0.5045008",
"0.5044823",
"0.5041837",
"0.5025847",
"0.5025807",
"0.50206715",
"0.50200987",
"0.5006018",
"0.49985355",
"0.49978125",
"0.499517",
"0.49772632",
"0.4959366",
"0.49507952",
"0.49442506",
"0.4939192",
"0.49314755",
"0.49266067",
"0.49230388",
"0.49131456",
"0.49075016",
"0.4901019",
"0.4894104",
"0.48926523",
"0.48828742",
"0.48772818",
"0.4864771",
"0.48607334",
"0.48596072",
"0.48572552",
"0.4841735",
"0.48413372",
"0.4840273",
"0.48366737",
"0.4831882",
"0.48296368",
"0.48235932",
"0.4822769",
"0.48204657",
"0.48007876",
"0.47989017",
"0.47980544",
"0.47908938",
"0.47684243",
"0.476394",
"0.4758769",
"0.47575945",
"0.47496295",
"0.4749007",
"0.47455847",
"0.47450307",
"0.4741676",
"0.4739052",
"0.47387534",
"0.47373313",
"0.4732487",
"0.4730911",
"0.4730587",
"0.47261176"
] | 0.80574137 | 0 |
Return whether your implementation of isMinimalCostToReach takes into account other robots, walls and turning (required to score 17+). The return value of this method determines the expected return value of isMinimalCostToReach in the test suite. This method must return either 0 or 1. | @Override
public int isMinimalCostToReach17Plus()
{
return 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isEligibleForRealMin() {\n return eligibleForRealMin;\n }",
"public double calculateCostInclusive() {\n\t\tdouble accumulatedCost = 0;\n\t\taccumulatedCost += calculateEuclideanDistance(host.grid.getLocation(host), solutionRepresentation.get(0));\n\t\taccumulatedCost += calculateCostExclusive();\n\t\t\n\t\treturn accumulatedCost;\n\t}",
"@Override\r\n\tpublic double getMinimalCostToReach(Robot robot, long x, long y)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn robot.getEnergyRequiredToReach(new Position(x, y));\r\n\t\t}\r\n\t\tcatch(IllegalBoardException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The given robot is not placed on a board..\");\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"The given robot is terminated.\");\r\n\t\t\treturn -1; \r\n\t\t}\r\n\t}",
"default int minimumHit(Player player) {\n\t\treturn -1;\n\t}",
"public boolean checkReached(float xTile, float yTile)\r\n/* 134: */ {\r\n/* 135:149 */ if ((this.mission) && (tileReachObjectives(xTile, yTile)))\r\n/* 136: */ {\r\n/* 137:152 */ this.reach[((int)xTile)][((int)yTile)] = 0;\r\n/* 138:153 */ this.reachablePlaces -= 1;\r\n/* 139:154 */ if (this.reachablePlaces == 0) {\r\n/* 140:156 */ return true;\r\n/* 141: */ }\r\n/* 142: */ }\r\n/* 143:160 */ return false;\r\n/* 144: */ }",
"boolean hasMinExperience();",
"private void notEligibleForRealMin() {\n eligibleForRealMin = false;\n }",
"boolean isNilWagerMinimum();",
"public final boolean searchMinimum(){\r\n\t\tif (!initialized()) minimum=true;\r\n\t\treturn minimum;\r\n\t}",
"public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"boolean isSetWagerMinimum();",
"public boolean tileReachObjectives(float xTile, float yTile)\r\n/* 122: */ {\r\n/* 123:136 */ return (!tileInBounds(xTile, yTile)) || \r\n/* 124:137 */ (this.reach[((int)xTile)][((int)yTile)] != 0);\r\n/* 125: */ }",
"boolean isNilSingleBetMinimum();",
"float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);",
"public boolean getWin() {\n if (targetDistance == 25) {\n if (missDistance <= 1 && missDistance >= -1) { //checks 25m win\n return true;\n }\n else {\n return false;\n }\n }\n else if (targetDistance == 50) { //checks 50m win\n if (missDistance <= 2 && missDistance >= -2) {\n return true;\n }\n else {\n return false;\n }\n }\n else { //checks 100m win\n if (missDistance <= 3 && missDistance >= -3) {\n return true;\n }\n else {\n return false;\n }\n }\n }",
"public boolean canDoBuildInitialRoad(){\n\t\t // If the player already has two roads on the board then he has already placed the initial roads\n\t\t if(playerPieces.getNumberOfRoads() < 14){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }",
"private boolean checkGreedyWinRate() {\r\n return myTotal.get(0) > enTotal.get(0)+2 && (myself.health > 50 || myself.health > opponent.health);\r\n }",
"public final boolean minimum(){\r\n\t\treturn minimum;\r\n\t}",
"public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}",
"public final boolean canUse(){\n\t\tmaintain();\n\t\t//check if grown if not try to grow\n\t\tif(grown){\t\n\t\t\tif(host.getStrength()>USE_COST){\n\t\t\t\thost.expend(USE_COST);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thost.expend(host.getStrength());\n\t\t\t}\n\t\t}\n\t\telse{\t\t\t\n\t\t\tcanGrow(host, this);\n\t\t}\t\n\t\treturn false;\n\t}",
"public boolean affordRoad() {\n \t\treturn (FREE_BUILD || roads.size() < MAX_ROADS\n \t\t\t\t&& getResources(Type.BRICK) >= 1\n \t\t\t\t&& getResources(Type.LUMBER) >= 1);\n \t}",
"static double addHeuristic1(GameState c, boolean isMaxNode) {\n\t\t// Value returned will be absolute. If its max node, this config is good\n\t\t// then value will be positive. If its min node,\n\t\t// and this config is good for min, then value will be negative\n\n\t\tint i, j, vacant_spaces;\n\t\t// Compute : Feasible Moves for self\n\t\tint self_feasible_moves = 0;\n\t\tint self_remaining_moves = 0;\n\t\tint opponent_feasible_moves = 0;\n\t\tint opponent_remaining_moves = 0;\n\n\t\t// Go through the board and figure out vacant spots\n\t\tvacant_spaces = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tif (c.getWeight(i) == 0) {\n\t\t\t\tvacant_spaces++;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 1; i <= GameState.MAX_WEIGHT; i = i + 1) {\n\t\t\t// Check if self have the weight\n\t\t\tif (c.IHaveWeight(i)) {\n\t\t\t\tself_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\t// Place it and see if you tip\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\tself_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if opponent has this weight\n\t\t\tif (c.opponentHasWeight(i)) {\n\t\t\t\topponent_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\t// Place the weight and see if you tip\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\topponent_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Need to take the max because one of the players may have played one\n\t\t// chance less\n\t\tif (self_remaining_moves == 0 && opponent_remaining_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (self_remaining_moves > opponent_remaining_moves)\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (self_remaining_moves * vacant_spaces);\n\t\telse\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (opponent_remaining_moves * vacant_spaces);\n\t}",
"public boolean isGoal() \n {\n return this.manhattan() == 0;\n // return this.manhattan() == 0 || this.checkTwinSolution();\n }",
"public boolean optimal() {\n\t\treturn optimal;\n\t}",
"private boolean checkGreedyIronCurtain() {\r\n return (myself.health < 30 || enTotal.get(0) >= 8 || opponent.isIronCurtainActive || this.myTotal.get(0) < this.enTotal.get(0));\r\n }",
"public boolean hasMinRequirements() {\n\t\t// FIXME MIN input\n\t\treturn true;\n\t}",
"boolean isSetSingleBetMinimum();",
"public boolean canGameStart() {\n\t\tif (users.getSize() >= quantidadeDeJogadoresMinimos) {\n\t\t\t// Jogo pode comešar\n\t\t\treturn true;\n\n\t\t}\n\t\t// Jogo nao pode comešar\n\t\treturn false;\n\t}",
"public boolean isGoal() {\n return hamming() == 0; // Board is solved if hamming distance is 0\n }",
"public boolean isOverSpeed(){ return vehicleAvarageSpeed > roadMaxSpeed; }",
"public int getMyNearbyThreshold() {\n return myNearbyThreshold;\n }",
"public boolean isFullySupplied()\n {\n boolean isFull = !model.needsFuel() || (model.maxFuel == fuel);\n isFull &= (model.maxAmmo == ammo);\n return isFull;\n }",
"public boolean isGoal() {\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n final int goalValue;\n if (row == N - 1 && col == N - 1) {\n goalValue = 0;\n }\n else {\n goalValue = N * row + col + 1;\n }\n if (tiles[row][col] != goalValue) {\n return false;\n }\n }\n }\n return true;\n }",
"static boolean canWin() throws GameActionException {\n\t\tfloat difference = 1000 - rc.getTeamVictoryPoints();\n\t\tif ((rc.getTeamBullets() / 10) >= difference) {\n\t\t\trc.donate(rc.getTeamBullets());\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}",
"int getMinigameDefenseChancesLeft();",
"@Override\r\n\tpublic boolean isNodeValid() {\n\t\treturn (SKILLS.HITPOINTS.getActualLevel() >= 25\r\n\t\t\t\t&& SKILLS.THIEVING.getActualLevel() >= 28\r\n\t\t\t\t&& Inventory.getCount(\"Coins\") >= 30 && (Location.karamjaFirstStepCheck.atLocation(Player.getPosition()) ||Location.karamjaBoatLandTile.equals(Player.getPosition()) ));\r\n\t}",
"public abstract double costPerMin (CallZone zone);",
"public int heuristic()\n {\n if (this.heuristic != Integer.MIN_VALUE)\n return this.heuristic;\n this.heuristic = 0;\n if (!this.safe)\n return 0;\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.heuristic = (this.d.size() * 100) + (this.NE * 10) + bonus;\n // value:\n return this.heuristic;\n }",
"private boolean CheckCostToBuildOrUpgrade(double cost)\r\n {\r\n return cost <= this.bitcoins;\r\n }",
"public Boolean IsIOtrminate() {\n Random r = new Random();\n int k = r.nextInt(100);\n //20%\n if (k <= 20) {\n return true;\n }\n return false;\n }",
"@Override\n public boolean isPointRequirementMet(final int awardedPoints) {\n totalPoints += awardedPoints;\n\n requirementMet = totalPoints >= requiredPoints;\n\n log.info(\"Points awarded: '{}', New total points: '{}', Required total points: '{}', met: '{}'\",\n new Object[] {awardedPoints, totalPoints, requiredPoints, requirementMet});\n\n return requirementMet;\n }",
"@Override\n public boolean shouldExecute()\n {\n if (!this.mustUpdate)\n {\n if (this.entity.getRNG().nextInt(this.executionChance) != 0)\n {\n return false;\n }\n }\n\n Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7);\n int attempts = 0;\n while (attempts < 10 && entity.getHomePosition().getDistance(vec3d != null ? (int)vec3d.xCoord : (int)entity.posX, vec3d != null ? (int)vec3d.yCoord : (int)entity.posY, vec3d != null ? (int)vec3d.zCoord : (int)entity.posZ) > entity.getMaximumHomeDistance()) {\n vec3d = RandomPositionGenerator.findRandomTarget(this.entity, 12, 8);\n attempts++;\n }\n\n if (vec3d == null || attempts >= 10)\n {\n return false;\n }\n else\n {\n this.xPosition = vec3d.xCoord;\n this.yPosition = vec3d.yCoord;\n this.zPosition = vec3d.zCoord;\n this.mustUpdate = false;\n return true;\n }\n }",
"public boolean increaseMinions() {\r\n\t\tif (this.minions < TOTAL_MINIONS) {\r\n\t\t\tthis.minions = this.minions + 1;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean isGoal();",
"public synchronized boolean HaveWon() {\n if (maxScore <= score) {\n return true;\n }\n return false;\n }",
"private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }",
"private boolean hasGoodwill(MaintenanceRequest maintenanceRequest){\n\t\tMaintenanceRequestTask task = null;\n\t\tboolean isGoodwill = false;\n\t\t\n\t\tif(!MALUtilities.isEmpty(maintenanceRequest.getMrqMrqId())){\n\t\t\tisGoodwill = true;\n\t\t}\n\t\t\t\t\n\t\tfor (Iterator<MaintenanceRequestTask> mrt = maintenanceRequest.getMaintenanceRequestTasks().iterator(); mrt.hasNext() && !isGoodwill;){\n\t\t\ttask = (MaintenanceRequestTask)mrt.next();\n\t\t\tif(!(MALUtilities.isEmpty(task.getGoodwillCost()) || task.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)){\n\t\t\t\tisGoodwill = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\treturn isGoodwill;\n\t}",
"public boolean findBestMatch() {\n\t\t\tif(nodes.size() >= nodeLimit) return false;\n\n\t\t\tdouble bestScore = 0.0;\n\t\t\tint bestLight = -1;\n\t\t\tfor(int p = 0; p < lights.size(); p++) {\n\t\t\t\tif(nodeIndex.contains(p)) continue;\n\t\t\t\tdouble score = scoreByDistance(lights.get(p));\n\t\t\t\tif(score != Double.NaN && score > bestScore) {\n\t\t\t\t\tbestScore = score;\n\t\t\t\t\tbestLight = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bestLight >= 0) {\n\t\t\t\taddNode(bestLight);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"boolean hasGeoTargetConstant();",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return hamming() == 0;\n }",
"public float getCost()\r\n/* 13: */ {\r\n/* 14:10 */ return this.costFromStart + this.estimatedCostToGoal;\r\n/* 15: */ }",
"public boolean isGoal() {\n boolean result = false; \n for (int i = 0; i < this.N; i++) {\n for (int j = 0; j < this.N; j++) {\n int idx = (i * this.N) + (j + 1);\n if (idx != N * N - 1 && tiles[i][j] != idx) {\n return false;\n } \n if (idx == N * N - 1) {\n if (tiles[N - 1][N - 1] == 0) return true;\n return false;\n }\n }\n }\n return result;\n }",
"protected double minimumCostPerUnitDistance( ) {\n\t\treturn 0.0;\n\t}",
"public boolean tileReachable(float tx, float ty, AgentModel selectedAgent)\r\n/* 243: */ {\r\n/* 244:271 */ float x = selectedAgent.getX() - 0.5F;\r\n/* 245:272 */ float y = selectedAgent.getY() - 0.5F;\r\n/* 246:274 */ switch ((int)selectedAgent.getAngle())\r\n/* 247: */ {\r\n/* 248: */ case 0: \r\n/* 249:277 */ if ((y - 1.0F == ty) && (tx >= x - 1.0F) && (tx <= x + 1.0F)) {\r\n/* 250:279 */ return true;\r\n/* 251: */ }\r\n/* 252: */ break;\r\n/* 253: */ case 90: \r\n/* 254:283 */ if ((x + 1.0F == tx) && (ty >= y - 1.0F) && (ty <= y + 1.0F)) {\r\n/* 255:285 */ return true;\r\n/* 256: */ }\r\n/* 257: */ break;\r\n/* 258: */ case 180: \r\n/* 259:289 */ if ((y + 1.0F == ty) && (tx >= x - 1.0F) && (tx <= x + 1.0F)) {\r\n/* 260:291 */ return true;\r\n/* 261: */ }\r\n/* 262: */ break;\r\n/* 263: */ case 270: \r\n/* 264:295 */ if ((x - 1.0F == tx) && (ty >= y - 1.0F) && (ty <= y + 1.0F)) {\r\n/* 265:298 */ return true;\r\n/* 266: */ }\r\n/* 267: */ break;\r\n/* 268: */ }\r\n/* 269:303 */ return false;\r\n/* 270: */ }",
"private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}",
"@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}",
"public static boolean isSomethingToAttackDefined() {\n\t\treturn _attackTargetUnit != null && !_attackTargetUnit.getType().isOnGeyser();\n\t}",
"private boolean checkGreedyDefense() {\r\n return enTotal.get(2)+1 < myTotal.get(2) && enTotal.get(0)+1 < myTotal.get(0);\r\n }",
"private boolean hit(int accuracy)\n {\n Random random = new Random();\n int num = random.nextInt(100); //creates random number 0-100\n if(num < accuracy) //if number is lower than the accuracy then you can attack\n {\n return true;\n } else\n {\n return false;\n }\n }",
"public boolean canReproduce() {\r\n ArrayList<Cell> neighbours = getNeighbours(FIRSTLAYER);\r\n\r\n int numOfSameT = 0;\r\n int numOfEmpty = 0;\r\n int numOfFoodC = 0;\r\n\r\n for (Cell cell : neighbours) {\r\n if (isSameType(cell.getInhabit())) {\r\n numOfSameT++;\r\n } else if (cell.getInhabit() == null && isTerrainAccessiable(cell)) {\r\n numOfEmpty++;\r\n } else if (isEdible(cell.getInhabit())) {\r\n numOfFoodC++;\r\n }\r\n }\r\n\r\n return (numOfSameT >= numOfSameTypeNeighbourToReproduce() \r\n && numOfEmpty >= numOfEmptyToReproduce()\r\n && numOfFoodC >= numOfFoodCellToReproduce());\r\n }",
"private boolean checkGreedyEnergy() {\r\n return myTotal.get(2) < 10 || (myTotal.get(2) < 13 && myTotal.get(2) <= enTotal.get(2));\r\n }",
"public boolean nearMaxMin() {\n double water = this.levelMessage.getDoubleParameter();\n double no = (this.configuration.getMaximalLimitLevel()\n - this.configuration.getMaximalNormalLevel()) / 4;\n if (water > this.configuration.getMaximalLimitLevel()\n || water > this.configuration.getMaximalLimitLevel() - no) {\n return true;\n } else if (water < this.configuration.getMinimalLimitLevel()\n || water < this.configuration.getMinimalLimitLevel() + no) {\n\n return true;\n }\n return false;\n }",
"public boolean meetsMinimumLength(){\n\n return alg.meetsMinimumLength(input.getText().toString());\n }",
"public boolean goalReached() {\n return (Math.abs(mTargetAngle - mCurrentAngle) < mTargetTolerance);\n }",
"float estimateCostToGoal( int current_x, int current_y, int current_z, boolean fromStart ) {\n\t\treturn 0;\n\t}",
"public boolean isSuitable(Food food) {\n return food.calculateFitness() < 100;\n }",
"public double getMinimumDistance() { return minDistance; }",
"public boolean foundGoal() \r\n\t{\r\n\t\t// Write the method that determines if the walker has found a way out of the maze.\r\n\t\treturn ( currentCol < 0 || currentRow < 0 || \r\n\t\t\t\t currentCol >= size || currentRow >= size );\r\n\t}",
"boolean CanBuyRoad();",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkSpeed() {\n\t\tboolean flag = oTest.checkSpeed();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"public static void evaluateMassiveAttackOptions() {\n\n\t\t// Always attack?\n\t\tif (FORCE_CRAZY_ATTACK) {\n\t\t\tcurrentState = STATE_ATTACK_PENDING;\n\t\t\tallowedDistanceFromSafePoint = 999;\n\t\t\treturn;\n\t\t}\n\n\t\t// Currently we are nor attacking, nor retreating.\n\t\tif (!isGlobalAttackInProgress()) {\n\t\t\tdecisionWhenNotAttacking();\n\t\t}\n\n\t\t// We are either attacking or retreating.\n\t\telse {\n\t\t\tallowedDistanceFromSafePoint += MOVE_FORWARD_SPEED;\n\t\t\tdecisionWhenAttacking();\n\t\t}\n\t}",
"public boolean isMinimalClassSizeFulfilled() {\n return minimalClassSize != Integer.MAX_VALUE && minimalClassSizeFulfilled;\n }",
"private static double findMinCost(double lemda, Vector finalVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n int m = destList.size();\r\n int w = n > m ? m : n;\r\n\r\n double [] costFor_r = new double[w];\r\n\r\n double minCost = MaxDistance;\r\n double totalCurToAll = findDistanceCurToAll(currentNode, destList);\r\n for ( int r = 0 ; r < w; r ++ )\r\n {\r\n Vector rSetVector = new Vector();\r\n costFor_r[r] = getMinSetCost_given_r( r+1, rSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n costFor_r[r] = (1.0 - lemda) * (r + 1) / n + costFor_r[r] / totalCurToAll;\r\n if ( costFor_r[r] < minCost ) {\r\n minCost = costFor_r[r];\r\n finalVector.clear();\r\n for (int k = 0; k < rSetVector.size(); ++k) {\r\n finalVector.add(k, rSetVector.get(k));\r\n }\r\n }\r\n }\r\n\r\n return minCost;\r\n }",
"public boolean isApplicable(DevelopmentCard card) {\n\t\treturn (this.familyMember.getActionValue()\n\t\t\t\t+ this.getPlayer().getBonuses().getActivationVariation(card.getCardType())\n\t\t\t\t+ paidServants >= card.getActivationCost());\n\t}",
"@Test\n public void getMaxReach() {\n assertEquals(\"Max reach for G should be 3\",\n 3,\n Shape.G.getMaxReach());\n assertEquals(\"Max reach for J should be 4\",\n 4,\n Shape.J.getMaxReach());\n assertEquals(\"Max reach for I should be 2\",\n 2,\n Shape.I.getMaxReach());\n\n // check different rotations\n assertEquals(\"Max vert reach for G facing south should be 2\",\n 2,\n Shape.G.getMaxReach(Direction.SOUTH, true));\n assertEquals(\"Max hori reach for J facing north should be 4\",\n 4,\n Shape.J.getMaxReach(Direction.NORTH, false));\n assertEquals(\"Max vert reach for I facing west should be 2\",\n 2,\n Shape.I.getMaxReach(Direction.WEST, true));\n }",
"public boolean isGoal() {\n return (man == 0);\n }",
"private boolean shouldBecomeCombatEngineer() {\r\n\t\tdouble machineUnitsCount = this.getNumberOfMachineUnits();\r\n\t\tdouble combatEngineers = this.informationStorage.getWorkerConfig().getTotalCombatEngineerCount();\r\n\r\n\t\treturn combatEngineers / machineUnitsCount <= this.combatEngineerTriggerPercentageEnroll;\r\n\t}",
"public int minCost(int[][] costs) {\n\nif(costs== null || costs.length == 0)\nreturn 0;\n// int n_houses = costs.length ;\nint lastR = costs[0][0];\nint lastB = costs[0][1];\nint lastG = costs[0][2];\nint currR,currB,currG ;\nfor(int i = 1; i< costs.length ; i++ ){\ncurrR = costs[i][0] + Math.min(lastB,lastG);\ncurrB = costs[i][1] + Math.min(lastR,lastG);\ncurrG = costs[i][2] + Math.min(lastR,lastB);\nlastR = currR;\nlastB = currB;\nlastG = currG;\n}\n// return Math.min(Math.min(lastR,lastB),lastG);\nreturn Math.min(Math.min(lastR,lastB),lastG);\n}",
"public boolean shouldExecute()\n {\n if (field_46105_a.getRNG().nextFloat() >= field_48294_e)\n {\n return false;\n }\n\n if (field_48293_f == (net.minecraft.src.EntityPlayer.class))\n {\n closestEntity = field_46105_a.worldObj.getClosestPlayerToEntity(field_46105_a, field_46101_d);\n }\n else\n {\n closestEntity = field_46105_a.worldObj.findNearestEntityWithinAABB(field_48293_f, field_46105_a.boundingBox.expand(field_46101_d, 3D, field_46101_d), field_46105_a);\n }\n\n return closestEntity != null;\n }",
"public boolean hasWon() {\n return isGoal(curBoard);\n }",
"@Override\n public int estimatedDistanceToGoal() {\n return manhattan();\n }",
"public float getMinAvailability()\n\t{\n\t\treturn piecePicker.getMinAvailability();\n\t}",
"public boolean isGoal() {\n if (blocks[dimension()-1][dimension()-1] != 0) return false;\n return hamming() == 0;\n }",
"public boolean isGoal() {\n return Arrays.deepEquals(tiles, goal);\n }",
"public boolean canStandOn(Environment tile)\n {\n if( tile.terrainType == TerrainType.TELETILE )\n return false; // Standing on empty space is pretty hard\n return getMoveCost(tile) < IMPASSABLE;\n }",
"public boolean isGoal() {\n \tfor (int row = 0; row < this.dimension(); row++) {\n \t\tfor (int column = 0; column < this.dimension(); column++) {\n \t\t\tif (blocks[row][column] != getGoalValueForBlock(row, column)) {\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t}\n \t\n \treturn true;\n }",
"public static void bruteForceMin(List<List<Integer>> costArray) {\r\n\t\tint numTradingPosts = costArray.size();\r\n\t\tint startingPoint = 0;\r\n\t\t\r\n\t\t//For every trading post, rent a canoe from the starting point and travel to it.\r\n\t\t//Then, recursively check all remaining paths that can be derived following that first rental.\r\n\t\tfor(int firstStop = 1; firstStop < numTradingPosts; firstStop++) {\r\n\t\t\tbruteForceStep(startingPoint, firstStop, 0, new ArrayList<ArrayList<Integer>>(), costArray);\r\n\t\t}\t\t\r\n\t\treturn;\r\n\t}",
"protected boolean checkForWin() {\r\n \t\r\n if (squaresRevealed == this.width * this.height - this.mines) {\r\n finishFlags();\r\n finish(GameStateModel.WON);\r\n return true;\r\n } \t\r\n \t\r\n return false;\r\n \t\r\n }",
"public int minCost(int[][] costs) {\n if (costs.length == 0) return 0;\n this.costs = costs;\n numHouses = costs.length;\n int cA = processCosts(0, 0);\n int cB = processCosts(0, 1);\n int cC = processCosts(0, 2);\n return Math.min(Math.min(cA, cB), cC);\n }",
"private static boolean hasFunds(double cost)\n {\n if (Clock.getRoundNum() < 200) { //TODO edit this out if necessary\n return rc.getTeamOre() > cost;\n } else {\n return rc.getTeamOre() > cost*2;\n }\n }",
"private boolean hasCapacity() {\n int used = 0 + evaluations.size() * 2;\n int available = Runtime.getRuntime().availableProcessors() * ServerRunner.getProcessorMultiplier();\n return used < available;\n }",
"public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }",
"@Override\n\tpublic boolean isUseableByPlayer(EntityPlayer p_70300_1_) {\n\t\treturn worldObj.getTileEntity(field_145851_c, field_145848_d,\n\t\t\t\tfield_145849_e) != this ? false : p_70300_1_.getDistanceSq(\n\t\t\t\tfield_145851_c + 0.5D, field_145848_d + 0.5D,\n\t\t\t\tfield_145849_e + 0.5D) <= 64.0D;\n\t}",
"public boolean isProjectile();",
"public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }"
] | [
"0.6981132",
"0.6256184",
"0.61798024",
"0.59347486",
"0.5904697",
"0.58826363",
"0.58263856",
"0.5790191",
"0.57562995",
"0.5725721",
"0.5724156",
"0.5711183",
"0.56946474",
"0.56125486",
"0.55935764",
"0.5592624",
"0.558843",
"0.5587489",
"0.5583571",
"0.5569119",
"0.5562354",
"0.5538758",
"0.55371165",
"0.5508655",
"0.54971695",
"0.5440955",
"0.5408409",
"0.540522",
"0.5399542",
"0.53950053",
"0.53859764",
"0.53643215",
"0.5354359",
"0.53408384",
"0.53304505",
"0.53301036",
"0.5326898",
"0.5324274",
"0.5323764",
"0.5319023",
"0.5308714",
"0.5305675",
"0.5304493",
"0.52767736",
"0.52694494",
"0.5266796",
"0.5263891",
"0.5263885",
"0.52524495",
"0.5251119",
"0.5251119",
"0.5251119",
"0.5251119",
"0.5251119",
"0.5251119",
"0.52453476",
"0.52450633",
"0.5241043",
"0.52362496",
"0.5235855",
"0.5225653",
"0.52172965",
"0.52113587",
"0.52061135",
"0.5203252",
"0.5197662",
"0.51902986",
"0.5188155",
"0.5184114",
"0.5179082",
"0.5172277",
"0.5171572",
"0.5170953",
"0.5164856",
"0.51550627",
"0.51457614",
"0.51335895",
"0.5129813",
"0.5129099",
"0.5125939",
"0.5124392",
"0.5122731",
"0.5118889",
"0.51169777",
"0.5111253",
"0.51087934",
"0.5106197",
"0.5102234",
"0.5098389",
"0.50901324",
"0.50849426",
"0.50764626",
"0.50751543",
"0.5075146",
"0.5070786",
"0.5066579",
"0.50653017",
"0.50490403",
"0.5044434",
"0.5043342"
] | 0.7166121 | 0 |
Return the minimal amount of energy required for robot to reach (x, y) taking into account the robot's current load and energy level. Do not take into account shooting and picking up/using/dropping batteries. The expected return value of this method depends on isMinimalCostToReach17Plus: If isMinimalCostToReach17Plus returns 0, then getMinimalCostToReach will only be called if there are no obstacles in the rectangle covering robot and the given position. Moreover, the result of this method should not include the energy required for turning. If isMinimalCostToReach17Plus returns 1, then getMinimalCostToReach must take into account obstacles (i.e. walls, other robots) and the fact that turning consumes energy. This method must return 1 if the given position is not reachable given the current amount of energy. In any case, this method must return 1 if robot is not placed on a board. | @Override
public double getMinimalCostToReach(Robot robot, long x, long y)
{
try
{
return robot.getEnergyRequiredToReach(new Position(x, y));
}
catch(IllegalBoardException exc)
{
System.out.println("The given robot is not placed on a board..");
return -1;
}
catch(IllegalStateException exc)
{
System.out.println("The given robot is terminated.");
return -1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double calculateCostInclusive() {\n\t\tdouble accumulatedCost = 0;\n\t\taccumulatedCost += calculateEuclideanDistance(host.grid.getLocation(host), solutionRepresentation.get(0));\n\t\taccumulatedCost += calculateCostExclusive();\n\t\t\n\t\treturn accumulatedCost;\n\t}",
"@Override\r\n\tpublic int isMinimalCostToReach17Plus()\r\n\t{\r\n\t\treturn 1;\r\n\t}",
"default int minimumHit(Player player) {\n\t\treturn -1;\n\t}",
"public int findLeast() {\r\n\tint cor = 0;\r\n\tint x = 9;\r\n\tfor (int r = 0; r < 9; r++) {\r\n\t for (int c = 0; c < 9; c++) {\r\n\t\tif (!board[r][c].getIsDef()) {\r\n\t\t if (board[r][c].getNumPossible() == 2) {\r\n\t\t\treturn r*10 + c;\r\n\t\t }\r\n\t\t if (board[r][c].getNumPossible() < x) {\r\n\t\t\tcor = r*10 + c;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n\treturn cor;\r\n }",
"float getGrowthCoefficient(BlockPos pos, World worldIn) {\n\t\tif(worldIn.canBlockSeeSky(pos.offset(EnumFacing.UP))) return 1;\n\t\tif(worldIn.getLight(pos)>=7) return 1;\n\t\treturn 1f;\n\t}",
"private static MapLocation getBestPastrLocNearMeBasedOnCowGrowthRate() {\n\t\tif (Clock.getRoundNum() < 1) {\n\t\t\tallCowGrowths = rc.senseCowGrowth();\t\t\t\n\t\t}\n\t\tMapLocation bestLocation = new MapLocation(curLoc.x, curLoc.y);\n\t\tdouble cowGrowthAmount = 0;\n\t\tMapLocation enemyHQLocation = rc.senseEnemyHQLocation();\n\t\tdouble distanceToEnemyHQ = curLoc.distanceSquaredTo(enemyHQLocation);\n\t\tfor (int i = 15; i-- > 0;) {\n\t\t\tfor (int j = 15; j-- > 0;) {\n\t\t\t\t// Check that it's in bounds\n\t\t\t\tif (curLoc.x - i + 8 >= 0 && curLoc.x - i + 8 < rc.getMapWidth() &&\n\t\t\t\t\tcurLoc.y - j + 8 >= 0 && curLoc.y - j + 8 < rc.getMapHeight()) {\n\t\t\t\t\tMapLocation mapLoc = new MapLocation(curLoc.x - i + 8, curLoc.y - j + 8);\n\t\t\t\t\tdouble currentLocGrowth = allCowGrowths[curLoc.x - i + 8][curLoc.y - j + 8];\n\n\t\t\t\t\t// Check that it's behind a perpendicular line and not void\n\t\t\t\t\t// and choose the best point.\n\t\t\t\t\tif (mapLoc.distanceSquaredTo(enemyHQLocation) < distanceToEnemyHQ &&\n\t\t\t\t\t\tcurrentLocGrowth > cowGrowthAmount && rc.senseTerrainTile(mapLoc) != TerrainTile.VOID) {\n\t\t\t\t\t\tcowGrowthAmount = currentLocGrowth;\n\t\t\t\t\t\tbestLocation = mapLoc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bestLocation;\n\t}",
"public float getMinAvailability()\n\t{\n\t\treturn piecePicker.getMinAvailability();\n\t}",
"public double minXp(){\n\t\tmin = xp[0];\n\t\tfor(int i=1;i<xp.length;i++){\n\t\t\tif(xp[i]<min){\n\t\t\t\tmin=xp[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}",
"public int heuristic()\n {\n if (this.heuristic != Integer.MIN_VALUE)\n return this.heuristic;\n this.heuristic = 0;\n if (!this.safe)\n return 0;\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.heuristic = (this.d.size() * 100) + (this.NE * 10) + bonus;\n // value:\n return this.heuristic;\n }",
"public int getHeuristicScore() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \tint cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic + cost;\r\n }",
"private synchronized double getCurrentObstaclePotential(){\n double obstacleField = 0;\n double obstaclePotential = 0;\n double goalPotential = 0;\n\n for(LidarPoint obstacle : obstaclePoints){\n //Generate obstacle positions\n Position obstaclePosition = new Position(-obstacle.getX(), -obstacle.getZ());\n //System.out.println(\"Current: \"+currentPosition);\n //System.out.println(\"Obstacle: \"+obstaclePosition);\n //Calculate distance from obstacle to eliminate out of range o's\n double obstacleDistance = getEuclidean(this.currentPosition, obstaclePosition);\n //System.out.println(\"Distance = \"+obstacleDistance);\n\n if((obstacleDistance < DEFAULT_SENSOR_RANGE) && !(DEFAULT_OBSTACLE_COEFFICIENT == 0)){ // might add obst coeff\n //Calculate field: increases if close to obstacle\n obstacleField += Math.pow(Math.E, -1/(DEFAULT_SENSOR_RANGE-obstacleDistance))/obstacleDistance;\n //System.out.println(\"Obstacle Field: \" + obstacleField);\n }\n }\n\n //Calculate Potentials\n goalPotential = DEFAULT_GOAL_COEFFICIENT * Math.pow(getEuclidean(currentPosition, goalPosition), 2);\n obstaclePotential = DEFAULT_OBSTACLE_COEFFICIENT * obstacleField;\n\n double totalPot = goalPotential + obstaclePotential;\n return totalPot;\n }",
"public double calculateCost(GridState newPoint){\n\t // Does the agent have access to weather information?\n\t return agent.danger(newPoint.getPosition());\n\t \n\t \n\t /* if(agent.hasWeatherInfo()) {\n\t\t // Check fire speed, check wind speed, calculate new fire speed, see if it is likely to spread to the state its gridpoint\n\t\t // Check if it is raining, because then it is slowing down the rain again\n\t\t return danger(newPoint);\n\t }\n\t else return 1.0;*/\n }",
"public double getMinimumDistance() { return minDistance; }",
"protected double calculatePower(IPoint2D robotLoc) {\n\t\tdouble distanceOverSlowDown = robotLoc.distance(m_destination) / m_slowDownDistance;\n\t\tif (distanceOverSlowDown > 1)\n\t\t\treturn 1;\n\t\treturn Math.max(distanceOverSlowDown, 0.75);\n\t}",
"public Integer getMinHealthyPercentage() {\n return this.minHealthyPercentage;\n }",
"private double getNearestAEnergy() {\n\t\tdouble value = getInitialEnergy();\n\t\tdouble ret = value;\n\t\twhile (value < getaEnergy()) {\n\t\t\tdouble step = getPreEdgeStep();\n\t\t\t// avoid infinite loop\n\t\t\tif (step <= 0.0)\n\t\t\t\tstep = 1.0;\n\t\t\tvalue += step;\n\t\t\tif (value > getaEnergy())\n\t\t\t\tbreak;\n\t\t\tret = value;\n\t\t}\n\t\treturn ret;\n\t}",
"private boolean canReach(Point positionEnemy, Point towerPosition) {\n return towerPosition.distance(positionEnemy) / Tile.TILE_WIDTH <= tower.getFireRange();\n }",
"private double objectiveFunction(final Map<DateTime, Position> position,\n\t\t\tfinal Schedule scheduleOfOtherDevices) {\n\t\tdouble fitness = 0;\n\n\t\tfor (DateTime currentRun : position.keySet()) {\n\t\t\tPosition currentPosition = position.get(currentRun);\n\t\t\tAmount<Power> loadNeededForEverySlotOfRun = currentPosition\n\t\t\t\t\t.getChosenValue();\n\n\t\t\tDateTime currentTime = currentPosition.getPossibleRun()\n\t\t\t\t\t.getEarliestStartTime();\n\t\t\twhile (currentTime.isBefore(currentRun.plus(currentPosition\n\t\t\t\t\t.getPossibleRun().getLengthOfRun()))) {\n\t\t\t\tCostFunction costFunction = pricingService\n\t\t\t\t\t\t.getCostFunction(currentTime);\n\n\t\t\t\tif (costFunction == null) {\n\t\t\t\t\t/*\n\t\t\t\t\t * LOG.error(\n\t\t\t\t\t * \"No cost function for time {} found. Substituting with {}\\navailable cost functions:\\n{}\"\n\t\t\t\t\t * , currentTime, DEFAULT_COSTS, StringUtils.join(\n\t\t\t\t\t * pricingService.getCostFunctions(), '\\n'));\n\t\t\t\t\t */\n\t\t\t\t\t/*\n\t\t\t\t\t * throw new IllegalArgumentException( String.format(\n\t\t\t\t\t * \"No cost function for time %s found\\navailable cost functions:\\n%s\"\n\t\t\t\t\t * , currentTime, StringUtils.join(\n\t\t\t\t\t * pricingService.getCostFunctions(), '\\n')));\n\t\t\t\t\t */\n\t\t\t\t\tfitness += DEFAULT_COSTS;\n\t\t\t\t} else {\n\t\t\t\t\tMap<DateTime, Slot> schedule = scheduleOfOtherDevices\n\t\t\t\t\t\t\t.getSchedule();\n\t\t\t\t\tif (schedule == null || schedule.get(currentTime) == null) {\n\t\t\t\t\t\tfitness += costFunction.getPrice()\n\t\t\t\t\t\t\t\t.getCostAtConsumption(\n\t\t\t\t\t\t\t\t\t\tloadNeededForEverySlotOfRun\n\t\t\t\t\t\t\t\t\t\t\t\t.divide(1000));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfitness += costFunction.getPrice()\n\t\t\t\t\t\t\t\t.getCostAtConsumption(\n\t\t\t\t\t\t\t\t\t\tloadNeededForEverySlotOfRun.plus(\n\t\t\t\t\t\t\t\t\t\t\t\tschedule.get(currentTime)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLoad())\n\t\t\t\t\t\t\t\t\t\t\t\t.divide(1000));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentTime = currentTime.plusMinutes(Constants.SLOT_INTERVAL);\n\t\t\t}\n\t\t}\n\t\treturn fitness;\n\t}",
"private Outcome minMax(PossibleBoard posBoard, Icon icon, int depth) {\n Outcome outcome = new Outcome();\n Result result = posBoard.determineOutcome();\n boolean maximiseWin = icon == getIcon();\n\n // BASE CASE\n if (result.gameComplete()) {\n outcome.score = result.getBonus();\n outcome.moveToMake = posBoard.coor;\n outcome.depth = depth;\n return outcome;\n }\n\n ArrayList<PossibleBoard> posNextBoards = getPossibleNextBoards(posBoard, icon);\n int optimalScore = (maximiseWin ? Integer.MIN_VALUE : Integer.MAX_VALUE);\n Coordinate optimalCoor = new Coordinate(0,0);\n int optimalDepth = Integer.MAX_VALUE;\n\n for (PossibleBoard posNextBoard : posNextBoards) {\n Outcome nextOutcome = minMax(posNextBoard, (icon == Icon.CROSSES ? Icon.NOUGHTS : Icon.CROSSES), depth + 1);\n\n if (maximiseWin && nextOutcome.score >= optimalScore) {\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n } else if (!maximiseWin && nextOutcome.score <= optimalScore){\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n }\n }\n\n outcome.moveToMake = optimalCoor;\n outcome.score = optimalScore;\n outcome.depth = optimalDepth;\n return outcome;\n }",
"private boolean isEligibleForRealMin() {\n return eligibleForRealMin;\n }",
"public PrimEdge calculateMinimum() {\n int minWage = Integer.MAX_VALUE;\n PrimEdge result = null;\n for (Map.Entry<Integer, PrimEdge> entry : dtable.entrySet()) {\n if (entry.getValue().getWage() < minWage) {\n result = entry.getValue();\n minWage = entry.getValue().getWage();\n }\n }\n return result;\n }",
"public int getMinDistance(){\n return totalDistance;\n }",
"public int getMinimumPoints() {\n return mWeakMinimumSizeAllowed ? WEAK_MINIMUM_SIZE : MINIMUM_SIZE;\n }",
"private void findSmallestCost() {\n int best = 0;\n fx = funFitness[0];\n for (int i = 1; i < population; i++) {\n if (funFitness[i] < fx) {\n fx = funFitness[i];\n best = i;\n }\n }\n //System.arraycopy(currentPopulation[best], 0, bestSolution, 0, dimension);\n copy(bestSolution, currentPopulation[best]);\n }",
"@Override\n\tpublic double calcConsumedEnergy() {\n\t\treturn (getBasicEnergyCost() * 4);\n\t}",
"public double getPointToPointEnergyCoefficient(Coordinates coordinate1, Coordinates coordinate2)\n {\n\n double distance = distance(coordinate1, coordinate2);\n return 1 + distance / (distance * random.nextDouble());\n }",
"public double getMinimumDistance() {\n double l = Double.POSITIVE_INFINITY;\n int stop = getDistanceEnd();\n\n calculateDistances();\n\n for (int i = 0; i < stop; i++) {\n l = Math.min(l, distances[i]);\n }\n\n return l;\n }",
"protected double evaluateFuelCost(SpatialPoint start, SpatialPoint end, double speed) {\n return start.distance(end) * ((Math.abs(speed - optSpeed) / optSpeed) * NONOPTIMAL_SPEED_PENALTY_COEF + 1.0);\n }",
"public double getApproxEmin() {\n try {\n return computeE(getTmin());\n }\n catch (Exception e) {\n return 0x0.0p0;\n }\n }",
"static double addHeuristic1(GameState c, boolean isMaxNode) {\n\t\t// Value returned will be absolute. If its max node, this config is good\n\t\t// then value will be positive. If its min node,\n\t\t// and this config is good for min, then value will be negative\n\n\t\tint i, j, vacant_spaces;\n\t\t// Compute : Feasible Moves for self\n\t\tint self_feasible_moves = 0;\n\t\tint self_remaining_moves = 0;\n\t\tint opponent_feasible_moves = 0;\n\t\tint opponent_remaining_moves = 0;\n\n\t\t// Go through the board and figure out vacant spots\n\t\tvacant_spaces = 0;\n\t\tfor (i = -GameState.HALF_BOARD; i <= GameState.HALF_BOARD; i = i + 1) {\n\t\t\tif (c.getWeight(i) == 0) {\n\t\t\t\tvacant_spaces++;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 1; i <= GameState.MAX_WEIGHT; i = i + 1) {\n\t\t\t// Check if self have the weight\n\t\t\tif (c.IHaveWeight(i)) {\n\t\t\t\tself_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\t// Place it and see if you tip\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\tself_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if opponent has this weight\n\t\t\tif (c.opponentHasWeight(i)) {\n\t\t\t\topponent_remaining_moves++;\n\t\t\t\t// Go through all the possible positions\n\t\t\t\tfor (j = -GameState.HALF_BOARD; j < GameState.HALF_BOARD; j++) {\n\t\t\t\t\t// Place the weight and see if you tip\n\t\t\t\t\tif (c.getWeight(j) == 0) {\n\t\t\t\t\t\tc.makeMove(i, j, PlayerName.none);\n\t\t\t\t\t\tif (!c.isTipping_old()) {\n\t\t\t\t\t\t\topponent_feasible_moves++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Now remove the weight\n\t\t\t\t\t\tc.removeMove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Need to take the max because one of the players may have played one\n\t\t// chance less\n\t\tif (self_remaining_moves == 0 && opponent_remaining_moves == 0) {\n\t\t\treturn 0.0;\n\t\t} else if (self_remaining_moves > opponent_remaining_moves)\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (self_remaining_moves * vacant_spaces);\n\t\telse\n\t\t\treturn (double) (self_feasible_moves - opponent_feasible_moves)\n\t\t\t\t\t/ (double) (opponent_remaining_moves * vacant_spaces);\n\t}",
"private static double findMinCost(double lemda, Vector finalVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n int m = destList.size();\r\n int w = n > m ? m : n;\r\n\r\n double [] costFor_r = new double[w];\r\n\r\n double minCost = MaxDistance;\r\n double totalCurToAll = findDistanceCurToAll(currentNode, destList);\r\n for ( int r = 0 ; r < w; r ++ )\r\n {\r\n Vector rSetVector = new Vector();\r\n costFor_r[r] = getMinSetCost_given_r( r+1, rSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n costFor_r[r] = (1.0 - lemda) * (r + 1) / n + costFor_r[r] / totalCurToAll;\r\n if ( costFor_r[r] < minCost ) {\r\n minCost = costFor_r[r];\r\n finalVector.clear();\r\n for (int k = 0; k < rSetVector.size(); ++k) {\r\n finalVector.add(k, rSetVector.get(k));\r\n }\r\n }\r\n }\r\n\r\n return minCost;\r\n }",
"int getMin() {\n\t\tif (stack.size() > 0) {\n\t\t\treturn minEle;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}",
"@POST(\"/ShipEnergyAdequate\")\n\tint shipEnergyAdequate(@Body MoveShipParams params);",
"public void minimum()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tif(rowTick[i]==8888)\n\t\t\t{\n\t\t\t\tfor(int j=0;j<n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(columnTick[j]==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cost[i][j]<min)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin=cost[i][j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int getRedstonePower(Point3d position){\r\n\t\treturn world.getRedstonePowerFromNeighbors(new BlockPos(position.x, position.y, position.z));\r\n\t}",
"public int getBestMove(ModelInterface field, List<IRatingMechanism> ratingMechanisms, Token owner) {\n tree = new Tree(field, ratingMechanisms, owner);\n // minimize or maximize each level\n for (int i = Tree.MAXDEPTH - 1; i > 0; i--) {\n //System.out.println(\"max/min level \" + i);\n List<Node> currLevel = tree.getLevel(i);\n if (!currLevel.isEmpty()) {\n \n if (currLevel.get(0).getCurrentOwner() == owner) {\n \n for (Node node : currLevel) {\n maximize(node);\n }\n \n } else {\n \n for (Node node : currLevel) {\n minimize(node);\n }\n }\n }\n }\n\n // debug\n for (int i = 0; i < tree.getLevel(1).size(); i++) {\n System.out.println(tree.getLevel(1).get(i).getMove().toString());\n }\n\n PossibleMove minMove = tree.getLevel(1).get(0).getMove();\n for (int i = 0; i < tree.getLevel(1).size(); i++) {\n if (tree.getLevel(1).get(i).getMove().getRating() < minMove.getRating()) {\n minMove = tree.getLevel(1).get(i).getMove();\n }\n }\n return minMove.getMove();\n }",
"private static int getHeuristic(MazeState current, HashSet<MazeState> goals) {\n\t\tint lowestCost = Integer.MAX_VALUE;\n\t\tint currentCost = 0;\n\t\tfor (MazeState goal : goals) {\n\t\t\tcurrentCost = Math.abs(current.col - goal.col) + Math.abs(current.row - goal.row);\n\t\t\tif (currentCost <= lowestCost) {\n\t\t\t\tlowestCost = currentCost;\n\t\t\t}\n\t\t}\n\t\treturn currentCost;\n\t}",
"public double calcEnergyToBeBought(double neededEnergy) {\n double energyLossIncluded = neededEnergy/cableEnergyLoss; //Here the amount of energy lost is calculated, see cable.getCost() and http://large.stanford.edu/courses/2010/ph240/harting1/\n return energyOffer.getEnergy() <= energyLossIncluded ? (energyOffer.getEnergy()) : energyLossIncluded;\n }",
"public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }",
"private double heuristicCost(Point p) {\n\t\treturn distance(p, goal);\n\t}",
"public int minCost(int[][] costs) {\n if (costs.length == 0) return 0;\n this.costs = costs;\n numHouses = costs.length;\n int cA = processCosts(0, 0);\n int cB = processCosts(0, 1);\n int cC = processCosts(0, 2);\n return Math.min(Math.min(cA, cB), cC);\n }",
"private double computeForcesWithinCells() {\r\n double potentialEnergy = 0;\r\n \r\n for (int i = 0; i < nXCells; i++) {\r\n for (int j = 0; j < nYCells; j++) {\r\n for (Molecule m1 = cells[i][j].firstMolecule; m1 != null; m1 = m1.nextMoleculeInCell) {\r\n for (Molecule m2 = m1.nextMoleculeInCell; m2 != null; m2 = m2.nextMoleculeInCell) {\r\n double pe = computeForceBetweenMolecules(m1, m2);\r\n if (pe != 0) {\r\n potentialEnergy += pe;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return potentialEnergy;\r\n }",
"float estimateCostToGoal( int current_x, int current_y, int current_z, boolean fromStart ) {\n\t\treturn 0;\n\t}",
"double getMinActiveAltitude();",
"public <V extends DataType<V>> int argmin(\r\n \t\tCostFunction<V> costFunction,\t\tPlanCostFunction<V> localCostFunction,\r\n\t\t\tList<Plan<V>> choices, \t\t\t\tV constant, \r\n\t\t\tdouble alpha,\t\t\t\t\t\tdouble beta,\r\n\t\t\tdouble discomfortSumConstant,\t\tdouble discomfortSumSqrConstant,\t\r\n\t\t\tint numAgents, \t\t\t\t\t\tMultiObjectiveIEPOSAgent agent) {\r\n\r\n\t\tdouble[] costs = new double[choices.size()];\r\n\t\tdouble[] discomfortSums = new double[choices.size()];\r\n\t\tdouble[] discomfortSumSqrs = new double[choices.size()];\r\n\r\n\t\tIntStream.range(0, choices.size()).forEach(i -> {\r\n\t\t\tV combined;\r\n\t\t\tif(constant != null) {\r\n\t\t\t\tcombined = constant.cloneThis();\r\n\t\t\t\tcombined.add(choices.get(i).getValue());\r\n\t\t\t} else {\r\n\t\t\t\tcombined = choices.get(i).getValue();\r\n\t\t\t}\r\n\t\t\tdouble cost = costFunction.calcCost(combined);\r\n\r\n\t\t\tcosts[i] = cost;\r\n\t\t\tdouble score = localCostFunction.calcCost(choices.get(i));\r\n\t\t\tdiscomfortSums[i] = discomfortSumConstant + score;\r\n\t\t\tdiscomfortSumSqrs[i] = discomfortSumSqrConstant + score*score;\r\n\t\t\t//System.out.print(\"agent: \" + agent.getPeer().getIndexNumber() + \", SumConst = \" + discomfortSumConstant + \", Sum2const = \" + discomfortSumSqrConstant);\r\n\t\t\t//System.out.println(\"Sum is \" + discomfortSums[i] + \", sum^2 is \" + discomfortSumSqrs[i] + \", num agents = \" + numAgents);\r\n\t\t});\r\n\r\n\t\treturn this.extendedOptimization(costs, alpha, beta, discomfortSums, discomfortSumSqrs, numAgents);\r\n\r\n }",
"void calculateFitness() {\n if (reachedGoal) {\n fitness = 1d / 16d + 8192d / (genome.step * genome.step);\n } else {\n double d = position.distance(Game.Setup.goal);\n fitness = 1d / (d * d);\n }\n }",
"float getRunPotential(Location position, int rowInc, int colInc, int maxRow, int maxCol) {\n IntLocation pos = new IntLocation(position);\n float runPotential = 0;\n int breadth = (rowInc == 1) ? (maxRow - pos.row()) : (maxCol - pos.col());\n GoBoardPosition startSpace = (GoBoardPosition) board.getPosition( pos );\n\n do {\n GoBoardPosition nextSpace = (GoBoardPosition) board.getPosition( pos );\n GoBoardPosition firstSpace = nextSpace;\n boolean containsEnemy = false;\n int runLength = 0;\n boolean player1 = groupString.isOwnedByPlayer1();\n while (inRun(pos, maxRow, maxCol, nextSpace, player1)) {\n if (containsEnemy(player1, nextSpace)) {\n containsEnemy = true;\n }\n runLength++;\n pos = pos.incrementOnCopy(rowInc, colInc);\n nextSpace = (GoBoardPosition) board.getPosition( pos );\n }\n boolean bounded = isBounded(startSpace, nextSpace, firstSpace);\n runPotential += accrueRunPotential(rowInc, pos, breadth, firstSpace, containsEnemy, runLength, bounded);\n\n pos = pos.incrementOnCopy(rowInc, colInc);\n\n } while (pos.col() <= maxCol && pos.row() <= maxRow);\n\n return runPotential;\n }",
"protected double minimumCostPerUnitDistance( ) {\n\t\treturn 0.0;\n\t}",
"public boolean isPositionReachable(Position position) {\n if (position.getXCoordinate().compareTo(maxPosition.getXCoordinate()) > 0 ||\n position.getYCoordinate().compareTo(maxPosition.getYCoordinate()) > 0 ||\n position.getXCoordinate().compareTo(minPosition.getXCoordinate()) < 0 ||\n position.getYCoordinate().compareTo(minPosition.getYCoordinate()) < 0)\n {\n return false;\n }\n return true;\n }",
"@Test\n public void getMaxReach() {\n assertEquals(\"Max reach for G should be 3\",\n 3,\n Shape.G.getMaxReach());\n assertEquals(\"Max reach for J should be 4\",\n 4,\n Shape.J.getMaxReach());\n assertEquals(\"Max reach for I should be 2\",\n 2,\n Shape.I.getMaxReach());\n\n // check different rotations\n assertEquals(\"Max vert reach for G facing south should be 2\",\n 2,\n Shape.G.getMaxReach(Direction.SOUTH, true));\n assertEquals(\"Max hori reach for J facing north should be 4\",\n 4,\n Shape.J.getMaxReach(Direction.NORTH, false));\n assertEquals(\"Max vert reach for I facing west should be 2\",\n 2,\n Shape.I.getMaxReach(Direction.WEST, true));\n }",
"@Override\n\tpublic float desireability() {\n\t\tAgentSpace agentSpace = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tMap<String,FoodEntry> map = agentSpace.getScentMemories().getFirst();\n\t\tif (map == null || map.size() == 0) { \n\t\t\t// we don't smell anything\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tAgentSpace space = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tBoundedEntry bounded = space.getBounded(Variable.energy);\n\t\tfloat pct = bounded.getValue() / bounded.getMax();\n\t\treturn 1 - (pct*pct);\n\t}",
"public boolean checkReached(float xTile, float yTile)\r\n/* 134: */ {\r\n/* 135:149 */ if ((this.mission) && (tileReachObjectives(xTile, yTile)))\r\n/* 136: */ {\r\n/* 137:152 */ this.reach[((int)xTile)][((int)yTile)] = 0;\r\n/* 138:153 */ this.reachablePlaces -= 1;\r\n/* 139:154 */ if (this.reachablePlaces == 0) {\r\n/* 140:156 */ return true;\r\n/* 141: */ }\r\n/* 142: */ }\r\n/* 143:160 */ return false;\r\n/* 144: */ }",
"public int getMineStrength(int position) {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\t\t\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\t\t\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\t\t\r\n\t\t//TODO\r\n\t\t\r\n\t\treturn -1;\r\n\t}",
"public double satisfyOrder(ShipmentOrder order) \n {\n double fOreToLoad, fOreToTake, fMetalRemaining;\n OrePile pile;\n\n if (order.getOrderedMetalWt() > calcTotalMetalWeight())\n throw new IllegalStateException(\"Not enough ore in this Shed to fulfill the order\");\n\n fMetalRemaining = order.getOrderedMetalWt();\n fOreToLoad = 0.000;\n\n while (fMetalRemaining > 0.) \n {\n pile = m_orePileQueue.peek();\n\n if (fMetalRemaining >= pile.calcMetalWeight()) {\n // Take this whole pile and dequeue it\n pile = m_orePileQueue.peek();\n m_orePileQueue.dequeue();\n fOreToLoad += pile.getWeight();\n fMetalRemaining -= pile.calcMetalWeight();\n }\n else \n {\n // Take part of this pile but leave it on the queue\n fOreToTake = fMetalRemaining / (pile.getGrade() / 100.0);\n pile.setWeight(pile.getWeight() - fOreToTake);\n fOreToLoad += fOreToTake;\n fMetalRemaining = 0.0;\t// We're done\n }\n }\n\n fMetalRemaining = 0;\n return fOreToLoad;\n }",
"public double getMinimalRadius() {\n\t\treturn minimalRadiusProperty().getValue();\n\t}",
"public abstract double costPerMin (CallZone zone);",
"@Override\r\n double computeAccelerations() {\r\n double potentialEnergy;\r\n \r\n potentialEnergy = computeWallForces();\r\n assignMoleculesToCells(); \r\n potentialEnergy += computeForcesWithinCells();\r\n potentialEnergy += computeForcesWithNeighbourCells();\r\n \r\n return potentialEnergy;\r\n }",
"public final boolean searchMinimum(){\r\n\t\tif (!initialized()) minimum=true;\r\n\t\treturn minimum;\r\n\t}",
"public int calculateDistance(Pair<Integer,Direction> eleLoc) {\n\t\tint start = request.getFloor();\n\t\tDirection dirReq = request.getDirection();\n\t\tDirection dirEle =(Direction) eleLoc.getV();\n\t\tint eleFloor =(int) eleLoc.getT();\n\t\t/*\n\t\t * Elevator can not handle multi job allotments yet\n\t\t */\n\t\tswitch(dirEle) {//calculate distance based on which way the elevator is moving\n\t\t\tcase UP: //if elevator is moving up or down, make sure it matches the direction of request\n\t\t\t\tif(dirReq==dirEle) {\n\t\t\t\t\treturn ((start-eleFloor)>=0)?(start-eleFloor+10):-1;\n\t\t\t\t}else {//if elevator movement != direction of request, do not chose elevator\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\tcase DOWN:\n\t\t\t\tif(dirReq==dirEle) {\n\t\t\t\t\treturn ((eleFloor-start)>=0)?(eleFloor-start+10):-1;\n\t\t\t\t}else {//if elevator movement != direction of request, do not chose elevator\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\tcase STATIONARY://if elevator is stationary get absolute value of distance\n\t\t\t\treturn 0;\n\t\t\tdefault:\n\t\t\t\treturn -1;\n\t\t}\n\t}",
"float getFitnessScore(MapLocation l) {\n\t\ttry{\n\t\t\tif(rc.canSenseLocation(l) && !rc.onTheMap(l)) {\n\t\t\t\t//System.out.println(\"dead square\");\n\t\t\t\treturn -999999.0f;\n\t\t\t}\n\t\t} catch(Exception e){e.printStackTrace();}\n\t\t\n\t\tfloat fitness = 0.0f;\n\t\t\n\t\tfor(RobotInfo ri : allRobots) {\n\t\t\tfitness -= 1f/l.distanceSquaredTo(ri.location);\n\t\t}\n\t\tif(type.equals(RobotType.GARDENER)) {\n\t\t\tfor(TreeInfo ti : allTrees) {\n\t\t\t\tif(ti.team.equals(Team.NEUTRAL)) {\n\t\t\t\t\tfitness -= 1f/l.distanceSquaredTo(ti.location);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfitness -= 10f/l.distanceSquaredTo(lastLocation);\n\t\t\n\t\treturn fitness;\n\t}",
"private float getHitProbability(int x, int y) {\n\t\tfloat probability = 0;\n\t\t\n\t\tfor (int i = -TOWER_RANGE; i <= TOWER_RANGE; i++) {\n\t\t\tfor (int j = -TOWER_RANGE; j <= TOWER_RANGE; j++) {\n\t\t\t\tint curX = x + i;\n\t\t\t\tint curY = y + j;\n\t\t\t\tif (currentState.inBounds(curX, curY)\n\t\t\t\t\t\t&& distance(x, y, curX, curY) <= TOWER_RANGE) { // tower shoots in a circular range\n\t\t\t\t\tprobability = (probability + board.getTowerProbability(curX, curY)) - (probability * board.getTowerProbability(curX, curY));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn probability * TOWER_ACCURACY;\n\t}",
"public int findMin() {\r\n\t\treturn this.min.value;\r\n\t}",
"public int minCost(int[][] costs) {\n\nif(costs== null || costs.length == 0)\nreturn 0;\n// int n_houses = costs.length ;\nint lastR = costs[0][0];\nint lastB = costs[0][1];\nint lastG = costs[0][2];\nint currR,currB,currG ;\nfor(int i = 1; i< costs.length ; i++ ){\ncurrR = costs[i][0] + Math.min(lastB,lastG);\ncurrB = costs[i][1] + Math.min(lastR,lastG);\ncurrG = costs[i][2] + Math.min(lastR,lastB);\nlastR = currR;\nlastB = currB;\nlastG = currG;\n}\n// return Math.min(Math.min(lastR,lastB),lastG);\nreturn Math.min(Math.min(lastR,lastB),lastG);\n}",
"public Point getAlteredCoord(Point actualPoint) {\n //If breath rate is out of range, returns an altered coordinate according to the level of out of range and\n //the current game level (Easy, Medium, Hard). If breath is in range, return the same coord.\n Point alteratedPoint = actualPoint;\n\n Random randomNoise = new Random();\n\n //As USER_CURRENT_BREATH_RATE will be changing, we must do a \"snapshot\" at this time to work with proper measures.\n double userCurrentSnap = USER_CURRENT_BREATH_RATE;\n\n //Consider 6-8, MAX_IDEAL_BREATH_RATE (8) will be the max\n double referenceDistance = MAX_BREATH_RATE - MAX_IDEAL_BREATH_RATE;\n double myRateExcess = userCurrentSnap - MAX_IDEAL_BREATH_RATE;\n double relationPreferedActual = myRateExcess / referenceDistance;\n\n //How much far of the ideal is?, according to our limit of 20\n double percentOfExcess = relationPreferedActual * 100;\n\n /*\n EASY:\n Speed: 25%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 30% of the maximum number on coord x or y\n MEDIUM:\n Speed: 45%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 50% of the maximum number on coord x or y\n HARD:\n Speed: 80%\n Range of speed change: (up to 15%)\n Maximum amount of noise: +/- 80% of the maximum number on coord x or y\n */\n\n //Maximum increment of speed in 15% of MAX_SCALED_SPEED\n double mxSpdInc = MAX_SCALED_SPEED * .15;\n\n //NOTE: The formulas obtained were based on x^2\n /*\n *Solving y=ax^2 + b\n *Finding the variables a, and b. X represents the amount of excess and Y represents the speed for that amount\n */\n double a, b;\n double maxSpeed; //Max space in case of 100% of\n double easyNoise = .38, mediumNoise = .58, hardNoise = .75; //Percents\n\n //drive_control works acording to the size of the wheel. And as closer to the circumference as faster that will be.\n int maxX = this.wheel.getBounds().width(); //This represent the max X possible coord on the wheel\n int maxY = this.wheel.getBounds().height();\n\n if (percentOfExcess > 0) {\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n\n //Alter speed. The speed will be changed\n maxSpeed = EASY_BASE_SPEED + mxSpdInc;\n b = EASY_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n\n alteratedPoint = getFinalPoint(maxX, maxY, easyNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n break;\n case MEDIUM:\n maxSpeed = MEDIUM_BASE_SPEED + mxSpdInc;\n b = MEDIUM_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, mediumNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n case HARD:\n maxSpeed = HARD_BASE_SPEED + mxSpdInc;\n b = HARD_BASE_SPEED; //Minimum\n a = (maxSpeed - b) / (100 * 100); //Maximum\n this.drive_control.setSpeedScale((float) getSpeedAccordingExcessPercent(a, b, percentOfExcess));\n alteratedPoint = getFinalPoint(maxX, maxY, hardNoise, percentOfExcess, actualPoint.x, actualPoint.y);\n\n\n break;\n }\n } else {//Else, the user's breath rate must be under 8 so it's ok.\n //In this case, we will ensure that the speed it's acording to the level.\n switch (this.ACTUAL_DIFICULTY) {\n case EASY:\n this.drive_control.setSpeedScale(this.EASY_BASE_SPEED);\n break;\n case MEDIUM:\n this.drive_control.setSpeedScale(this.MEDIUM_BASE_SPEED);\n break;\n case HARD:\n this.drive_control.setSpeedScale(this.HARD_BASE_SPEED);\n break;\n }\n }\n return alteratedPoint;\n }",
"private static int consumeReceiverEnergy(PlayerEntity player, BlockPos c, RegistryKey<World> dimension) {\n World world = LevelTools.getLevel(player.level, dimension);\n if (world == null) {\n Logging.warn(player, \"Something went wrong with the destination!\");\n return 0;\n }\n TileEntity te = world.getBlockEntity(c);\n if (!(te instanceof MatterReceiverTileEntity)) {\n Logging.warn(player, \"Something went wrong with the destination!\");\n return 0;\n }\n\n MatterReceiverTileEntity matterReceiverTileEntity = (MatterReceiverTileEntity) te;\n\n return matterReceiverTileEntity.getCapability(CapabilityEnergy.ENERGY).map(h -> {\n int defaultCost = TeleportConfiguration.rfPerTeleportReceiver.get();\n int rf = matterReceiverTileEntity.getCapability(CapabilityInfusable.INFUSABLE_CAPABILITY).map(inf ->\n (int) (defaultCost * (2.0f - inf.getInfusedFactor()) / 2.0f)).orElse(defaultCost);\n\n if (rf <= 0) {\n return 0;\n }\n int extracted = Math.min(rf, h.getEnergyStored());\n ((GenericEnergyStorage)h).consumeEnergy(rf);\n\n long remainingRf = ((GenericEnergyStorage) h).getEnergy();\n if (remainingRf <= 1) {\n Logging.warn(player, \"The matter receiver has run out of power!\");\n } else if (remainingRf < (TeleportConfiguration.RECEIVER_MAXENERGY.get() / 10)) {\n Logging.warn(player, \"The matter receiver is getting very low on power!\");\n } else if (remainingRf < (TeleportConfiguration.RECEIVER_MAXENERGY.get() / 5)) {\n Logging.warn(player, \"The matter receiver is getting low on power!\");\n }\n\n return 10 - (extracted * 10 / rf);\n }).orElse(0);\n }",
"@Override\r\n\tpublic double min_value(GameState s, int depthLimit)\r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\t\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn -(stateEvaluationValue);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMin = Double.POSITIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\t\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\t\r\n\t\t\t\tdouble tempMin = currMin;\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 2;\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMin = Math.min(currMin, max_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (currMin < tempMin)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\r\n\t\t\treturn currMin;\r\n\r\n\t\t}\r\n\t}",
"private int calculateCellPower(int xPosition, int yPosition) {\n\t\tint rackId = xPosition + 10;\r\n\t\t// Power level starts at rack id times y coordinate.\r\n\t\tlong calculatingCellPower = rackId * yPosition;\r\n\t\t// Add the grid serial number.\r\n\t\tcalculatingCellPower += gridSerialNumber;\r\n\t\t// Multiply by the rack id.\r\n\t\tcalculatingCellPower *= rackId;\r\n\t\t// Keep only the hundreds digit (e.g. '3' in 12345).\r\n\t\tString cellPowerString = Long.toString(calculatingCellPower); \r\n\t\tchar hundredsDigit = cellPowerString.charAt(cellPowerString.length() - 3);\r\n\t\tint cellPower = Character.digit(hundredsDigit, 10);\r\n\t\t// Subtract five to determine the actual cell power.\r\n\t\treturn cellPower - 5;\r\n\t}",
"static int minStepToReachTarget(int knightPos[], int targetPos[], int N) {\n // x and y direction, where a knight can move\n int dx[] = {-2, -1, 1, 2, -2, -1, 1, 2};\n int dy[] = {-1, -2, -2, -1, 1, 2, 2, 1};\n\n // queue for storing states of knight in board\n Queue<Cell> q = new LinkedList<>();\n\n // push starting position of knight with 0 distance\n q.add(new Cell(knightPos[0], knightPos[1], 0));\n\n Cell t;\n int x, y;\n boolean[][] visit = new boolean[N + 1][N + 1];\n\n // loop untill we have one element in queue\n while (!q.isEmpty()) {\n t = q.poll();\n if (visit[t.x][t.y]) \n continue;\n visit[t.x][t.y] = true;\n\n // if current cell is equal to target cell,\n // return its distance\n if (t.x == targetPos[0] && t.y == targetPos[1]) {\n return t.dis;\n }\n\n // loop for all reahable states\n for (int i = 0; i < 8; i++) {\n x = t.x + dx[i];\n y = t.y + dy[i];\n\n // If rechable state is not yet visited and\n // inside board, push that state into queue\n if (isInside(x, y, N) && !visit[x][y]) {\n q.add(new Cell(x, y, t.dis + 1));\n }\n }\n }\n return 0;\n }",
"public int getMoveCost(Environment tile)\n {\n return getMoveCost(tile.weatherType, tile.terrainType);\n }",
"public int getMinimumPlayers() {\n return getOption(ArenaOption.MINIMUM_PLAYERS);\n }",
"public int currentPlayerReachable(Player o1, Player o2){\n int range = o2.getNumberMoveRemaining()+o2.getBombRange();\n ArrayList<Cell> reachableCells = new ArrayList<Cell>();\n reachableCells = getReacheableCellsInRange(o2.getCell(), range);\n // the current player is not safe from the enemy considered\n if(reachableCells.contains(o1.getCell())){\n return -1;\n }\n // the current player is safe from the enemy considered\n else {\n return 1;\n }\n }",
"public int calculateMinimumHP(int[][] A) {\n\n\t\tif (A == null || A.length == 0 || A[0].length == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tint m = A.length;\n\t\tint n = A[0].length;\n\t\tint[][] minHealth = new int[m][n];\n\t\t//We added 1 extra because minimum 1 is needed\n\t\t// if a[m-1][n-1]=-5, then we need 6\n\t\t// if a[m-1][n-1]=-50, then we need 51\n\t\t// if a[m-1][n-1]=0, then we need 1\n\t\t// if a[m-1][n-1]=30, then we need 1\n\t\tminHealth[m - 1][n - 1] = Math.max(-A[m - 1][n - 1] + 1, 1);\n\n\t\t// We calculate minHeath in the last column\n\t\t// We already calculated for m-2 to let's do between m-2 to 0\n\t\tfor (int i = m - 2; i >= 0; i--) {\n\t\t\t// The power gets added.\n\t\t\t// If the power is very large, its no use. Overall we need only 1\n\t\t\t// If i,n-1 needs health(-ve value),\n\t\t\t// then it will addup to minHealth[i+1][n-1]\n\t\t\tminHealth[i][n - 1] = Math.max(minHealth[i + 1][n - 1] - A[i][n - 1], 1);\n\t\t}\n\n\t\t//similarly for last row\n\t\tfor (int i = n - 2; i >= 0; i--) {\n\t\t\tminHealth[m - 1][i] = Math.max(minHealth[m - 1][i + 1] - A[m - 1][i], 1);\n\t\t}\n\n\t\tfor (int i = m - 2; i >= 0; i--) {\n\t\t\tfor (int j = n - 2; j >= 0; j--) {\n\t\t\t\tminHealth[i][j] = Math.min(minHealth[i + 1][j], minHealth[i][j + 1]) - A[i][j];\n\t\t\t\t// If minHealthNeeded <=0, then it means we have extra power.\n\t\t\t\t// We only need 1 extra power\n\t\t\t\tminHealth[i][j] = Math.max(minHealth[i][j], 1);\n\t\t\t}\n\t\t}\n\n\t\treturn minHealth[0][0];\n\t}",
"public double min() {\n\t\tif (count() > 0) {\n\t\t\treturn _min.get();\n\t\t}\n\t\treturn 0.0;\n\t}",
"private Position getPositionWormMinHealth(ArrayList<Worm> worms) {\n Worm wormWithMinHealth = worms.get(0);\n int i;\n for (Worm worm : worms) {\n if (worm.health < wormWithMinHealth.health) {\n wormWithMinHealth = worm;\n }\n }\n return (wormWithMinHealth.position);\n }",
"private Integer getMines(Integer xOpen, Integer yOpen){\n int counter=0;\r\n // System.out.println(\"getMines() [\"+xOpen+\"][\"+yOpen+\"]\");\r\n for(int i=xOpen-1; i<=(xOpen+1) ; i++){\r\n for(int j=yOpen-1; j<=(yOpen+1) ; j++){\r\n if(isValidCell(i,j) && grid[i][j].isMine()){ //split y && le quite uno\r\n counter++; //solo un operador and \r\n }\r\n }\r\n }\r\n// System.out.println(\" getMines().result = \"+counter);\r\n return counter; //contador de minas, el mismo no puede ser una mina \r\n }",
"private Node lowestCostThrough(List<Node> openSet, Map<Node, Double> costThrough){\n Node lowest = openSet.get(0);\n\n for(Node n: openSet){\n if(costThrough.get(n) < costThrough.get(lowest)){\n lowest = n;\n }\n }\n return lowest;\n }",
"private static int minimum() {\n\t\tint popSize = 0;\n\t\tChromosome thisChromo = null;\n\t\tChromosome thatChromo = null;\n\t\tint winner = 0;\n\t\tboolean foundNewWinner = false;\n\t\tboolean done = false;\n\n\t\twhile (!done) {\n\t\t\tfoundNewWinner = false;\n\t\t\tpopSize = population.size();\n\t\t\tfor (int i = 0; i < popSize; i++) {\n\t\t\t\tif (i != winner) { // Avoid self-comparison.\n\t\t\t\t\tthisChromo = population.get(i);\n\t\t\t\t\tthatChromo = population.get(winner);\n\t\t\t\t\tif (thisChromo.conflicts() < thatChromo.conflicts()) {\n\t\t\t\t\t\twinner = i;\n\t\t\t\t\t\tfoundNewWinner = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (foundNewWinner == false) {\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\treturn winner;\n\t}",
"java.math.BigDecimal getWagerMinimum();",
"protected float getSoilMineralContent(World world, BlockPos pos){\n if(world.getTileEntity(pos.down()).getBlockType() != ResynthBlocks.BLOCK_MINERAL_SOIL)\n return 0F;\n\n TileEntityMineralSoil tEntity = (TileEntityMineralSoil)world.getTileEntity(pos.down());\n return tEntity.getMineralPercentage();\n }",
"protected ValuePosition getMinimum() {\n\t\t// Calcule la position et la durée d'exécution de la requête la plus courte dans le tableau des requêtes\n\t\tValuePosition minimum = new ValuePosition();\n\t\tminimum.position = 0;\n\t\tfor(int pos=0; pos<requests.length; pos++) {\n\t\t\tRequest request = requests[pos];\n\t\t\tif(request == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minimum.value == null || request.getElapsedTime() < minimum.value) {\n\t\t\t\tminimum.position = pos;\n\t\t\t\tminimum.value = request.getElapsedTime();\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}",
"@Override\n public abstract float defensiveUse(float characterdefensivePoints, float characterEnergyPoints);",
"@Pure\n\tdouble getEstimatedCost();",
"public int distBonus(){\n Player currentplayer = state.getCurrentPlayer();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n ArrayList<GameObject> listObjectsOnCurrentCell;\n GameObject objectOnCell;\n int distTmp;\n int dist= tabcells.length+tabcells[0].length;\n for(int i=0;i<tabcells.length;i++){\n for(int j=0;j<tabcells[0].length;j++){\n listObjectsOnCurrentCell = tabcells[i][j].getGameObjects();\n for(GameObject object: listObjectsOnCurrentCell){\n if(object instanceof Bonus || object instanceof BonusWall){\n distTmp = manhattan(object,currentplayer);\n if(distTmp<dist){\n dist = distTmp;\n }\n }\n }\n }\n }\n return dist;\n }",
"@Override\n\tpublic double calcSpendFuel() {\n\t\tdouble result = distance / (literFuel - fuelStart);\n\t\treturn result;\n\t}",
"public abstract float getEstimatedCost(AStarNode paramAStarNode);",
"public int minimax(Tile[][] board, int depth, boolean isMaximizing) {\n int result = WinnerChecker.checkWinner();\r\n if(result != 2) {\r\n return result;\r\n }\r\n\r\n int bestScore = 0;\r\n if(isMaximizing){\r\n bestScore = 1;\r\n for(int i = 0; i< 3; i++){\r\n for(int j = 0; j< 3; j++){\r\n // Is the spot available?\r\n if(board[i][j].text.getText().isEmpty()){\r\n board[i][j].text.setText(\"O\");\r\n TicTacToeApp.previous_move = board[i][j];\r\n int score = minimax(board, depth+1,false);\r\n board[i][j].text.setText(\"\");\r\n bestScore = Math.min(score, bestScore);\r\n }\r\n }\r\n }\r\n }else{\r\n bestScore = -1;\r\n for(int i = 0; i< 3; i++){\r\n for(int j = 0; j< 3; j++){\r\n // Is the spot available?\r\n if(board[i][j].text.getText().isEmpty()){\r\n board[i][j].text.setText(\"X\");\r\n TicTacToeApp.previous_move = board[i][j];\r\n int score = minimax(board, depth+1,true);\r\n board[i][j].text.setText(\"\");\r\n bestScore = Math.max(score, bestScore);\r\n }\r\n }\r\n }\r\n }\r\n return bestScore;\r\n }",
"public boolean tileReachObjectives(float xTile, float yTile)\r\n/* 122: */ {\r\n/* 123:136 */ return (!tileInBounds(xTile, yTile)) || \r\n/* 124:137 */ (this.reach[((int)xTile)][((int)yTile)] != 0);\r\n/* 125: */ }",
"public long getMinFree() {\n return params.getMinimumFree() * 1024 * 1024;\n }",
"private MoveEvaluation minimax (int ply, IComparator comp, \n\t\t\tIPlayer player, IPlayer opponent) {\n\n\t\t// Try to improve on this lower-bound (based on selector). Reflects no move possible.\n\t\tMoveEvaluation best = new MoveEvaluation (comp.initialValue());\n\n\t\t// get all moves for this player and generate the boards that result\n\t\t// from making these moves. Select maximum of children if we are MAX\n\t\t// and minimum of children if we are MIN\n\t\tIterator<IGameMove> it = player.validMoves(state).iterator(); \n\t\twhile (it.hasNext()) {\n\t\t\tIGameMove move = it.next();\n\t\t\t\n\t\t\tmove.execute(state);\n\t\t\tnumComputationalStates++;\n\t\t\t\n\t\t\t// debugging output along the way...\n\t\t\tif (numComputationalStates % 100 == 0) {\n\t\t\t\tSystem.out.println (numComputationalStates);\n\t\t\t}\n\t\t\t\n\t\t\tMoveEvaluation pathMove = alreadyDetermined(state);\n\t\t\t\n\t\t\tif (pathMove == null) {\n\t\t\t\tint trial;\n\t\t\t\tif (ply <= 0) {\n\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t} else {\n\t\t\t\t\t// Recursively evaluate position. Compute MiniMax and swap\n\t\t\t\t\t// player and opponent, synchronously with MIN and MAX. If no move is\n\t\t\t\t\t// associated, then evaluate the generated board from original player\n\t\t\t\t\tMoveEvaluation me = minimax (ply-1, comp.opposite(), opponent, player);\n\t\t\t\t\tif (me.move == null) {\n\t\t\t\t\t\ttrial = original.eval(state);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrial = me.score;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpathMove = new MoveEvaluation (move, trial);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmove.undo(state);\n\t\t\t\n\t\t\t// If we are selected as the better move, then update accordingly\n\t\t\tif (comp.compare(best.score, pathMove.score) < 0) {\n\t\t\t\tbest = new MoveEvaluation (move, pathMove.score); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// this move was selected for the gameState. record it. If it is null, then the game has\n\t\t// already been won or this is a draw; in either case, we will let recursive parent take\n\t\t// care of the scoring. Even add when no move, so we can keep track of the WON games.\n\t\taddToList(state, best);\n\t\t\n\t\treturn best;\n\t}",
"Execution getClosestDistance();",
"public static int minCost(int[][] costs) {\n\n\t\treturn 0;\n\t\t\n\t}",
"public int getBaseXp() {\n\t\treturn 0;\n\t}",
"@Test\n\tpublic void testGetEnergyConsumption() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\tassertTrue(explorer.getEnergyConsumption() == 0);\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getEnergyConsumption() == 6);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getEnergyConsumption() == 10);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getEnergyConsumption() == 11);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getEnergyConsumption() == 15);\n\t\t}\n\t\tassertTrue(explorer.getEnergyConsumption() > 0);\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n public Graph<NodeData,EdgeData>.Node findNearbyNode(int x, int y) {\r\n Graph.Node nearbyNode = null;\r\n for (Graph<NodeData,EdgeData>.Node node:canvas.graph.getNode()){\r\n Point p = node.getData().getPosition();\r\n if (p.distance(x,y)<=40){\r\n nearbyNode = node;\r\n }\r\n }\r\n return nearbyNode;\r\n }",
"private double computeForcesWithNeighbourCells() {\r\n double potentialEnergy = 0;\r\n for (Cell[] cellPair: neighbourCells) { \r\n if (cellPair[1].firstMolecule == null) continue; // If cell2 is empty, skip\r\n \r\n for (Molecule m1 = cellPair[0].firstMolecule; m1 != null; m1 = m1.nextMoleculeInCell) {\r\n for (Molecule m2 = cellPair[1].firstMolecule; m2 != null; m2 = m2.nextMoleculeInCell) {\r\n double pe = computeForceBetweenMolecules(m1, m2);\r\n if (pe != 0) {\r\n potentialEnergy += pe;\r\n }\r\n }\r\n }\r\n }\r\n return potentialEnergy;\r\n }",
"protected void setStateToLowestEnergy() {\n\tpoints = bestEverPoints;\n\n\t// make a copy of the best points\n\tbestEverPoints = getPoints();\n\n\tbuildEnergyMatrix();\n\tstateEnergy();\n }",
"public double get_overcharge_cost() {\n\t\treturn overchargepermin;\n\t}",
"public double getMinDist(){\n\t\tquickSort(0, pnt.length - 1);\t// for divide\n\t\t/* CASE: same point */\n\t\tif(min == 0)\n\t\t\treturn 0;\n\n\t\tmin = getDist(pnt[0], pnt[pnt.length - 1]);\n\t\tdivide(0, pnt.length - 1);\n\n\t\treturn min;\n\t}",
"public int getHeuristicScore2() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \t//int cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic; //+ cost;\r\n }",
"public int minX()\n\t{\n\t\tint m = coords[0][0];\n\t\t\n\t\tfor (int i=0; i<4; i++)\n\t\t{\n\t\t\tm = Math.min (m, coords[i][0]);\n\t\t}\n\t\t\n\t\treturn m;\n\t}"
] | [
"0.61487",
"0.5658287",
"0.5365024",
"0.5293348",
"0.5230923",
"0.51359314",
"0.5068767",
"0.5010543",
"0.49997044",
"0.49729985",
"0.49341193",
"0.49125254",
"0.49124795",
"0.48820412",
"0.48260581",
"0.4800379",
"0.4782758",
"0.47790277",
"0.47779968",
"0.47671694",
"0.47671187",
"0.47642067",
"0.4762836",
"0.47528726",
"0.47522932",
"0.47522593",
"0.47442186",
"0.4734599",
"0.47080496",
"0.47075617",
"0.46918836",
"0.46911213",
"0.46788228",
"0.46754178",
"0.4673387",
"0.46674946",
"0.4660889",
"0.46573976",
"0.4652709",
"0.46513867",
"0.46485958",
"0.46478844",
"0.46412352",
"0.46358144",
"0.46314535",
"0.4629929",
"0.46196708",
"0.46119124",
"0.46109846",
"0.46097645",
"0.46032727",
"0.45994553",
"0.45961967",
"0.45884794",
"0.45814213",
"0.45811066",
"0.4580456",
"0.45798793",
"0.4578644",
"0.45694104",
"0.4565264",
"0.45560563",
"0.45448056",
"0.45441133",
"0.4539555",
"0.4532227",
"0.45262778",
"0.45088685",
"0.45044658",
"0.4497206",
"0.44910488",
"0.44800305",
"0.44782493",
"0.4474191",
"0.4467769",
"0.44624814",
"0.44618002",
"0.44597638",
"0.44595626",
"0.44534454",
"0.445253",
"0.44459194",
"0.4445195",
"0.4441903",
"0.44385737",
"0.4437927",
"0.44293255",
"0.4429252",
"0.44211546",
"0.44209576",
"0.4417806",
"0.44134852",
"0.4413051",
"0.4413013",
"0.44051692",
"0.44012454",
"0.4399685",
"0.4395815",
"0.43932742",
"0.43863568"
] | 0.76724833 | 0 |
Return whether your implementation of moveNextTo takes into account other robots, walls and the fact that turning consumes energy (required to score 18+). The return value of this method determines the expected effect of moveNextTo in the test suite. This method must return either 0 or 1. | @Override
public int isMoveNextTo18Plus()
{
return 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }",
"@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }",
"public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }",
"private boolean needToTurn() {\n\t\tdouble curDir = sens.getDirection();\n\t\tdouble desDirPlusAmount = desiredDirection + TURNSPEED;\n\t\tdouble desDirMinusAmount = desiredDirection - TURNSPEED;\n\n\t\t// if desired direction is <||> +_ x degrees\n\t\tif (curDir < desDirMinusAmount || curDir > desDirPlusAmount) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean moveStep() {\n\t\t// TODO: take orientation into account\n\t\t\n\t\t// Work out the distance to the destination\n\t\tDouble2D delta = destination.subtract(getPosition());\n//\t\tSystem.out.println(this.toString() + \"has \" + delta.length() + \" to go.\"); // Debug\n\t \n\t // If this is below a small value, we have arrived, return true\n\t if (delta.length() < 4) return true;\n\t \n\t // FIXME: a better model allow different speed for different vehicle class\n\t // update the speed of vehicle\n\t velocity.setTo(delta.x * 0.004, delta.y * 0.004);;\n\t \n\t // FIXME: avoidance?\n\t \n\t // FIXME: orientation?\n//\t\torientation += angularRate;\n\t // update the vehicle location\n\t\tDouble2D location = _siteState.getArea().getObjectLocation(this);\n\t\t_siteState.getArea().setObjectLocation(this, location.add(new Double2D(velocity)));\n\t \n\t\treturn false;\n\t}",
"private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}",
"@Test\n public void moreThanOneCheckerOnToLocation() {\n\n assertTrue(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.R1, Location.R3));\n game.nextTurn();\n // to der gerne skulle vaere lovlige og stemme med terningerne\n assertTrue(game.move(Location.R6, Location.R5));\n assertTrue(game.move(Location.R8, Location.R6));\n game.nextTurn();\n assertTrue(game.move(Location.R2, Location.R5));\n assertTrue(game.move(Location.R3, Location.R7));\n game.nextTurn();\n // der staar nu to sorte paa R4\n assertFalse(game.move(Location.R6, Location.R3));\n }",
"private boolean selectedPieceHasNextMove(Position startingPosition) {\n\t\treturn false;\n\t}",
"public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}",
"@Override\n protected boolean isFinished() {\n if(direction){\n if(leftTarget <= Robot.driveTrain.getLeftEncoderDistanceInches() || rightTarget <= Robot.driveTrain.getRightEncoderDistanceInches()){\n turnPID.resetPID();\n return true;\n } else{\n return false;\n }\n \n } else{\n if(leftTarget >= Robot.driveTrain.getLeftEncoderDistanceInches() || rightTarget >= Robot.driveTrain.getRightEncoderDistanceInches()){\n turnPID.resetPID();\n return true;\n } else{\n return false;\n }\n }\n \n \n }",
"@Override\n protected boolean isFinished() {\n //stop once the left side is high enough\n return Robot.myLifter.getLeftEncoder() < pos;\n }",
"public boolean canMove()\n\t{\n\t\tif(delayMove>compareSpeed())\n\t\t{\n\t\t\tdelayMove=0;\n\t\t\treturn true;\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override\n public boolean isFinished() {\n// return false;\n return LightningMath.epsilonEqual(shooter.getFlywheelMotor1Velocity(), shooter.motor1setpoint, Constants.FLYWHEEL_EPSILON) &&\n LightningMath.epsilonEqual(shooter.getFlywheelMotor2Velocity(), shooter.motor2setpoint, Constants.FLYWHEEL_EPSILON) &&\n LightningMath.epsilonEqual(shooter.getFlywheelMotor3Velocity(), shooter.motor3setpoint, Constants.FLYWHEEL_EPSILON);\n }",
"public Coordinate getNextMove() {\n\n if (targetMode && salvationMode == false) {\n\n Coordinate bestNextTarget;\n\n if (!fixedDirection) { // direction is not known\n\n int maxCount = 0;\n bestNextTarget = this.previousTarget;\n\n // find the best target around the last target //\n\n if (inBound(this.axis.y + 1, this.axis.x)) {\n maxCount = countGrid[this.axis.y + 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + 1);\n direction = 0; // north by default\n }\n\n if (inBound(this.axis.y - 1, this.axis.x)) {\n if (countGrid[this.axis.y - 1][this.axis.x] > maxCount) {\n maxCount = countGrid[this.axis.y - 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - 1);\n direction = 2;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x + 1)) { // try east\n if (countGrid[this.axis.y][this.axis.x + 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x + 1];\n bestNextTarget = new Coordinate(this.axis.x + 1, this.axis.y);\n direction = 1;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x - 1)) { // try west\n if (countGrid[this.axis.y][this.axis.x - 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x - 1];\n bestNextTarget = new Coordinate(this.axis.x - 1, this.axis.y);\n direction = 3;\n }\n }\n\n seekAgain = false;\n\n } else { // direction is known\n\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y);\n\n if (direction == 0) { // north\n if (inBound(this.axis.y + distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n } else { // else go south\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n direction = 2;\n }\n\n } else if (direction == 1) { // east\n if (inBound(this.axis.y, this.axis.x + distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n } else { // else go west\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n direction = 3;\n }\n\n } else if (direction == 2) { // south\n if (inBound(this.axis.y - distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n } else { // else go north\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n direction = 0;\n }\n\n } else if (direction == 3) { // west\n if (inBound(this.axis.y, this.axis.x - distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n } else { // else go east\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n direction = 1;\n }\n }\n }\n\n this.previousTarget = bestNextTarget;\n\n } else {\n this.previousTarget = getGlobalHighestCount();\n }\n\n toExclude.add(new Coordinate(this.previousTarget.y, this.previousTarget.x));\n\n this.countGrid[this.previousTarget.y][this.previousTarget.x] = 0;\n\n return this.previousTarget;\n }",
"@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }",
"private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }",
"public boolean canMove2() {\n\t\tGrid<Actor> gr = getGrid(); \n\t\tif (gr == null) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tLocation loc = getLocation(); \n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (!gr.isValid(next)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!gr.isValid(next2)) {\n\t\t\treturn false;\n\t\t}\n\t\tActor neighbor = gr.get(next2); \n\t\treturn (neighbor == null) || (neighbor instanceof Flower); \n\t}",
"@Override\n\tpublic boolean canMoveToNext() {\n\t\treturn true;\n\t}",
"public boolean isMoveLegal() {\n if (!getGame().getBoard().contains(getFinalCoords())) {\n return false;\n }\n\n // for aero units move must use up all their velocity\n if (getEntity() instanceof Aero) {\n Aero a = (Aero) getEntity();\n if (getLastStep() == null) {\n if ((a.getCurrentVelocity() > 0) && !getGame().useVectorMove()) {\n return false;\n }\n } else {\n if ((getLastStep().getVelocityLeft() > 0) && !getGame().useVectorMove()\n && !(getLastStep().getType() == MovePath.MoveStepType.FLEE\n || getLastStep().getType() == MovePath.MoveStepType.EJECT)) {\n return false;\n }\n }\n }\n\n if (getLastStep() == null) {\n return true;\n }\n\n if (getLastStep().getType() == MoveStepType.CHARGE) {\n return getSecondLastStep().isLegal();\n }\n if (getLastStep().getType() == MoveStepType.RAM) {\n return getSecondLastStep().isLegal();\n }\n return getLastStep().isLegal();\n }",
"public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }",
"private boolean checkMoveNext(PositionTracker tracker) {\n\t\t \n\t\t GeneralUtility generalTool = new GeneralUtility();\n\t\t \n\t\t if((tracker.getExactRow() + 1) == tracker.getMaxRows()) { //initiate if statement\n\t\t\t if((tracker.getExactColumn() + 1) == tracker.getMaxColumns()) //initiate if statement\n\t\t\t\t generalTool.beatGame();\n\t\t }\n\t\t \n\t\t return true; //returns the value true\t\n\t }",
"@Override\n protected boolean isFinished() {\n SmartDashboard.putNumber(\"TurnCommand Current Heading\", Robot.m_drivetrain.getAngle());\n SmartDashboard.putNumber(\"TurnCommand Target\", Start + TurnGoal);\n if (IsLeft) {\n return Robot.m_drivetrain.getAngle() <= Start + TurnGoal;\n } else {\n return Robot.m_drivetrain.getAngle() >= Start + TurnGoal;\n }\n }",
"protected boolean isFinished() {\r\n \tif (manipulator.isHighSwitchPressed() && speed > 0 ||\r\n \t\tmanipulator.isLowSwitchPressed() && speed < 0)\r\n \t\treturn true;\r\n \t\r\n \treturn isTimedOut();\r\n \t\r\n// \tif (targetHeight > startHeight) {\r\n// \t\treturn manipulator.getAverageElevatorHeight() >= targetHeight;\r\n// \t} else {\r\n// \t\treturn manipulator.getAverageElevatorHeight() <= targetHeight;\r\n// \t}\r\n }",
"private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }",
"private boolean isNextMoveEnPassentCapture(Move move)\r\n\t{\r\n\t\tif (!(move.capture instanceof Pawn)) return false;\r\n\t\tif (Math.abs(move.from.coordinate.x - move.to.coordinate.x) != 1) return false;\r\n\t\tif (Math.abs(move.from.coordinate.y - move.to.coordinate.y) != 1) return false;\r\n\t\tif (!move.to.isEmpty()) return false;\r\n\t\treturn true;\r\n\t}",
"protected boolean isFinished() {\n \tdouble changeInX = targetX - Robot.sensors.getXCoordinate();\n \tdouble changeInY = targetY - Robot.sensors.getYCoordinate();\n \tdouble distance = Math.sqrt(Math.pow(changeInX, 2) + Math.pow(changeInY, 2));\n return distance < 8 || System.currentTimeMillis() >= stopTime;\n }",
"@Override\n public boolean isFinished() {\n \n boolean thereYet = false;\n\n double time = timer.get();\n\n \n if (Math.abs(targetDistance - distanceTraveled) <= 4){\n\n thereYet = true;\n\n // else if(Math.abs(targetDistance - distanceTraveled) <= 24){\n\n //shifter.shiftDown();\n \n //}\n\n \n\n } else if (stopTime <= time - startTime){\n\n thereYet = true;\n }\n SmartDashboard.putNumber(\"Distance Traveled\", distanceTraveled);\n\n return thereYet;\n\n }",
"protected boolean isFinished() {\n \tif(Math.abs(Robot.driveTrain.getHeading() - targetDirection) < 2) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }",
"protected boolean isFinished() {\n \treturn Robot.lift.isMotionMagicNearTarget() || totalTimer.get() > 5.0;\n }",
"@Override\n\tpublic boolean step(){\n\t\tboolean ret=false;\n\t\tif(!isFollowing()){\n\t\t\t//80% valoszinuseggel leptet egy szomszedra\n\t\t\tRandom rng=new Random();\n\t\t\tboolean doAStep =rng.nextInt(10)>1;\n\t\t\tif(doAStep){\n\t\t\t\tif(tile != null){\n\t\t\t\tint bound=tile.getNeighbors().size();\n\t\t\t\t//System.out.println(\"bound :\"+bound);\n\t\t\t\t//System.out.println(\"ez lett a bound: \"+rng.nextInt(bound));\n\t\t\t\tret=step(tile.getNeighbors().get(rng.nextInt(bound)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}",
"private boolean isLastMoveRochade()\r\n\t{\r\n\t\tMove lastMove = getLastMove();\r\n\t\tif (lastMove == null) return false;\r\n\t\tPiece king = lastMove.to.piece;\r\n\t\tif (!(king instanceof King)) return false;\r\n\t\t\r\n\t\tint y = king.getColor().equals(Color.WHITE) ? 0 : 7;\r\n\t\tif (lastMove.to.coordinate.y != y) return false;\r\n\t\t\r\n\t\tint xDiffAbs = Math.abs(lastMove.to.coordinate.x - lastMove.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}",
"protected boolean isFinished() {\n \tif (moving) return Robot.armPiston.getMajor() != PistonPositions.Moving; /* && Robot.armPiston.getMinor() != PistonPositions.Moving; */\n \treturn true;\n }",
"public boolean foundGoal() \r\n\t{\r\n\t\t// Write the method that determines if the walker has found a way out of the maze.\r\n\t\treturn ( currentCol < 0 || currentRow < 0 || \r\n\t\t\t\t currentCol >= size || currentRow >= size );\r\n\t}",
"protected boolean isFinished() {\n\tif(this.motionMagicEndPoint >0) {\n \tif(Math.abs(RobotMap.motorLeftTwo.get() )< 0.09 && Math.abs(RobotMap.motorRightTwo.get() )> -0.09&& Timer.getFPGATimestamp()-starttime > 10) {\n \t\treturn true;\n \t}\n\t}\n\t\n return false;\n }",
"public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }",
"public boolean isLegalMove() {\n return iterator().hasNext();\n }",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"@Test\n\t\t\tpublic void testTargetOneStep()\n\t\t\t{\n\t\t\t\t//Test one step and check for the right space\n\t\t\t\tboard.calcTargets(0, 7, 1);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(1, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(1, 7)));\n\n\t\t\t\t// Test one step near a door with the incorrect direction\n\t\t\t\tboard.calcTargets(13, 6, 1);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(3, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 6)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 5)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 7)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"public boolean checkAndMove() {\r\n\r\n\t\tif(position == 0)\r\n\t\t\tdirection = true;\r\n\r\n\t\tguardMove();\r\n\r\n\t\tif((position == (guardRoute.length - 1)) && direction) {\r\n\t\t\tposition = 0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(direction)\r\n\t\t\tposition++;\r\n\t\telse\r\n\t\t\tposition--;\r\n\r\n\t\treturn false;\r\n\t}",
"public final boolean isMoving() {\r\n\t\treturn moveStart > 0;\r\n\t}",
"@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }",
"public boolean isMoving() {\n\t\treturn moveProgress > 0;\n\t}",
"private boolean moveContinues(Point piece){\r\n boolean result = canEats(piece);\r\n // if move continues, next move has to start with the same piece\r\n model.setCheckPiece((result)?piece:null);\r\n return result;\r\n }",
"public boolean cooperate()\n {\n return this.agent.getLastMove();\n }",
"public boolean takeControl() {\n\t\treturn Project2a.curState == Project2a.RobotState.Forward && Project2a.getCurTime() - 500 > MoveForward.startTime;\n\t}",
"private static boolean moveCloserToTarget() {\n Direction f = forward;\n int startingDistance = target.distanceSquaredTo(S.rc.getLocation());\n forward = S.rc.getLocation().directionTo(target);\n forward = forward.rotateLeft();\n for (int i = 0; i < 8; i++) {\n if (target.distanceSquaredTo(S.rc.getLocation().add(forward)) < startingDistance)\n if (moveForwardStrict())\n return true;\n forward = forward.rotateRight();\n }\n forward = f;\n return false;\n }",
"private void thinkAboutNext(ArrayList<Point> pos, boolean hit, boolean destroyedIt) {\n if (!searching && hit) {\n betweenTwo = false;\n System.out.println(\"WAS A NEW TARGET\");\n if(!destroyedIt) {\n int[] d = Direction.DOWN.getDirectionVector();\n Point n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.DOWN);\n\n d = Direction.UP.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.UP);\n\n d = Direction.LEFT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.LEFT);\n\n d = Direction.RIGHT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.RIGHT);\n\n directionLooking = directionsToGo.get(directionsToGo.size() - 1);\n }\n }\n else if (searching) {\n //FILTER OUT ALREADY ATTACKED\n\n System.out.println(\"WAS AN OLD TARGET\");\n\n //FAILED\n if(!hit) {\n justBefore = firstHit;\n int size = directionsToGo.size();\n\n for(int i = size - 1; i >= 0; i--){\n Point n = new Point(justBefore.x + directionsToGo.get(i).getDirectionVector()[0],\n justBefore.y + directionsToGo.get(i).getDirectionVector()[1]);\n if(!pos.contains(n))\n directionsToGo.remove(i);\n }\n directionLooking = directionsToGo.get(0);\n }\n else\n if(!pos.contains(pWD(justBefore, directionLooking))) {\n justBefore = firstHit;\n directionLooking = directionLooking.getOpposite();\n }\n\n }\n if(hit) {\n searching = !destroyedIt;\n }\n }",
"public boolean playNextStep(Move otherMove) {\n if (isGameFinished()) {\n return false;\n }\n // If we are in move creation state, we add move and move to next player.\n if (isCreateMoveState) {\n if(addMove(otherMove)){\n nextPlayer();\n isCreateMoveState = false;\n return true;\n }\n else{\n return false;\n }\n\n\n } else {\n // If we are in KopyMove state, we compare moves and increment to next move or player.\n boolean succeeded = compareMove(otherMove);\n if (!succeeded) {\n // If we kill the current player, the index will fix automatically.\n killCurrentPlayer();\n } else {\n nextMove();\n }\n return succeeded;\n }\n }",
"public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}",
"public boolean encountered(){\n boolean encounter = false;\n\n int stepsNeeded = player.getDestination().getStepsNeeded();\n\n float percent = (chance * 1.0f / stepsNeeded * 1.0f) * 100;\n float result = r.nextFloat() * 100;\n\n if(result <= percent && percent >= 20) {\n encounter = true;\n }\n\n return encounter;\n }",
"public boolean walkReturns(){\n int count = 1;\n move();\n \n while((x!=0)||(y!=0)){\n move();\n count++;\n if(count>=safeguard){\n return false;\n }\n }\n return true;\n }",
"public boolean moveNext(\n )\n {\n // Scanning the current graphics object...\n ContentObject currentObject = getCurrent();\n if(currentObject != null)\n {\n \t\n \tString cmdStr = currentObject.toString();\n \t/*\n \tif(cmdStr.contains(\"f*\") || cmdStr.contains(\"{f }\")) {\n \t\tSystem.out.println(cmdStr);\n \t}\n \t*/\n \tif(!cmdStr.contains(\"{re [36, 270, 540, 720]}, {f }\")) {\n \t\tcurrentObject.scan(state);\n \t}\n }\n\n // Moving to the next object...\n if(index < objects.size())\n {index++; refresh();}\n\n return getCurrent() != null;\n }",
"boolean isMoveFinished(int tick);",
"private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public boolean canMoveForward()\n {\n boolean ans = true;\n\n Iterator<WallMulti> walls = this.walls.iterator();\n\n while(walls.hasNext ())\n {\n WallMulti wall = walls.next();\n\n if(wall.getType ().equals (\"H\"))\n {\n if(locX>=wall.getX()-15 && locX<=wall.getX()+wall.getLength()+15)\n {\n if(wall.getY()-locY<=50 && wall.getY()-locY>=0 && degree>=0 && degree<=150)\n {\n ans=false;\n }\n if(locY-wall.getY()<=8 && locY-wall.getY()>=0 && degree>=180 && degree<=360)\n {\n ans=false;\n }\n }\n }\n\n if(wall.getType ().equals (\"V\"))\n {\n if(locY>=wall.getY()-15 &&locY<=wall.getY()+wall.getLength()+15)\n {\n if(wall.getX()-locX<=50 && wall.getX()-locX>=0 &&\n ((degree>=0 && degree<=90)||(degree>=270 && degree<=360)) )\n {\n ans=false;\n }\n if(locX-wall.getX()<=8 && locX-wall.getX()>=0 &&\n degree>=90 && degree<=270 )\n {\n ans=false;\n }\n }\n }\n }\n return ans;\n }",
"public boolean MoveNext()\r\n { \r\n _index++;\r\n\r\n return _index < Count;\r\n }",
"@Override\n\tpublic boolean CheckMovingRules(Board testBoard,int target_x_pos, int target_y_pos) {\n\t\treturn ((target_x_pos-cur_x_pos==1)&&(target_y_pos-cur_y_pos==2))||((target_x_pos-cur_x_pos==2)&&(target_y_pos-cur_y_pos==1))||\n\t\t\t\t((target_x_pos-cur_x_pos==2)&&(target_y_pos-cur_y_pos==-1))||((target_x_pos-cur_x_pos==1)&&(target_y_pos-cur_y_pos==-2))||\n\t\t\t\t((target_x_pos-cur_x_pos==-1)&&(target_y_pos-cur_y_pos==2))||((target_x_pos-cur_x_pos==-1)&&(target_y_pos-cur_y_pos==-2))||\n\t\t\t\t((target_x_pos-cur_x_pos==-2)&&(target_y_pos-cur_y_pos==1))||((target_x_pos-cur_x_pos==-2)&&(target_y_pos-cur_y_pos==-1));\n\t}",
"private boolean turnIfNeeded() {\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }",
"boolean doMove();",
"public boolean canMove() {\n\n if (workers.size() == 0) return true;\n\n return workerCanMove(0) || workerCanMove(1);\n }",
"@Override\n public boolean isFinished() {\n return !(System.currentTimeMillis() - currentMs < timeMs) &&\n // Then check to see if the lift is in the correct position and for the minimum number of ticks\n Math.abs(Robot.lift.getPID().getSetpoint() - Robot.lift.getEncoderHeight()) < error\n && ++currentCycles >= minDoneCycles;\n }",
"@Override\n public boolean isFinished() {\n double[] positions = drivetrain.getPositions();\n\n return Math.abs(positions[0] - targetDistance) <= allowedError && Math.abs(positions[1] - targetDistance) <= allowedError;\n }",
"public int runFromMuckrakerMove() throws GameActionException {\n\n //flag indicates best direction to move, not direction I am moving...\n\n boolean foundEnemyMuckraker = false;\n double rewardOfStaying = 9999;\n\n int canMoveIndicesSize = 0;\n int idx = 0;\n for (Direction direction : Constants.DIRECTIONS) {\n moveRewards[idx] = 9998;\n moveLocs[idx] = Cache.CURRENT_LOCATION.add(direction);\n if (controller.canMove(direction)) {\n canMoveIndices[canMoveIndicesSize++] = idx;\n }\n ++idx;\n }\n\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_ENEMY_ROBOTS) {\n if (robotInfo.getType() == RobotType.MUCKRAKER) {\n foundEnemyMuckraker = true;\n MapLocation enemyLocation = robotInfo.location;\n //for all valid locations, find travelDistance...\n rewardOfStaying = Math.min(rewardOfStaying, Pathfinding.travelDistance(Cache.CURRENT_LOCATION, enemyLocation) + 0.01 * Cache.CURRENT_LOCATION.distanceSquaredTo(enemyLocation));\n for (int i = 0; i < idx; ++i) {\n moveRewards[i] = Math.min(moveRewards[i], Pathfinding.travelDistance(moveLocs[i], enemyLocation) + 0.01 * moveLocs[i].distanceSquaredTo(enemyLocation));\n }\n }\n }\n\n int flag = CommunicationMovement.encodeMovement(true, true, CommunicationMovement.MY_UNIT_TYPE.SL, CommunicationMovement.MOVEMENT_BOTS_DATA.NOT_MOVING, CommunicationMovement.COMMUNICATION_TO_OTHER_BOTS.NOOP, false, false, 0);\n int bestValidDirection = -1;\n double bestValidReward = rewardOfStaying;\n\n if (foundEnemyMuckraker) {\n int bestDirection = -1;\n double bestReward = rewardOfStaying;\n\n for (int i = 0; i < idx; ++i) {\n if (moveRewards[i] > bestReward) { //find the best direction based on the reward\n bestDirection = i;\n bestReward = moveRewards[i];\n }\n }\n\n /* MOVE TOWARDS ME IS SET SO POLITICANS CAN MOVE TOWARDS THIS BOT (NOT SLANDERERS) -> BE CAREFUL IF/WHEN PARSING THIS SETTING */\n flag = CommunicationMovement.encodeMovement(true, true, CommunicationMovement.MY_UNIT_TYPE.SL, CommunicationMovement.convert_DirectionInt_MovementBotsData(bestDirection), CommunicationMovement.COMMUNICATION_TO_OTHER_BOTS.MOVE_TOWARDS_ME, false, true, 0);\n\n for (int i = 0; i < canMoveIndicesSize; ++i) {\n if (moveRewards[canMoveIndices[i]] > bestValidReward) {\n bestValidDirection = canMoveIndices[i];\n bestValidReward = moveRewards[canMoveIndices[i]];\n }\n }\n }\n\n // if a politician or slanderer has both a muckraker and slanderer in range, then run away opposite of the danger direction\n int bestDirectionBasedOnPoliticianDangerIdx = -1;\n if (!foundEnemyMuckraker) {\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_FRIENDLY_ROBOTS) {\n if (robotInfo.getType() == RobotType.POLITICIAN || robotInfo.getType() == RobotType.MUCKRAKER) {\n\n if (controller.canGetFlag(robotInfo.ID)) {\n int encodedFlag = controller.getFlag(robotInfo.ID);\n if (CommunicationMovement.decodeIsSchemaType(encodedFlag) &&\n CommunicationMovement.decodeIsDangerBit(encodedFlag)) {\n\n if (CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.PO\n || CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.MU) {\n //A POLITICIAN OR MUCKRAKER WHO SAYS HE IS IN DANGER (enemy muckraker nearby)\n CommunicationMovement.MOVEMENT_BOTS_DATA badArea = CommunicationMovement.decodeMyPreferredMovement(encodedFlag);\n int badIdx = CommunicationMovement.convert_MovementBotData_DirectionInt(badArea);\n Direction bestDirection = Constants.DIRECTIONS[badIdx].opposite();\n bestDirectionBasedOnPoliticianDangerIdx = bestDirection.ordinal();\n break;\n }\n }\n }\n }\n }\n }\n\n /* Set communication for other slanderers if there is a muckraker within my range */\n if (!Comms.hasSetFlag && controller.canSetFlag(flag)) {\n Comms.hasSetFlag = true;\n controller.setFlag(flag);\n }\n\n /* Below is based on movement */\n if (!controller.isReady()) return 1;\n\n if (foundEnemyMuckraker) {\n if (bestValidDirection != -1) {\n controller.move(Constants.DIRECTIONS[bestValidDirection]);\n return 2;\n }\n return 1;\n }\n\n\n /* No muckrakers were found, so we need to check the flags of nearby slanderer units instead. */\n double closestLocation = 9998;\n int preferedMovementDirectionIdx = -1;\n\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_FRIENDLY_ROBOTS) {\n if (robotInfo.getType() == RobotType.POLITICIAN) { //SLANDERERS THINK ALL SLANDERERS ARE POLITICIANS, so we need to check politicians here...\n double dist = Pathfinding.travelDistance(Cache.CURRENT_LOCATION, robotInfo.location)\n + 0.01 * Cache.CURRENT_LOCATION.distanceSquaredTo(robotInfo.location);\n if (dist < closestLocation && controller.canGetFlag(robotInfo.ID)) { //the closest bot in danger to us is our biggest threat as well\n int encodedFlag = controller.getFlag(robotInfo.ID);\n\n if (CommunicationMovement.decodeIsSchemaType(encodedFlag)) {\n if (CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.SL && CommunicationMovement.decodeIsDangerBit(encodedFlag)) {\n CommunicationMovement.MOVEMENT_BOTS_DATA movementBotsData = CommunicationMovement.decodeMyPreferredMovement(encodedFlag);\n preferedMovementDirectionIdx = CommunicationMovement.convert_MovementBotData_DirectionInt(movementBotsData);\n closestLocation = dist;\n }\n }\n }\n }\n }\n\n if (preferedMovementDirectionIdx != -1) {\n Direction direction = Pathfinding.toMovePreferredDirection(Constants.DIRECTIONS[preferedMovementDirectionIdx], 1);\n if (direction != null) {\n controller.move(direction);\n return 2;\n }\n return 1;\n }\n\n if (bestDirectionBasedOnPoliticianDangerIdx != -1) {\n Direction direction = Pathfinding.toMovePreferredDirection(Constants.DIRECTIONS[bestDirectionBasedOnPoliticianDangerIdx], 1);\n if (direction != null) {\n controller.move(direction);\n return 2;\n }\n return 1;\n }\n\n return 0; // no reason whatsoever to move\n }",
"@Override\r\n\tboolean isFinished() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(checkForWin() != -1)\r\n\t\t\treturn true;\r\n\t\telse if(!(hasValidMove(0) || hasValidMove(1)))\r\n\t\t\treturn true; //game draw both are stuck\r\n\t\telse return false;\r\n\t}",
"@Override\r\n\tprotected boolean isFinished() {\n\t\treturn Math.abs(elevator.getWristPosition() - elevator.getWristStages()[elevator.getWristStage()]) < Math.PI/18 && !elevator.isRunning(ElevatorSubsystem.Follower.ELEVATOR);\r\n\t}",
"private boolean isMove() {\n return this.getMoves().size() != 0;\n }",
"@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }",
"private void enemyMove() {\n\n\t\tboolean goAgain = false;\n\n\t\tint x = (int) (Math.random() * 10);\n\t\tint y = (int) (Math.random() * 10);\n\n\t\t// Make sure the enemy hits in a checkerboard pattern.\n\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\tif (y % 2 == 0) {\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t\t}\n\t\t} else { // if x is odd, y should be even\n\t\t\tif (y % 2 == 1)\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t}\n\n\t\tif (enemyLastShotHit && getDifficulty() > 0) { // /if last shot was a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hit, enemy\n\t\t\t// will try to\n\t\t\t// check around it only run if difficulty is\n\t\t\t// normal or above\n\t\t\tx = enemyLastHitX;\n\t\t\ty = enemyLastHitY;\n\n\t\t\tif (getDifficulty() != 2) {\n\n\t\t\t\tif (conflictX == 4) {\n\t\t\t\t\tconflictX = 0;\n\t\t\t\t} else if (conflictY == 4) {\n\t\t\t\t\tconflictY = 0;\n\t\t\t\t\t// System.out.println(\"conflict has been reset \");\n\t\t\t\t}\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\t// System.out.println(\"checking down\");\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\n\t\t\t\t\tif (checkDirection == 0) // checks in each direction\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse if (checkDirection == 1)\n\t\t\t\t\t\tx--;\n\t\t\t\t\telse if (checkDirection == 2)\n\t\t\t\t\t\ty++;\n\t\t\t\t\telse if (checkDirection == 3) {\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x < 0) // making sure coordinates stay within bounds\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\telse if (x > 9)\n\t\t\t\t\t\tx = 9;\n\t\t\t\t\tif (y < 0)\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\telse if (y > 9)\n\t\t\t\t\t\ty = 9;\n\t\t\t\t}\n\t\t\t} // medium diff\n\n\t\t\telse if (getDifficulty() == 2) {// hard difficulty\n\t\t\t\t// gives enemy unfair advantage\n\n\t\t\t\tif (conflictX == 4)\n\t\t\t\t\tconflictX = 0;\n\t\t\t\tif (conflictY == 4)\n\t\t\t\t\tconflictY = 0;\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\t\tif (y + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x][y + 1] == 1)// if y+1 is a hit and it is\n\t\t\t\t\t\t\t\t\t\t\t\t\t// within bounds, it will go\n\t\t\t\t\t\t\t\t\t\t\t\t\t// there\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x][y - 1] == 1)\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t\tif (x + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x + 1][y] == 1)\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t}\n\t\t\t\t\tif (x - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} // hard diff\n\t\t\tcheckDirection++;\n\t\t} // lasthit\n\n\t\tint tryCount = 0;\n\t\twhile (egrid[x][y] == 3) { // makes sure enemy doesn't hit same spot\n\t\t\t\t\t\t\t\t\t// twice\n\t\t\tx = (int) (Math.random() * 10);\n\t\t\ty = (int) (Math.random() * 10);\n\t\t\tif (tryCount < 20 && getDifficulty() > 0) {\n\t\t\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\t\t\tif (y % 2 == 0) { // for checkerboard pattern\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t} else { // if x is odd, y should be even\n\t\t\t\t\tif (y % 2 == 1)\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttryCount++;\n\t\t}\n\n\t\tif (egrid[x][y] == 1) { // hit branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilehit.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a hit\");\n\t\t\tenemyLastShotHit = true; // starts ai\n\t\t\tcheckDirection = 0;\n\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\tenemyLastHitX = x; // stores x and y values\n\t\t\t\tenemyLastHitY = y;\n\t\t\t}\n\t\t\tehits--; // keeps score\n\t\t}\n\n\t\telse if (egrid[x][y] == 2) { // poweup branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilepower.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a PowerUp\");\n\t\t\tgoAgain = true;\n\t\t}\n\n\t\telse\n\t\t\t// miss branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilemiss.jpg\"));\n\n\t\tegrid[x][y] = 3;\n\n\t\tcheckEnemyWin();\n\n\t\tif (goAgain)\n\t\t\tenemyMove();\n\n\t}",
"public boolean moveOn() {\n\t\t\n\t}",
"protected boolean isFinished() {\n //boolean onTarget = Math.abs(\n //encoderValue - Math.abs(Robot.arm.getArmEncoderValue())) <= RobotMap.ArmConstants.ARM_ENCODER_BUFFER;\n boolean hasBeenZeroed = Robot.arm.hasButtonBeenPressed();\n boolean onTarget = false;\n if(initialPos < setpoint) {\n onTarget = Math.abs(Robot.arm.getArmEncoderValue()) >= setpoint;\n }else if(initialPos >= setpoint) {\n onTarget = Math.abs(Robot.arm.getArmEncoderValue()) <= setpoint;\n }\n return this.isTimedOut() || !hasBeenZeroed || onTarget;\n }",
"public boolean goalReached() {\n return (Math.abs(mTargetAngle - mCurrentAngle) < mTargetTolerance);\n }",
"@Override\n protected boolean isFinished() {\n return (Math.abs(hpIntake.getWristPosition()) - HatchPanelIntake.positions[position.ordinal()] < Math.PI/12);\n }",
"public boolean move(int[][] foodPos){\n\tint[] target = findFood(foodPos);\n\tRandom choiceGen = new Random();\n\tif(target == null && trackTime != 0){\n\t moveAfter(previousTarget, choiceGen);\n\t trackTime--;\n\t return false;\n\t}\n\telse if(target != null){\n\t return moveAfter(target, choiceGen);\n\t}\n\trandomMove(choiceGen);\n\treturn false;\n }",
"boolean isMoving();",
"public static boolean isValidMove(Robot robot) {\r\n\t\t\r\n\t\tint x = robot.getX();\r\n\t\tint y = robot.getY();\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of bound to the east\r\n\t\tif(robot.facingEast()) {\r\n\t\t\tif(x + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the west\r\n\t\tif(robot.facingWest()) {\r\n\t\t\tif(x - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't hit\r\n\t\t//the wall to the south\r\n\t\tif(robot.facingSouth()) {\r\n\t\t\tif(y - 1 > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t//Make sure the next move won't out\r\n\t\t//of the bound to the north\r\n\t\tif(robot.facingNorth()) {\r\n\t\t\tif(y + 1 < 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn false;\r\n\t}",
"public boolean moveAfter(int[] target, Random choiceGen){\n\tint xDiff = target[0] - position[0], yDiff = target[1] - position[1];\n\tint choice = 0;\n\tif(Math.abs(xDiff) > 0 && Math.abs(yDiff) > 0){\n\t choice = choiceGen.nextInt(2);\n\t if(choice == 1){\n\t\tposition[1] += yDiff/(Math.abs(yDiff));\n\t }\n\t else{\n\t\tposition[0] += xDiff/(Math.abs(xDiff));\n\t }\n\t}\n\telse if(Math.abs(xDiff) > 0){\n\t position[0] += xDiff/(Math.abs(xDiff));\n\t if(position[0] == target[0]){\n\t\ttrackTime = 0;\n\t\treturn true;\n\t }\n\t}\n\telse if(Math.abs(yDiff) > 0){\n\t position[1] += yDiff/(Math.abs(yDiff));\n\t if(position[1] == target[1]){\n\t\ttrackTime = 0;\n\t\treturn true;\n\t }\n\t}\n\telse{\n\trandomMove(choiceGen);\n\ttrackTime = 0;\n\t}\n\treturn false;\n }",
"public boolean more_moves() {\n\t\tif (future_moves.size() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected boolean isFinished() {\n logger.info(\"Ending left drive\");\n \treturn timer.get()>howLongWeWantToMove;\n }",
"@Override\n\tprotected boolean isFinished() {\n\t\tif (!stoppable) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t// return Robot.elevator.getLevel() == Level.Bottom;\n\t\t\treturn (Robot.elevator.getLevel() == Level.Bottom && v < 0.0) || (Robot.elevator.getLevel() == Level.Top && v > 0.0);\n\t\t}\n\t}",
"public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }",
"public boolean isSuccessiveMove() {\n return successiveMove;\n }",
"boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\n }",
"@Override\n protected boolean isFinished() {\n //calculate distances traveled on X and Y axes by averaging encoder values\n double xAvg = (double)(Robot.driveTrain.getFREncoder() + Robot.driveTrain.getBLEncoder()) / 2.0;\n double yAvg = (double)(Robot.driveTrain.getFLEncoder() + Robot.driveTrain.getBREncoder()) / 2.0;\n \n //some checks to see if the robot is within 100 encoder counts of the target\n boolean finishedX = (Math.abs(xDist - xAvg) < 100);\n boolean finishedY = (Math.abs(yDist - yAvg) < 100);\n\n //finished if X and Y are within 100 counts or if the command times out\n return ((finishedX && finishedY) || isTimedOut());\n }",
"@Test\n public void onlyStartPlayerMoves() {\n assertTrue(game.move(Location.R1, Location.R3));\n assertEquals(1, game.getCount(Location.R3));\n assertEquals(1, game.getCount(Location.R1));\n }",
"private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}",
"boolean canMove();",
"public int TakeStep()\n\t\t{\n\t\t// the eventual movement command is placed here\n\t\tVec2\tresult = new Vec2(0,0);\n\n\t\t// get the current time for timestamps\n\t\tlong\tcurr_time = abstract_robot.getTime();\n\n\n\t\t/*--- Get some sensor data ---*/\n\t\t// get vector to the ball\n\t\tVec2 ball = abstract_robot.getBall(curr_time);\n\n\t\t// get vector to our and their goal\n\t\tVec2 ourgoal = abstract_robot.getOurGoal(curr_time);\n\t\tVec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);\n\n\t\t// get a list of the positions of our teammates\n\t\tVec2[] teammates = abstract_robot.getTeammates(curr_time);\n\n\t\t// find the closest teammate\n\t\tVec2 closestteammate = new Vec2(99999,0);\n\t\tfor (int i=0; i< teammates.length; i++)\n\t\t\t{\n\t\t\tif (teammates[i].r < closestteammate.r)\n\t\t\t\tclosestteammate = teammates[i];\n\t\t\t}\n\n\n\t\t/*--- now compute some strategic places to go ---*/\n\t\t// compute a point one robot radius\n\t\t// behind the ball.\n\t\tVec2 kickspot = new Vec2(ball.x, ball.y);\n\t\tkickspot.sub(theirgoal);\n\t\tkickspot.setr(abstract_robot.RADIUS);\n\t\tkickspot.add(ball);\n\n\t\t// compute a point three robot radii\n\t\t// behind the ball.\n\t\tVec2 backspot = new Vec2(ball.x, ball.y);\n\t\tbackspot.sub(theirgoal);\n\t\tbackspot.setr(abstract_robot.RADIUS*5);\n\t\tbackspot.add(ball);\n\n\t\t// compute a north and south spot\n\t\tVec2 northspot = new Vec2(backspot.x,backspot.y+0.7);\n\t\tVec2 southspot = new Vec2(backspot.x,backspot.y-0.7);\n\n\t\t// compute a position between the ball and defended goal\n\t\tVec2 goaliepos = new Vec2(ourgoal.x + ball.x,\n\t\t\t\tourgoal.y + ball.y);\n\t\tgoaliepos.setr(goaliepos.r*0.5);\n\n\t\t// a direction away from the closest teammate.\n\t\tVec2 awayfromclosest = new Vec2(closestteammate.x,\n\t\t\t\tclosestteammate.y);\n\t\tawayfromclosest.sett(awayfromclosest.t + Math.PI);\n\n\n\t\t/*--- go to one of the places depending on player num ---*/\n\t\tint mynum = abstract_robot.getPlayerNumber(curr_time);\n\n\t\t/*--- Goalie ---*/\n\t\tif (mynum == 0)\n\t\t\t{\n\t\t\t// go to the goalie position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = goaliepos;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.1) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- midback ---*/\n\t\telse if (mynum == 1)\n\t\t\t{\n\t\t\t// go to a midback position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = backspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 2)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = northspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 4)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = southspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.3 )\n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*---Lead Forward ---*/\n\t\telse if (mynum == 3)\n\t\t\t{\n\t\t\t// if we are more than 4cm away from the ball\n\t\t\tif (ball.r > .3)\n\t\t\t\t// go to a good kicking position\n\t\t\t\tresult = kickspot;\n\t\t\telse\n\t\t\t\t// go to the ball\n\t\t\t\tresult = ball;\n\t\t\t}\n\n\n\t\t/*--- Send commands to actuators ---*/\n\t\t// set the heading\n\t\tabstract_robot.setSteerHeading(curr_time, result.t);\n\n\t\t// set speed at maximum\n\t\tabstract_robot.setSpeed(curr_time, 1.0);\n\n\t\t// kick it if we can\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\tabstract_robot.kick(curr_time);\n\n\t\t/*--- Send message to other robot ---*/\n\t\t// COMMUNICATION\n\t\t// if I can kick\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\t{\n\t\t\t// and I am robot #3\n\t\t\tif ((mynum==3))\n\t\t\t\t{\n\t\t\t\t// construct a message\n\t\t\t\tStringMessage m = new StringMessage();\n\t\t\t\tm.val = (new Integer(mynum)).toString();\n\t\t\t\tm.val = m.val.concat(\" can kick\");\n\n\t\t\t\t// send the message to robot 2\n\t\t\t\t// note: broadcast and multicast are also\n\t\t\t\t// available.\n\t\t\t\ttry{abstract_robot.unicast(2,m);}\n\t\t\t\tcatch(CommunicationException e){}\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- Look for incoming messages ---*/\n\t\t//COMMUNICATION\n\t\twhile (messagesin.hasMoreElements())\n\t\t\t{\n\t\t\tStringMessage recvd = \n\t\t\t\t(StringMessage)messagesin.nextElement();\n\t\t\tSystem.out.println(mynum + \" received:\\n\" + recvd);\n\t\t\t}\n\n\t\t// tell the parent we're OK\n\t\treturn(CSSTAT_OK);\n\t\t}",
"protected boolean isFinished() {\r\n if (Math.abs(motorWithEncoder.getSetpoint() - motorWithEncoder.getPosition()) < 0.5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public boolean continueExecuting()\n {\n if (!closestEntity.isEntityAlive())\n {\n return false;\n }\n\n if (field_46105_a.getDistanceSqToEntity(closestEntity) > (double)(field_46101_d * field_46101_d))\n {\n return false;\n }\n else\n {\n return field_46102_e > 0;\n }\n }",
"public boolean isFinished() {\n return !rightMotor.isMoving() && !leftMotor.isMoving();\n }",
"public boolean move() {\n\t double[] movePre = movePreProcessing();\n\n double dxbak=movePre[0], dybak=movePre[1], dthetabak=movePre[2];\n boolean collision = false;\n\t\t\n\t\tif (hasGrown!=0 || dx!=0 || dy!=0 || dtheta!=0) {\n\t\t\thasMoved = true;\n\t\t\t// Check it is inside the world\n\t\t\tcollision = !isInsideWorld();\n\t\t\t// Collision detection with biological corridors\n\t\t\tif (alive) {\n\t\t\t\tOutCorridor c = _world.checkHitCorridor(this);\n\t\t\t\tif (c != null && c.canSendOrganism()) {\n\t\t\t\t\tif (c.sendOrganism(this))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collision detection with other organisms.\n Organism otherOrganism = _world.checkHit(this);\n\t\t\tif (otherOrganism != null) {\n\t\t\t if (this.contact(otherOrganism)) {\n collision = true;\n }\n }\n\n\n\t\t\t// If there is a collision, undo movement.\n\t\t\tif (collision) {\n\t\t\t\thasMoved = false;\n\t\t\t\toffset(-dxbak,-dybak,-dthetabak);\n\t\t\t\tif (hasGrown!=0) {\n\t\t\t\t\t_growthRatio+=hasGrown;\n\t\t\t\t\tsymmetric();\n\t\t\t\t}\n\t\t\t\tcalculateBounds(hasGrown!=0);\n\t\t\t}\n\t\t}\n\t\t// Substract one to the time needed to reproduce\n\t\tif (_timeToReproduce > 0)\n\t\t\t_timeToReproduce--;\n\t\t// Check if it can reproduce: it needs enough energy and to be adult\n\t\tif (_energy > _geneticCode.getReproduceEnergy() + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)\n\t\t\t\t&& _growthRatio==1 && _timeToReproduce==0 && alive)\n\t\t\treproduce();\n\t\t// Check that it don't exceed the maximum chemical energy\n\t\tif (_energy > _geneticCode.getReproduceEnergy()) {\n\t\t\tif (_energy > 2*_geneticCode.getReproduceEnergy()) {\n\t\t\t\tuseEnergy(_energy - 2*_geneticCode.getReproduceEnergy());\n\t\t\t} else {\n\t\t\t useEnergy((_energy - _geneticCode.getReproduceEnergy()) / 300);\n\t\t\t}\n\t\t}\n\t\t// Maintenance\n\t\tbreath();\n\t\t// Check that the organism has energy after this frame\n\t\treturn _energy > Utils.tol;\n\t}",
"@Test\n public void isJumpActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentRed = agents.get(0);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentRed, CheckersPosition.P21,\n CheckersPosition.P17);\n action.doIt();\n }\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P14);\n action.doIt();\n }\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentRed, CheckersPosition.P22,\n CheckersPosition.P18);\n action.doIt();\n }\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can jump his token over a red token to an empty space.\n assertTrue(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P14,\n CheckersPosition.P21));\n\n // Agent white cannot jump his token to an occupied space.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P14,\n CheckersPosition.P23));\n\n // Agent white cannot jump his token to an adjacent empty space.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P10,\n CheckersPosition.P15));\n\n // Agent white cannot jump his own token.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P08,\n CheckersPosition.P15));\n }",
"public void currentSquareIsGoodExecute() throws GameActionException {\n // try to move towards EC with any ordinal directions that decreases distance (NE, SE, SW, NW)\n\n if (!controller.isReady()) return;\n\n int moveTowardsDistance = Cache.CURRENT_LOCATION.distanceSquaredTo(Cache.myECLocation);\n Direction moveTowardsDirection = null;\n\n for (Direction direction : Constants.ORDINAL_DIRECTIONS) {\n if (controller.canMove(direction)) {\n MapLocation candidateLocation = Cache.CURRENT_LOCATION.add(direction);\n int candidateDistance = candidateLocation.distanceSquaredTo(Cache.myECLocation);\n boolean isGoodSquare = checkIfGoodSquare(candidateLocation);\n if (isGoodSquare && candidateDistance < moveTowardsDistance) {\n moveTowardsDistance = candidateDistance;\n moveTowardsDirection = direction;\n }\n }\n }\n\n if (moveTowardsDirection != null) {\n controller.move(moveTowardsDirection);\n }\n }",
"protected boolean isFinished() {\n \tif (Math.abs(_finalTickTargetLeft - Robot.driveTrain.getEncoderLeft()) <= 0 &&\n \t\t\tMath.abs(_finalTickTargetRight - Robot.driveTrain.getEncoderRight()) <= 0)\n \t{\n \t\treturn true;\n \t}\n return false;\n }",
"public abstract boolean canMove(Board board, Spot from, Spot to);",
"public abstract boolean canMove();",
"public boolean continueExecuting()\n {\n double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ);\n return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D;\n }",
"private boolean isFirstMove(int numberGeneratedSoFarLength) {\n\t\treturn numberGeneratedSoFarLength == 1;\n\t}",
"protected boolean isFinished() {\n \t//finish if distance >= requried distance\n return (Robot.drive.leftEncoder.getDistance() >= distance || Robot.drive.rightEncoder.getDistance() >= distance);\n }",
"public abstract void makeBestMove();"
] | [
"0.68994445",
"0.6864811",
"0.67015386",
"0.64668906",
"0.641153",
"0.641094",
"0.6383532",
"0.6367318",
"0.6349534",
"0.63448817",
"0.6300175",
"0.62864",
"0.6284398",
"0.62679386",
"0.626621",
"0.6217696",
"0.6216244",
"0.6207924",
"0.62043524",
"0.620391",
"0.6192571",
"0.61629975",
"0.61536634",
"0.61495537",
"0.6139201",
"0.6115615",
"0.6107346",
"0.610439",
"0.6099552",
"0.60988843",
"0.6089901",
"0.60741067",
"0.6074039",
"0.60688305",
"0.6065501",
"0.6040166",
"0.60398364",
"0.6039639",
"0.60243726",
"0.60135955",
"0.6004622",
"0.59944504",
"0.5989295",
"0.59842503",
"0.5982959",
"0.59812784",
"0.59672284",
"0.59624803",
"0.59527105",
"0.59431016",
"0.5930209",
"0.5926647",
"0.5923959",
"0.5915513",
"0.5915284",
"0.5914592",
"0.59106034",
"0.5909104",
"0.59086704",
"0.5908619",
"0.5900504",
"0.58877456",
"0.58831453",
"0.58815944",
"0.58771896",
"0.58730394",
"0.5856528",
"0.58501744",
"0.5849557",
"0.58355343",
"0.58328795",
"0.58210087",
"0.58191013",
"0.5818068",
"0.5812585",
"0.57961786",
"0.579361",
"0.57935023",
"0.5793339",
"0.57926553",
"0.57850003",
"0.5783105",
"0.57814014",
"0.578071",
"0.5780526",
"0.5776657",
"0.5775454",
"0.57725567",
"0.5770073",
"0.57695955",
"0.57688046",
"0.57648885",
"0.5762092",
"0.5760602",
"0.5759858",
"0.57578826",
"0.57569754",
"0.57567424",
"0.5749844",
"0.57483137",
"0.5747999"
] | 0.0 | -1 |
Move robot as close as possible (expressed as the manhattan distance) to other given their current energy and load. If multiple optimal (in distance) solutions exist, select the solution that requires the least amount of total energy. Both robots can move and turn to end up closer to each other. Do not take into account shooting and picking up/using/dropping batteries. The expected return value of this method depends on isMoveNextTo18Plus: If isMoveNextTo18Plus returns 0, then moveNextTo will only be called if there are no obstacles in the rectangle covering robot and other. Moreover, your implementation must be optimal only in the number of moves (i.e. ignore the fact that turning consumes energy). If isMoveNextTo18Plus returns 1, then moveNextTo must take into account obstacles (i.e. walls, other robots) and the fact that turning consumes energy. Do not change the state if robot and other are not located on the same board. | @Override
public void moveNextTo(Robot robot, Robot other)
{
try
{
robot.moveNextTo(other);
}
catch(IllegalBoardException exc)
{
System.out.println("Both robots are not placed on the same board");
}
catch(IllegalStateException exc)
{
System.out.println("One or both robots is either terminated or does not have a board.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void move(Maze here) {\n\n\t\tCoordinates target = here.getPlayer().find(); // where the player is\n\n\t\tArrayList<Coordinates> canMove = freeMoves(here); // the ways that aren't\n\t\t\t\t\t\t\t\t\t\t\t\t\t// blocked\n\n\t\tif (!canMove.isEmpty()) { // you can move\n\n\t\t\tCoordinates go = find(); // go is the new coordinates\n\n\t\t\tif (here.getMCell(target).dark()) {\n\t\t\t\tthis.sleep = true;\n\t\t\t\tCollections.shuffle(canMove);\n\t\t\t\tgo = charge(canMove.get(0), here);\n\t\t\t}\n\n\t\t\t// only one option\n\t\t\telse if (canMove.size() == 1)\n\t\t\t\tgo = charge(canMove.get(0), here);\n\n\t\t\telse { // select the best\n\n\t\t\t\t// not too dissimilar to the search method in wargames\n\t\t\t\tPair<Coordinates, Double> best = new Pair<>(target, Double.MAX_VALUE);\n\n\t\t\t\tfor (Coordinates options : canMove) {\n\t\t\t\t\tCoordinates guess = go.add(options);\n\n\t\t\t\t\tdouble gDist = guess.dist(target);\n\n\t\t\t\t\tif (gDist < best.second()) {\n\t\t\t\t\t\tbest.first(options);\n\t\t\t\t\t\tbest.second(gDist);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tgo = charge(best.first(), here);\n\t\t\t}\n\t\t\tmove(go, here);\n\t\t}\n\t}",
"public void performMove() {\n\t\tfor (int x = 0; x <= size-1; x++)\n\t\t\tfor (int y = 0; y <= size-1; y++)\n\t\t\t\tlocalBoard[y][x] = 0;\n\t\t\n\t\t//reset the flag that indicates if a move has been found that decreases the heuristic\n\t\tfoundBetterMove = false;\n\t\t\n\t\t//fill in the appropriate heuristic values\n\t\tpopulateHillValues();\n\t\tArrayList<PotentialMove> myBestList = new ArrayList<PotentialMove>();\n\n\t\t//Find the square with the lowest heuristic value. this should really write the values to an array. \n\t\tint squareDifferential = -1;\n\t\t//String outValue = \"\";\n\t\tfor (int y = 0; y <= size-1; y++) {\n\t\t\tfor (int x = 0; x <= size-1; x++){\n\t\t\t\t//outValue = outValue + localBoard[y][x];\n\t\t\t\tif (squareDifferential < 0) //lowestSquareFound not found yet \n\t\t\t\t{\n\t\t\t\t\tif ((NQueens.queens[x] != y) && //set if the current square isn't already occupied by a queen\n\t\t\t\t\t\t\t(localBoard[NQueens.queens[x]][x] >= localBoard[y][x])) {\n\t\t\t\t\t\tif (localBoard[y][x] == localBoard[NQueens.queens[x]][x])\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) > squareDifferential) { // find the square with the largest differential in value from the queen in the column\n\t\t\t\t\tmyBestList.clear();\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, false));\n\t\t\t\t\tsquareDifferential = localBoard[NQueens.queens[x]][x] - localBoard[y][x];\n\t\t\t\t}\n\t\t\t\telse if (((localBoard[NQueens.queens[x]][x] - localBoard[y][x]) == squareDifferential) && // the differential is equal to the current best differential\n\t\t\t\t\t\t(NQueens.queens[x] != y)) { // and isn't already occupied by a queen\n\t\t\t\t\tmyBestList.add(new PotentialMove(x, y, true));\n\t\t\t\t}\n\t\t\t\t//else the square is higher, has a queen or isn't marginally better than the current queen's position in the row\n\t\t\t}\n\t\t\t//outValue = outValue + \"\\n\";\n\t\t}\n\t\t//JOptionPane.showMessageDialog(null, outValue);\n\t\t\n\t\tif (myBestList.isEmpty())\n\t\t\treturn;\n\t\t\n\t\tint listSize = myBestList.size();\n\t\tPotentialMove bestMove;\n\t\t\n\t\t//grab the non-Sideways moves first\n\t\tfor (int i = 0; i < listSize; i++) {\n\t\t\tif (!(myBestList.get(i).isSideways)) {\n\t\t\t\tbestMove = myBestList.get(i);\n\t\t\t\tfoundBetterMove = true;\n\t\t\t\tsidewaysMoves = 0;\n\t\t\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sidewaysMoves > MAXSIDEWAYSMOVES) { // hit MAXSIDEWAYSMOVES consecutive sideways moves, mark as unsolvable\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//all available moves sideways moves, let's select one randomly\n\t\tRandom generator = new Random();\n\t\tint randomElement = generator.nextInt(listSize);\n\t\t\n\t\tbestMove = myBestList.get(randomElement);\n\t\tfoundBetterMove = true;\n\t\tsidewaysMoves++;\n\t\tNQueens.queens[bestMove.xCoordinate] = bestMove.yCoordinate;\n\t}",
"public abstract void makeBestMove();",
"public Coordinate getNextMove() {\n\n if (targetMode && salvationMode == false) {\n\n Coordinate bestNextTarget;\n\n if (!fixedDirection) { // direction is not known\n\n int maxCount = 0;\n bestNextTarget = this.previousTarget;\n\n // find the best target around the last target //\n\n if (inBound(this.axis.y + 1, this.axis.x)) {\n maxCount = countGrid[this.axis.y + 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + 1);\n direction = 0; // north by default\n }\n\n if (inBound(this.axis.y - 1, this.axis.x)) {\n if (countGrid[this.axis.y - 1][this.axis.x] > maxCount) {\n maxCount = countGrid[this.axis.y - 1][this.axis.x];\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - 1);\n direction = 2;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x + 1)) { // try east\n if (countGrid[this.axis.y][this.axis.x + 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x + 1];\n bestNextTarget = new Coordinate(this.axis.x + 1, this.axis.y);\n direction = 1;\n }\n }\n\n if (inBound(this.axis.y, this.axis.x - 1)) { // try west\n if (countGrid[this.axis.y][this.axis.x - 1] > maxCount) {\n maxCount = countGrid[this.axis.y][this.axis.x - 1];\n bestNextTarget = new Coordinate(this.axis.x - 1, this.axis.y);\n direction = 3;\n }\n }\n\n seekAgain = false;\n\n } else { // direction is known\n\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y);\n\n if (direction == 0) { // north\n if (inBound(this.axis.y + distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n } else { // else go south\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n direction = 2;\n }\n\n } else if (direction == 1) { // east\n if (inBound(this.axis.y, this.axis.x + distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n } else { // else go west\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n direction = 3;\n }\n\n } else if (direction == 2) { // south\n if (inBound(this.axis.y - distanceFromHit, this.axis.x)) {\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y - distanceFromHit);\n } else { // else go north\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x, this.axis.y + distanceFromHit);\n direction = 0;\n }\n\n } else if (direction == 3) { // west\n if (inBound(this.axis.y, this.axis.x - distanceFromHit)) {\n bestNextTarget = new Coordinate(this.axis.x - distanceFromHit, this.axis.y);\n } else { // else go east\n distanceFromHit = 1;\n bestNextTarget = new Coordinate(this.axis.x + distanceFromHit, this.axis.y);\n direction = 1;\n }\n }\n }\n\n this.previousTarget = bestNextTarget;\n\n } else {\n this.previousTarget = getGlobalHighestCount();\n }\n\n toExclude.add(new Coordinate(this.previousTarget.y, this.previousTarget.x));\n\n this.countGrid[this.previousTarget.y][this.previousTarget.x] = 0;\n\n return this.previousTarget;\n }",
"public void makeMove() {\n ArrayList<Field> myFields = new ArrayList<>();\n for (Field[] fieldsRow : fields) {\n for (Field field : fieldsRow) {\n if(field != null && this.equals(field.getPlayer())) {\n myFields.add(field);\n }\n }\n }\n bestMove[0] = myFields.get(0);\n bestMove[1] = myFields.get(0);\n\n Random rand = new Random();\n for(Field destination : destinationFields) {\n if(canMove()) break;\n destinationField = destination;\n for (Field origin : myFields) {\n for(int i = 0; i < origin.getNeighbours().length; ++i) {\n Field neighbour = origin.getNeighbours()[i];\n if(neighbour != null) {\n if(neighbour.getPlayer() == null) {\n if(valueOfMove(origin, neighbour) > valueOfMove(bestMove[0], bestMove[1])) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n } else if(valueOfMove(origin, neighbour) == valueOfMove(bestMove[0], bestMove[1])) {\n if(rand.nextBoolean()) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n }\n }\n } else {\n Field nextField = neighbour.getNeighbours()[i];\n if(nextField != null) {\n correctJumpPaths(origin,null, origin);\n }\n }\n }\n }\n }\n }\n }",
"public Move calculateMove(Location location) {\r\n\t\tDirection newDirection;\r\n\r\n\t\tArrayList<Location> neighbors = location.getNeighbors(location, map, 2);\r\n\t\t// remove neighbors that are mine or neutral\r\n\t\tneighbors = location.getEnemies(location, map, myID);\r\n\r\n\t\tif (location.getSite().strength == 0) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\t\tif ((location.getSite().strength < 5 || location.getSite().strength < 4 * location.getSite().production)\r\n\t\t\t\t&& location.getSite().isAllowed(location.getSite().production)) {\r\n\t\t\tLocation.planMove(location, Direction.STILL);\r\n\t\t\treturn new Move(location, Direction.STILL);\r\n\t\t}\r\n\r\n\t\tif(neighbors.size() == 0) {\r\n\r\n\t\t\tif (isSafe(location)) {\r\n\t\t\t\tnewDirection = getClosestBoundary(location);\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tnewDirection = getBestNeighbor(location);\r\n\t\t\tif (newDirection != Direction.STILL) {\r\n\t\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\t\treturn new Move(location, newDirection);\r\n\t\t\t}\r\n\t\t\tnewDirection = chooseBestDirection(location);\r\n\t\t\tLocation.planMove(location, newDirection);\r\n\t\t\treturn new Move(location, newDirection);\r\n\t\t}\r\n\t\tnewDirection = getClosestEnemy(location);\r\n\t\tLocation.planMove(location, newDirection);\r\n\t\treturn new Move(location, newDirection);\r\n\t}",
"public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }",
"@Override\n\tpublic GridCell execute() {\n\t\t//1. if there is a winning position, take it\n\t\tArrayList<GridCell> winningCell = TicTacToeBoardExaminer.getWinningPositions(board, side);\n\t\tif (winningCell.size() > 0) {\n\t\t\tGridCell move = winningCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//2. if there is a losing position, block it\n\t\tArrayList<GridCell> losingCell = TicTacToeBoardExaminer.getLosingPositions(board, side);\n\t\tif (losingCell.size() > 0) {\n\t\t\tGridCell move = losingCell.get(0);\n\t\t\treturn move;\n\t\t}\n\t\t\n\t\t//TODO: Implement checking of forks. This will get you to 100% win or tie rate\n\t\t\n\t\t//3. Otherwise get the optimal position\n\t\tGridCell optimal = TicTacToeBoardExaminer.getOptimal(board, side);\n\t\tif (optimal != null)\n\t\t\treturn optimal;\n\t\t\n\t\t//4. Otherwise just move randomly\n\t\telse \n\t\t\treturn new RandomStrategy(board, side).execute();\n\t\t\n\t}",
"public void actionPerformed(ActionEvent e) {\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }",
"public Move doMove(Move opponentsMove, long millisLeft) {\n\t\tSystem.out.println(\" \\n\\n\\n\\n||||>> Turn: \" + turn + \" <<||||\\n\\n\\n\\n\");\n\t\tMove move = new Move();\n\t\tif(opponentsMove != null) {\n\t\t\tboard.move(opponentsMove, opponentSide);\n\t\t}\n\t\tif(getMoveList(board, side).size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t//Move chosenMove = null;\n\t\t//if(chosenMove != null) { System.out.println(\"chosenMove\" + chosenMove); }\n\t\t//else{ System.out.println(\"chosenMove == null\"); }\n\t\tPair<Double, Move> store = minimax(board, side, 0, 6, move, -Double.MAX_VALUE, Double.MAX_VALUE);\n\t\tMove chosenMove = store.move;\n\t\t//int maxDepth = 8;\n\t\t//alt(board, side, chosenMove, -Float.MAX_VALUE, Float.MAX_VALUE, 0, maxDepth);\n\t\tturn++;\n\t\tif(board.checkMove(chosenMove, side)) {\n\t\t\tSystem.out.println(\"ChosenMove: \" + chosenMove.toString());\n\t\t\t//System.out.println(\"FINAL:theScore: \" + store.score);\n\t\t\tSystem.out.println(\"Other Current Score: \" + evaluator(board, side.opposite()));\n\t\t\tSystem.out.println(\"Computer Current Score: \" + evaluator(board, side));\n\t\t\tboard.move(chosenMove, side);\n\t\t\treturn chosenMove;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }",
"private static Point chooseNextPos(Point currPos, Point droneNextDes, Point coord1, Point coord2, double buildingSideGrad, Point buildingCentre, List<List<List<Point>>> noFlyZonesCoords, Point previous1, Point previous2) throws IOException, InterruptedException {\r\n\t\tvar possibleNextPos = possibleNextPos(currPos, coord1, coord2, buildingSideGrad, buildingCentre);\r\n\t\tvar nextPosTemp1 = possibleNextPos.get(0);\r\n\t\tvar nextPosTemp2 = possibleNextPos.get(1);\r\n\t\t\r\n\t\tvar euclidDist1 = euclidDist(droneNextDes, nextPosTemp1); \r\n\t\tvar euclidDist2 = euclidDist(droneNextDes, nextPosTemp2);\r\n\t\t\r\n\t\tPoint nextPos = droneNextDes;\r\n\t\t\r\n\r\n\t\t//in the case that both directions result in no intersection, \r\n\t\t//it chooses the one that minimises the distance between the drone's next position and desired position \r\n\t\t//and doesn't result in the drone going back and fourth continuously \r\n\t\tif(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==true && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==true) {\r\n\t\t\tvar repeatedMoveDir1 = false; //in the case that previous1 and previous2 are null\r\n\t\t\tvar repeatedMoveDir2 = false;\r\n\t\t\tif(previous1!=null && previous2!=null) {\r\n\t\t\t\trepeatedMoveDir1 = computeDir(previous2, previous1)==computeDir(currPos, nextPosTemp1); //next move is equal to 2 moves before, indicating repeated move\r\n\t\t\t\trepeatedMoveDir2 = computeDir(previous2, previous1)==computeDir(currPos, nextPosTemp2);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(euclidDist1<euclidDist2 && repeatedMoveDir1==false || repeatedMoveDir2==true) {\r\n\t\t\t\tnextPos = nextPosTemp1;\r\n\t\t\t}\r\n\t\t\tif(repeatedMoveDir1==true || euclidDist2<euclidDist1 && repeatedMoveDir2==false){\r\n\t\t\t\tnextPos = nextPosTemp2;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==true && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==false) {\r\n\t\t\tnextPos = nextPosTemp1;\r\n\t\t}\r\n\t\telse if(noIntersections(currPos, nextPosTemp1, noFlyZonesCoords)==false && noIntersections(currPos, nextPosTemp2, noFlyZonesCoords)==true) { //\r\n\t\t\tnextPos = nextPosTemp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\treturn nextPos;\r\n\t}",
"private Move getBestMove() {\r\n\t\tSystem.out.println(\"getting best move\");\r\n\t\tChessConsole.printCurrentGameState(this.chessGame);\r\n\t\tSystem.out.println(\"thinking...\");\r\n\t\t\r\n\t\tList<Move> validMoves = generateMoves(false);\r\n\t\tint bestResult = Integer.MIN_VALUE;\r\n\t\tMove bestMove = null;\r\n\t\t\r\n\t\tfor (Move move : validMoves) {\r\n\t\t\texecuteMove(move);\r\n\t\t\t//System.out.println(\"evaluate move: \"+move+\" =========================================\");\r\n\t\t\tint evaluationResult = -1 * negaMax(this.maxDepth,\"\");\r\n\t\t\t//System.out.println(\"result: \"+evaluationResult);\r\n\t\t\tundoMove(move);\r\n\t\t\tif( evaluationResult > bestResult){\r\n\t\t\t\tbestResult = evaluationResult;\r\n\t\t\t\tbestMove = move;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"done thinking! best move is: \"+bestMove);\r\n\t\treturn bestMove;\r\n\t}",
"@Override\n /**\n * Selects a move based on the current game state\n */\n public Move selectMove() {\n Game game = this.game.copy();\n List<Move> moves = game.getValidMoves(this.player);\n Collections.shuffle(moves);\n\n // Create a thread pool\n Executor executor = Executors.newFixedThreadPool(this.threadCount);\n CompletionService<MinimaxEngineWorker> service = new ExecutorCompletionService<MinimaxEngineWorker>(executor);\n\n // Determine the value of each move using the thread pool\n for (Move move : moves) {\n service.submit(new MinimaxEngineWorker(game, move, this.hashMap));\n }\n\n Move bestMove = null;\n double bestMoveValue = Double.NEGATIVE_INFINITY;\n int movesSize = moves.size();\n long moveCount = 0;\n long hashMapHits = 0;\n for (int i = 0; i < movesSize; i++) {\n try {\n // Block until a worker thread finishes\n MinimaxEngineWorker worker = service.take().get();\n\n // Report progress\n moveCount += worker.moveCount;\n hashMapHits += worker.hashMapHits;\n this.setProgress((double) i / movesSize, moveCount, hashMapHits);\n\n // Update the best move\n if (bestMove == null || worker.moveValue >= bestMoveValue) {\n bestMove = worker.move;\n bestMoveValue = worker.moveValue;\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }\n \n // Clear the hashmap\n this.hashMap.clear();\n Runtime.getRuntime().gc();\n\n return bestMove;\n }",
"private static void findBestRelocationMove(RelocationMove rm, Solution s, double [][] distanceMatrix, int numberOfVehicles) \n\t{\n\t\t//This is a variable that will hold the cost of the best relocation move\n\t\tdouble bestMoveCost = Double.MAX_VALUE;\n\n\t\t//We will iterate through all available vehicles\n\t\t\n\t\t//Vehicles to relocate FROM\n\t\tfor (int from = 0; from<numberOfVehicles; from++)\n\t\t{\n\t\t\t// Vehicles to relocate TO\n\t\t\tfor (int to = 0; to<numberOfVehicles; to++)\n\t\t\t{\n\n\t\t\t\tfor (int fromIndex = 1; fromIndex < s.routes.get(from).customers.size() - 1; fromIndex++)\n\t\t\t\t{\n\t\t\t\t\t//Node A is the predecessor of B\n\t\t\t\t\tCustomer A = s.routes.get(from).customers.get(fromIndex - 1);\n\n\t\t\t\t\t//Node B is the relocated node\n\t\t\t\t\tCustomer B = s.routes.get(from).customers.get(fromIndex);\n\n\t\t\t\t\t//Node C is the successor of B\n\t\t\t\t\tCustomer C = s.routes.get(from).customers.get(fromIndex + 1);\n\n\t\t\t\t\t//We will iterate through all possible re-insertion positions for B\n\t\t\t\t\tfor (int afterIndex = 0; afterIndex < s.routes.get(to).customers.size() -1; afterIndex ++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ((afterIndex != fromIndex && afterIndex != fromIndex - 1)||from != to)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Node F the node after which B is going to be reinserted\n\t\t\t\t\t\t\tCustomer F = s.routes.get(to).customers.get(afterIndex);\n\n\t\t\t\t\t\t\t//Node G the successor of F\n\t\t\t\t\t\t\tCustomer G = s.routes.get(to).customers.get(afterIndex + 1);\n\n\t\t\t\t\t\t\t//The arcs A-B, B-C, and F-G break\n\t\t\t\t\t\t\tdouble costRemovedFrom = distanceMatrix[A.ID][B.ID] + distanceMatrix[B.ID][C.ID];\n\t\t\t\t\t\t\tdouble costRemovedTo = distanceMatrix[F.ID][G.ID];\n\n\t\t\t\t\t\t\t//The arcs A-C, F-B and B-G are created\n\t\t\t\t\t\t\tdouble costAddedFrom = distanceMatrix[A.ID][C.ID];\n\t\t\t\t\t\t\tdouble costAddedTo = distanceMatrix[F.ID][B.ID] + distanceMatrix[B.ID][G.ID];\n\n\t\t\t\t\t\t\t//This is the cost of the move, or in other words\n\t\t\t\t\t\t\t//the change that this move will cause if applied to the current solution\n\t\t\t\t\t\t\tdouble fromMoveCost = costAddedFrom - costRemovedFrom;\n\t\t\t\t\t\t\tdouble toMoveCost = costAddedTo - costRemovedTo;\n\n\t\t\t\t\t\t\t//If this move is the best found so far\n\t\t\t\t\t\t\tdouble moveCost = fromMoveCost+toMoveCost;\n\t\t\t\t\t\t\tif ((moveCost < bestMoveCost)&&(from == to || (s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand<=s.routes.get(to).capacity)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//set the best cost equal to the cost of this solution\n\t\t\t\t\t\t\t\tbestMoveCost = moveCost;\n\n\t\t\t\t\t\t\t\t//store its characteristics\n\t\t\t\t\t\t\t\trm.positionOfRelocated = fromIndex;\n\t\t\t\t\t\t\t\trm.positionToBeInserted = afterIndex;\n\t\t\t\t\t\t\t\trm.toMoveCost = toMoveCost;\n\t\t\t\t\t\t\t\trm.fromMoveCost = fromMoveCost;\n\t\t\t\t\t\t\t\trm.fromRoute = from;\n\t\t\t\t\t\t\t\trm.toRoute = to;\n\t\t\t\t\t\t\t\trm.moveCost = moveCost;\n\t\t\t\t\t\t\t\tif (from != to) {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load - s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load + s.routes.get(from).customers.get(fromIndex).demand;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\trm.fromUpdLoad = s.routes.get(from).load;\n\t\t\t\t\t\t\t\t\trm.toUpdLoad = s.routes.get(to).load;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private int getBestMove(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return 0;\n }\n if (depth > STEP_BACK_DEPTH) {\n try {\n Thread.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n if (shouldStop()) {\n Log.d(Constants.MY_TAG,\"out CalculatingBot\");\n unlock();\n return 0;\n }\n }\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return minimum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n return minimum;\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return maximum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n return maximum;\n }\n }",
"public void moveAllRobotsOneStep(Map<IGridRobot, GridCell> robot2dest){\n\t\t// If the passed map were contained GridRobots, we could count the longest delay and sleep this thread\n\t\t// But I'm not doing it to stay consistent with all the other methods (and to stay flexible)\n\t\t// This requires the tests to sleep themselves\n\t\t//long longestDelay = 0;\n\t\tPathPlanner planner = new PathPlanner();\n\t\tfor (Map.Entry<IGridRobot, GridCell> entry: robot2dest.entrySet()){\n\t\t\tEntry<IGridRobot, Direction> dir = planner.nextStepOneRobot(this, entry);\n\t\t\tif (dir != null){\n\t\t\t\tdir.getKey().step(dir.getValue());\n\t\t\t}\n\t\t}\n\t}",
"private void intelligentDecideMove() {\n\t\tMonster target=nearestEnemy();\r\n\t\tif(target!=null){\t\t\t\t//FIRST PRIORITY: pursue the target if it can be seen.\r\n\t\t\tswitchStates(PURSUIT);\r\n\t\t\ttargetTile=new Tile(target.currentTile);\r\n\t\t\t//saveMove();\r\n\t\t\tmonster.moveTowards(target);\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\ttargetLostResponse();\r\n\t\t\t}\r\n\t}",
"Execution getClosestDistance();",
"Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }",
"public int TakeStep()\n\t\t{\n\t\t// the eventual movement command is placed here\n\t\tVec2\tresult = new Vec2(0,0);\n\n\t\t// get the current time for timestamps\n\t\tlong\tcurr_time = abstract_robot.getTime();\n\n\n\t\t/*--- Get some sensor data ---*/\n\t\t// get vector to the ball\n\t\tVec2 ball = abstract_robot.getBall(curr_time);\n\n\t\t// get vector to our and their goal\n\t\tVec2 ourgoal = abstract_robot.getOurGoal(curr_time);\n\t\tVec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);\n\n\t\t// get a list of the positions of our teammates\n\t\tVec2[] teammates = abstract_robot.getTeammates(curr_time);\n\n\t\t// find the closest teammate\n\t\tVec2 closestteammate = new Vec2(99999,0);\n\t\tfor (int i=0; i< teammates.length; i++)\n\t\t\t{\n\t\t\tif (teammates[i].r < closestteammate.r)\n\t\t\t\tclosestteammate = teammates[i];\n\t\t\t}\n\n\n\t\t/*--- now compute some strategic places to go ---*/\n\t\t// compute a point one robot radius\n\t\t// behind the ball.\n\t\tVec2 kickspot = new Vec2(ball.x, ball.y);\n\t\tkickspot.sub(theirgoal);\n\t\tkickspot.setr(abstract_robot.RADIUS);\n\t\tkickspot.add(ball);\n\n\t\t// compute a point three robot radii\n\t\t// behind the ball.\n\t\tVec2 backspot = new Vec2(ball.x, ball.y);\n\t\tbackspot.sub(theirgoal);\n\t\tbackspot.setr(abstract_robot.RADIUS*5);\n\t\tbackspot.add(ball);\n\n\t\t// compute a north and south spot\n\t\tVec2 northspot = new Vec2(backspot.x,backspot.y+0.7);\n\t\tVec2 southspot = new Vec2(backspot.x,backspot.y-0.7);\n\n\t\t// compute a position between the ball and defended goal\n\t\tVec2 goaliepos = new Vec2(ourgoal.x + ball.x,\n\t\t\t\tourgoal.y + ball.y);\n\t\tgoaliepos.setr(goaliepos.r*0.5);\n\n\t\t// a direction away from the closest teammate.\n\t\tVec2 awayfromclosest = new Vec2(closestteammate.x,\n\t\t\t\tclosestteammate.y);\n\t\tawayfromclosest.sett(awayfromclosest.t + Math.PI);\n\n\n\t\t/*--- go to one of the places depending on player num ---*/\n\t\tint mynum = abstract_robot.getPlayerNumber(curr_time);\n\n\t\t/*--- Goalie ---*/\n\t\tif (mynum == 0)\n\t\t\t{\n\t\t\t// go to the goalie position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = goaliepos;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.1) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- midback ---*/\n\t\telse if (mynum == 1)\n\t\t\t{\n\t\t\t// go to a midback position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = backspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 2)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = northspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 4)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = southspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.3 )\n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*---Lead Forward ---*/\n\t\telse if (mynum == 3)\n\t\t\t{\n\t\t\t// if we are more than 4cm away from the ball\n\t\t\tif (ball.r > .3)\n\t\t\t\t// go to a good kicking position\n\t\t\t\tresult = kickspot;\n\t\t\telse\n\t\t\t\t// go to the ball\n\t\t\t\tresult = ball;\n\t\t\t}\n\n\n\t\t/*--- Send commands to actuators ---*/\n\t\t// set the heading\n\t\tabstract_robot.setSteerHeading(curr_time, result.t);\n\n\t\t// set speed at maximum\n\t\tabstract_robot.setSpeed(curr_time, 1.0);\n\n\t\t// kick it if we can\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\tabstract_robot.kick(curr_time);\n\n\t\t/*--- Send message to other robot ---*/\n\t\t// COMMUNICATION\n\t\t// if I can kick\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\t{\n\t\t\t// and I am robot #3\n\t\t\tif ((mynum==3))\n\t\t\t\t{\n\t\t\t\t// construct a message\n\t\t\t\tStringMessage m = new StringMessage();\n\t\t\t\tm.val = (new Integer(mynum)).toString();\n\t\t\t\tm.val = m.val.concat(\" can kick\");\n\n\t\t\t\t// send the message to robot 2\n\t\t\t\t// note: broadcast and multicast are also\n\t\t\t\t// available.\n\t\t\t\ttry{abstract_robot.unicast(2,m);}\n\t\t\t\tcatch(CommunicationException e){}\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- Look for incoming messages ---*/\n\t\t//COMMUNICATION\n\t\twhile (messagesin.hasMoreElements())\n\t\t\t{\n\t\t\tStringMessage recvd = \n\t\t\t\t(StringMessage)messagesin.nextElement();\n\t\t\tSystem.out.println(mynum + \" received:\\n\" + recvd);\n\t\t\t}\n\n\t\t// tell the parent we're OK\n\t\treturn(CSSTAT_OK);\n\t\t}",
"PrioritizedMove getBestMoveFor(int player, int desiredLength);",
"public void updatePossibleMovesOther(){\n\t\tif( hasMoved){\n\t\t\tpossibleMovesOther = null;\n\t\t\treturn;\n\t\t}\n\t\t// Get left castle updateMoves first\n\t\tchar[] temp = AlgebraicNotationHelper.getAlgebraicNotationLeftOf( startingFile, startingRank);\n\t\ttemp = AlgebraicNotationHelper.getAlgebraicNotationLeftOf( temp[0], temp[1]);\n\t\ttemp = AlgebraicNotationHelper.getAlgebraicNotationLeftOf( temp[0], temp[1]);\n\t\t// Should be b1 for light color King (or b8 for dark color King)\n\t\tAlgebraicNotation tempAN = new AlgebraicNotation( temp[0], temp[1]);\n\t\tpossibleMovesOther.add( tempAN);\n\t\t// Get right castle updateMoves next\n\t\ttemp = AlgebraicNotationHelper.getAlgebraicNotationRightOf( startingFile, startingRank);\n\t\ttemp = AlgebraicNotationHelper.getAlgebraicNotationRightOf( temp[0], temp[1]);\n\t\t// Should be g1 for light color King (or g8 for dark color King)\n\t\ttempAN = new AlgebraicNotation( temp[0], temp[1]);\n\t\tpossibleMovesOther.add( tempAN);\t\n\t}",
"public int runFromMuckrakerMove() throws GameActionException {\n\n //flag indicates best direction to move, not direction I am moving...\n\n boolean foundEnemyMuckraker = false;\n double rewardOfStaying = 9999;\n\n int canMoveIndicesSize = 0;\n int idx = 0;\n for (Direction direction : Constants.DIRECTIONS) {\n moveRewards[idx] = 9998;\n moveLocs[idx] = Cache.CURRENT_LOCATION.add(direction);\n if (controller.canMove(direction)) {\n canMoveIndices[canMoveIndicesSize++] = idx;\n }\n ++idx;\n }\n\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_ENEMY_ROBOTS) {\n if (robotInfo.getType() == RobotType.MUCKRAKER) {\n foundEnemyMuckraker = true;\n MapLocation enemyLocation = robotInfo.location;\n //for all valid locations, find travelDistance...\n rewardOfStaying = Math.min(rewardOfStaying, Pathfinding.travelDistance(Cache.CURRENT_LOCATION, enemyLocation) + 0.01 * Cache.CURRENT_LOCATION.distanceSquaredTo(enemyLocation));\n for (int i = 0; i < idx; ++i) {\n moveRewards[i] = Math.min(moveRewards[i], Pathfinding.travelDistance(moveLocs[i], enemyLocation) + 0.01 * moveLocs[i].distanceSquaredTo(enemyLocation));\n }\n }\n }\n\n int flag = CommunicationMovement.encodeMovement(true, true, CommunicationMovement.MY_UNIT_TYPE.SL, CommunicationMovement.MOVEMENT_BOTS_DATA.NOT_MOVING, CommunicationMovement.COMMUNICATION_TO_OTHER_BOTS.NOOP, false, false, 0);\n int bestValidDirection = -1;\n double bestValidReward = rewardOfStaying;\n\n if (foundEnemyMuckraker) {\n int bestDirection = -1;\n double bestReward = rewardOfStaying;\n\n for (int i = 0; i < idx; ++i) {\n if (moveRewards[i] > bestReward) { //find the best direction based on the reward\n bestDirection = i;\n bestReward = moveRewards[i];\n }\n }\n\n /* MOVE TOWARDS ME IS SET SO POLITICANS CAN MOVE TOWARDS THIS BOT (NOT SLANDERERS) -> BE CAREFUL IF/WHEN PARSING THIS SETTING */\n flag = CommunicationMovement.encodeMovement(true, true, CommunicationMovement.MY_UNIT_TYPE.SL, CommunicationMovement.convert_DirectionInt_MovementBotsData(bestDirection), CommunicationMovement.COMMUNICATION_TO_OTHER_BOTS.MOVE_TOWARDS_ME, false, true, 0);\n\n for (int i = 0; i < canMoveIndicesSize; ++i) {\n if (moveRewards[canMoveIndices[i]] > bestValidReward) {\n bestValidDirection = canMoveIndices[i];\n bestValidReward = moveRewards[canMoveIndices[i]];\n }\n }\n }\n\n // if a politician or slanderer has both a muckraker and slanderer in range, then run away opposite of the danger direction\n int bestDirectionBasedOnPoliticianDangerIdx = -1;\n if (!foundEnemyMuckraker) {\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_FRIENDLY_ROBOTS) {\n if (robotInfo.getType() == RobotType.POLITICIAN || robotInfo.getType() == RobotType.MUCKRAKER) {\n\n if (controller.canGetFlag(robotInfo.ID)) {\n int encodedFlag = controller.getFlag(robotInfo.ID);\n if (CommunicationMovement.decodeIsSchemaType(encodedFlag) &&\n CommunicationMovement.decodeIsDangerBit(encodedFlag)) {\n\n if (CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.PO\n || CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.MU) {\n //A POLITICIAN OR MUCKRAKER WHO SAYS HE IS IN DANGER (enemy muckraker nearby)\n CommunicationMovement.MOVEMENT_BOTS_DATA badArea = CommunicationMovement.decodeMyPreferredMovement(encodedFlag);\n int badIdx = CommunicationMovement.convert_MovementBotData_DirectionInt(badArea);\n Direction bestDirection = Constants.DIRECTIONS[badIdx].opposite();\n bestDirectionBasedOnPoliticianDangerIdx = bestDirection.ordinal();\n break;\n }\n }\n }\n }\n }\n }\n\n /* Set communication for other slanderers if there is a muckraker within my range */\n if (!Comms.hasSetFlag && controller.canSetFlag(flag)) {\n Comms.hasSetFlag = true;\n controller.setFlag(flag);\n }\n\n /* Below is based on movement */\n if (!controller.isReady()) return 1;\n\n if (foundEnemyMuckraker) {\n if (bestValidDirection != -1) {\n controller.move(Constants.DIRECTIONS[bestValidDirection]);\n return 2;\n }\n return 1;\n }\n\n\n /* No muckrakers were found, so we need to check the flags of nearby slanderer units instead. */\n double closestLocation = 9998;\n int preferedMovementDirectionIdx = -1;\n\n for (RobotInfo robotInfo : Cache.ALL_NEARBY_FRIENDLY_ROBOTS) {\n if (robotInfo.getType() == RobotType.POLITICIAN) { //SLANDERERS THINK ALL SLANDERERS ARE POLITICIANS, so we need to check politicians here...\n double dist = Pathfinding.travelDistance(Cache.CURRENT_LOCATION, robotInfo.location)\n + 0.01 * Cache.CURRENT_LOCATION.distanceSquaredTo(robotInfo.location);\n if (dist < closestLocation && controller.canGetFlag(robotInfo.ID)) { //the closest bot in danger to us is our biggest threat as well\n int encodedFlag = controller.getFlag(robotInfo.ID);\n\n if (CommunicationMovement.decodeIsSchemaType(encodedFlag)) {\n if (CommunicationMovement.decodeMyUnitType(encodedFlag) == CommunicationMovement.MY_UNIT_TYPE.SL && CommunicationMovement.decodeIsDangerBit(encodedFlag)) {\n CommunicationMovement.MOVEMENT_BOTS_DATA movementBotsData = CommunicationMovement.decodeMyPreferredMovement(encodedFlag);\n preferedMovementDirectionIdx = CommunicationMovement.convert_MovementBotData_DirectionInt(movementBotsData);\n closestLocation = dist;\n }\n }\n }\n }\n }\n\n if (preferedMovementDirectionIdx != -1) {\n Direction direction = Pathfinding.toMovePreferredDirection(Constants.DIRECTIONS[preferedMovementDirectionIdx], 1);\n if (direction != null) {\n controller.move(direction);\n return 2;\n }\n return 1;\n }\n\n if (bestDirectionBasedOnPoliticianDangerIdx != -1) {\n Direction direction = Pathfinding.toMovePreferredDirection(Constants.DIRECTIONS[bestDirectionBasedOnPoliticianDangerIdx], 1);\n if (direction != null) {\n controller.move(direction);\n return 2;\n }\n return 1;\n }\n\n return 0; // no reason whatsoever to move\n }",
"@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}",
"protected Direction selectMove() {\n Map<Integer, Direction> positive, negative;\n // Add the directions that contains negative stations in a negative set\n // And every other direction in a positive set\n positive = new HashMap<Integer,Direction>(16);\n negative = new HashMap<Integer,Direction>(16);\n for (Direction d : Direction.directions) {\n int result = checkMove(d);\n if (result == 1) {\n positive.put(positive.size(), d);\n } else if (result == 0) {\n negative.put(negative.size(), d);\n } else {\n continue;\n }\n }\n // If there is no positive move, choose a RANDOM negative move\n if (positive.isEmpty()) {\n return negative.get(rand.nextInt(negative.size()));\n } else { // Otherwise choose a RANDOM positive move\n return positive.get(rand.nextInt(positive.size()));\n }\n }",
"public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }",
"public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }",
"@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}",
"public Location getClosestMoveableLocation(Location otherLocation, Location currentLocation) {\n Location closestLocation;\n List<Location> locations = getSurroundingFourLocations(currentLocation);\n List<Location> randomizedLocations = new LinkedList<Location>();\n\n while (!locations.isEmpty()) {\n int LOW = 0;\n int HIGH = locations.size();\n Random randomize = new Random();\n\n int randomIndex = randomize.nextInt(HIGH - LOW) + LOW;\n randomizedLocations.add(locations.remove(randomIndex));\n }\n\n closestLocation = checkClosestLocation(otherLocation, randomizedLocations.get(0), randomizedLocations.get(1));\n closestLocation = checkClosestLocation(otherLocation, closestLocation, randomizedLocations.get(2));\n closestLocation = checkClosestLocation(otherLocation, closestLocation, randomizedLocations.get(3));\n\n return closestLocation;\n }",
"private int getSmartMove(char[] boardConfig) {\n\n ArrayList<Integer> emptySpaces = getEmptySpaces(boardConfig);\n\n double bestScore = -1;\n String bestChoice = \"\";\n int move = 0;\n\n //Loop through each empty space on the board\n for (Integer emptySpace : emptySpaces) {\n int space = emptySpace;\n\n char[] tempBoard = new char[boardConfig.length];\n\n //Create a copy of the board array\n System.arraycopy(boardConfig, 0, tempBoard, 0, boardConfig.length);\n\n //Add the current player's piece to the current empty spot\n tempBoard[space] = game.getPlayer() == 0 ? 'X' : 'O';\n\n //Get a string from the possible move board\n String tempBoardString = boardToString(tempBoard);\n\n //Attempt to get the possible move board configuration data from the long term memory\n BoardRecord record = longTermMemory.get(tempBoardString);\n\n //Check if a record was found\n if (record != null) {\n\n //Calculate the score of the current move in question\n float currentValue = (float) (record.getWins() - record.getLosses()) / (record.getLosses() + record.getWins() + record.getTies());\n\n //If the new move is better than the current best move choose it\n if (currentValue > bestScore) {\n bestScore = currentValue;\n move = space;\n bestChoice = tempBoardString;\n }\n }\n }\n\n if (!Objects.equals(bestChoice, \"\")) {\n shortTermMemory.add(bestChoice);\n return move;\n } else {\n return getRandomMove(boardConfig);\n }\n }",
"public void moveToSonar(final TurnType dir,\n float power,\n float distanceLimit,\n int timeoutMillis,\n boolean isAdjust,\n boolean isBreak)\n throws InterruptedException\n {\n final float p = Range.clip(power, -1f, 1f);\n\n // turn wheels\n setTurnWait(dir);\n\n if (timeoutMillis < 0) {\n timeoutMillis = 30000;\n }\n\n long startTimestamp = System.currentTimeMillis();\n long timeStamp = startTimestamp;\n\n float distance = Float.MAX_VALUE;\n while (op.opModeIsActive() &&\n (timeStamp - startTimestamp < timeoutMillis)) {\n\n if (dir == TurnType.STRAFE) {\n distance = (power < 0 ? sonarLeft.getDistance() : sonarRight.getDistance());\n //op.telemetry.addData(\"distance\", distance);\n\n if (distance < distanceLimit) {\n break;\n }\n }\n else if (dir == TurnType.FORWARD) {\n if (power > 0) {\n distance = sonarFront.getDistance();\n //op.telemetry.addData(\"distance\", distance);\n }\n else {\n break;\n }\n\n if (distance < distanceLimit) {\n break;\n }\n }\n else {\n break;\n }\n\n if (isAdjust) {\n adjustPower(dir,\n p);\n }\n else {\n setPower(p,\n p,\n dir);\n }\n\n //op.telemetry.update();\n op.idle();\n timeStamp = System.currentTimeMillis();\n } // while\n\n if (isBreak) {\n stop2();\n }\n\n if (Thread.currentThread().isInterrupted()) {\n RobotLog.e(\"Thread interrupted\");\n }\n else if (op.isStopRequested()) {\n RobotLog.e(\"Stop requested\");\n }\n\n RobotLog.i(\"Sonar: \" + distance);\n RobotLog.i(\"Move took \" + (System.currentTimeMillis() - startTimestamp) + \" milliseconds\");\n op.idle();\n }",
"public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic Move stateMachineSelectMove(long timeout)\n\t\t\tthrows TransitionDefinitionException, MoveDefinitionException, GoalDefinitionException {\n\t\tlong start = System.currentTimeMillis();\n\t\tList<Move> moves = getStateMachine().getLegalMoves(getCurrentState(), getRole());\n\t\tMove bestMove = moves.get(0);\n\t\tint bestScore = 0;\n\t\tfor (Move move: moves) {\n\t\t\tint result = getMinScore(getRole(), move, getCurrentState(), 0, 100);\n\t\t\tif (result > bestScore) {\n\t\t\t\tbestScore = result;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t}\n\n\t\tlong stop = System.currentTimeMillis();\n\t\tnotifyObservers(new GamerSelectedMoveEvent(moves, bestMove, stop - start));\n\t\treturn bestMove;\n\t}",
"public void makeMove(Location loc)\n {\n \tLocation curLoc = getLocation();\n \tint curDirection = getDirection();\n // get 2 left locations\n\t\tLocation leftNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.LEFT);\n Location leftNextNeighborLoc = leftNeighborLoc.getAdjacentLocation(curDirection + Location.LEFT);\n // get 2 right locations\n Location rightNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n Location rightNextNeighborLoc = rightNeighborLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n // initial a null\n Actor leftNeighborActor = null;\n Actor leftNextNeighborActor = null;\n Actor rightNeighborActor = null;\n Actor rightNextNeighborActor = null;\n\n boolean isLeftValid = false;\n boolean isRightValid = false;\n\n Grid<Actor> grid = getGrid();\n // if left valid\n if (grid.isValid(leftNeighborLoc) && grid.isValid(leftNextNeighborLoc))\n {\n \tleftNeighborActor = grid.get(leftNeighborLoc);\n \tleftNextNeighborActor = grid.get(leftNextNeighborLoc);\n \t\n \tif (leftNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisLeftValid = true;\n }\n }\n // if right valid\n if (grid.isValid(rightNeighborLoc) && grid.isValid(rightNextNeighborLoc))\n {\n \trightNeighborActor = grid.get(rightNeighborLoc);\n \trightNextNeighborActor = grid.get(rightNextNeighborLoc);\n\n \tif (rightNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisRightValid = true;\n }\n }\n // if both valid\n if (isLeftValid && isRightValid)\n {\n\t // move ramdonly\n if (Math.random() < 0.5)\n\t {\n\t \tmoveTo(leftNextNeighborLoc);\n\t \n\t }\n\t else{\n\t \tmoveTo(rightNextNeighborLoc);\n\t }\n }\n // right valid only\n else if (isRightValid && !isLeftValid)\n {\n \tmoveTo(rightNextNeighborLoc);\n }\n // left valid only\n else if (!isRightValid && isLeftValid)\n {\n \tmoveTo(leftNextNeighborLoc);\n }\n else\n {\n \tsuper.makeMove(loc);\n }\n \n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}",
"@Override\r\n\t// Precondition: During testing the AI is associated with the 'O', the odd number move.\r\n \tpublic Point desiredMove(TicTacToeGame theGame) {\n\t\t\r\n\t\tchar[][] board = theGame.getTicTacToeBoard();\r\n\t\tPoint dPoint;\r\n\t //check for win\r\n\t\tdPoint = winOrBlock(board,'O');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"winning\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//check for block\r\n\t\tdPoint = winOrBlock(board,'X');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"blocking\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//otherwise pick random loc\r\n\t\tRandom randy = new Random(); \r\n\t int randX = randy.nextInt(3);\r\n\t int randY = randy.nextInt(3);\r\n\t while(!theGame.available(randX, randY)) {\r\n\t \trandX = randy.nextInt(3);\r\n\t \trandY = randy.nextInt(3);\r\n\t }\r\n\t System.out.println(\"random\");\r\n\t return new Point(randX, randY);\r\n\t}",
"private static List<Point> possibleNextPos(Point currPos, Point coord1, Point coord2, double buildingSideGrad, Point buildingCentre){\r\n\t\tvar coord1Lat = coord1.latitude();\r\n\t\tvar coord1Lon = coord1.longitude();\r\n\t\tvar coord2Lat = coord2.latitude();\r\n\t\tvar coord2Lon = coord2.longitude();\r\n\t\t\r\n\t\tvar currPosLon = currPos.longitude();\r\n\t\tvar currPosLat = currPos.latitude();\r\n\t\t\r\n\t\tvar buildingLon = buildingCentre.longitude();\r\n\t\tvar buildingLat = buildingCentre.latitude();\r\n\t\t\r\n\t\tvar dir1 = computeDir(coord1, coord2); //in the case that the drone is moving in the direction coord1 to coord2\r\n\t\tvar nextPosTemp1 = nextPos(dir1, currPos); //the temporary next position if the drone moves in dir1\r\n\t\t\r\n\t\tvar dir2 = computeDir(coord2, coord1); //in the case that the drone is moving in the direction coord2 to coord1\r\n\t\tvar nextPosTemp2 = nextPos(dir2, currPos); //the temporary next position if the drone moves in dir2 \r\n\t\t\r\n\t\tvar possibleNextPos = new ArrayList<Point>();\r\n\t\t\r\n\t\tif(Math.abs(buildingSideGrad)>=1) { //in this case, longitudes of building centre and drone current position are compared\r\n\t\t\t//coord1 to coord2 scenario\r\n\t\t\tif((coord1Lat>coord2Lat && buildingLon<currPosLon) || (coord1Lat<coord2Lat && buildingLon>currPosLon)) {\r\n\t\t\t\tdir1 = (dir1+10)%360; //angle increased such that drone doesn't fly over side of building\r\n\t\t\t\tnextPosTemp1 = nextPos(dir1, currPos);\r\n\t\t\t}\r\n\t\t\t//coord2 to coord1 scenario\r\n\t\t\tif((coord1Lat<coord2Lat && buildingLon<currPosLon) || (coord1Lat>coord2Lat && buildingLon>currPosLon)) {\r\n\t\t\t\tdir2 = (dir2+10)%360;\r\n\t\t\t\tnextPosTemp2 = nextPos(dir2, currPos);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse { //in this case, latitudes of building centre and drone current position are compared\r\n\t\t\tif((coord1Lon>coord2Lon && buildingLat>currPosLat) || (coord1Lon<coord2Lon && buildingLat<currPosLat)) {\r\n\t\t\t\tdir1 = (dir1+10)%360; \r\n\t\t\t\tnextPosTemp1 = nextPos(dir1, currPos);\r\n\t\t\t}\r\n\r\n\t\t\tif((coord1Lon<coord2Lon && buildingLat>currPosLat) || (coord1Lon>coord2Lon && buildingLat<currPosLat)) {\r\n\t\t\t\tdir2 = (dir2+10)%360;\r\n\t\t\t\tnextPosTemp2 = nextPos(dir2, currPos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tpossibleNextPos.add(nextPosTemp1);\r\n\t\tpossibleNextPos.add(nextPosTemp2);\r\n\t\t\r\n\t\treturn possibleNextPos;\r\n\t}",
"public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }",
"public int startMoving() throws RobotCrashException{\n \t//holds direction to step in\n \tDirection direction;\n \t//holds the robot about to move\n \tIGridRobot robot;\n \t//holds the return of pathplanner\n \tEntry<IGridRobot, Direction> toMove;\n \t//The task that will be run in a new thread\n \tTask runnable;\n \t//Pool of threads\n \tExecutorService es = \n \t\t\tnew ScheduledThreadPoolExecutor(this.robot2dest.size());\n \t\n \t//Holds the gridcell a robot is about to step to\n \tGridCell newCell;\n \t//A map of currently moving robots\n \tMap<IGridRobot, Direction> movingBots;\n \tint steps = 0;\n \t\n \t//Keep moving robots until the number that reached the destination\n \t//is equal to the number of robots we are moving\n \twhile(this.c.getCount() < this.robot2dest.size()){\n \t\ttoMove = \n \t\t\t\tthis.pathplanner.nextStep(this.warehouse, this.robot2dest);\n \t\t\n \t\tif(toMove != null){\n \t\t\trobot = toMove.getKey();\n \t\tdirection = toMove.getValue();\n \t\tnewCell = GridRobot.oneCellOver(robot.getLocation(),\n \t\t\t\tdirection);\n \t\t\n \t\t//Check if the robot is about to crash into another robot\n \t\tfor(IGridRobot r : this.robot2dest.keySet()){\n \t\t\tif(newCell.equals(r.getLocation())){\n \t\t\t\tthrow new RobotCrashException();\n \t\t\t}\n \t\t}\n \t\t//Check if they are stepping onto where another robot is stepping\n \t\tmovingBots = warehouse.getRobotsInMotion();\n \t\tfor(IGridRobot r : movingBots.keySet()){\n \t\t\tif(GridRobot.oneCellOver(r.getLocation(),\n \t\t\t\t\tmovingBots.get(r)).equals(newCell)){\n \t\t\t\t\n \t\t\t\tthrow new RobotCrashException();\n \t\t\t}\n \t\t}\n \t\t\n \t\t//Move the robot in a new thread\n \t\tthis.warehouse.addMovingRobot(robot, direction);\n \t\tsteps++;\n \t\trunnable = new Task(robot, direction);\n \t\tCompletableFuture.runAsync(runnable, es);\n \t\t}\n \t}\n \treturn steps;\n }",
"private Move getBestMove(RaceTrack track, CellData[][] cells,\n\t\t\tPair<Integer, Integer> pos, Pair<Integer, Integer> speed, int depth) {\n\t\tCellData cellData = cells[pos.getLeft()][pos.getRight()];\n\n\t\tMap<Pair<Integer, Integer>, Character> availableMoves = new HashMap<>();\n\t\tint contX = pos.getLeft() + speed.getLeft();\n\t\tint contY = pos.getRight() + speed.getRight();\n\n\t\tPair<Integer, Integer> cont0 = Pair.of(contX, contY);\n\t\tif (cellData.getLegalMoves().contains(cont0)) {\n\t\t\tavailableMoves.put(cont0, '0');\n\t\t}\n\t\tPair<Integer, Integer> contL = Pair.of(contX - 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contL)) {\n\t\t\tavailableMoves.put(contL, 'L');\n\t\t}\n\t\tPair<Integer, Integer> contR = Pair.of(contX + 1, contY);\n\t\tif (cellData.getLegalMoves().contains(contR)) {\n\t\t\tavailableMoves.put(contR, 'R');\n\t\t}\n\t\tPair<Integer, Integer> contU = Pair.of(contX, contY - 1);\n\t\tif (cellData.getLegalMoves().contains(contU)) {\n\t\t\tavailableMoves.put(contU, 'U');\n\t\t}\n\t\tPair<Integer, Integer> contD = Pair.of(contX, contY + 1);\n\t\tif (cellData.getLegalMoves().contains(contD)) {\n\t\t\tavailableMoves.put(contD, 'D');\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> moveMap = new HashMap<>();\n\n\t\tfor (Pair<Integer, Integer> move : availableMoves.keySet()) {\n\t\t\tint moveValue = getMoveValue(cells, pos.getLeft(), pos.getRight(),\n\t\t\t\t\tmove.getLeft(), move.getRight());\n\t\t\tmoveMap.put(move, moveValue);\n\t\t}\n\n\t\tList<Pair<Integer, Integer>> allMoves = new ArrayList<>(\n\t\t\t\tmoveMap.keySet());\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(moveMap.get(o2), moveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tPair<Integer, Integer> bestMove = allMoves.get(0);\n\n\t\tif ((depth == 0) || (moveMap.get(bestMove) > 0)) {\n\t\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\t\tavailableMoves.get(bestMove));\n\t\t}\n\t\tfinal Map<Pair<Integer, Integer>, Integer> newMoveMap = new HashMap<>();\n\t\tfor (Pair<Integer, Integer> move : allMoves) {\n\t\t\tPair<Integer, Integer> newSpeed = Pair.of(\n\t\t\t\t\tmove.getLeft() - pos.getLeft(),\n\t\t\t\t\tmove.getRight() - pos.getRight());\n\t\t\tint moveValue = getBestMove(track, cells, move, newSpeed, depth - 1).value;\n\t\t\tnewMoveMap.put(move, moveValue);\n\t\t}\n\t\tCollections.sort(allMoves, new Comparator<Pair<Integer, Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n\t\t\t\t\tPair<Integer, Integer> o2) {\n\t\t\t\treturn Integer.compare(newMoveMap.get(o2), newMoveMap.get(o1));\n\t\t\t}\n\t\t});\n\t\tbestMove = allMoves.get(0);\n\t\treturn new Move(bestMove, moveMap.get(bestMove),\n\t\t\t\tavailableMoves.get(bestMove));\n\t}",
"public Move pickBestMove(Board board) {\n\t\treturn null;\n\t}",
"public void move(int moveDirection) {\n //if same or opposite direction, check if movable\n if ((direction - moveDirection) % 6 == 0) {\n this.direction = moveDirection;\n if (moveable()) {\n if (direction == 12) {\n this.setLocation(new Point(this.getX(),\n this.getY() - speed));\n }\n //move right\n if (direction == 3) {\n this.setLocation(new Point(this.getX() + speed,\n this.getY()));\n\n }\n //move down\n if (direction == 6) {\n this.setLocation(new Point(this.getX(),\n this.getY() + speed));\n }\n //move left\n if (direction == 9) {\n this.setLocation(new Point(this.getX() - speed,\n this.getY()));\n }\n\n }\n } // if it is turning, check if can turn or not. If can turn then turn and move according to the direction before turn, otherwise, just leave the monster there\n else {\n Point snapToGridPoint = GameUtility.GameUtility.snapToGrid(\n this.getLocation());\n Point gridPoint = GameUtility.GameUtility.toGridCordinate(\n this.getLocation());\n Point nextPoint = new Point(gridPoint.x, gridPoint.y);\n //if the distance is acceptable\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 2.5) {\n\n if (moveDirection == 3) {\n int x = Math.max(0, gridPoint.x + 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 6) {\n int y = Math.max(0, gridPoint.y + 1);\n nextPoint = new Point(gridPoint.x, y);\n } else if (moveDirection == 9) {\n int x = Math.min(19, gridPoint.x - 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 12) {\n int y = Math.min(19, gridPoint.y - 1);\n nextPoint = new Point(gridPoint.x, y);\n }\n // if the turn is empty, then snap the monster to the grid location\n if (!(GameManager.getGameMap().getFromMap(nextPoint) instanceof Wall) && !(GameManager.getGameMap().getFromMap(\n nextPoint) instanceof Bomb)) {\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 10) {\n this.setLocation(snapToGridPoint);\n this.direction = moveDirection;\n } else {\n if (direction == 9 || direction == 3) {\n int directionOfMovement = (snapToGridPoint.x - getX());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX() + directionOfMovement * speed,\n this.getY()));\n } else if (direction == 12 || direction == 6) {\n int directionOfMovement = (snapToGridPoint.y - getY());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX(),\n this.getY() + directionOfMovement * speed));\n }\n }\n }\n }\n }\n }",
"public Direction nextMove(Game gameState) {\n\n // Create a copy of this game state and walk in the first direction\n Game curr = new Game(gameState);\n curr.step(directions[0]);\n\n // Set the current minimum found cost and index to this first direction's cost\n int minCost = getCost(curr);\n int minIndex = 0;\n\n // Loop through the other directions\n for (int i = 1, max = directions.length; i < max; i++) {\n\n // Create a copy of this game state and walk in a new direction\n curr = new Game(gameState);\n curr.step(directions[i]);\n int thisCost = getCost(curr);\n\n // Check if this new cost is lower than previous ones and if so, update minCost and minIndex accordingly\n if (thisCost < minCost) {\n minCost = thisCost;\n minIndex = i;\n }\n }\n\n // Return the direction corresponding to this minimum cost\n return directions[minIndex];\n }",
"public void currentSquareIsGoodExecute() throws GameActionException {\n // try to move towards EC with any ordinal directions that decreases distance (NE, SE, SW, NW)\n\n if (!controller.isReady()) return;\n\n int moveTowardsDistance = Cache.CURRENT_LOCATION.distanceSquaredTo(Cache.myECLocation);\n Direction moveTowardsDirection = null;\n\n for (Direction direction : Constants.ORDINAL_DIRECTIONS) {\n if (controller.canMove(direction)) {\n MapLocation candidateLocation = Cache.CURRENT_LOCATION.add(direction);\n int candidateDistance = candidateLocation.distanceSquaredTo(Cache.myECLocation);\n boolean isGoodSquare = checkIfGoodSquare(candidateLocation);\n if (isGoodSquare && candidateDistance < moveTowardsDistance) {\n moveTowardsDistance = candidateDistance;\n moveTowardsDirection = direction;\n }\n }\n }\n\n if (moveTowardsDirection != null) {\n controller.move(moveTowardsDirection);\n }\n }",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"void guiMoveFromCurrentPostionTo(Position to){\n\n\tPosition nextPos;\n\tSystem.out.println(\"Calculating path from \" + currentPosition + \" to \" + to);\n\t\n\tNode solution = null;\n\tsolution = aStar.generalSearch(currentPosition, to);\n\tif (solution != null) {\n\n\t\tSystem.out.println(name + \": Found a path.\");\n\t\tSystem.out.print(name + \": Path = \");\n\t\tsolution.printNode();\n\t\tSystem.out.println();\n\n\t\tAStarNode aStarSolution = (AStarNode)solution;\n\n\t\tList<Position> path = aStarSolution.getPath();\n\t\tListIterator iter = path.listIterator();\n\t\tnextPos = (Position)iter.next();\n\n\t\twhile(!currentPosition.equals(to)) {\n\t\t\n\t\t\tnextPos = (Position)iter.next();\n\t\t\tSystem.out.println(name + \": Attempting to move into \" + nextPos);\n\t\t\tif(nextPos.moveInto(aStar.getGrid())) {\n\t\t\t\n\t\t\t\twaiter.move(nextPos.getX(), nextPos.getY());\n\t\t\t\tcurrentPosition.release(aStar.getGrid());\t\n\t\t\t\tcurrentPosition = nextPos;\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tSystem.out.println(name + \": \" + nextPos + \" is locked. Recalculating path...\");\n\t\t\t\tsolution = aStar.generalSearch(currentPosition, to);\n\t\t\t\tif (solution != null) {\n\n\t\t\t\t\tSystem.out.println(name + \": Found a path.\");\n\t\t\t\t\tSystem.out.print(name + \": Path = \");\n\t\t\t\t\tsolution.printNode();\n\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t\taStarSolution = (AStarNode)solution;\n\t\t\t\t\tpath = aStarSolution.getPath();\n\t\t\t\t\titer = path.listIterator();\n\t\t\t\t\tnextPos = (Position)iter.next();\n\t\t\t\t}\t\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"No path from \" + currentPosition + \" to \" + to);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tSystem.out.println(\"No path from \" + currentPosition + \" to \" + to);\n\t}\t\n }",
"@Override\n void movePhase() throws IOException, InterruptedException, IOExceptionFromController {\n boolean godPower = false;\n ArrayList<Cell> possibleMoves = findPossibleMoves(activeWorker.getPosition());\n Cell movePosition = client.chooseMovePosition(possibleMoves);\n CellView startView = new CellView(activeWorker.getPosition());\n CellView endView = new CellView(movePosition);\n CellView startView2 = null;\n CellView endView2 = null;\n // + allow pushing away opponents\n if (movePosition.hasWorker()) {\n godPower = true;\n Worker pushedWorker = movePosition.getWorker();\n Cell nextCell;\n int nextX = movePosition.getPosX() + (movePosition.getPosX() - activeWorker.getPosition().getPosX());\n int nextY = movePosition.getPosY() + (movePosition.getPosY() - activeWorker.getPosition().getPosY());\n nextCell = board.getCell(nextX, nextY);\n startView2 = endView;\n endView2 = new CellView(nextCell);\n try {\n pushedWorker.move(nextCell);\n } catch (IllegalMoveException e) {\n gameController.logError(e.getMessage());\n return;\n }\n //\n }\n try {\n activeWorker.move(movePosition);\n } catch (IllegalMoveException e) {\n gameController.logError(e.getMessage());\n }\n if (godPower) displayMove(startView, endView, startView2, endView2, card);\n else displayMove(startView, endView, null);\n }",
"public void move() {\n\t\t// tolerance of angle at which the Base starts moving\n\t\tint tolerance = 10;\n\t\tif(Math.abs(angle) < Math.abs(angleDesired)+tolerance && Math.abs(angleDesired)-tolerance < Math.abs(angle)) {\n\t\t\tdouble vX = Math.cos(Math.toRadians(this.angle + 90)) * v;\n\t\t\tdouble vY = Math.sin(Math.toRadians(this.angle + 90)) * v;\n\t\t\t\n\t\t\tthis.x += vX;\n\t\t\tthis.y += vY;\t\n\t\t\tthis.rectHitbox = new Rectangle((int)(x-rectHitbox.width/2),(int)(y-rectHitbox.height/2),rectHitbox.width,rectHitbox.height);\n\t\t}\n\t\t// curTargetPathBoardRectangle\n\t\tRectangle curTPBR = pathBoardRectangles.get(curTargetPathCellIndex).rect;\n\t\tRectangle rectSmallerBR = new Rectangle((int)curTPBR.getCenterX()-5,(int)curTPBR.getCenterY()-5,10,10);\n\t\t// updates the index when it crosses a pathCell so it counts down from pathCell to pathCell,\n\t\t// always having the next pathCell in the array as the target until the end is reached then it stops\n\t\tif(rectSmallerBR.contains(new Point((int)x,(int)y))) {\n\t\t\tif(curTargetPathCellIndex < pathBoardRectangles.size()-1) {\n\t\t\t\tcurTargetPathCellIndex++;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex-1);\n\t\t\t\ttAutoDirectionCorrection.restart();\n\t\t\t}else {\n\t\t\t\tparentGP.isMoving = false;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex);\n\t\t\t\tpathBoardRectangles.clear();\n\t\t\t\ttAutoDirectionCorrection.stop();\n\t\t\t\tStagePanel.tryCaptureGoldMine(parentGP);\n\t\t\t}\n\t\t}\n\t}",
"static void moving() throws GameActionException {\n\n\t\tcheckLumberjack();\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tif (rc.canBuildRobot(RobotType.SCOUT, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SCOUT) < Constants.MAX_COUNT_SCOUT) {\n\t\t\trc.buildRobot(RobotType.SCOUT, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SCOUT);\n\t\t\treturn;\n\t\t}\n\t\t// } else if (rc.canBuildRobot(RobotType.SOLDIER, buildDirection) &&\n\t\t// rc.readBroadcast(Channels.COUNT_SOLDIER) <\n\t\t// Constants.MAX_COUNT_SOLDIER) {\n\t\t// rc.buildRobot(RobotType.SOLDIER, buildDirection);\n\t\t// Communication.countMe(RobotType.SOLDIER);\n\t\t// return;\n\t\t// }\n\n\t}",
"public void move(Cell[][] board) {\n Cell[] nextCells = generateNeighbors(this.x, this.y);\n Cell nextCell = nextCells[rand.nextInt(4)];\n if (!this.objectFound) {\n if (nextCell != null && nextCell.isOccupied() && nextCell.occupiedBy instanceof Integer) {\n this.objectFound = true;\n this.goal = nextCell;\n } else if (nextCell != null && !nextCell.isOccupied()) {\n synchronized (board[this.x][this.y]) {\n board[this.x][this.y].resetCell();\n nextCell.occupiedBy = this;\n }\n }\n } else {\n // bfs to location\n System.out.println(\"BFS to goal\");\n }\n }",
"public MovementProgressEnum performRealMovement(Entity mover, Room room, Integer moveSpeed) {\n\t\tMovementProgressEnum result = MovementProgressEnum.IN_PROGRESS;\n\t\tfloat xOffset = 0;\n\t\tfloat yOffset = 0;\n\t\tGridPositionComponent gridPositionComponent = Mappers.gridPositionComponent.get(mover);\n\t\tVector2 absolutePos = gridPositionComponent.getAbsolutePos();\n\t\t\n\t\tMoveComponent moveCompo = Mappers.moveComponent.get(mover);\n\t\t\n\t\tif (moveSpeed == null) moveSpeed = room.hasEnemies() ? MOVE_SPEED : MOVE_SPEED_IN_CLEARED_ROOMS;\n\t\t\n\t\tif (moveCompo.currentMoveDestinationPos.x > absolutePos.x) {\n\t\t\tMappers.spriteComponent.get(mover).flipX = false;\n\t\t\tabsolutePos.x = absolutePos.x + moveSpeed.intValue();\n\t\t\t\n\t\t\tif (absolutePos.x >= moveCompo.currentMoveDestinationPos.x) {\n\t\t\t\txOffset = moveSpeed.intValue() - (absolutePos.x - moveCompo.currentMoveDestinationPos.x);\n\t\t\t\tabsolutePos.x = moveCompo.currentMoveDestinationPos.x;\n\t\t\t\tresult = performEndOfMovement(mover, moveCompo, room);\n\t\t\t} else {\n\t\t\t\tmoveCompo.arrivedOnTile = false;\n\t\t\t\txOffset = moveSpeed.intValue();\n\t\t\t}\n\t\t} else if (moveCompo.currentMoveDestinationPos.x < absolutePos.x) {\n\t\t\tMappers.spriteComponent.get(mover).flipX = true;\n\t\t\tabsolutePos.x = absolutePos.x - moveSpeed.intValue();\n\n\t\t\tif (absolutePos.x <= moveCompo.currentMoveDestinationPos.x) {\n\t\t\t\txOffset = -moveSpeed.intValue() - (absolutePos.x - moveCompo.currentMoveDestinationPos.x);\n\t\t\t\tabsolutePos.x = moveCompo.currentMoveDestinationPos.x;\n\t\t\t\tresult = performEndOfMovement(mover, moveCompo, room); \t\t\t\n\t\t\t} else {\n\t\t\t\tmoveCompo.arrivedOnTile = false;\n\t\t\t\txOffset = -moveSpeed.intValue();\n\t\t\t}\n\t\t} else if (moveCompo.currentMoveDestinationPos.y > absolutePos.y) { \n\t\t\tabsolutePos.y = absolutePos.y + moveSpeed.intValue();\n\t\t\t\n\t\t\tif (absolutePos.y >= moveCompo.currentMoveDestinationPos.y) {\n\t\t\t\tyOffset = moveSpeed.intValue() - (absolutePos.y - moveCompo.currentMoveDestinationPos.y);\n\t\t\t\tabsolutePos.y = moveCompo.currentMoveDestinationPos.y;\n\t\t\t\tresult = performEndOfMovement(mover, moveCompo, room); \t\t\t\n\t\t\t} else {\n\t\t\t\tmoveCompo.arrivedOnTile = false;\n\t\t\t\tyOffset = moveSpeed.intValue();\n\t\t\t}\n\t\t} else if (moveCompo.currentMoveDestinationPos.y < absolutePos.y) {\n\t\t\tabsolutePos.y = absolutePos.y - moveSpeed.intValue();\n\t\t\t\n\t\t\tif (absolutePos.y <= moveCompo.currentMoveDestinationPos.y) {\n\t\t\t\tyOffset = -moveSpeed.intValue() - (absolutePos.y - moveCompo.currentMoveDestinationPos.y);\n\t\t\t\tabsolutePos.y = moveCompo.currentMoveDestinationPos.y;\n\t\t\t\tresult = performEndOfMovement(mover, moveCompo, room); \t\t\t\n\t\t\t} else {\n\t\t\t\tmoveCompo.arrivedOnTile = false;\n\t\t\t\tyOffset = -moveSpeed.intValue();\n\t\t\t}\n\t\t} else {\n\t\t\t//No move to perform, target already reached\n\t\t\tresult = performEndOfMovement(mover, moveCompo, room);\n\t\t}\n\t\t\n\t\t\n\t\tif (result != null) {\n\t\t\tgridPositionComponent.absolutePos(absolutePos.x, absolutePos.y);\n\n\t\t\tfor (Component c : mover.getComponents()) {\n\t\t\t\tif (c instanceof MovableInterface) {\n\t\t\t\t\t((MovableInterface) c).performMovement(xOffset, yOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"private void updateMovement() {\n if (_movementTask == null) {\n return;\n }\n\n if (getOwner().isDead() || _followTarget != null && _followTarget.isDead()) {\n cancelMoveTask2(true);\n return;\n }\n\n // Movement is invalid! Queue a new movement and wait again!\n if (_destinationLocation == null)\n {\n if (_waypoints.peek() != null) {\n _destinationLocation = _waypoints.poll();\n\n if (getOwner().getLocation().getGameSector() != null && getOwner().getLocation().getGameSector().hasActiveNeighbours()) {\n double validatedZ = GeoService.getInstance().validateZ(_destinationLocation.getX(), _destinationLocation.getY(), _destinationLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n if (_destinationLocation != null) {\n _destinationLocation.setZ(validatedZ);\n }\n else {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n _isSectorActive = true;\n }\n else {\n _isSectorActive = false;\n }\n notifySector(true);\n }\n else\n {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n }\n\n if (_destinationLocation != null) {\n // Update current character movement, the location.\n float deltaTime = (System.currentTimeMillis() - _movementTick) / 1000.0f;\n float movementSpeed = getOwner().getActionStorage().getMoveSpeed();\n if (getOwner().getActionStorage().getAction().getActionChartActionT().getApplySpeedBuffType().isMove()) {\n movementSpeed *= (getOwner().getGameStats().getMoveSpeedRate().getMoveSpeedRate() + 1_000_000.0f) / 1_000_000.0f;\n }\n\n Location ownerLocation = getOwner().getLocation();\n\n double movementDirectionX = _destinationLocation.getX() - ownerLocation.getX();\n double movementDirectionY = _destinationLocation.getY() - ownerLocation.getY();\n double movementDirectionZ = _destinationLocation.getZ() - ownerLocation.getZ();\n\n double directionLength = Math.sqrt(Math.pow(movementDirectionX, 2) + Math.pow(movementDirectionY, 2) + Math.pow(movementDirectionZ, 2));\n movementDirectionX /= directionLength;\n movementDirectionY /= directionLength;\n movementDirectionZ /= directionLength;\n\n ownerLocation.setXYZ(\n ownerLocation.getX() + movementDirectionX * movementSpeed * deltaTime,\n ownerLocation.getY() + movementDirectionY * movementSpeed * deltaTime,\n ownerLocation.getZ() + movementDirectionZ * movementSpeed * deltaTime\n );\n\n if (_isSectorActive && !_navigationType.isAir()) {\n double validatedZ = GeoService.getInstance().validateZ(ownerLocation.getX(), ownerLocation.getY(), ownerLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n ownerLocation.setZ(validatedZ);\n }\n\n if (ownerLocation.isValid() && World.getInstance().getWorldMap().updateLocation(getOwner(), ownerLocation.getX(), ownerLocation.getY())) {\n double distanceToPoint = MathUtils.getDistance(ownerLocation, _destinationLocation) - getOwner().getTemplate().getBodySize();\n notifyVehicleMovement();\n\n if (_followTarget != null) {\n distanceToPoint -= _followTarget.getTemplate().getBodySize();\n\n if (!MathUtils.isInRange(_destinationLocation, _followTarget.getLocation(), 150)) {\n _destinationLocation.setLocation(_followTarget.getLocation());\n notifySector(true);\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n } else {\n // Check if we are near another destination, then we will\n // switch to another waypoint instead to continue our journey.\n Location nextWaypoint = _waypoints.peek();\n if (nextWaypoint != null) {\n if (distanceToPoint < 100) {\n _destinationLocation = null;\n }\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n }\n } else {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n }\n }\n _movementTick = System.currentTimeMillis();\n }",
"public PentagoMove alphabetaw(PentagoBoardState boardState){\n PentagoBoardState pbs = (PentagoBoardState) boardState.clone();\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n\n PentagoMove bestmove = legalmoves.get(0);\n PentagoMove bestopponentmove = new PentagoMove(0,0,0,0,0);\n int bestmovescore = -9999999;\n int bestwhitescore = 0;\n //ArrayList<Integer> scores = new ArrayList<Integer>();\n for(int i = 0;i<legalmoves.size()-1;i++){\n\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove next = legalmoves.get(i);\n\n newboard.processMove(next);\n\n int score = evaluate(newboard);\n //scores.add(score);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n\n if(score > 100000){\n newboard.getWinner();\n newboard.printBoard();\n System.out.println(\"FOUND A WINNER\" + score);\n return next;\n }\n\n\n PentagoMove currentopponentmove;\n ArrayList<PentagoMove> opponentlegalmoves = newboard.getAllLegalMoves();\n if (opponentlegalmoves.size()!=0){\n currentopponentmove = opponentlegalmoves.get(0);\n }\n\n int minopponentmovescore = 999999;\n int thismovescore = -9999;\n ArrayList<PentagoMove> bestopponentmoves = new ArrayList<PentagoMove>();\n PentagoMove currentbestopponentmove = new PentagoMove(0,0,0,0,0);\n\n for(int a = 0;a<opponentlegalmoves.size()-1;a++){\n\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove opponentnext = opponentlegalmoves.get(a);\n\n pbsopponent.processMove(opponentnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int opponentscore = evaluate(pbsopponent);\n\n\n\n\n\n if (minopponentmovescore>opponentscore){\n //currentopponentmove = opponentnext;\n minopponentmovescore = opponentscore;\n bestopponentmoves.add(opponentnext);\n currentbestopponentmove = opponentnext;\n }\n\n\n }\n bestopponentmove = currentbestopponentmove;\n //lvl 3\n /*\n\n int lvl3minscore =99999;\n PentagoMove currentmaxmove;\n for (int r = 0;r<bestopponentmoves.size()-1;r++) {\n PentagoBoardState pbsopponent = (PentagoBoardState) newboard.clone();\n pbsopponent.processMove(bestopponentmoves.get(r));\n\n ArrayList<PentagoMove> maxlegalmoves = pbsopponent.getAllLegalMoves();\n if (maxlegalmoves.size() != 0) {\n currentmaxmove = maxlegalmoves.get(0);\n }\n int opponentscore = evaluate(pbsopponent);\n int findminmaxmovescore = -99999;\n for (int s = 0; s < maxlegalmoves.size() - 1; s++) {\n\n PentagoBoardState maxboard = (PentagoBoardState) pbsopponent.clone();\n //System.out.println( pbs.getTurnPlayer() + \"BEFORE PROCESS\");\n PentagoMove maxnext = maxlegalmoves.get(s);\n\n maxboard.processMove(maxnext);\n //System.out.println( pbs.getTurnPlayer() + \" AFTER PROCES\");\n //pbs.printBoard();\n\n int maxnextscore = evaluate(pbsopponent);\n if (findminmaxmovescore < maxnextscore) {\n currentmaxmove = maxnext;\n findminmaxmovescore = maxnextscore;\n }\n }\n if (thismovescore<findminmaxmovescore){\n //currentopponentmove = opponentnext;\n thismovescore = findminmaxmovescore;\n }\n\n //opponentscore = maxmovescore;\n }\n\n //end experiment\n\n\n\n\n if (mycolour ==1){\n lvl3minscore =minopponentmovescore;\n }\n */\n if (minopponentmovescore>bestmovescore){//minopponentmovescore\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n\n }\n else if (minopponentmovescore == bestmovescore){\n if (score > bestwhitescore){\n System.out.println(\"max player move score: \"+score + \"Min : \" + minopponentmovescore);\n bestmovescore = minopponentmovescore;\n bestmove = next;\n bestwhitescore = score;\n }\n\n\n\n }\n\n\n }\n System.out.println(\"final max player move score: \"+ bestmovescore + \"\\n My best move: \"+bestmove.toPrettyString() + \"\\n My best move: \"+ bestopponentmove.toPrettyString());\n return bestmove;\n }",
"public Move chooseMove(PentagoBoardState boardState) {\r\n try {\r\n if (heuristicOnly) {\r\n System.out.println(\"chose from heuristic\");\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n if (mcts == null) {\r\n mcts = new MonteCarloUCT();\r\n }\r\n return mcts.nextMove(new LowMemoryBoardState(boardState));\r\n } catch (OutOfMemoryError e) {\r\n /*\r\n if the memory limit is exceeded, we *attempt* to free memory\r\n by nullifying our mcts and asking the JVM to garbage collect.\r\n Since this is a serious error, we switch the instance to use\r\n a heuristic exclusively, to prevent going over the memory limit\r\n again.\r\n */\r\n mcts = null;\r\n System.gc();\r\n this.heuristicOnly = true;\r\n return Heuristics.choseMove(new LowMemoryBoardState(boardState));\r\n }\r\n }",
"private void updateDesiredDirection() {\n\t\t/* http://www.cs.mcgill.ca/~hsafad/robotics/, accessed 28/02/16 */\n\n\t\t// First, set all seen bots' charge to -VE, all on LEDs to +VE, all off LEDs to 0.0D\n\t\tpopulateCharges();\n\t\t\n\t\t// VARIABLES\n\t\tdouble dirX = 0.0D; // relative dirX and dirY that the bot will need to face\n\t\tdouble dirY = 0.0D; \n\t\tdouble dx = 0.0D;\t// used to calculate each push/pull force, added to dirX, dirY\n\t\tdouble dy = 0.0D;\n\t\tdouble targetCharge = 0.0D;\t// charge of current target bot / led\n\t\tdouble minS = 50;\n\t\tdouble distSq = 0.0D;\t// distance^2 to bot/led\n\t\tdouble safety = 0.0D;\n\t\tdouble norm = 0.0D;\n\t\t\n\t\tfor (int i = 0; i < seenCharges.size(); i++) {\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// now, update direction depending on charges\n\t\t\t\tif (seenCharges.get(i) instanceof Bot) {\n\t\t\t\t\t\t\n\t\t\t\t\ttargetCharge = ((Bot) seenCharges.get(i)).getCharge();\n\t\t\t\t\tdistSq = sens.getDistanceTo((Bot) seenCharges.get(i));\n\t\t\t\t\tdistSq = distSq * distSq;\n\t\t\t\t\t\n\t\t\t\t\t// calculated forces\n\t\t\t\t\tdx = targetCharge * (((Bot) seenCharges.get(i)).getX() - this.getX()) / distSq;\n\t\t\t\t\tdy = targetCharge * (((Bot) seenCharges.get(i)).getY() - this.getY()) / distSq;\n\n\t\t\t\t\t// add calculated forces to overall direction so far\n\t\t\t\t\tdirX += dx;\n\t\t\t\t\tdirY += dy;\n\t\t\t\t\t\n\t\t\t\t\tsafety = distSq / ((dx*dirX + dy*dirY));\n\t\t\t\t\tif ((safety > 0) && (safety < minS)) { minS = safety; }\n\t\t\t\t\t\t\n\t\t\t\t} else if ((seenCharges.get(i) instanceof LED)) {\n\t\t\t\t\n\t\t\t\t\ttargetCharge = ((LED) seenCharges.get(i)).getCharge();\n\t\t\t\t\t\n\t\t\t\t\tif (targetCharge != 0.0D) { \n\t\t\t\t\t\t\n\t\t\t\t\t\tdistSq = sens.getDistanceTo((LED) seenCharges.get(i));\n\t\t\t\t\t\tdistSq = distSq * distSq;\n\n\t\t\t\t\t\t// calculated forces\n\t\t\t\t\t\tdx = targetCharge * (((LED) seenCharges.get(i)).getTargetX() - this.getX()) / distSq;\n\t\t\t\t\t\tdy = targetCharge * (((LED) seenCharges.get(i)).getTargetY() - this.getY()) / distSq;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// add calculated forces to overall direction so far\n\t\t\t\t\t\tdirX += dx;\n\t\t\t\t\t\tdirY += dy;\n\t\t\t\t\t\t\n\t\t\t\t\t\tsafety = distSq / ((dx*dirX + dy*dirY));\n\t\t\t\t\t\tif ((safety > 0) && (safety < minS)) { minS = safety; }\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (minS < 5) {\n\t\t\t\t\t\t\ttargetCharge *= minS/5;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\tif (minS > 50) {\n\t\t\t\t\t\t\ttargetCharge *= minS/50;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"ERROR: unknown seenCharges item \"+i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// calculate vector normal, apply to dirX, dirY\n\t\tnorm = Math.sqrt(dirX*dirX + dirY*dirY);\n\t\tdirX = dirX / norm;\n\t\tdirY = dirY / norm;\n\t\t\n\t\t// set desired direction if it calculates a number\n\t\tif (dirX == (double) dirX && dirY == (double) dirY) {\n\t\t\tthis.setDesiredDirection(sens.getDirectionTo(dirX + sens.getXPos(), dirY + sens.getYPos()));\n\t\t}\n\t}",
"public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }",
"void simulateMove(CheckersData cur_board, CheckersMove move, int player) {\n\n cur_board.makeMove(move);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. That means their could be another choice to make.\n */\n if (move.isJump()) {\n CheckersMove[] newMoves;\n newMoves = cur_board.getLegalJumpsFrom(player, move.toRow, move.toCol);\n if (newMoves != null) {\n simulateMove(cur_board, newMoves[0], player);\n }\n \t // we have to keep jumping until we can't! If there is more than one jump\n // we are just going to have to pick the first one. More logic could go here\n }\n return;\n }",
"@Override\n public State doMove(State otherState) {\n\tWaterJugState state = (WaterJugState) otherState;\n \n if(this.getMoveName().equals(\"Fill Jug X\")){\n //if water jug X has room to add to \n if(state.getJugX() < 3){\n nextState = new WaterJugState(3, state.getJugY());\n } //else water jug x is full =3\n else {\n nextState = null;\n }\n }\n else if(this.getMoveName().equals(\"Fill Jug Y\")){\n if(state.getJugY()<4){\n nextState = new WaterJugState(state.getJugX(),4);\n }\n else{\n nextState=null;\n }\n }\n else if(this.getMoveName().equals(\"Empty Jug X\")){\n if(state.getJugX()>0){\n nextState = new WaterJugState(0,state.getJugY());\n }\n else{\n nextState=null;\n }\n }\n else if(this.getMoveName().equals(\"Empty Jug Y\")){\n if(state.getJugY()>0){\n nextState = new WaterJugState(state.getJugX(),0); \n }\n else{\n nextState= null;\n }\n }\n else if(this.getMoveName().equals(\"Transfer Jug X to Jug Y\")){\n if(state.getJugX()>0 && state.getJugY()<4){\n int Ycount=state.getJugY();\n int Xcount=state.getJugX();\n int total=Ycount+Xcount;\n if(total<=4){\n nextState = new WaterJugState(0,state.getJugX()+state.getJugY()); \n }\n else if(total>4){\n nextState= new WaterJugState((state.getJugX()+state.getJugY()-4),(state.getJugX()+state.getJugY())-(state.getJugX()+state.getJugY()-4)); \n }\n }\n else{\n nextState= null;\n }\n }\n else if(this.getMoveName().equals(\"Transfer Jug Y to Jug X\")){\n if(state.getJugY()>0 && state.getJugX()<3){\n int Ycount=state.getJugY();\n int Xcount=state.getJugX();\n int total=Ycount+Xcount;\n if(total<=3){\n nextState = new WaterJugState(state.getJugX()+state.getJugY(),0); \n }\n else if(total>3){\n nextState= new WaterJugState((state.getJugX()+state.getJugY())-(state.getJugX()+state.getJugY()-3),(state.getJugX()+state.getJugY()-3)); \n }\n }\n else{\n nextState= null;\n } \n }\n \n return nextState; \n }",
"public void moveToSelected() {\n if (selectionX != -1) {\n // This short circuits but if it's not multiplayer the second statement will do nothing\n if (map.moveEntity(map.getCurrentTurnHero(), selectionX, selectionY) && multiplayerGameManager\n .hookPlayerMove(selectionX, selectionY)) {\n map.updateVisibilityArray();\n visionChanged = true;\n // See if this hero has moved on a position that meets any movement objectives\n gameState.updateMovementGoal(selectionX, selectionY);\n }\n }\n\n if (map.getCurrentTurnHero().getActionPoints() < 2) {\n nextTurn();\n }\n }",
"public int getIntelligentMove(int[] availableMoves, int[] board){\n for (int move : availableMoves){\n int[] tempBoard = board.clone();\n tempBoard[move] = 1;\n int result = checkWinner(tempBoard);\n if (result == 1){\n return move;\n }\n \n }\n \n // Check if user can win, if so then block\n \n for (int move : availableMoves){\n int[] tempBoard = board.clone();\n tempBoard[move] = -1;\n int result = checkWinner(tempBoard);\n if (result == 2){\n return move;\n }\n \n }\n \n // If middle is available, take it\n for (int move: availableMoves){\n if (move == 4){\n return move;\n }\n }\n \n // Move into a corner in a row/col that the user is in\n int cornerMove = checkCorners(board, availableMoves);\n if (cornerMove >= 0){\n \n }\n \n // Otherwise, take random move\n Random rand = new Random();\n int possibleMoves = availableMoves.length;\n int moveIndex = rand.nextInt(possibleMoves);\n \n return availableMoves[moveIndex];\n \n \n }",
"private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}",
"public Move makeSubsequentMove(){\n Move move = null;\n maxScore = 0;\n bestWord = new ArrayList<Tile>();\n for (Anchor anchor : findAnchors()){\n ArrayList<Tile> inputTiles = new ArrayList<Tile>(tray);\n inputTiles.add(anchor.anchorTile);\n findHighestScoringWord(inputTiles, new ArrayList<Tile>(), \"\", 0, anchor);\n }\n if (bestWord == null || bestWord.size() == 0){\n //should i have some kind of get new tray of tiles thing?\n return move;\n } else {\n int startCol;\n int startRow;\n if (currentAnchor.isAcross()){\n startCol = currentAnchor.col - getAnchorPosition(currentAnchor, bestWord);\n startRow = currentAnchor.row;\n } else {\n startCol = currentAnchor.col;\n startRow = currentAnchor.row - getAnchorPosition(currentAnchor, bestWord);\n }\n\n move = new Move(bestWord , startRow , startCol ,currentAnchor.isAcross(), maxScore , bot);\n //move.execute(Board?);\n }\n return move;\n }",
"private Pair decideMovement(Entity e) {\n Pair pos = gameMap.getCoordinatesFor(e.getId());\n Movable movable = mm.get(e);\n Array<Pair> reachableCells = gameMap.pathFinder.getReachableCells(pos.x, pos.y, movable);\n ImmutableBag<Integer> enemies = groupAI.getEnemies(e);\n if (enemies.size() == 0) return reachableCells.get(MathUtils.random(reachableCells.size-1));\n\n // The best enemy you are considering chasing and its score\n int targetEnemy = -1;\n float bestScore = 0f;\n\n // The current enemy you are checking out and its score\n int id;\n float score;\n\n // How far away is the enemy? How many enemies are within a small radius of it?\n int distance, count;\n\n for (int i = 0; i < enemies.size(); i++) {\n count = 1;\n Pair target = gameMap.getCoordinatesFor(enemies.get(i));\n distance = MapTools.distance(pos.x, pos.y, target.x, target.y);\n for (Pair cell : MapTools.getNeighbors(target.x, target.y, 6)) {\n id = gameMap.getEntityAt(cell.x, cell.y);\n if (!enemies.contains(id)) continue;\n count++;\n }\n\n score = groupAI.entityScores.get(enemies.get(i)) * count / (1 + distance / 5);\n if (score > bestScore) {\n bestScore = score;\n targetEnemy = enemies.get(i);\n }\n }\n\n if (targetEnemy > -1) {\n Pair target = gameMap.getCoordinatesFor(targetEnemy);\n Path path = gameMap.pathFinder.findPath(pos.x, pos.y, target.x, target.y, movable, true);\n for (int i = 0; i < path.getLength(); i++) {\n Step step = path.getStep(i);\n Pair p = new Pair(step.getX(),step.getY());\n if (reachableCells.contains(p, false)) return p;\n }\n }\n return reachableCells.get(MathUtils.random(reachableCells.size-1));\n }",
"@Override\r\n\t\tpublic Action BestMove(AI_Domain game) {\r\n\t\t\t return new Action(minimax(game,true,depth,true,null).getPath());\r\n\t\t}",
"protected Object[] getBestMove(Solution soln, Move[] moves, ObjectiveFunction objectiveFunction, TabuList tabuList, AspirationCriteria aspirationCriteria, boolean maximizing, boolean chooseFirstImprovingMove)\n/* */ {\n/* 260 */ int threads = getThreads();\n/* 261 */ if (threads == 1)\n/* */ {\n/* 263 */ return SingleThreadedTabuSearch.getBestMove(soln, moves, objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 271 */ Move bestMove = null;\n/* 272 */ double[] bestMoveVal = null;\n/* 273 */ boolean bestMoveTabu = false;\n/* 274 */ NeighborhoodHelper[] helpers = getHelpers();\n/* */ \n/* */ \n/* 277 */ int numGroups = helpers.length;\n/* 278 */ int nominalSize = moves.length / numGroups;\n/* 279 */ Move[][] moveGroups = new Move[numGroups][];\n/* */ \n/* */ \n/* 282 */ for (int i = 0; i < numGroups - 1; i++)\n/* */ {\n/* 284 */ moveGroups[i] = new Move[nominalSize];\n/* 285 */ System.arraycopy(moves, i * nominalSize, moveGroups[i], 0, nominalSize);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 291 */ moveGroups[(numGroups - 1)] = new Move[nominalSize + moves.length % numGroups];\n/* 292 */ System.arraycopy(moves, (numGroups - 1) * nominalSize, moveGroups[(numGroups - 1)], 0, moveGroups[(numGroups - 1)].length);\n/* */ \n/* */ \n/* */ \n/* 296 */ for (int i = 0; i < numGroups; i++) {\n/* 297 */ helpers[i].setWork(soln, moveGroups[i], objectiveFunction, tabuList, aspirationCriteria, maximizing, chooseFirstImprovingMove, this);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 304 */ Object[][] bestMoves = new Object[numGroups][];\n/* 305 */ for (int i = 0; i < numGroups; i++)\n/* */ {\n/* */ \n/* 308 */ Object[] contender = helpers[i].getBestMove();\n/* */ \n/* */ \n/* 311 */ Move newMove = (Move)contender[0];\n/* 312 */ double[] newObjVal = (double[])contender[1];\n/* 313 */ boolean newMoveTabu = ((Boolean)contender[2]).booleanValue();\n/* */ \n/* */ \n/* */ \n/* 317 */ if (bestMove == null)\n/* */ {\n/* 319 */ bestMove = newMove;\n/* 320 */ bestMoveVal = newObjVal;\n/* 321 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 327 */ else if (SingleThreadedTabuSearch.isFirstBetterThanSecond(newObjVal, bestMoveVal, maximizing))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 335 */ if ((bestMoveTabu) || (!newMoveTabu)) {\n/* 336 */ bestMove = newMove;\n/* 337 */ bestMoveVal = newObjVal;\n/* 338 */ bestMoveTabu = newMoveTabu;\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* 344 */ else if ((bestMoveTabu) && (newMoveTabu)) {\n/* 345 */ bestMove = newMove;\n/* 346 */ bestMoveVal = newObjVal;\n/* 347 */ bestMoveTabu = newMoveTabu;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 355 */ return new Object[] { bestMove, bestMoveVal, new Boolean(bestMoveTabu) };\n/* */ }",
"private void StepForRobot() { \r\n\r\n\t\tIterator<Robot> itr = rob.iterator();\r\n\t\twhile(itr.hasNext()) {\r\n\r\n\t\t\tRobot r = itr.next();\r\n\t\t\tFruit fDest = null;\r\n\t\t\tdouble maxSum = 0;\r\n\t\t\tnode_data v = null;\r\n\t\t\tIterator<Fruit> it = fru.iterator();\r\n\t\t\twhile(it.hasNext()) {\r\n\r\n\r\n\t\t\t\tFruit f = it.next();\r\n\t\t\t\tdouble sum =0;\r\n\t\t\t\tint dest = f.e.getSrc();\r\n\t\t\t\tList<node_data> list = Algo.shortestPath(r.src, dest);\r\n\t\t\t\tlist.add(dgraph.getNode(f.e.getDest()));\r\n\r\n\r\n\r\n\t\t\t\tfor(int i = 0;i<list.size()-1;i++)\r\n\t\t\t\t\tsum += dgraph.getEdge(list.get(i).getKey(), list.get(i+1).getKey()).getWeight();\r\n\t\t\t\tsum = f.getValue() / sum;\r\n\r\n\t\t\t\tif(sum > maxSum && !f.isDest) {\r\n\r\n\r\n\t\t\t\t\tmaxSum = sum;\r\n\t\t\t\t\tv = list.get(1); \r\n\t\t\t\t\tfDest = f;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(fDest != null) {\r\n\r\n\r\n\r\n\t\t\t\tfDest.setDest(true);\r\n\t\t\t\tgame.chooseNextEdge(r.id, v.getKey());\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"public void attemptMove(BoardPos to) {\n if (legalPos.contains(to)) {\n lastColor = !lastColor; // next turn\n // move striking piece to the end position\n board.set(to, board.get(legalPos.get(legalPos.indexOf(to)).getRouteLast()));\n // clear positions \"en route\" - pieces to strike and the initial position\n for (BoardPos step : legalPos.get(legalPos.indexOf(to)).getRoute())\n board.get(step).setEmpty();\n // promote qualifying pieces to crown\n findCrown();\n }\n\n legalPos.clear(); // next turn - no highlights\n }",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }",
"public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}",
"private Move defaultMoveInGoodPlace(PentagoBoard b0) {\n \tPentagoBoard b = (PentagoBoard)b0.clone();\n \tList<Move> moves = b.getMovesFor(getColor());\n \tfor(Move m: moves) {\n \t\tPentagoMove pM = (PentagoMove)m;\n \t\tif(havMyNeighbour(b,getColor(), pM.getPlaceX(), pM.getPlaceY()) == false)\n \t\t\tcontinue;\n \t\tif(canWinInRow(b,pM.getPlaceY(),getColor())) {\n \t\t\tb.doMove(m);\n \t\t\tif(canWinOpponentNow(b) != null) { // przeciwnik nie moze wygrac po moim ruchu\n \t\t\tb.undoMove(m);\n \t\t\tcontinue;\n \t\t}\n \t\t\treturn m;\n \t\t}\n \t\tif(canWinInColumn(b,pM.getPlaceX(),getColor())) {\n \t\t\tb.doMove(m);\n \t\t\tif(canWinOpponentNow(b) != null) { // przeciwnik nie moze wygrac po moim ruchu\n \t\t\tb.undoMove(m);\n \t\t\tcontinue;\n \t\t}\n \t\t\treturn m;\n \t\t}\n \t}\n \treturn null;\n }",
"private void navToPoint(Unit unit){\n\t\tMapLocation currentLocation = unit.location().mapLocation();\n\t\tMapLocation locationToTest;\n\t\tMapLocation targetLocation = orderStack.peek().getLocation();\n\t\tlong smallestDist=1000000000; //arbitrary large number\n\t\tlong temp;\n\t\tDirection closestDirection=null;\n\t\tint i=1;\n\t\t\n\t\tif(gc.isMoveReady(unitID)){\n\t\t\t//first find the direction that moves us closer to the target\n\t\t\tfor(Direction dir : Direction.values()){\n\t\t\t\tif (debug) System.out.println(\"this (\"+dir.name()+\") is the \"+i+\"th direction to check, should get to 9\");\n\t\t\t\tlocationToTest=currentLocation.add(dir);\n\t\t\t\t//make sure it is on the map and is passable\n\t\t\t\tif (debug){\n\t\t\t\t\tSystem.out.println(\"testing this location: \"+locationToTest);\n\t\t\t\t\tSystem.out.println(\"valid move? \"+gc.canMove(unitID, dir));\n\t\t\t\t}\n\t\t\t\tif(gc.canMove(unitID, dir)){\n\t\t\t\t\tif (debug)System.out.println(\"we can indeed move there...\");\n\t\t\t\t\t//make sure the location hasn't already been visited\n\t\t\t\t\tif(!pastLocations.contains(locationToTest)){\n\t\t\t\t\t\tif (debug)System.out.println(\"not been there recently...\");\n\t\t\t\t\t\t//at this point its a valid location to test, check its distance\n\t\t\t\t\t\ttemp = locationToTest.distanceSquaredTo(targetLocation);\n\t\t\t\t\t\tif (debug)System.out.println(\"distance :\"+temp);\n\t\t\t\t\t\tif (temp<smallestDist){\n\t\t\t\t\t\t\tif (debug)System.out.println(\"new closest!\");\n\t\t\t\t\t\t\t//new closest point, update accordingly\n\t\t\t\t\t\t\tsmallestDist=temp;\n\t\t\t\t\t\t\tclosestDirection=dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}//end of for-each loop\n\t\t}//end move ready if.\n\t\t\n\t\t//actual movement and maintenance of places recently visited\n\t\tif(closestDirection!=null){\n\t\t\tif (debug){\n\t\t\t\tSystem.out.println(\"found a closest direction, calling navInDirection()\");\n\t\t\t\tSystem.out.println(\"heading \"+closestDirection.name());\n\t\t\t}\n\t\t\tmoveInDirection(closestDirection, unit);\n\t\t\tcleanUpAfterMove(unit);\n\t\t}else{\n\t\t\t//can't get any closer\n\t\t\tif (debug) System.out.println(\"can't get closer, erasing past locations\");\n\t\t\tpastLocations.clear();\n\t\t}\n\t\t\n\t\t//have we arrived close enough?\n\t\tif(unit.location().mapLocation().distanceSquaredTo(targetLocation)<=howCloseToDestination){\n\t\t\t//atTargetLocation=true;\n\t\t\t\n\t\t\t//if order was a MOVE order, it is complete, go ahead and pop it off the stack\n\t\t\tif(orderStack.peek().getType().equals(OrderType.MOVE)){\n\t\t\t\torderStack.pop();\n\t\t\t}\n\t\t\tif (debug) System.out.println(\"Unit \"+unit.id()+\" arrived at destination.\");\n\t\t}\n\t\t\n\t\t;\n\t}",
"@Override\n\tprotected boolean moveRobot(boolean printEachStep) {\n\t\tboolean move=true;\n\t\tint incOrDecR = destRow > curRow ? 1 : -1, \n\t\t\tincOrDecC = destCol > curCol ? 1 : -1, \n\t\t\tcount = diagonalCount();\n\t\t\t// Move diagonally as close to the destination it can get to\n\t\t\tfor(int i=0; i<count; ++i) {\n\t\t\t\tif(move=grid.moveFromTo(this, curRow, curCol, \n\t\t\t\t\t\tblockedRow=curRow+incOrDecR, \n\t\t\t\t\t\tblockedCol=curCol+incOrDecC)) { \n\t\t\t\t\tcurRow+=incOrDecR; \n\t\t\t\t\tcurCol+=incOrDecC;\n\t\t\t\t\t--energyUnits;\n\t\t\t\t\tif(printEachStep)\n\t\t\t\t\t\tgrid.printGrid();\n\t\t\t\t} else {\n\t\t\t\t\treturn move; \n\t\t\t\t}\n\t\t\t}\n\t\tmove=super.moveRobot(printEachStep);\n\t\treturn move;\n\t}",
"@Override\n public void runMovingTest() {\n long now;\n int count, search;\n elapsedTime.clear();\n expandedCells.clear();\n GraphPath<Integer,DefaultWeightedEdge> agentPath=null;\n GraphPath<Integer,DefaultWeightedEdge> targetPath=null;\n //Integer agentNode, targetNode;\n List<Integer> pathToFollow = null;\n for(Point[] p : points){\n pathfinder = new LazyMovingTargetAdaptiveAStarShortestPath<Integer, DefaultWeightedEdge>(map);\n count=0;\n search=0;\n agentNode = p[0].toNode();\n targetNode = p[1].toNode();\n LinkedList<Integer> movingExpCell = new LinkedList<>();\n LinkedList<Long> movingElapsTime = new LinkedList<>();\n targetThread r = new targetThread();\n evadeThread = new Thread(r);\n evadeThread.start();\n while(!agentNode.equals(targetNode)){\n if(pathToFollow==null || !agentPath.getEndVertex().equals(targetNode)) {\n agentPath = pathfinder.getShortestPath(agentNode, targetNode, new OctileDistance());\n if(pathfinder.getElapsedTime() > Long.valueOf(1900))\n continue;\n movingElapsTime.add(pathfinder.getElapsedTime());\n movingExpCell.add(pathfinder.getNumberOfExpandedNodes());\n search++;\n }\n Integer targetNext = null;\n Integer agentNext = null;\n if(count%2==0) {\n /*targetPath = new Trailmax<Integer,DefaultWeightedEdge>(map).getShortestPath(agentNode,targetNode,null);\n pathToFollow = Graphs.getPathVertexList(targetPath);\n if (!pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n if (targetNext.equals(targetNode) && !pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n targetNode = targetNext;*/\n synchronized(moveTarget) {\n moveTarget = new Boolean(true);\n }\n\n try {\n Thread.sleep(12);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n pathToFollow=Graphs.getPathVertexList(agentPath);\n if(!pathToFollow.isEmpty()){\n int i = pathToFollow.lastIndexOf(agentNode);\n agentNext=pathToFollow.remove(i+1);\n }\n agentNode = agentNext;\n count++;\n //System.out.println(agentNode+\",\"+targetNode);\n\n }\n\n r.terminate();\n try {\n evadeThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n pathToFollow=null;\n movingElapsedTime.put(p, movingElapsTime);\n movingExpandedCells.put(p, movingExpCell);\n movesMap.put(p, count);\n searchesMap.put(p, search);\n if(verbose) {\n Long totElaps = Long.valueOf(0);\n Integer totExp = 0;\n for (Long l : movingElapsTime) totElaps += l;\n for (Integer i : movingExpCell) totExp += i;\n System.out.println(\"total elapsed: \" + totElaps + \" total expanded \" + totExp);\n }\n }\n }",
"private Direction moveToGoal() throws GameActionException {\n Direction toGoal = location.directionTo(goal);\n if (rc.canMove(toGoal)) {\n return toGoal;\n } else {\n return getHandOnWall();\n }\n }",
"public void makeBestMove(String method, double angle, String who){\n\t\tif (method==\"avoid\"){\n\t\t\tif (!blocked1){\n\t\t\t\tthis.convertToMotion(move1x,move1y, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x,move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (!blocked3){\n\t\t\t\t\t\tthis.convertToMotion(move3x,move3y, who);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif (!blocked4){\n\t\t\t\t\t\t\tthis.convertToMotion(move4x,move4y, who);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//Dependent on most dominant vector component. Else, NPC stays put.\n\t\tif (method==\"freeze\"){\n\t\t\tif (!blocked1){\n\t\t\t\tthis.convertToMotion(move1x,move1y, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (who==\"Trainer\"){\n\t\t\t\t\tif(move1x==0 && move1y==1){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceDown();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(1+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==0 && move1y==-1){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceUp();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(0+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==1 && move1y==0){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceRight();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(2+4);\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(move1x==-1 && move1y==0){\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).faceLeft();\n\t\t\t\t\t\tthis._movingTrainers.get(_thisTrainer).setNextDir(3+4);\n\t\t\t\t\t\t}\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t\n\t\t\t\t\tthis.repaint();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(method==\"vert\"){\n\t\t\tint moveVx=0;\n\t\t\tint moveVy=0;\n\t\t\tint xIndex;\n\t\t\tint yIndex;\n\t\t\t\n\t\t\tif (who==\"Trainer\"){\n\t\t\t\txIndex=this._movingTrainers.get(_thisTrainer).getXIndex();\n\t\t\t\tyIndex=this._movingTrainers.get(_thisTrainer).getYIndex();\n\t\t\t}\n\t\t\telse{\n\t\t\t\txIndex=this._xIndex;\n\t\t\t\tyIndex=this._yIndex;\n\t\t\t}\n\t\t\tboolean blockedV=false;\n\t\t\t\n\t\t\tif (angle>0 && angle<180){\n\t\t\t\tmoveVy=1;\n\t\t\t\tmoveVx=0;\n\t\t\t}\n\t\t\tif (angle>180 && angle<360){\n\t\t\t\tmoveVy=-1;\n\t\t\t\tmoveVx=0;\n\t\t\t}\n\t\t\tif (angle==0 || angle==360){\n\t\t\t\tmoveVx=-1;\n\t\t\t\tmoveVy=0;\n\t\t\t}\n\t\t\tif (angle==180){\n\t\t\t\tmoveVx=1;\n\t\t\t\tmoveVy=0;\n\t\t\t}\t\n\t\t\t\n\t\t\t\n\t\t\tif((!_gbs.getPlayer().isIgnoring() && who == \"Player\") || who == \"Trainer\"){\n\t\t\t\tif(xIndex + moveVx<=this._room.getX() && yIndex + moveVy<=this._room.getY() && xIndex + moveVx>=0 && yIndex + moveVy>=0){\n\t\t\t\t\t char nextV=this._room._roomGrid[xIndex + moveVx][yIndex + moveVy];\n\t\t\t\t\t if(nextV==NO || nextV==TRAINER || nextV == CUT || nextV==VERTICAL || nextV == RIGHT_LEDGE || nextV == LEFT_LEDGE|| ((nextV==DOOR || nextV== SEAMLESS) && !this._approachTimer.isRunning())|| (nextV== SURF && !this._movingTrainers.get(_thisTrainer).canSurf()) || ((nextV== FREE || nextV == GRASS) && this._movingTrainers.get(_thisTrainer).canSurf()) || (xIndex + moveVx ==this.xObs && yIndex+moveVy==this.yObs)){\n\t\t\t\t blockedV=true;\n\t\t\t\t }\n\t\t\t\t\t for(int j=0; j<this._movingTrainers.size();j++){\n\t\t\t\t\t\t if(xIndex + moveVx ==this._movingTrainers.get(_thisTrainer).getXIndex() && yIndex + moveVy ==this._movingTrainers.get(_thisTrainer).getYIndex()){\n\t\t\t\t\t\t\t if(this._movingTrainers.get(j).isDefeated() && this._movingTrainers.get(j).getVanishing()){}\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t blockedV=true;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tblockedV=true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!blockedV){\n\t\t\t\tthis.convertToMotion(moveVx,moveVy, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\tif(xIndex + moveVx==_xIndex && yIndex + moveVy==_yIndex){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).facePlayer(this._xIndex, this._yIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(method==\"horiz\"){\n\t\t\tint moveHx=0;\n\t\t\tint moveHy=0;\n\t\t\tint xIndex;\n\t\t\tint yIndex;\n\t\t\t\n\t\t\tif (who==\"Trainer\"){\n\t\t\txIndex=this._movingTrainers.get(_thisTrainer).getXIndex();\n\t\t\tyIndex=this._movingTrainers.get(_thisTrainer).getYIndex();\n\t\t\t}\n\t\t\telse{\n\t\t\t\txIndex=this._xIndex;\n\t\t\t\tyIndex=this._yIndex;\n\t\t\t}\n\t\t\t\n\t\t\tboolean blockedH=false;\n\n\t\t\tif (angle>90 && angle<270){\n\t\t\t\tmoveHy=0;\n\t\t\t\tmoveHx=1;\n\t\t\t}\n\t\t\tif ((angle>270 && angle <=360)||(angle>=0 && angle<90)){\n\t\t\t\tmoveHy=0;\n\t\t\t\tmoveHx=-1;\n\t\t\t}\t\n\t\t\tif (angle==90){\n\t\t\t\tmoveHx=0;\n\t\t\t\tmoveHy=1;\n\t\t\t}\n\t\t\tif (angle==270){\n\t\t\t\tmoveHx=0;\n\t\t\t\tmoveHy=-1;\n\t\t\t}\n\n\t\t\t\n\t\t\tif((!_gbs.getPlayer().isIgnoring() && who == \"Player\") || who == \"Trainer\"){\n\t\t\t\tif(xIndex + moveHx<=this._room.getX() && yIndex + moveHy<=this._room.getY() && xIndex + moveHx>=0 && yIndex + moveHy>=0){\n\t\t\t\t\t char nextH=this._room._roomGrid[xIndex + moveHx][yIndex + moveHy];\n\t\t\t\t\t if(nextH==NO || nextH==TRAINER || nextH == CUT || nextH==VERTICAL || nextH == RIGHT_LEDGE || nextH == LEFT_LEDGE|| ((nextH==DOOR || nextH== SEAMLESS) && !this._approachTimer.isRunning())|| (nextH== SURF && !this._movingTrainers.get(_thisTrainer).canSurf()) || ((nextH== FREE || nextH == GRASS) && this._movingTrainers.get(_thisTrainer).canSurf()) || (xIndex + moveHx ==this.xObs && yIndex+moveHy==this.yObs)){\n\t\t\t\t blockedH=true;\n\t\t\t\t }\n\t\t\t\t\t for(int j=0; j<this._movingTrainers.size();j++){\n\t\t\t\t\t\t if(xIndex + moveHx ==this._movingTrainers.get(_thisTrainer).getXIndex() && yIndex + moveHy ==this._movingTrainers.get(_thisTrainer).getYIndex()){\n\t\t\t\t\t\t\t if(this._movingTrainers.get(j).isDefeated() && this._movingTrainers.get(j).getVanishing()){}\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t blockedH=true;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tblockedH=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!blockedH){\n\t\t\t\tthis.convertToMotion(moveHx,moveHy, who);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(method==\"drunk\"){\n\t\t\tRandom r = new Random();\n\t\t\tint rand = r.nextInt(100);\n\t\t\t\n\t\t\t//Probabilities:\n\t\t\t//Best move = 50%\n\t\t\tint p1=50;\n\t\t\t//Second best = 15%\n\t\t\tint p2=65;\n\t\t\t//Third best = 10%\n\t\t\tint p3=75;\n\t\t\t//Worst move = 10%\n\t\t\tint p4=85;\n\t\t\t//Doesn't move at all. = 15%\n\t\t\tint p5=100;\n\t\t\t\n\t\t\tif(rand<=p1){\n\t\t\t\tif(!blocked1){\n\t\t\t\t\tthis.convertToMotion(move1x, move1y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p2){\n\t\t\t\tif(!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x, move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p3){\n\t\t\t\tif(!blocked3){\n\t\t\t\t\tthis.convertToMotion(move3x, move3y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p4){\n\t\t\t\tif(!blocked4){\n\t\t\t\t\tthis.convertToMotion(move4x, move4y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p5){\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(method==\"wander\"){\n\t\t\tRandom r = new Random();\n\t\t\tint rand = r.nextInt(100);\n\t\t\t\n\t\t\t//Probabilities:\n\t\t\t//Best move = 65%\n\t\t\tint p1=65;\n\t\t\t//Second best = 10%\n\t\t\tint p2=75;\n\t\t\t//Third best = 5%\n\t\t\tint p3=80;\n\t\t\t//Worst move = 5%\n\t\t\tint p4=85;\n\t\t\t//Doesn't move at all. = 15%\n\t\t\tint p5=100;\n\t\t\t\n\t\t\tif(rand<=p1){\n\t\t\t\tif(!blocked1){\n\t\t\t\t\tthis.convertToMotion(move1x, move1y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p2){\n\t\t\t\tif(!blocked2){\n\t\t\t\t\tthis.convertToMotion(move2x, move2y, who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p3){\n\t\t\t\tif(!blocked3){\n\t\t\t\t\tthis.convertToMotion(move3x, move3y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p4){\n\t\t\t\tif(!blocked4){\n\t\t\t\t\tthis.convertToMotion(move4x, move4y,who);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(rand<=p5){\n\t\t\t\tif(who==\"Trainer\"){\n\t\t\t\t\tthis.getMovingTrainers().get(_thisTrainer).setCanMove(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t}",
"void doMakeMove(CheckersMove move) {\n\n boardData.makeMove(move, false);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. */\n \n if (move.isJump()) {\n legalMoves = boardData.getLegalJumpsFrom(currentPlayer, move.toRow, move.toCol);\n if (legalMoves != null) {\n if (currentPlayer == CheckersData.RED) {\n console(\"RED: You must continue jumping.\");\n } else {\n console(\"BLACK: You must continue jumping.\");\n }\n selectedRow = move.toRow; // Since only one piece can be moved, select it.\n selectedCol = move.toCol;\n refreshBoard();\n return;\n }\n }\n\n /* The current player's turn is ended, so change to the other player.\n Get that player's legal moves. If the player has no legal moves,\n then the game ends. */\n if (currentPlayer == CheckersData.RED) {\n currentPlayer = CheckersData.BLACK;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"BLACK has no moves. RED wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"BLACK: Make your move. You must jump.\");\n } else {\n console(\"BLACK: Make your move.\");\n }\n } else {\n currentPlayer = CheckersData.RED;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"RED has no moves. BLACK wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"RED: Make your move. You must jump.\");\n } else {\n console(\"RED: Make your move.\");\n }\n }\n\n /* Set selectedRow = -1 to record that the player has not yet selected\n a piece to move. */\n selectedRow = -1;\n\n /* As a courtesy to the user, if all legal moves use the same piece, then\n select that piece automatically so the user won't have to click on it\n to select it. */\n if (legalMoves != null) {\n boolean sameStartSquare = true;\n for (int i = 1; i < legalMoves.length; i++) {\n if (legalMoves[i].fromRow != legalMoves[0].fromRow\n || legalMoves[i].fromCol != legalMoves[0].fromCol) {\n sameStartSquare = false;\n break;\n }\n }\n if (sameStartSquare) {\n selectedRow = legalMoves[0].fromRow;\n selectedCol = legalMoves[0].fromCol;\n }\n }\n\n /* Make sure the board is redrawn in its new state. */\n refreshBoard();\n\n }",
"public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }",
"public Coordinates choosePath(Actor robot) {\n\t\tCoordinates tempV = null;\n\t\tint tempDist = 0;\n\t\tboolean occupied = false;\n\t\ttempV = robot.getCoords();\n\t\tDirections dir = Directions.getDirection();\n\t\tswitch (dir) {\n\t\tcase RIGHT:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX() + 1, tempV.getY());\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX() - 1, tempV.getY());\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase LEFT:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX() - 1, tempV.getY());\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX() + 1, tempV.getY());\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase DOWN:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() + 1);\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() - 1);\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\tcase UP:\n\t\t\tdo {\n\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() - 1);\n\t\t\t\tif (gameWorld.isTileFree(tempV) == false) {\n\t\t\t\t\toccupied = true;\n\t\t\t\t\ttempV = new Coordinates(tempV.getX(), tempV.getY() + 1);\n\t\t\t\t} else {\n\t\t\t\t\ttempDist = robot.getCoords().dst(tempV);\n\t\t\t\t\tif (tempDist == robot.getRange() - 1 || tempDist >= robot.getEnergy()) {\n\t\t\t\t\t\toccupied = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (occupied != true);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn tempV;\n\t}",
"public final Tile selectComputerMove() {\r\n Tile tile = null;\r\n int count = 0;\r\n String tileName = null;\r\n boolean continueLoop = true;\r\n \r\n // First try to find a winning move\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"0\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0; \r\n }\r\n \r\n // If none found, try to block \"X\"\r\n for (Rail rail : rails) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"X\")) count++;\r\n }\r\n if (count == 2) {\r\n for (Tile t : rail.getTiles()) {\r\n if (t.getText().equals(\"\")) {\r\n tileName = t.getName();\r\n return t;\r\n }\r\n }\r\n }\r\n count = 0;\r\n }\r\n \r\n // If no blocking move, try to play the center which gives \"O\"\r\n // a statistical advantage\r\n if (!tiles[R2C2].isSelected()) {\r\n return tiles[R2C2];\r\n }\r\n \r\n \r\n // If center move is not available, try to find an open corner tile, \r\n // which might set up an winning combination\r\n if (!tiles[R1C1].isSelected()) {\r\n return tiles[R1C1];\r\n } else if (!tiles[R3C3].isSelected()) {\r\n return tiles[R3C3];\r\n } else if (!tiles[R3C1].isSelected()) {\r\n return tiles[R3C1];\r\n } else if (!tiles[R1C3].isSelected()) {\r\n return tiles[R1C3];\r\n }\r\n \r\n // If none found just pick an empty tile at random\r\n if(tileName == null) {\r\n int row = rand.nextInt(3) + 1;\r\n int col = rand.nextInt(3) + 1;\r\n tileName = \"r\" + row + \"c\" + col;\r\n for (Tile btn: tiles) {\r\n if (btn.getName().equals(tileName)) {\r\n tile = btn;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n return tile;\r\n }",
"public void move(){\n \n currentFloor = currentFloor + ( 1 * this.direction);\n //if we're at the bottom or top after move, flip the bit\n if(Elevator.MIN_FLOOR == currentFloor \n || currentFloor == Elevator.MAX_FLOOR)\n this.direction *= -1;\n \n if(destinedPassengers[ currentFloor ] > 0)\n elevatorStop( currentFloor, true );\n \n if(building.floor(currentFloor).passengersWaiting() > 0)\n elevatorStop(currentFloor, false);\n \n }",
"public void travelTo2(double x, double y) {\n \t\tdouble minAng;\n \t\twhile (Math.abs(x - myOdometer.getX()) > CM_ERR || Math.abs(y - myOdometer.getY()) > CM_ERR) {\n\t\t\tminAng = (Math.atan2(y - myOdometer.getY(), x - myOdometer.getX())) * (180.0 / Math.PI);\n\t\t\tif (minAng < 0)\n\t\t\t\tminAng += 360.0;\n\t\t\tthis.turnTo(minAng, true);\n\t\t\tDelay.msDelay(500); \n \t\t\tthis.setSpeeds(FAST, FAST);\n \t\t}\n \t\tthis.setSpeeds(0, 0);\n \t}",
"public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}",
"public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}",
"@Override\r\n public void makeMove(final Move move) {\n if (this.getMoves().size() >= 4) {\r\n this.resetNewDirBots();\r\n }\r\n \r\n // It is OK to now make the default move\r\n // basically add a New Point to the move queue\r\n super.makeMove(move); \r\n initDirBotMove(this.north);\r\n initDirBotMove(this.south);\r\n initDirBotMove(this.east);\r\n initDirBotMove(this.west); \r\n }",
"@Override\r\n public void makeLogicMove() {\r\n\r\n this.printThoughts();\r\n this.printMessages();\r\n \r\n // If dead, don't make a move //\r\n if (this.isDead()) {\r\n return;\r\n } \r\n \r\n if (this.getVerbose()) {\r\n System.err.println(\"Making logic move for aibotscorer - \" + this.getMoves().size());\r\n }\r\n \r\n final AIBotScoreModel scores = scoreAllDirections();\r\n if (this.getVerbose()) {\r\n System.err.println(scores);\r\n }\r\n if (this.getMoves().size() <= 3) {\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n if (this.getMoves().size() == 26) {\r\n this.addMessages(\"-5000-AI: using default move, on 30 clause\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final int randomMoveFlag = random.nextInt(16);\r\n if (randomMoveFlag == 1) {\r\n this.addMessages(\"-4000-AI: using default move, random case\");\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move lastMove = this.getLastMoveNull();\r\n if (lastMove == null) {\r\n this.addMessages(\"-3000-AI: using default move, last move null\");\r\n // Revert back to the default move\r\n super.makeLogicMove();\r\n return;\r\n }\r\n \r\n final Move north = lastMove.decy();\r\n final Move south = lastMove.incy();\r\n final Move east = lastMove.incx();\r\n final Move west = lastMove.decx();\r\n \r\n final LinkedHashMap<Double, Move> map = new LinkedHashMap<Double, Move>();\r\n map.put(new Double(scores.getScoreNorth()), north);\r\n map.put(new Double(scores.getScoreSouth()), south);\r\n map.put(new Double(scores.getScoreEast()), east);\r\n map.put(new Double(scores.getScoreWest()), west);\r\n final LinkedHashMap<Double, Move> scoreMap = BotUtilityMap.sortMapByKey(map);\r\n \r\n if (this.getVerbose()) {\r\n System.err.println(scoreMap);\r\n }\r\n \r\n final boolean validScoreCheck = this.makeLogicMoveAIValidateScores(scoreMap);\r\n if (!validScoreCheck) {\r\n // If on the valid case, the move has already been made \r\n super.makeLogicMove();\r\n return;\r\n } // End of if //\r\n }",
"public LinkedList<Pair<DirType, Location>> getMove(int curX, int curY) {\n // find the shortest path to each coin from this current position (we don't actually care about\n // coins that we don't have a path to)\n // then, find the shortest path from each of those coins to each other coin\n\n // then, we want all Hamiltonian paths (and all subpaths?) Traveling Salesman Problem\n // i.e. we care about paths for as long as the number of steps it takes to complete\n // is less than or equal to the number of turns we have remaining\n\n // convert the Location[][] we have into David and Austin's LocationsToNode\n LocationsToNode graph = new LocationsToNode(maze);\n // knownCoins are ONLY the coins we have paths to. we will calculate the\n // shortest paths later. there are repeat calculations below.\n LinkedList<Node> coins = bfsFindCoins(graph, curX, curY);\n for (Node coinFrom : coins) {\n Location coinFromLoc = graph.getLocation(coinFrom);\n LinkedList<LinkedList<Location>> pathsToOthers = new LinkedList<LinkedList<Location>>();\n for (Node coinTo : coins) {\n Location coinToLoc = graph.getLocation(coinTo);\n LinkedList<Location> path = getShortestPath(coinFrom, coinTo, graph);\n pathsToOthers.add(path);\n }\n paths.put(coinFromLoc,pathsToOthers);\n }\n\n // calculating all possible Hamiltonian paths....\n // this is A LOT of paths we're talking about\n // i.e. we want every path that visits every single coin\n // so if we know 20 coins, starting at point 1, we have 19 choices\n // for the second point, 18 for the third, and so on (this is on the order of\n // n! total paths without dynamic programming, and might be too much brute force)\n // https://en.wikipedia.org/wiki/Hamiltonian_path#Properties\n // https://en.wikipedia.org/wiki/Travelling_salesman_problem#Heuristic_and_approximation_algorithms\n // https://stackoverflow.com/questions/16555978/example-of-a-factorial-time-algorithm-o-n\n // then, we will decide which Hamiltonian is the best for the number of\n // moves we have available to us\n\n // instead, i am going to try only calculating the paths we can actually make with our current number\n // of turns because we want the most coins in the fewest turns\n\n // WE ONLY CARE ABOUT THE LONGEST (COIN) PATH WITH THE SAME NUMBER OF TURNS\n\n return new LinkedList<Pair<DirType, Location>>();\n }",
"private static double bestMoveHelper(Board board, int pliesLeft) {\n\t\tif (TRANSPOSITION_TABLE.containsKey(board.getHashCode())) {\n\t\t\treturn TRANSPOSITION_TABLE.get(board.getHashCode());\n\t\t}\n\t\tif (pliesLeft == 1 || board.isOver()) {\n\t\t\treturn recordEvaluation(board, board.evaluate());\n\t\t}\n\t\tBinaryOperator<Double> optimumFinder = board.whoseMove().isWhite() ? Math::max : Math::min;\n\t\treturn recordEvaluation(board, board.getLegalMoves().stream()\n\t\t\t\t.map(bindAtEnd(BasicDepthBasedMinimax::bestMoveHelper, pliesLeft - 1).compose(board::performMove))\n\t\t\t\t.reduce(optimumFinder).get());\n\t}",
"public void move() {\r\n\t\tif(torretas.size() == 0){\r\n\t\t\tagregarExplosiones();\r\n\t\t}\r\n\t\tif(System.currentTimeMillis() - init > delay && !control[0])\r\n\t\t\tif(puedeMoverse()){\r\n\t\t\t\tif(random){\r\n\t\t\t\t\tint select = -1;\r\n\t\t\t\t\tboolean move = false;\r\n\t\t\t\t\twhile(!move){\r\n\t\t\t\t\t\tselect = rn.nextInt(4);\r\n\t\t\t\t\t\tif(select == 0 || select == 3){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 2 && hayTorretas(x + defaultWidth/2 + 190, x+defaultWidth)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 1 && hayTorretas(x, x+defaultWidth/2 - 190)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\r\n\t\t\t\t\tint auxX = x;\r\n\t\t\t\t\tint auxY = y;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(select == 0){\r\n\t\t\t\t\t\tmoves[0] = moves[1] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = -defaultHeight;\r\n\t\t\t\t\t\tvelocidad = 4;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 1){\r\n\t\t\t\t\t\tmoves[2] = moves[3] = true;\r\n\t\t\t\t\t\tx = 800;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 2){\r\n\t\t\t\t\t\tmoves[4] = moves[5] = true;\r\n\t\t\t\t\t\tx = - defaultWidth;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 3){\r\n\t\t\t\t\t\tmoves[6] = moves[7] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = 800;\r\n\t\t\t\t\t\tvelocidad = 5;\r\n\t\t\t\t\t\treproductor.addSound(alarm, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactualizarTorretas(x-auxX, y-auxY);\r\n\t\t\t\t\t\r\n\t\t\t\t\trandom = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de arriba a abajo\r\n\t\t\t\tif(!moves[2] && !moves[3] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[0] && y + defaultHeight < 500){\r\n\t\t\t\t\ty +=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0, +velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[0] = false;\r\n\t\t\t\t\tif(y + defaultHeight > -100 && moves[1]){\r\n\t\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0, -velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmoves[1] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de derecha a izquierda\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[2] && x > 250){\t\r\n\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[2] = false;\r\n\t\t\t\t\tif(x < 900 && moves[3]){\r\n\t\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[3] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de izquierda a derecha\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[4] && x + defaultWidth < 550){\r\n\t\t\t\t\t\r\n\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[4] = false;\r\n\t\t\t\t\tif(x + defaultWidth > -100 && moves[5]){\r\n\t\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[5] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de abajo a arriba\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[4] && !moves[5])\r\n\t\t\t\tif(moves[6] && y > 250){\r\n\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0,-velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[6] = false;\r\n\t\t\t\t\tif(y < 700 && moves[7]){\r\n\t\t\t\t\t\ty+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0,velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[7] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tsetMove();\r\n\t}",
"private Move getBestMove(Node node) {\n Move bestMove = null;\n double best_val = Integer.MIN_VALUE;\n for (Node child : node.getChildren()) {\n double payOff = (child.getPlays() == 0) ? 0 : (child.getWins() / child.getPlays());\n if (child.getPlays() == 0) {\n System.out.println(\"No records for play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", board: \" + Arrays.deepToString(child.getState().getBoard()));\n } else {\n System.out.println(\"payOff: \" + payOff + \", play: \" + \"oldRow: \" + child.getState().getMove().oldRow + \", oldCol: \"\n + child.getState().getMove().oldCol + \", newRow: \" + child.getState().getMove().newRow + \", newCol: \" +\n child.getState().getMove().newCol + \", plays: \" + child.getPlays() + \", wins: \" + child.getWins());\n }\n if (payOff > best_val) {\n best_val = payOff;\n bestMove = child.getState().getMove();\n }\n }\n System.out.println();\n return bestMove;\n }",
"private static boolean moveCloserToTarget() {\n Direction f = forward;\n int startingDistance = target.distanceSquaredTo(S.rc.getLocation());\n forward = S.rc.getLocation().directionTo(target);\n forward = forward.rotateLeft();\n for (int i = 0; i < 8; i++) {\n if (target.distanceSquaredTo(S.rc.getLocation().add(forward)) < startingDistance)\n if (moveForwardStrict())\n return true;\n forward = forward.rotateRight();\n }\n forward = f;\n return false;\n }",
"private void updateBigGameBoardForNextMove(){\n changeLetterAndVisuals();\n /*\n This next step is essential to the game:\n The player just chose a position on a smallGameBoard; this position is where he will\n be able to choose on the big board. For example, if player 1 puts an x in the top-left\n corner of a small game, then player 2 should play in the top-left small game (provided\n it is not already won).\n */\n nextGamePosition = chosenButton.getButtonPosition();\n nextGame = getGame(nextGamePosition);\n //If the next game is already won, then the next player can choose anywhere\n if (checkGameWin(nextGame.getLettersOfAllButtons())){\n for (ButtonClass b : allButtons) {\n b.setAvailable(true);\n }\n for(SmallGameBoard game: games){\n if (game.getGameBoardColor() == R.color.blackTransparent){\n game.changeGameColor(R.color.black);\n }\n }\n } else {\n //If next game is not won, then the player must play on the next game board\n setAvailableButtons(nextGamePosition);\n //Sets all boards besides the next game board to half transparent\n for (SmallGameBoard game: games){\n if(game.getGameBoardColor() == R.color.black){\n game.changeGameColor(R.color.blackTransparent);\n }\n }\n nextGame.changeGameColor(R.color.black);\n }\n //For playerVsComputer, this is when the computer makes its move\n if (!activity.getPlayerVsPlayer() && !computerIsMoving){\n computerMove(activity.getDifficulty());\n computerIsMoving = false;\n }\n }",
"public int chooseElevator() {\n\t\tPair<Integer,Direction> eleLoc;\n\t\tHashMap<Integer, Pair<Integer, Direction>> mapClone = map.getElevatorsData(); //get map of up to date elevator locations\n\t\tint distance;\n\t\tint minDist=9999;\n\t\tint choice = -1;\n\t\t//iterate over all elevators in the system\n\t\tfor(int i = 1;i<=Constants.elevator;i++) {\n\t\t\teleLoc = mapClone.get(i);//get elevators current system\n\t\t\tdistance =calculateDistance(eleLoc);\n\t\t\t//System.out.println(\"Elevator \" + i + \" is \" + distance + \" away from next job\");\n\t\t\t//if distance is optimal\n\t\t\tif(distance >=0 && distance <minDist) {\n\t\t\t\tchoice = i;\n\t\t\t\tminDist = distance;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn choice;\n\t}",
"@Override\n\tpublic void updatePosition()\n\t{\n\t\tif(!fired && !pathfinding)\n\t\t{\n\t\t\tif(x == destX && y == destY)\n\t\t\t{\n\t\t\t\tfired = true;\n\t\t\t\tvehicle.msgAnimationDestinationReached();\n\t\t\t\tcurrentDirection = MovementDirection.None;\n\t\t\t\t\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\tif(cIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t{\n\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(allowedToMove || drunk)\n\t\t\t{\n\t\t\t\tswitch(currentDirection)\n\t\t\t\t{\n\t\t\t\t\tcase Right:\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Down:\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x % CityPanel.GRID_SIZE == 0 && y % CityPanel.GRID_SIZE == 0 && !moves.isEmpty())\n\t\t\t{\t\n\t\t\t\tif(allowedToMove || drunk)\n\t\t\t\t{\n\t\t\t\t\tcurrentDirection = moves.pop();\n\t\t\t\t\n\t\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\t\n\t\t\t\t\tif(current != next)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\n\t\t\t\t\tswitch(currentDirection)\n\t\t\t\t\t{\n\t\t\t\t\tcase Down:next = new Point(current.x,current.y + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:next = new Point(current.x - 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Right:next = new Point(current.x + 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:next = new Point(current.x,current.y - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:next = current;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[next.y][next.x].tryAcquire())\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(next.y).get(next.x);\n\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Pathfinder.isCrossWalk(next, city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(Gui g : guiList)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(g instanceof PassengerGui)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(nextIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextIntersection.acquireAll();\n\t\t\t\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tguiList.add(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!allowedToMove && drunk)\n\t\t{\n\t\t\tcity.addGui(new ExplosionGui(x,y));\n\t\t\tSystem.out.println(\"DESTROYING\");\n\t\t\tcity.removeGui(this);\n\t\t\tvehicle.stopThread();\n\t\t\tsetPresent(false);\n\t\t\t\n\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\n\t\t\tif(cIntersection == null)\n\t\t\t{\n\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t{\n\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t{\n\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t}\n\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}",
"public boolean moveStep() {\n\t\t// TODO: take orientation into account\n\t\t\n\t\t// Work out the distance to the destination\n\t\tDouble2D delta = destination.subtract(getPosition());\n//\t\tSystem.out.println(this.toString() + \"has \" + delta.length() + \" to go.\"); // Debug\n\t \n\t // If this is below a small value, we have arrived, return true\n\t if (delta.length() < 4) return true;\n\t \n\t // FIXME: a better model allow different speed for different vehicle class\n\t // update the speed of vehicle\n\t velocity.setTo(delta.x * 0.004, delta.y * 0.004);;\n\t \n\t // FIXME: avoidance?\n\t \n\t // FIXME: orientation?\n//\t\torientation += angularRate;\n\t // update the vehicle location\n\t\tDouble2D location = _siteState.getArea().getObjectLocation(this);\n\t\t_siteState.getArea().setObjectLocation(this, location.add(new Double2D(velocity)));\n\t \n\t\treturn false;\n\t}",
"@Override\n public IMove doMove(IGameState state) {\n\n //Find macroboard to play in\n for (int[] move : preferredMoves)\n {\n if(state.getField().getMacroboard()[move[0]][move[1]].equals(IField.AVAILABLE_FIELD))\n {\n \n Random rnd = new Random();\n //find move to play\n for (int[] selectedMove : preferredMoves)\n {\n \n int x = move[0]*3 + selectedMove[0];\n int y = move[1]*3 + selectedMove[1];\n if(!state.getField().getBoard()[x][y].contains(IField.EMPTY_FIELD)\n && !state.getField().getBoard()[x][y].contains(IField.AVAILABLE_FIELD))\n {\n try\n {\n x = x + (rnd.nextInt(selectedMove[0] % 2 + 1));\n \n \n } catch (Exception e)\n {\n \n }\n try\n {\n y = y - (rnd.nextInt(selectedMove[0] % 2 - 1));\n \n } catch (Exception e)\n {\n \n }\n try\n {\n x = x - (rnd.nextInt(selectedMove[0] % 2 -1));\n \n \n } catch (Exception e)\n {\n \n }\n \n \n \n \n }\n if(state.getField().getBoard()[x][y].equals(IField.EMPTY_FIELD))\n {\n \n return new Move(x,y);\n }\n }\n }\n }\n\n //NOTE: Something failed, just take the first available move I guess!\n return state.getField().getAvailableMoves().get(0);\n }",
"public void move()\n {\n move(WALKING_SPEED);\n }",
"@Override\n public void use(Game game) {\n\n // ChooseTarget chooseTarget=new ChooseTarget(\"Select where do you want to move\",availableSquare);\n // game.notifyObservers(chooseTarget);\n game.getController().setGoOn(false);\n\n Worker worker = (Worker) game.getTargetInUse();\n game.getController().setCanSkip(true);\n\n if (game.getTargetSelected().getSquare().getWorker() != null && ((Worker) game.getTargetInUse()).getMandatorySquare() == null) {\n game.setTargetSelected(game.getTargetSelected().getSquare().getWorker());\n Worker w1 = (Worker) game.getTargetSelected();\n w1.setMandatorySquare(((Worker) game.getTargetInUse()).getHistoryPos().get(0));\n game.getController().setCanSkip(false);\n }\n\n if (worker.getMandatorySquare() != null) {\n //game.getTargetInUse().getSquare().removeWorker();\n game.getController().setCanSkip(false);\n game.getCurrentPlayer().setHasBeenMoved(true);\n worker.getMandatorySquare().setWorker((Worker) game.getTargetInUse());\n UpdateEvent event = new UpdateEvent(game.squareToJsonArrayGenerator());\n game.notifyObservers(event);\n // worker.setMandatorySquare(null);\n return;\n }\n\n if (worker.getCanBeMoved()) {\n if (availableSquare.contains(game.getTargetSelected().getSquare())) {\n game.getTargetInUse().getSquare().removeWorker();\n game.getCurrentPlayer().setHasBeenMoved(true);\n game.getTargetSelected().getSquare().setWorker((Worker) game.getTargetInUse());\n availableSquare.clear();\n UpdateEvent event = new UpdateEvent(game.squareToJsonArrayGenerator());\n game.notifyObservers(event);\n\n if (worker.getSquare().getLevel() == 3 && worker.getHistoryPos().get(worker.getHistoryPos().size() - 2).getLevel() < 3) {\n for (Worker w : game.getCurrentPlayer().getWorkers())\n if (w.equals(worker)) {\n game.setWinner(game.getCurrentPlayer());\n TurnState state = new NotifyVictoryState();\n game.getController().setState(state);\n state.executeState(game.getController());\n break;\n }\n }\n // availableSquare.add((worker.getHistoryPos().get(0));\n } else { game.notifyCurrent(new ExceptionEvent(\"target not available\"));\n game.getController().apply(new UndoCommand(), (VirtualView) game.getCurrentView());\n }\n } else new ExceptionEvent(\"you can't move\");\n //worker.setActualPos(target.getSquare());\n // worker.getHistoryPos().add(target.getSquare());\n\n //creazione evento+gestione skippable\n //game.getCurrentPlayer().setInQue(false);\n }"
] | [
"0.6654058",
"0.6209509",
"0.6180211",
"0.6016648",
"0.5948397",
"0.59146035",
"0.588749",
"0.5872363",
"0.5870754",
"0.58668345",
"0.5847279",
"0.58174366",
"0.58158547",
"0.5814269",
"0.5789638",
"0.57889235",
"0.57823634",
"0.5776004",
"0.5769157",
"0.5759278",
"0.57535154",
"0.5736882",
"0.5731018",
"0.57111627",
"0.56874096",
"0.56858355",
"0.56732345",
"0.5658194",
"0.565736",
"0.5650199",
"0.5649221",
"0.56464684",
"0.56455874",
"0.5635021",
"0.56331587",
"0.5613311",
"0.56031847",
"0.558296",
"0.5581948",
"0.55787444",
"0.555339",
"0.55400574",
"0.55372727",
"0.5523635",
"0.5507478",
"0.5502155",
"0.54984874",
"0.5490451",
"0.5488563",
"0.5479352",
"0.54740024",
"0.54573745",
"0.5456856",
"0.5455141",
"0.5449614",
"0.5444731",
"0.54443115",
"0.54368615",
"0.54306227",
"0.54273856",
"0.5423628",
"0.5411008",
"0.5408765",
"0.54087514",
"0.5399005",
"0.539582",
"0.5395473",
"0.538338",
"0.5381848",
"0.53593177",
"0.5355288",
"0.5355275",
"0.53505766",
"0.5350182",
"0.5345846",
"0.5344058",
"0.53408307",
"0.5335809",
"0.53175163",
"0.5315796",
"0.53148353",
"0.53109",
"0.52960736",
"0.52894086",
"0.5289164",
"0.5274943",
"0.52748483",
"0.5273247",
"0.52669376",
"0.52661663",
"0.5258756",
"0.52576524",
"0.5253338",
"0.5249879",
"0.5247216",
"0.5245408",
"0.5243004",
"0.5242484",
"0.52364546",
"0.5228441"
] | 0.62955785 | 1 |
Make robot shoot in the orientation it is currently facing (if possible). Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public void shoot(Robot robot) throws UnsupportedOperationException
{
try
{
if(robot.canShoot())
{
robot.shoot();
}
}
catch(IllegalStateException exc)
{
System.out.println("A terminated robot cannot shoot.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void execute() {\n headingPID.setSetpoint(-angle); //should be -angle \n Robot.driveBase.DriveAutonomous();\n }",
"protected void execute() {\n\t//\tif (Math.abs(Robot.launcher.getDegrees()) < 5.5) {\n\t\t\tif (up)\n\t\t\t\tRobot.launcher.tiltDown();\n\t\t\telse\n\t\t\t\tRobot.launcher.tiltUp();\n//\t\t} else {\n//\t\t\tLog.warn(\"Turret rotated too much to tilt\");\n//\t\t\tend();\n//\t\t}\n\t}",
"@Override\n\tpublic void setOrientation(Vector3 orient) {\n\n\t}",
"@Override\n // float limbSwing(par1), float limbSwingAmount(par2), float ageInTicks(par3), float netHeadYaw(par4), float headPitch(par5), float scaleFactor(par6), Entity entityIn(par7):\n public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)\n {\n EntityFamiliar entityFamiliar = (EntityFamiliar)entityIn;\n\n if (entityFamiliar.isCharging())\n {\n if (entityFamiliar.getPrimaryHand() == EnumHandSide.RIGHT)\n {\n this.armRight.rotateAngleX = 3.7699115F;\n }\n else\n {\n this.armLeft.rotateAngleX = 3.7699115F;\n }\n }\n \n // RightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;\n this.armRight.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 2.0F * limbSwingAmount * 0.5F;\n\n // LeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;\n this.armLeft.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F;\n \n // RightArm.rotateAngleZ = 0.0F;\n this.armRight.rotateAngleZ = 0.0F;\n \n // LeftArm.rotateAngleZ = 0.0F;\n this.armLeft.rotateAngleZ = 0.0F;\n \n // Wings (from EntityVex):\n this.wingRight.rotationPointZ = 2.0F;\n this.wingLeft.rotationPointZ = 2.0F;\n this.wingRight.rotationPointY = 1.0F;\n this.wingLeft.rotationPointY = 1.0F;\n this.wingRight.rotateAngleY = 0.47123894F + MathHelper.cos(ageInTicks * 0.8F) * (float)Math.PI * 0.05F;\n this.wingLeft.rotateAngleY = -this.wingRight.rotateAngleY;\n this.wingLeft.rotateAngleZ = -0.47123894F;\n this.wingLeft.rotateAngleX = 0.47123894F;\n this.wingRight.rotateAngleX = 0.47123894F;\n this.wingRight.rotateAngleZ = 0.47123894F;\n\n // Head.rotateAngleY = par5 (headPitch) / (180F / (float)Math.PI);\n this.head.rotateAngleX = headPitch / (180F / (float)Math.PI);\n\n // Head.rotateAngleY = par4 (netHeadYaw) / (180F / (float)Math.PI);\n this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI);\n\n // Tentacles (using spider model):\n //float f = ((float)Math.PI / 4F);\n this.tentacleFrontLeft.rotateAngleZ = -((float)Math.PI / 4F);\n this.tentacleFrontRight.rotateAngleZ = ((float)Math.PI / 4F);\n this.tentacleFrontMid.rotateAngleZ = -0.58119464F;\n this.tentacleBackMid.rotateAngleZ = 0.58119464F;\n this.tentacleBackLeft.rotateAngleZ = -((float)Math.PI / 4F);\n this.tentacleBackRight.rotateAngleZ = ((float)Math.PI / 4F);\n //float f1 = -0.0F;\n //float f2 = 0.3926991F;\n this.tentacleFrontLeft.rotateAngleY = ((float)Math.PI / 4F);\n this.tentacleFrontRight.rotateAngleY = -((float)Math.PI / 4F);\n this.tentacleFrontMid.rotateAngleY = 0.3926991F;\n this.tentacleBackMid.rotateAngleY = -0.3926991F;\n this.tentacleBackLeft.rotateAngleY = -((float)Math.PI / 4F);\n this.tentacleBackRight.rotateAngleY = ((float)Math.PI / 4F);\n float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount;\n float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * limbSwingAmount;\n float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;\n float f6 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount;\n float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float)Math.PI) * 0.4F) * limbSwingAmount;\n float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;\n this.tentacleFrontLeft.rotateAngleY += f3;\n this.tentacleFrontRight.rotateAngleY += -f3;\n this.tentacleFrontMid.rotateAngleY += f4;\n this.tentacleBackMid.rotateAngleY += -f4;\n this.tentacleBackLeft.rotateAngleY += f5;\n this.tentacleBackRight.rotateAngleY += -f5;\n this.tentacleFrontLeft.rotateAngleZ += f6;\n this.tentacleFrontRight.rotateAngleZ += -f6;\n this.tentacleFrontMid.rotateAngleZ += f7;\n this.tentacleBackMid.rotateAngleZ += -f7;\n this.tentacleBackLeft.rotateAngleZ += f8;\n this.tentacleBackRight.rotateAngleZ += -f8;\n }",
"public void rotate180 (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(180f).setDuration(50); //turn toy robot AROUND (180')\n\n rotateRight += 2; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }",
"public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }",
"public void execute() {\n RobotContainer.drive.turnToAngle(this.angle, turnSpeed);\n }",
"@Override\n protected void execute() {\n Robot.getEndEffectorAngle().goToPos(holdPos);\n }",
"@Override\npublic void setAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){\n}",
"public void shoot() {\n _shooterMotor1.set(_targetRPM);\n }",
"@Override\n public void execute() {\n mShooter.setAngle(mServoAngle);\n }",
"public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}",
"public void rotateRight (View view){\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(90f).setDuration(50); //turn toy robot LEFT\n\n rotateRight++; //counter to determine orientation\n System.out.println(\"rotateRight \" + rotateRight);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight));\n\n } else errorMessage(\"Please place toy robot\");\n }",
"protected void execute() {\n timeRunning = timeSinceInitialized();\n if (!Robot.lifter2.getunder15()) {\n Robot.shooter.set(190);\n System.out.println(\"In position: \"+inPosition.get());\n } else {\n System.out.println(\"under angle don't shoot!\");\n }\n \n }",
"public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }",
"public void teleopArcadeDrive(){\r\n\t\tmyRobot.arcadeDrive(-m_controls.driver_Y_Axis(), -m_controls.driver_X_Axis());\r\n\t}",
"private void robotMovement()\n {\n\n /* If it will be rotating, don't drive */\n if (!joystick.rightShouldMove()) {\n\n if (joystick.leftShouldMove()) {\n\n /* Derive movement values from gamepad */\n Joystick.Direction direction = joystick.getLeftDirection();\n double power = joystick.getLeftPower();\n\n int[] modifier;\n\n if (direction == Joystick.Direction.UP) {\n modifier = modUP;\n } else if (direction == Joystick.Direction.DOWN) {\n modifier = modDOWN;\n } else if (direction == Joystick.Direction.RIGHT) {\n modifier = modRIGHT;\n } else {\n modifier = modLEFT;\n }\n\n motorLeftFront.setPower(modifier[0] * ((power * 0.8) + (0.01 * frontInc)));\n motorRightFront.setPower(modifier[1] * ((power * 0.8) + (0.01 * frontInc)));\n motorLeftBack.setPower(modifier[2] * ((power * 0.8) + (0.01 * backInc)));\n motorRightBack.setPower(modifier[3] * ((power * 0.8) + (0.01 * backInc)));\n\n } else {\n setMotorPowerToZero();\n }\n\n } else {\n\n /* Rotation modifiers for sides of bot */\n Joystick.Direction d = joystick.getRightDirection();\n double power = joystick.getRightPower();\n boolean left = d == Joystick.Direction.LEFT;\n double sideMod = left ? 1 : -1;\n\n /* Set motor power */\n motorLeftFront.setPower(sideMod * power);\n motorLeftBack.setPower(sideMod * power);\n motorRightFront.setPower(sideMod * power);\n motorRightBack.setPower(sideMod * power);\n\n }\n\n }",
"public void shoot() {\n\t\tgetWeapon().triggerMain();\n\t\tsetShooting(true);\n\t}",
"public void target()\n {\n if(noRotation == false)\n {\n if(timer % 3 == 0)\n {\n int currentRotation = getRotation();\n turnTowards(xMouse, yMouse);\n int newRotation = getRotation();\n if (Math.abs(currentRotation-newRotation) > 180)\n {\n if (currentRotation < 180) currentRotation += 360;\n else newRotation += 360;\n }\n if(currentRotation != newRotation)\n { \n setRotation(currentRotation+direction()*8);\n }\n }\n }\n }",
"@Override\n public void giveCommands(Robot robot) {\n super.giveCommands(robot);\n\n arcadeDrive(robot.getDrivetrain());\n\n }",
"protected void shootAtBeginAutonomous() {\r\n double secondWheel = 1;\r\n double firstWheel = SpinWheels.FIRST_WHEEL_RATIO * 1;\r\n Robot.shooter.setShootingMotors(firstWheel, secondWheel);\r\n if (machineState == 4) {\r\n Robot.shooter.setShootingMotors(0, 0);\r\n machineState++;\r\n } else if (machineState == 0 || machineState == 1 || machineState == 2) {\r\n if (waitForPistonRetract()) {\r\n Robot.storageBox.extendFiringPiston();\r\n } else if (waitForPistonExtend()) {\r\n Robot.storageBox.retractFiringPiston();\r\n machineState++;\r\n }\r\n }\r\n }",
"public void TurnCommand() {\n\n requires(Robot.driveSubsystem);\n\n }",
"void turn(float degrees) {\n _rotVector.rotate(radians(degrees));\n }",
"@Override\n public void initialize() {\n setPoint = (((targetAngle + driveSubsystem.getHeading() + 180) % 360) - 180);\n }",
"private void Turn(double degrees) {\n\n // Update the target angle\n TargetAngle = NormalizeAngle(TargetAngle + degrees);\n\n // Loops until the robot has reached the target\n while (opModeIsActive()) {\n\n // Calculate how many degrees the robot still has to turn\n double DegreesRemaining = NormalizeAngle(TargetAngle - GetRobotAngle());\n\n // Calculate the turn speed\n double TurnSpeed;\n if (DegreesRemaining < 180)\n TurnSpeed = -MinTurnSpeed + -((MaxTurnSpeed - MinTurnSpeed) * Math.min(DegreesRemaining / AccelAngle, 1));\n else\n TurnSpeed = MinTurnSpeed + ((MaxTurnSpeed - MinTurnSpeed) * Math.min((360 - DegreesRemaining) / AccelAngle, 1));\n\n // Apply the new motor speeds\n backleft.setPower(TurnSpeed);\n backright.setPower(TurnSpeed);\n frontleft.setPower(TurnSpeed);\n frontright.setPower(TurnSpeed);\n\n if(Math.abs(DegreesRemaining) < 1)\n break;\n }\n\n // Stop the motors\n frontright.setPower(0);\n frontleft.setPower(0);\n backright.setPower(0);\n backleft.setPower(0);\n }",
"public void implement(){\n this.rb.moveForward(1);\n \n \n if(this.rb.canPickThing()){\n this.rb.pickThing();\n }\n\n //turn the rb 90 degree to the south\n this.rb.turnLeft();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the east\n this.rb.turnRight();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the north\n this.rb.turnLeft();\n\n //move the navigator\n this.rb.moveForward(2);\n\n //turn Right the robot\n this.rb.turnRight();\n\n //stop at the starting position per move()\n this.rb.moveForward(1); \n \n this.rb.putThing();\n \n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n \n //turn the navigator 90 degree to the west\n this.rb.turnRight();\n \n this.rb.moveForward(1);\n \n this.rb.turnLeft();\n \n this.rb.moveForward(1);\n \n this.rb.turnRight();\n \n this.rb.moveForward(2);\n \n this.rb.turnLeft();\n }",
"protected void rotateTo(double target) {\n robot.rightFront.setDirection(REVERSE);\n robot.rightBack.setDirection(REVERSE);\n\n while (opModeIsActive() && robot.rightFront.getDirection() != REVERSE) {\n idle();\n }\n\n if (target < 0) target += 360;\n\n double heading = get360Heading();\n while (opModeIsActive() && !withinRange(heading, target)) {\n // Run Dubberke-Richards logic\n if (Math.abs(heading - target) <= 180) {\n if (heading-target >= 0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n } else { // |heading-target| > 180\n if (heading-target<0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n }\n\n // Update heading for next loop\n heading = get360Heading();\n\n telemetry.addData(\"Heading\", heading);\n telemetry.update();\n }\n\n halt();\n }",
"public static void waltz() {\n //test code written by bokun: self rotation\n leftMotor.setSpeed(ROTATE_SPEED);\n rightMotor.setSpeed(ROTATE_SPEED);\n leftMotor.forward();\n rightMotor.backward();\n }",
"@Override\n\tprotected void execute() {\n\t\tdouble speed = Robot.oi.getSpeed();\n\t\tdouble turn = Robot.oi.getTurn();\n\t\tdouble leftSpeed;\n\t\tdouble rightSpeed;\n\n\t\tif (Robot.oi.getGyroReset()) {\n\t\t\tRobot.chassisSubsystem.resetGyroHeading();\n\t\t}\n\n\t\tif (Robot.oi.getGyroCalibrate()) {\n\t\t\tRobot.chassisSubsystem.calibrateGyro();\n\t\t}\n\n\t\t/**\n\t\t * If the chassisSubsystem says that we should be in high gear, switch\n\t\t * to high gear, otherwise, switch to low gear.\n\t\t */\n\t\tif (Robot.oi.getGearShiftButton() >= 0.5) {\n\t\t\tRobot.chassisSubsystem.setGear(Gear.HIGH);\n\t\t} else {\n\t\t\tRobot.chassisSubsystem.setGear(Gear.LOW);\n\t\t}\n\n\t\t\n\n\t\t/**\n\t\t * If the user is not turning, then follow the gyro using the GoStraight\n\t\t * command.\n\t\t */\n\t\t/*\n\t\t * if (Math.abs(turn) < 0.03) { Scheduler.getInstance().add(new\n\t\t * GoStraightCommand(Robot.chassisSubsystem.getCurrentAngle())); return;\n\t\t * }\n\t\t */\n\n\t\t/*\n\t\t * double defaultValue = 0; Robot.chassisSubsystem.resetGyroHeading();\n\t\t * double angle = Robot.oi.table.getNumber(\"angle\", defaultValue);\n\t\t * System.out.println(angle);\n\t\t * \n\t\t * if(Robot.oi.getAlignShotButton()) { Scheduler.getInstance().add(new\n\t\t * PivotToAngleCommand(angle)); return; }\n\t\t */\n\n\n\t\tdouble targetCenterX = 0;\n\t\tif (Robot.oi.getAutoAlignShotButton() && targetCenterX != RobotMap.NO_VISION_TARGET) {\n\t\t\tScheduler.getInstance().add(new AlignAndShootHighShotCommand(MatchPeriod.TELEOP));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (Robot.oi.getManualAlignShotButton()) {\n\t\t\tScheduler.getInstance().add(new AlignAndShootHighShotCommand(MatchPeriod.TELEOP));\n\t\t\treturn;\n\t\t}\n\n\t\t// Use the driver input to set the speed and direction.\n\t\tif (Math.abs(speed) < 0.03) {\n\t\t\tleftSpeed = turn / 2.0;\n\t\t\trightSpeed = -turn / 2.0;\n\t\t} else {\n\t\t\tleftSpeed = (turn < 0.0) ? speed * (1.0 + turn) : speed;\n\t\t\trightSpeed = (turn < 0.0) ? speed : speed * (1.0 - turn);\n\t\t}\n\n\t\tRobot.chassisSubsystem.setSpeed(leftSpeed, rightSpeed);\n\t}",
"public void VuforiaOrientator() {\n }",
"public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }",
"@Override\n public void setTurtleAngle(double angle) {\n screenCreator.updateCommandQueue(\"Angles\", Collections.singletonList(angle));\n }",
"public void autonomous() {\n /*myRobot.setSafetyEnabled(false);\n myRobot.drive(-0.5, 0.0);\t// drive forwards half speed\n Timer.delay(2.0);\t\t// for 2 seconds\n myRobot.drive(0.0, 0.0);\t// stop robot\n */\n \t/*gyro.reset();\n \twhile(isAutonomous()){\n \t\tdouble angle = gyro.getAngle();\n \tmyRobot.drive(0, -angle * Kp);\t\n \tTimer.delay(.004);\n \t}\n \tmyRobot.drive(0.0, 0.0);\n \t*/\n }",
"public void applyStrategy(){\n\t\tfloat dx, dy;\n\t\t\n\t\tdx = targetCar.getX() - myCar.getX();\n\t\tdy = targetCar.getY() - myCar.getY();\n\t\t\n\t\t// awesome, atan2 handles all the hard parts of arctan calculations\n\t\tint angle = (int)Math.toDegrees( Math.atan2(dx, dy) );\n\t\tmyCar.setHeading( angle );\n\t}",
"public void setOrientation(Direction orientation);",
"protected void execute() {\n Robot.imu.setUniversalHeading(heading);\n }",
"@Override public void run()\n {\n robot.angles = robot.imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n robot.gravity = robot.imu.getGravity();\n }",
"@Override\n public void rotate(Command command) {\n switch (command){\n case UP:\n setOrientation(Orientation.UP);\n break;\n\n case DOWN:\n setOrientation(Orientation.DOWN);\n break;\n\n case LEFT:\n setOrientation(Orientation.LEFT);\n break;\n\n case RIGHT:\n setOrientation(Orientation.RIGHT);\n break;\n\n default:\n }\n }",
"public void turnRight()\r\n\t{\r\n\t\theading += 2; //JW\r\n\t\t//Following the camera\r\n\t\t//heading += Math.sin(Math.toRadians(15)); \r\n\t\t//heading += Math.cos(Math.toRadians(15));\r\n\t}",
"@Override\n protected void execute() {\n /*\n * Keep the angle read from the gyro constantly converted as long as currentAngle is \n * referenced compared to always reading raw values from the getGyroYaw.\n */\n if (Robot.drivetrain.getGyroYaw() < 0.0f) {\n currentAngle = Robot.drivetrain.getGyroYaw() + 360.0f;\n } else {\n currentAngle = Robot.drivetrain.getGyroYaw();\n\n }\n if (!clockwise) {\n /* Counterclockwise turning */\n Robot.drivetrain.arcadeDrive(speedY, -speedZ);\n } else if (clockwise) {\n /* Clockwise turning */\n Robot.drivetrain.arcadeDrive(speedY, speedZ);\n }\n }",
"@Override\n protected void initialize() {\n Robot.tilt.setSpeed(speed);\n }",
"public void rotateLeft (View view){ //onClick for LEFT Button\n\n if (toyRobotIsActive) {\n\n robot.animate().rotationBy(-90f).setDuration(50); //turn toy robot LEFT\n\n rotateLeft--; //counter to determine orientation\n System.out.println(\"rotateLeft \" + rotateLeft);\n System.out.println(\"rotateLeft + rotateRight = \"\n + orientation(rotateLeft, rotateRight)); //chk params in Logs\n\n } else errorMessage(\"Please place toy robot\");\n }",
"@Override\n\tprotected void execute() {\n\t\tdrive.arcadeDrive(Robot.oi.getDriveJoystickForward(), Robot.oi.getDriveJoystickLateral());\n\t}",
"public void setRotation(){\n\t\t\tfb5.accStop();\n\t\t\twt.turning = true;\n\t\t\tif(state == BotMove.RIGHT_15){\n\t\t\t\tfb5.turnRightBy(6);\n\t\t\t\tangle = (angle+360-20)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.RIGHT_10){\n\t\t\t\tfb5.turnRightBy(3);\n\t\t\t\tangle = (angle+360-10)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.LEFT_5){\n\t\t\t\tfb5.turnLeftBy(2);\n\t\t\t\tangle = (angle+360+5)%360;\n\t\t\t}\n\t\t}",
"public void randomWalk(){\r\n int newAngle = (int) ( (double) Math.random() * 360) ;\r\n\r\n super.xVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n super.yVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n }",
"@Override\n protected void execute() \n {\n move(Robot.oi.mechJoystick);\n }",
"protected void execute() \n {\n \tRobot.ballManipSubsystem.setTopRollerToShootingSpeed();\n }",
"@Override\npublic void teleopPeriodic() {\nm_robotDrive.arcadeDrive(m_stick.getRawAxis(5)* (-0.5), m_stick.getRawAxis(4)*0.5);\n}",
"public abstract boolean facingRight();",
"Robot getRobot(Position pos);",
"public void setShootRight(boolean TorF) {\n shootRight = TorF;\n }",
"void shoot();",
"public abstract void interagir(Robot robot);",
"public java.lang.Object getRobotOrientation() throws CallError, InterruptedException {\n return (java.lang.Object)service.call(\"getRobotOrientation\").get();\n }",
"public TurnToDefaultAngle() {\n super(0, RobotContainer.m_robotDrive);\n }",
"public void strafe(double speed, boolean angle, double inches, double timeout){\n int newLeftTarget;\n int newRightTarget;\n int newLeftBottomTarget;\n int newRightBottomTarget;\n if (opModeIsActive()) {\n if (angle) {\n //strafe right\n // Determine new target position, and pass to motor controller\n newLeftTarget = robot.leftFrontMotor.getCurrentPosition() + (int)(Math.abs(inches) * COUNTS_PER_INCH);\n newLeftBottomTarget = robot.leftBackMotor.getCurrentPosition() + (int)(-Math.abs(inches) * COUNTS_PER_INCH);\n newRightTarget = robot.rightFrontMotor.getCurrentPosition() + (int)(-Math.abs(inches) * COUNTS_PER_INCH);\n newRightBottomTarget = robot.rightBackMotor.getCurrentPosition() + (int)(Math.abs(inches) * COUNTS_PER_INCH);\n robot.leftFrontMotor.setTargetPosition(newLeftTarget);\n robot.leftBackMotor.setTargetPosition(newLeftBottomTarget);\n robot.rightFrontMotor.setTargetPosition(newRightTarget);\n robot.rightBackMotor.setTargetPosition(newRightBottomTarget);\n\n // Turn On RUN_TO_POSITION\n robot.leftFrontMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.leftBackMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.rightFrontMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.rightBackMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // reset the timeout time and start motion.\n runtime.reset();\n robot.leftFrontMotor.setPower(Math.abs(speed));\n robot.rightFrontMotor.setPower(Math.abs(speed));\n robot.leftBackMotor.setPower(Math.abs(speed));\n robot.rightBackMotor.setPower(Math.abs(speed));\n\n // keep looping while we are still active, and there is time left, and both motors are running.\n // Note: We use (isBusy() && isBusy()) in the loop test, which means that when EITHER motor hits\n // its target position, the motion will stop. This is \"safer\" in the event that the robot will\n // always end the motion as soon as possible.\n // However, if you require that BOTH motors have finished their moves before the robot continues\n // onto the next step, use (isBusy() || isBusy()) in the loop test.\n\n while (opModeIsActive() &&\n (runtime.seconds() < timeout) &&\n (robot.leftFrontMotor.isBusy() && robot.rightFrontMotor.isBusy())) {\n\n // Display it for the driver.\n telemetry.addData(\"Path1\", \"Running to %7d :%7d\", newLeftTarget, newRightTarget);\n telemetry.addData(\"Path2\", \"Running at %7d :%7d\",\n robot.leftFrontMotor.getCurrentPosition(),\n robot.rightFrontMotor.getCurrentPosition(), robot.leftBackMotor.getCurrentPosition(), robot.rightBackMotor.getCurrentPosition());\n telemetry.update();\n }\n // Stop all motion;\n robot.rightFrontMotor.setPower(0);\n robot.rightBackMotor.setPower(0);\n robot.leftFrontMotor.setPower(0);\n robot.leftBackMotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n robot.rightFrontMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.rightBackMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.leftFrontMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.leftBackMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n } else if (!angle) {\n //strafe left\n // Determine new target position, and pass to motor controller\n newLeftTarget = robot.leftFrontMotor.getCurrentPosition() + (int)(-Math.abs(inches) * COUNTS_PER_INCH);\n newLeftBottomTarget = robot.leftBackMotor.getCurrentPosition() + (int)(Math.abs(inches) * COUNTS_PER_INCH);\n newRightTarget = robot.rightFrontMotor.getCurrentPosition() + (int)(Math.abs(inches) * COUNTS_PER_INCH);\n newRightBottomTarget = robot.rightBackMotor.getCurrentPosition() + (int)(-Math.abs(inches) * COUNTS_PER_INCH);\n robot.leftFrontMotor.setTargetPosition(newLeftTarget);\n robot.leftBackMotor.setTargetPosition(newLeftBottomTarget);\n robot.rightFrontMotor.setTargetPosition(newRightTarget);\n robot.rightBackMotor.setTargetPosition(newRightBottomTarget);\n\n // Turn On RUN_TO_POSITION\n robot.leftFrontMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.leftBackMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.rightFrontMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.rightBackMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // reset the timeout time and start motion.\n runtime.reset();\n robot.leftFrontMotor.setPower(Math.abs(speed));\n robot.rightFrontMotor.setPower(Math.abs(speed));\n robot.leftBackMotor.setPower(Math.abs(speed));\n robot.rightBackMotor.setPower(Math.abs(speed));\n\n // keep looping while we are still active, and there is time left, and both motors are running.\n // Note: We use (isBusy() && isBusy()) in the loop test, which means that when EITHER motor hits\n // its target position, the motion will stop. This is \"safer\" in the event that the robot will\n // always end the motion as soon as possible.\n // However, if you require that BOTH motors have finished their moves before the robot continues\n // onto the next step, use (isBusy() || isBusy()) in the loop test.\n\n while (opModeIsActive() &&\n (runtime.seconds() < timeout) &&\n (robot.leftFrontMotor.isBusy() && robot.rightFrontMotor.isBusy())) {\n\n // Display it for the driver.\n telemetry.addData(\"Path1\", \"Running to %7d :%7d\", newLeftTarget, newRightTarget);\n telemetry.addData(\"Path2\", \"Running at %7d :%7d\",\n robot.leftFrontMotor.getCurrentPosition(),\n robot.rightFrontMotor.getCurrentPosition(), robot.leftBackMotor.getCurrentPosition(), robot.rightBackMotor.getCurrentPosition());\n telemetry.update();\n }\n // Stop all motion;\n robot.rightFrontMotor.setPower(0);\n robot.rightBackMotor.setPower(0);\n robot.leftFrontMotor.setPower(0);\n robot.leftBackMotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n robot.rightFrontMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.rightBackMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.leftFrontMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.leftBackMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }\n }\n }",
"private void turnRight() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.SOUTH;\n break;\n case WEST:\n direction = Position.Direction.NORTH;\n break;\n case NORTH:\n direction = Position.Direction.EAST;\n break;\n case SOUTH:\n direction = Position.Direction.WEST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }",
"@SuppressWarnings(\"incomplete-switch\")\n\tprivate void rotatingBehavior() {\n\t\tif (remainingSteps > 0) {\n\t\t\tremainingSteps--;\n\t\t} else {\n\t\t\tswitch (facing) {\n\t\t\t\tcase LEFT:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UP:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase RIGHT:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOWN:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tremainingSteps = STEP_SIZE;\n\t\t}\n\t}",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public AutoAim(TurretSubsystem turret, ShooterSubsystem shooter, LED led) {\n // Add your commands in the super() call, e.g.\n // super(new FooCommand(), new BarCommand());\n super(\n // aim towards thing\n new RunCommand(\n () -> {\n turret.turretAuto();\n //System.out.println(\"aiming with turret\");\n },\n turret\n ),\n\n new ShooterSetSpeedPIDF(shooter, true),\n\n new RunCommand(() -> {\n led.turnOnLED();\n }) {\n @Override\n public void end(boolean interrupted) {\n led.turnOffLED();\n }\n }\n \n // start shooter motor\n );\n this.turret = turret;\n this.shooter = shooter;\n this.led = led;\n }",
"public void setShooting(boolean TorF) {\n this.shooting = TorF;\n }",
"public interface Rotateable extends InteractiveEntity {\n Palstance getPalstance();\n double getIntetia();\n}",
"@Test\n public void rotateCommand() {\n ICommand cmd = Commands.getComand(\"rotate\");\n Robot robot = new Robot(0, 0);\n Vector2Di dir = robot.getDir();\n int rot_amount = 90;\n double orig_angle = dir.angle();\n cmd.exec(rot_amount, robot, null);\n assertEquals(orig_angle + rot_amount, dir.angle(), 0.1);\n }",
"public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }",
"@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}",
"public abstract void interagir (Robot robot);",
"@Override\r\n\tpublic int getOrientation(Robot robot)\r\n\t{\r\n\t\treturn robot.getOrientation().ordinal();\r\n\t}",
"public void RotateRight(double speed, int distance) {\n // Reset Encoders\n robot2.DriveRightFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n sleep(500);\n\n robot2.DriveRightFront.setTargetPosition(0);\n robot2.DriveRightRear.setTargetPosition(0);\n robot2.DriveLeftFront.setTargetPosition(0);\n robot2.DriveLeftRear.setTargetPosition(0);\n\n // Set RUN_TO_POSITION\n\n robot2.DriveRightFront.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // Set Motor Power to 0\n robot2.DriveRightFront.setPower(0);\n robot2.DriveRightRear.setPower(0);\n robot2.DriveLeftFront.setPower(0);\n robot2.DriveLeftRear.setPower(0);\n\n\n double InchesMoving = (distance * COUNTS_PER_INCH);\n\n // Set Target to RotateRight\n robot2.DriveRightFront.setTargetPosition((int) -InchesMoving);\n robot2.DriveRightRear.setTargetPosition((int) -InchesMoving);\n robot2.DriveLeftRear.setTargetPosition((int) InchesMoving);\n robot2.DriveLeftFront.setTargetPosition((int) InchesMoving);\n\n while (robot2.DriveRightFront.isBusy() && robot2.DriveRightRear.isBusy() && robot2.DriveLeftRear.isBusy() && robot2.DriveLeftFront.isBusy()) {\n\n // wait for robot to move to RUN_TO_POSITION setting\n\n double MoveSpeed = speed;\n\n // Set Motor Power\n robot2.DriveRightFront.setPower(MoveSpeed);\n robot2.DriveRightRear.setPower(MoveSpeed);\n robot2.DriveLeftFront.setPower(MoveSpeed);\n robot2.DriveLeftRear.setPower(MoveSpeed);\n\n } // THis brace close out the while Loop\n\n //Reset Encoders\n robot2.DriveRightFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftFront.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveRightRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot2.DriveLeftRear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n\n\n robot2.DriveRightFront.setPower(0);\n robot2.DriveRightRear.setPower(0);\n robot2.DriveLeftFront.setPower(0);\n robot2.DriveLeftRear.setPower(0);\n }",
"@Override\n\t\t\tpublic void shoot() {\n\t\t\t}",
"protected void execute() {\n \tdouble currentAngle = driveTrain.gyro.getYaw();\n \tdriveTrain.drive.arcadeDrive(speed, 0);\n }",
"@Override\n public void walk() {\n System.out.println(\"the robot is walking ... \");\n }",
"public void adjustShooterAngleManual() {\n\n // If the driver pushes the Square Button on the PS4 Controller,\n // set the worm drive motors to go backwards (lower it).\n if (PS4.getRawButton(PS4_X_BUTTON) == true) {\n\n wormDriveMotors.set(-0.2);\n\n // If the driver pushes the Triangle Button on the PS4 Controller,\n // set the worm drive motors to go forwards (raise it up).\n } else if (PS4.getRawButton(PS4_SQUARE_BUTTON) == true) {\n\n wormDriveMotors.set(0.4);\n }\n\n // If the driver is an idiot and is pressing BOTH the Square Button AND the\n // Triangle Button at the same time, OR (||) if the driver is pushing neither\n // button, set the motor speed to 0.\n else if (((PS4.getRawButton(PS4_X_BUTTON) == true) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == true))\n || ((PS4.getRawButton(PS4_X_BUTTON) == false) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == false))) {\n\n wormDriveMotors.set(0);\n }\n\n }",
"private void moveForwards() {\n\t\tposition = MoveAlgorithmExecutor.getAlgorithmFromCondition(orientation).execute(position);\n\t\t\n\t\t// Extracted the condition to check if tractor is in Ditch\n\t\tif(isTractorInDitch()){\n\t\t\tthrow new TractorInDitchException();\n\t\t}\n\t}",
"public ShooterHoodAngleCommand(ShooterSubsystem shoot, double angle) {\n mServoAngle = angle;\n mShooter = shoot;\n addRequirements(mShooter);\n // Use addRequirements() here to declare subsystem dependencies.\n }",
"private void turnAround() {\r\n this.setCurrentDirection(-getCurrentDirection());\r\n }",
"public Robot(int orientation, Position pos_ini) {\r\n\t\tthis.pos_courante = pos_ini;\r\n\t\tthis.orientation = orientation;\r\n\t\tderniereAction = AUCUNE_ACTION;\r\n\t}",
"public void cameraRotation() throws InterruptedException {\n\t\tint lowSide = (int)random(1,4);\r\n\t\tint highSide = (int)random(5,10);\r\n\t\tint medLowSide = (int)random(10,15);\r\n\t\tint medHighSide = (int)random(35,60);\r\n\t\tint highLowSide = (int)random(70,100);\r\n\t\tint highHighSide = (int)random(200,300);\r\n\t\tint cameraRotRandom = (int)random(0,1000);\r\n\t\tint cameraAngle = (int)camera.getPitchAngle(); // did we want to do anything with this?\r\n\t\t\r\n\t\t// twitch\r\n\t\tif (cameraRotRandom <= 200) {\r\n\t\t\t//log(\"antiban, move camera, twitch\");\r\n\t\t\tint twitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (twitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (twitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// medium movements\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 900) {\r\n\t\t\t//log(\"antiban, move camera, medium\");\r\n\t\t\tint medtwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (medtwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (medtwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// complete rotations\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 1000) {\r\n\t\t\t//log(\"antiban, move camera, long rotation\");\r\n\t\t\tint hightwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (hightwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (hightwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban camera rotation\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public void shape() {\n\t\tSystem.out.println(\"super robot입니다. 팔, 다리, 몸통, 머리가 있습니다.\");\r\n\t}",
"public void spinTurret(double _speed) {\n turretMotor.set(_speed);\n }",
"public void setShootingDirection(short x){\n this.shootingDirection = x;\n }",
"protected void execute() {\n \tif(degrees > 0)\n \t{\n \t\tRobot.driveBase.set(ControlMode.PercentOutput, -speed, speed);\n \t}\n \telse if(degrees < 0)\n \t{\n \t\tRobot.driveBase.set(ControlMode.PercentOutput, speed, -speed);\n \t}\n \t\n }",
"public void DriveForwardSimple() {\n \ttheRobot.drive(-0.5, 0.0);\n }",
"@Override\n public void initialize() {\n arm.setPosition(degrees);\n }",
"public void cameraRotation() throws InterruptedException {\n\t\tint lowSide = (int)random(1,4);\r\n\t\tint highSide = (int)random(5,10);\r\n\t\tint medLowSide = (int)random(10,15);\r\n\t\tint medHighSide = (int)random(35,60);\r\n\t\tint highLowSide = (int)random(70,100);\r\n\t\tint highHighSide = (int)random(200,300);\r\n\t\tint cameraRotRandom = (int)random(0,1000);\r\n\t\t//int cameraAngle = (int)camera.getPitchAngle(); // did we want to do anything with this?\r\n\t\t\r\n\t\t// twitch\r\n\t\tif (cameraRotRandom <= 200) {\r\n\t\t\t//log(\"antiban, move camera, twitch\");\r\n\t\t\tint twitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (twitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (twitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(lowSide,highSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(lowSide,highSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(lowSide,highSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// medium movements\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 900) {\r\n\t\t\t//log(\"antiban, move camera, medium\");\r\n\t\t\tint medtwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (medtwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (medtwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(medLowSide,medHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(medLowSide,medHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(medLowSide,medHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// complete rotations\r\n\t\t\r\n\t\telse if (cameraRotRandom <= 1000) {\r\n\t\t\t//log(\"antiban, move camera, long rotation\");\r\n\t\t\tint hightwitchRandom = (int)random(1,4);\r\n\t\t\t\r\n\t\t\tif (hightwitchRandom == 1) {\r\n\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (hightwitchRandom == 2) {\r\n\t\t\t\tcamera.moveYaw(random(highLowSide,highHighSide));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tif(random(0,3) == 1) {\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.movePitch((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tcamera.movePitch(random(highLowSide,highHighSide));\r\n\t\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\tcamera.moveYaw((random(highLowSide,highHighSide)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban camera rotation\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public abstract void rotate();",
"private void rotateRight() {\n robot.leftBack.setPower(TURN_POWER);\n robot.leftFront.setPower(TURN_POWER);\n robot.rightBack.setPower(-TURN_POWER);\n robot.rightFront.setPower(-TURN_POWER);\n }",
"public void manualShoot(double speed) {\n shooter1.set(speed);\n }",
"public static void hookMotor() {\n\t\thookMotor.rotate(45);\n\t}",
"public Shooter() {\n setDefaultCommand(new RunCommand(this::stop, this));\n _shooterMotor2.follow(_shooterMotor1);\n _shooterMotor1.setInverted(true);\n _shooterMotor2.setInverted(false);\n\n _shooterMotor1.configFactoryDefault();\n _shooterMotor1.config_kF(0, _kF);\n _shooterMotor1.config_kP(0, _kP);\n _shooterMotor1.setNeutralMode(NeutralMode.Coast);\n }",
"@Override\n\t\tpublic void driveRobot(double power, double pivot) {\n\t\t\tclosedLoopArcade(power, pivot);\n\t\t}",
"@Override\n\tpublic void move() {\n\t\theading = Heading.randHeading();\n\t\tif (heading == Heading.NORTH) {\n\t\t\tthis.location.y -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.EAST) {\n\t\t\tthis.location.x += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.SOUTH) {\n\t\t\tthis.location.y += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.WEST) {\n\t\t\tthis.location.x -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t}\n\t\tadjustPos();\n\t\tinfect();\n\t}",
"protected void execute() {\n \tif (isIntaking) {\n \t\tRobot.conveyor.forward();\n \t} else {\n \t\tRobot.conveyor.backward();\n \t}\n }",
"public void alignRobotToShoot(){\n double rangeError;\n double angleError;\n double rangePercent = .1; // Percent of range error to pass to moveBot\n double anglePercent = .5; // Percent of angle error to pass to moveBot\n\n boolean rangeGood = false;\n boolean angleGood = false;\n\n if (Math.abs(targetRange - shotRange)> rangeCloseEnough){\n // Still not in optimal shot position\n rangeError = targetRange - shotRange;\n } else {\n rangeGood = true;\n rangeError = 0;\n }\n if (Math.abs(relativeBearing) > angleCloseEnough){\n // still not pointing the target\n angleError = relativeBearing;\n } else{\n angleGood = true;\n angleError = 0;\n }\n\n if (!rangeGood || !angleGood){\n moveBot(rangePercent * rangeError, anglePercent * angleError, 0, 0.2);\n }\n }",
"@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }",
"public JoystickDriveCommand() {\n\t\trequires(Robot.chassisSubsystem);\n\t}",
"@Override\n protected void execute() {\n Robot.driveTrain.drive(Robot.oi.joystick);\n }",
"public void rotateTurtle(double deg){\n\t\tSystem.out.println(\"in rotate\");\n\n\t\tmyTurtle.turn(deg);\n\t\tthis.updateTurtleOnView();\n\t}",
"protected void execute() {\n\n \n\n\n\n if (Robot.drive.gyroGetAngle() > m_autorotateangle) { // turn left\n if ( Math.abs(m_autorotateangle - Robot.drive.gyroGetAngle()) < rampthreshold ) {\n Robot.drive.setLeftSide(m_minspeed);\n Robot.drive.setRightSide(m_minspeed);\n } else {\n Robot.drive.setLeftSide(m_leftpower);\n Robot.drive.setRightSide(m_leftpower);\n }\n } else { // turn right\n if ( Math.abs(m_autorotateangle - Robot.drive.gyroGetAngle()) < rampthreshold ) {\n Robot.drive.setLeftSide(-m_minspeed);\n Robot.drive.setRightSide(-m_minspeed);\n } else {\n Robot.drive.setLeftSide(-m_leftpower);\n Robot.drive.setRightSide(-m_leftpower);\n }\n\n }\n\n \n\n \t//SmartDashboard.putNumber(\"NavX getYaw\", Robot.navX.getYaw());\n }",
"@Override\n public void execute() {\n Robot.driveBase.arcadeDrive(Robot.oi.driver.getLeftY() * m_powerScale, Robot.oi.driver.getRightX() * m_powerScale, false);\n }",
"public void gyroDrive ( double speed,\n double distance,\n double angle) {\n\n\n // Ensure that the opmode is still activ\n\n // Determine new target position, and pass to motor controller\n moveCounts = (int)(distance * COUNTS_PER_INCH);\n newLeftTarget = leftmotor.getCurrentPosition() + moveCounts;\n newRightTarget = rightmotor.getCurrentPosition() + moveCounts;\n\n // Set Target and Turn On RUN_TO_POSITION\n leftmotor.setTargetPosition(newLeftTarget);\n rightmotor.setTargetPosition(newRightTarget);\n\n leftmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n rightmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // start motion.\n speed = Range.clip(Math.abs(speed), 0.0, 1.0);\n\n maxSpeed = speed;\n speed = INCREMENT;\n rampUp = true;\n\n leftmotor.setPower(speed);\n rightmotor.setPower(speed);\n\n // keep looping while we are still active, and BOTH motors are running.\n while ((leftmotor.isBusy() && rightmotor.isBusy())) {\n if (rampUp){\n speed += INCREMENT ;\n if (speed >= maxSpeed ) {\n speed = maxSpeed;\n }\n }\n\n // adjust relative speed based on heading error.\n error = getError(angle);\n steer = getSteer(error, P_DRIVE_COEFF);\n\n // if driving in reverse, the motor correction also needs to be reversed\n if (distance < 0)\n steer *= -1.0;\n\n leftSpeed = speed - steer;\n rightSpeed = speed + steer;\n\n // Normalize speeds if either one exceeds +/- 1.0;\n max = Math.max(Math.abs(leftSpeed), Math.abs(rightSpeed));\n if (max > 1.0)\n {\n leftSpeed /= max;\n rightSpeed /= max;\n }\n\n leftmotor.setPower(leftSpeed);\n rightmotor.setPower(rightSpeed);\n }\n\n // Stop all motion;\n leftmotor.setPower(0);\n rightmotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n leftmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n gyroHold(TURN_SPEED,angle,0.166);\n\n }"
] | [
"0.6795645",
"0.6138678",
"0.6082846",
"0.6072228",
"0.6054524",
"0.60084975",
"0.6008064",
"0.596942",
"0.5917883",
"0.58792275",
"0.5870422",
"0.5843617",
"0.582684",
"0.5825516",
"0.58162576",
"0.58156896",
"0.5809895",
"0.5804949",
"0.58028275",
"0.5795888",
"0.57791424",
"0.5772838",
"0.5771712",
"0.57570535",
"0.57531554",
"0.57441825",
"0.5724505",
"0.5712718",
"0.5701387",
"0.56967646",
"0.5694357",
"0.56816655",
"0.5680911",
"0.5675718",
"0.5674533",
"0.56667435",
"0.56588596",
"0.5656513",
"0.5653655",
"0.5651487",
"0.5646522",
"0.56418014",
"0.5641466",
"0.5629129",
"0.56271726",
"0.5626162",
"0.56255037",
"0.56184953",
"0.561016",
"0.56027466",
"0.5593848",
"0.5591632",
"0.5590446",
"0.55851865",
"0.55681825",
"0.55575275",
"0.5555549",
"0.5551988",
"0.5545767",
"0.5545188",
"0.5542109",
"0.5538817",
"0.553839",
"0.5527801",
"0.5523265",
"0.55180717",
"0.5506092",
"0.5505997",
"0.550431",
"0.55041164",
"0.54956156",
"0.5492929",
"0.5491159",
"0.54800916",
"0.5476772",
"0.54720086",
"0.54682475",
"0.54621226",
"0.5455736",
"0.5448465",
"0.54409707",
"0.5436574",
"0.5436509",
"0.543464",
"0.54332376",
"0.5429954",
"0.54292977",
"0.542899",
"0.5425729",
"0.541845",
"0.54124856",
"0.5411116",
"0.54083854",
"0.53984094",
"0.5395086",
"0.5393676",
"0.5393166",
"0.5391731",
"0.53914946",
"0.53914386"
] | 0.676752 | 1 |
Create a new wall. Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public Wall createWall() throws UnsupportedOperationException
{
return new Wall();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Square createWall() {Collect.Hit(\"BoardFactory.java\",\"createWall()\"); Collect.Hit(\"BoardFactory.java\",\"createWall()\", \"1976\");return new Wall(sprites.getWallSprite()) ; }",
"WallType createWallType();",
"private void createWalls(){\n\t \tfloat wallWidth = GameRenderer.BOARD_WIDTH ;\n\t \tfloat wallHeight = GameRenderer.BOARD_HEIGHT ;\n\t \tint offset = -2;\n\t \tint actionBaOffset = 2;\n\t \t\n\t \t//Left Wall\n\t \tnew SpriteWall(0, actionBaOffset, 0, wallHeight+offset);\n\t \t\n\t \t//Right Wall\n\t \tnew SpriteWall(wallWidth+offset, actionBaOffset, wallWidth+offset, wallHeight+offset);\n\t \t\n\t \t//Top Wall\n\t \tnew SpriteWall(0, actionBaOffset, wallWidth+offset, actionBaOffset);\n\t \t\n\t \t//Bottom Wall\n\t \tnew SpriteWall(0, wallHeight+offset, wallWidth+offset, wallHeight+offset);\n\t \t\n\t }",
"public static MotionlessElement createWall() {\r\n\treturn wall;\r\n\t}",
"@Override\n\tpublic Wall MakeWall() {\n\t\treturn new RedWall();\n\t}",
"public Wall() {\n super(false, \"wall\");\n }",
"public void addWall(Wall w)\n {\n walls.add(w);\n }",
"public WallObject() {\n super(\"walls/\");\n setEnterable(false);\n }",
"private void createWalls() {\n int environmentWidth = config.getEnvironmentWidth();\n int environmentHeight = config.getEnvironmentHeight();\n // Left\n Double2D pos = new Double2D(0, environmentHeight / 2.0);\n Double2D v1 = new Double2D(0, -pos.y);\n Double2D v2 = new Double2D(0, pos.y);\n WallObject wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Right\n pos = new Double2D(environmentWidth, environmentHeight / 2.0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Top\n pos = new Double2D(environmentWidth / 2.0, 0);\n v1 = new Double2D(-pos.x, 0);\n v2 = new Double2D(pos.x, 0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Bottom\n pos = new Double2D(environmentWidth / 2.0, environmentHeight);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n }",
"public Wall() {\n\t\tcanHold = false;\n\t\tisPassable = false;\n\t\ttype = TileTypes.WALL;\n\t}",
"public void addWall(StructureTypeEnum type, int x1, int y1, int x2, int y2, float qualityLevel, long structureId, boolean isIndoor) {\n/* 3891 */ if (logger.isLoggable(Level.FINEST))\n/* */ {\n/* 3893 */ logger.finest(\"StructureID: \" + structureId + \" adding wall at \" + x1 + \"-\" + y1 + \",\" + x2 + \"-\" + y2 + \", QL: \" + qualityLevel);\n/* */ }\n/* */ \n/* */ \n/* 3897 */ DbWall dbWall = new DbWall(type, this.tilex, this.tiley, x1, y1, x2, y2, qualityLevel, structureId, StructureMaterialEnum.WOOD, isIndoor, 0, getLayer());\n/* 3898 */ addWall((Wall)dbWall);\n/* 3899 */ updateWall((Wall)dbWall);\n/* */ }",
"public void makeBody()\n {\n Texture text;\n if(bounds.getHeight()<bounds.getWidth()) {\n text = new Texture(\"img/wall.jpg\");\n }else{\n text = new Texture(\"img/wall2.jpg\");\n }\n\n Sprite wallSprite;\n wallSprite = new Sprite(text);\n wallSprite.setSize(bounds.getWidth(),bounds.getHeight());\n wallSprite.setOrigin(bounds.getWidth()/2, bounds.getHeight()/2);\n\n BodyDef bodydef = new BodyDef();\n bodydef.type = BodyType.StaticBody;\n bodydef.position.set(position.x,position.y);\n\n PolygonShape shape = new PolygonShape();\n shape.setAsBox(bounds.width/2, bounds.height/2);\n\n FixtureDef def = new FixtureDef();\n def.shape = shape;\n def.friction = 0.5f;\n def.restitution = 0;\n wall = world.createBody(bodydef);\n wall.createFixture(def);\n wall.getFixtureList().get(0).setUserData(\"w\");\n wall.setUserData(wallSprite);\n\n shape.dispose();\n }",
"private void addWalls() {\n wallList.add(new RectF(0, 0, wallSize, screenHeight / 2 - doorSize));\n wallList.add(new RectF(0, screenHeight / 2 + doorSize, wallSize, screenHeight));\n wallList.add(new RectF(0, 0, screenWidth / 2 - doorSize, wallSize));\n wallList.add(new RectF(screenWidth / 2 + doorSize, 0, screenWidth, wallSize));\n wallList.add(new RectF(screenWidth - wallSize, 0, screenWidth, screenHeight / 2 - doorSize));\n wallList.add(new RectF(screenWidth - wallSize, screenHeight / 2 + doorSize, screenWidth, screenHeight));\n wallList.add(new RectF(0, screenHeight - wallSize, screenWidth / 2 - doorSize, screenHeight));\n wallList.add(new RectF(screenWidth / 2 + doorSize, screenHeight - wallSize, screenWidth, screenHeight));\n }",
"public void create(){}",
"@Override\r\n\tpublic void putWall(Board board, long x, long y, Wall wall) throws UnsupportedOperationException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\twall.setPosition(new Position(x,y));\r\n\t\t\twall.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this wall or this board is terminated; the wall cannot be placed on the board.\");\r\n\t\t}\r\n\t}",
"public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }",
"public void createWall() { // make case statement?\n\t\tRandom ran = new Random();\n\t\tint range = 6 - 1 + 1; // max - min + min\n\t\tint random = ran.nextInt(range) + 1; // add min\n\n\t\t//each wall is a 64 by 32 chunk \n\t\t//which stack to create different structures.\n\t\t\n\t\tWall w; \n\t\tPoint[] points = new Point[11];\n\t\tpoints[0] = new Point(640, -32);\n\t\tpoints[1] = new Point(640, 0);\n\t\tpoints[2] = new Point(640, 32); // top\n\t\tpoints[3] = new Point(640, 384);\n\t\tpoints[4] = new Point(640, 416);\n\n\t\tif (random == 1) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 2) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96); // top\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 3) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192); // top\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 4) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192);\n\t\t\tpoints[10] = new Point(640, 224); // top\n\t\t} else if (random == 5) {\n\t\t\tpoints[5] = new Point(640, 64); // top\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 6) {\n\t\t\tpoints[5] = new Point(640, 192);\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256); // bottom\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t}\n\n\t\tfor (int i = 0; i < points.length; i++) { // adds walls\n\t\t\tw = new Wall();\n\t\t\tw.setBounds(new Rectangle(points[i].x, points[i].y, 64, 32));\n\t\t\twalls.add(w);\n\t\t}\n\t\tWall c; // adds a single checkpoint\n\t\tc = new Wall();\n\t\tcheckPoints.add(c);\n\t\tc.setBounds(new Rectangle(640, 320, 32, 32));\n\t}",
"public interface Wall {\n\n void create(boolean horizontal);\n List<Coordinate> getCoordinates();\n Color getColor();\n}",
"public static Entity createWall(float width, float height) {\n\t\tEntity wall = new Entity()\n\t\t\t.addComponent(new PhysicsComponent().setBodyType(BodyType.StaticBody))\n\t\t\t.addComponent(new ColliderComponent().setLayer(PhysicsLayer.OBSTACLE));\n\t\twall.setScale(width, height);\n\t\treturn wall;\n\t}",
"Wall getWall(long wallId) throws NoSuchWallException {\n/* 3520 */ if (this.walls != null)\n/* */ {\n/* 3522 */ for (Iterator<Wall> it = this.walls.iterator(); it.hasNext(); ) {\n/* */ \n/* 3524 */ Wall wall = it.next();\n/* 3525 */ if (wall.getId() == wallId)\n/* 3526 */ return wall; \n/* */ } \n/* */ }\n/* 3529 */ throw new NoSuchWallException(\"There are no walls on this tile so cannot find wallid: \" + wallId);\n/* */ }",
"public Wall(String name, physics.Vect p1, physics.Vect p2) {\n this.name = name;\n this.wall = new physics.LineSegment(p1, p2);\n checkRep();\n }",
"public boolean isWall();",
"public Wall(int x, int y)\r\n\t{\r\n\t\tsuper(x,y);\r\n\t}",
"public int generateWall() {\n Entity e = new Wall(rand.nextInt(10) + 1);\n e.setRelativeVelocity(mGame.getPlayer().getVelocity());\n e.setPosition(1000, mMap.getBottomBound() - e.getHeight());\n mGame.addEntity(e);\n\n return e.getWidth();\n }",
"public void create() {\n\t\t\n\t}",
"public abstract void create();",
"public Wall(int x1, int y1,int x2,int y2) {\r\n\tthis.x1 = x1 + TRANSLATION;\r\n\tthis.x2 = x2 + TRANSLATION;\r\n\tthis.y1 = y1 + TRANSLATION;\r\n\tthis.y2 = y2 + TRANSLATION;\r\n\tbustedWall = false; \r\n}",
"public Wall()\n {\n super();\n setColor( null );\n\n }",
"public WallTile()\n\t{\n\t\t\n\t}",
"Lehrkraft createLehrkraft();",
"Wall(Sprite sprite) {Collect.Hit(\"BoardFactory.java\",\"Wall(Sprite sprite)\");this.background = sprite; Collect.Hit(\"BoardFactory.java\",\"Wall(Sprite sprite)\", \"2420\");}",
"private StackPane buildWall(Wall wall) {\n double x_offset = wall.getPosition().getX() * TILE_WIDTH;\n double y_offset = wall.getPosition().getY() * TILE_HEIGHT - 8;\n if (wall.getOrientation() == WallOrientation.VERTICAL) {\n x_offset -= 8;\n y_offset += 8;\n }\n ImageView imageView = getWallTextureFor(wall);\n StackPane stackPane = new StackPane();\n stackPane.setLayoutX(x_offset);\n stackPane.setLayoutY(y_offset);\n stackPane.setDisable(true);\n stackPane.getChildren().add(imageView);\n return stackPane;\n }",
"public IThread createThread() throws IllegalWriteException, BBException;",
"@Deprecated\npublic interface ProfileWallLogic {\n\t\n\t/**\n\t * Notifies a user's connections of an event added to the user's wall.\n\t * \n\t * Note: the wall logic is currently responsible for timestamping the event,\n\t * but we might want to pass the date in this API call instead.\n\t * \n\t * @param event the event to add.\n\t * @param userUuid the ID of the user that created the event.\n\t */\n\tpublic void addNewEventToWall(String event, String userUuid);\n\t\n\t/**\n\t * Notifies a user's connections of a status update added to the user's wall.\n\t * \n\t * Note: the wall logic is currently responsible for timestamping the status\n\t * update, but we might want to pass the date in this API call instead.\n\t * \n\t * @param status the status to add.\n\t * @param userUuid the ID of the user whose status we're posting.\n\t */\n\tpublic void addNewStatusToWall(String status, String userUuid);\n\t\n\t/**\n\t * Adds a new wall item comment.\n\t * \n\t * @param wallItemComment the wall item comment to add.\n\t * @return <code>true</code> if the add is successful and\n\t * <code>false</code> if the add fails.\n\t */\n\tpublic boolean addNewCommentToWallItem(WallItemComment wallItemComment);\n\t\n\t/**\n\t * Posts the specified wall item to the specified user's wall and the\n\t * walls of their connections.\n\t * \n\t * @param userUuid the id of the user whose wall we're posting to.\n\t * @param wallItem the wall item to post.\n\t */\n\tpublic boolean postWallItemToWall(String userUuid, WallItem wallItem);\n\t\n\t/**\n\t * Removes the specified wall item.\n\t *\n\t * @param wallItem the wall item to remove.\n\t */\n\tpublic boolean removeWallItemFromWall(WallItem wallItem);\n\n\t/**\n\t * Returns the specified wall item.\n\t *\n\t * @param wallItemId the wall item to return.\n\t * @return the wall item for the specified id.\n\t */\n\tpublic WallItem getWallItem(long wallItemId);\n\n\t/**\n\t * Returns the specified wall item comment.\n\t *\n\t * @param wallItemCommentId the wall item comment to return.\n\t * @return the wall item comment for the specified id.\n\t */\n\tpublic WallItemComment getWallItemComment(long wallItemCommentId);\n\t\n\t/**\n\t * Returns the wall for the specified user. The privacy record will\n\t * be looked up.\n\t *\n\t * @param userUuid the user to query by.\n\t * @return the wall for the specified user.\n\t */\n\tpublic List<WallItem> getWallItemsForUser(String userUuid);\n\t\n\t/**\n\t * Returns the wall for the specified user. Privacy settings are used\n\t * to determine if the user is allowed to access the requested wall.\n\t *\n\t * @param userUuid the user to query by.\n\t * @param privacy the privacy record for the user.\n\t * @return the wall for the specified user.\n\t */\n\tpublic List<WallItem> getWallItemsForUser(String userUuid, ProfilePrivacy privacy);\n\t\n\t/**\n\t * Returns the number of available wall items for the specified user. The\n\t * privacy record will be looked up.\n\t *\n\t * @param userUuid the user to query by.\n\t * @return the number of available wall items for the specified user.\n\t */\n\tpublic int getWallItemsCount(String userUuid);\n\t\n\t/**\n\t * Returns the number of available wall items for the specified user.\n\t * Privacy settings are used to determine if the user is allowed to access\n\t * the requested wall items.\n\t *\n\t * @param userUuid the user to query by.\n\t * @param privacy the privacy record for the user.\n\t * @return the number of available wall items for the specified user.\n\t */\n\tpublic int getWallItemsCount(String userUuid, ProfilePrivacy privacy);\n\n}",
"public Friend createFriend();",
"private static void makeWalls(City city) \n {\n Wall[] walls = new Wall[6];\n \n for(int i=0; i<6; i++)\n {\n walls[i] = new Wall(city, i+1, 5, Direction.EAST);\n walls[i] = new Wall(city, i+1, 0, Direction.WEST);\n walls[i] = new Wall(city, 1, i, Direction.NORTH);\n walls[i] = new Wall(city, 6, i, Direction.SOUTH);\n }\n }",
"public static void addFullWall(Block fullWall) {\r\n\t\t_fullWalls.add(fullWall);\r\n\t}",
"public void buildWall() {\n for (int i = 0; i < worldWidth; i += 1) {\n for (int j = 0; j < worldHeight; j += 1) {\n if (world[i][j].equals(Tileset.NOTHING)\n && isAdjacentFloor(i, j)) {\n world[i][j] = Tileset.WALL;\n }\n }\n }\n }",
"public void createFrame() {\r\n System.out.println(\"Framing: Adding the log walls.\");\r\n }",
"public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }",
"@Override\n\tpublic void buildWalls() {\n\t\tSystem.out.println(\"Building Glass Walls\");\t\n\t}",
"public void addNewEventToWall(String event, String userUuid);",
"public boolean isWall() {\r\n return getObjectGroup() == ObjectGroup.WALL;\r\n }",
"public WpWallSurface(int x, int y,Position position,SurfaceType type,boolean passing) {\n super(x, y,position);\n this.type = type;\n this.passing = passing;\n }",
"public Wall(){\n\t\tstarttext = \"\";\n\t\tname = \"\";\n\t\texamine = \"\";\n\t\tverb = \"\";\n\t\t//object = null;\n\t\t//exitobj = null;\n\t}",
"void createMaterial(Material material) throws CreateException;",
"void create(Member member);",
"@Override\r\n\tpublic void create() {\n\t\t\r\n\t}",
"public static final Vector<JARWall> createFloor( int x, int y, int width, JARImage imgWall, JARImage imgTopping )\n {\n Vector<JARWall> ret = new Vector<JARWall>();\n\n int drawX = x;\n\n //browse width\n for ( int i = 0; i < width; ++i )\n {\n //add wall\n ret.add( new JARWall( drawX, y, imgWall, CollisionType.EColliding, DrawingLayer.EBeforePlayer ) );\n\n //add topping if specified\n if ( imgTopping != null )\n {\n ret.add( new JARWall( drawX, y - 64, imgTopping, CollisionType.ENonColliding, DrawingLayer.EBeforePlayer ) );\n }\n\n //increase drawing location\n drawX += 128;\n }\n\n return ret;\n }",
"@Override\n\tpublic Structure createNew() {\n\t\treturn new FloorSwitch();\n\t}",
"public void buildBoundaryWall() {\n for (int i = 0; i < worldWidth; i += 1) {\n for (int j = 0; j < worldHeight; j += 1) {\n if (i == 0 || i == worldWidth - 1\n || j == 0 || j == worldHeight - 1) {\n world[i][j] = Tileset.WALL;\n }\n }\n }\n }",
"public boolean isWall()\n\t{\n\t\treturn block == Block.HORIZONTAL_WALL || block == Block.VERTICAL_WALL\n\t\t\t\t|| block == Block.BOT_LEFT_TOP_RIGHT_WALL\n\t\t\t\t|| block == Block.BOT_RIGHT_TOP_LEFT_WALL || isGhostGate();\n\t}",
"public Room createRoom(Room room);",
"private void addWall(int positionX, int positionY) {\n for (int i = Math.max(0, positionX - 1);\n i < Math.min(size.width, positionX + 2); i++) {\n for (int j = Math.max(0, positionY - 1);\n j < Math.min(size.height, positionY + 2); j++) {\n if (world[i][j] == Tileset.NOTHING) {\n world[i][j] = Tileset.WALL;\n }\n }\n }\n }",
"private void generateAddWalls(int x, int y) {\n\n\t\t// make center walkable\n\t\tmaze[x][y] = Block.EMPTY;\n\n\t\t// all around add to list\n\t\tfor (Point point : allDirections) {\n\t\t\tif (x > 1 && y > 1 && x < width - 2 && y < height - 2\n\t\t\t\t\t&& maze[x + point.x][y + point.y] == Block.WALL)\n\t\t\t\twallList.add(new Point(x + point.x, y + point.y));\n\t\t}\n\t}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"Stone create();",
"public ItemStack createWand() {\n ItemStack wand = new ItemStack(Material.DIAMOND_AXE, 1);\n ItemMeta wandMeta = wand.getItemMeta();\n ArrayList<String> wandArray = new ArrayList<String>();\n wandMeta.setDisplayName(ChatColor.GOLD + \"Walls Wand\");\n wandMeta.addEnchant(Enchantment.DAMAGE_ALL, 3, true);\n wandArray.add(ChatColor.GREEN + \"The magic wand\");\n wandArray.add(ChatColor.GREEN + \"Use it to select area\");\n wandArray.add(ChatColor.RED + \"Left Click/Right click\");\n wandMeta.setLore(wandArray);\n wand.setItemMeta(wandMeta);\n this.wandinfo = wand;\n return wand;\n }",
"public Square createGround() {Collect.Hit(\"BoardFactory.java\",\"createGround()\"); Collect.Hit(\"BoardFactory.java\",\"createGround()\", \"1746\");return new Ground(sprites.getGroundSprite()) ; }",
"@objid (\"617db225-55b6-11e2-877f-002564c97630\")\n @Override\n public boolean canCreate(Class<? extends MObject> type) {\n return false;\n }",
"public boolean isWall () {\n if (this.equals(SquareType.WALL))\n return true;\n else\n return false;\n }",
"protected DugWall() {\r\n\t\tsuper(sprite, PERMEABILITY.PENETRABLE);\r\n\t\t\r\n\t}",
"public static void add() {\n Application.currentUserCan( 1 );\n render();\n }",
"public void updateWall(Wall wall) {\n/* 4128 */ if (this.structure != null) {\n/* */ \n/* 4130 */ if (this.watchers != null)\n/* */ {\n/* 4132 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 4136 */ vz.updateWall(this.structure.getWurmId(), wall);\n/* */ }\n/* 4138 */ catch (Exception e) {\n/* */ \n/* 4140 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }\n/* 4144 */ if (this.structure.isFinalized()) {\n/* */ \n/* */ try {\n/* */ \n/* 4148 */ wall.save();\n/* */ }\n/* 4150 */ catch (IOException iox) {\n/* */ \n/* 4152 */ logger.log(Level.WARNING, \"Failed to save structure wall: \" + wall.getId() + '.', iox);\n/* */ } \n/* */ }\n/* */ } \n/* */ }",
"public void makeNew() {\n\t\towner.switchMode(WindowMode.ITEMCREATE);\n\t}",
"@Override\n\tpublic void create() {\n\n\t}",
"public void addNewStatusToWall(String status, String userUuid);",
"org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();",
"public void createTurn() {\n Turn turn = new Turn(this.getOnlinePlayers());\n this.setCurrentTurn(turn);\n }",
"public boolean isWall() {\n return type == CellType.WALL;\n }",
"public WallLoader() {\n //Nothing to do.\n }",
"public void generate() {\n\t\t// all cardinal direction for up,down,left and right\n\t\tthis.allDirections = Arrays.asList(new Point(-1, 0), new Point(1, 0), new Point(0, 1),\n\t\t\t\tnew Point(0, -1));\n\n\t\twallList = new ArrayList<>();\n\t\tgenerateAddWalls(width / 2, height / 2);\n\t\t// generateAddWalls( 3, 3);\n\n\t\tRandom rand = new Random();\n\n\t\twhile (wallList.size() > 0) {\n\t\t\tPoint wall = wallList.get(rand.nextInt(wallList.size()));\n\n\t\t\tint emptyWallX = wall.x;\n\t\t\tint emptyWallY = wall.y;\n\n\t\t\tfor (Point point : allDirections) {\n\t\t\t\tif (maze[wall.x + point.x][wall.y + point.y] == Block.EMPTY) {\n\t\t\t\t\temptyWallX = wall.x + point.x;\n\t\t\t\t\temptyWallY = wall.y + point.y;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find if oposite direction is empty by inverting the delta\n\t\t\tint deltaX = wall.x - emptyWallX;\n\t\t\tint deltaY = wall.y - emptyWallY;\n\n\t\t\tif (maze[wall.x + deltaX][wall.y + deltaY] == Block.WALL) {\n\t\t\t\tmaze[wall.x][wall.y] = Block.EMPTY;\n\t\t\t\tgenerateAddWalls(wall.x + deltaX, wall.y + deltaY);\n\t\t\t}\n\n\t\t\twallList.remove(wall);\n\t\t}\n\t}",
"@PostMapping(\"/createNewGameRoom\")\n @ResponseStatus(HttpStatus.CREATED)\n public Game generateNewGameRoom() {\n String entrycode = service.generateEntryCode();\n currentGame.setEntrycode(entrycode);\n currentGame = gameDao.add(currentGame);\n return currentGame;\n }",
"private void buildWalls() {\n for (Position floor : floors) {\n addWall(floor.xCoordinate, floor.yCoordinate);\n }\n }",
"public static void addHalfWall(Block halfWall) {\r\n\t\t_halfWalls.add(halfWall);\r\n\t}",
"void create(Model model) throws Exception;",
"@Override\n\tpublic void create () {\n\n\t}",
"public abstract void createBoard();",
"public void create() {\n int emptyBlocks = 0; \t\t\t\t\t\t\t\t// count of empty blocks\r\n int walls = 0; \t\t\t\t\t\t\t\t\t// count of walls\r\n int[] wallsRow = new int[(m.rows*m.columns)/2]; \t// temporary wall positions (half the total maze size)\r\n int[] wallsColumn = new int[(m.rows*m.columns)/2];\r\n \r\n for (int i = 0; i < m.rows; i++) \t\t\t\t\t// for each row\r\n for (int j = 0; j < m.columns; j++)\t\t\t\t// for each column (each block in a row)\r\n \tm.maze[i][j] = 1;\t\t\t\t\t\t\t// make the block a wall\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t// the maze is all walls\r\n \r\n for (int i = 1; i < m.rows - 1; i += 2) \t\t\t// loop over every other block\r\n for (int j = 1; j < m.columns - 1; j += 2) {\r\n \tm.maze[i][j] = -emptyBlocks; \t\t\t\t// make every other block an empty block\r\n \temptyBlocks++;\t\t\t\t\t\t\t\t// so increment our empty blocks\r\n if (i < m.rows - 2) { \t\t\t\t\t\t// if there is a block below this room\r\n \twallsRow[walls] = i + 1;\t\t\t\t// set this block to be a wall in the temporary wall array\r\n \twallsColumn[walls] = j;\r\n walls++;\t\t\t\t\t\t\t\t// increment because we added a wall to the maze\r\n }\r\n if (j < m.columns - 2) { \t\t\t\t\t// if there is a block below this room\r\n \twallsRow[walls] = i;\t\t\t\t\t// set this block to be a wall in the temporary wall array\r\n \twallsColumn[walls] = j + 1;\r\n walls++;\t\t\t\t\t\t\t\t// increment because we added a wall to the maze\r\n }\r\n }\r\n repaint();\r\n for (int i = walls - 1; i > 0; i--) {\t\t\t\t// loop over the number of walls generated (half the total maze size)\r\n int r = (int)(Math.random() * i); \t\t\t\t// choose a random wall\r\n removeWall(wallsRow[r], wallsColumn[r]);\t\t// remove the wall if it doesn't form a loop\r\n wallsRow[r] = wallsRow[i];\r\n wallsColumn[r] = wallsColumn[i];\r\n }\r\n for (int i = 1; i < m.rows - 1; i++) \t\t\t\t// for each row\r\n for (int j = 1; j < m.columns - 1; j++)\t\t\t// for each column (each block in a row)\r\n if (m.maze[i][j] < 0)\t\t\t\t\t\t// set the empty blocks to finalized blocks \r\n \tm.maze[i][j] = 3;\r\n }",
"Strobo createStrobo();",
"@Override\n\tpublic void create(Owner owner) {\n\n\t}",
"public createNew(){\n\t\tsuper(\"Create\"); // title for the frame\n\t\t//layout as null\n\t\tgetContentPane().setLayout(null);\n\t\t//get the background image\n\t\ttry {\n\t\t\tbackground =\n\t\t\t\t\tnew ImageIcon (ImageIO.read(getClass().getResource(\"Wallpaper.jpg\")));\n\t\t}//Catch for file error\n\t\tcatch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tJOptionPane.showMessageDialog(null, \n\t\t\t\t\t\"ERROR: File(s) Not Found\\n Please Check Your File Format\\n\"\n\t\t\t\t\t\t\t+ \"and The File Name!\");\n\t\t}\n\t\t//Initialize all of the compenents \n\t\tlblBackground = new JLabel (background);\n\t\tlblTitle = new JLabel (\"Create Menu\");\n\t\tlblTitle.setFont(new Font(\"ARIAL\",Font.ITALIC, 30));\n\t\tlblName = new JLabel(\"Please Enter Your First Name.\");\n\t\tlblLastName= new JLabel (\"Please Enter Your Last Name.\");\n\t\tlblPhoneNumber = new JLabel (\"Please Enter Your Phone Number.\");\n\t\tlblAddress = new JLabel (\"Please Enter Your Address.\");\n\t\tlblMiddle = new JLabel (\"Please Enter Your Middle Name (Optional).\");\n\t\tbtnCreate = new JButton (\"Create\");\n\t\tbtnBack = new JButton (\"Back\");\n\t\t//set the font\n\t\tlblName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblLastName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblPhoneNumber.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblAddress.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblMiddle.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\n\t\t//add action listener\n\t\tbtnCreate.addActionListener(this);\n\t\tbtnBack.addActionListener(this);\n\t\t//set bounds for all the components\n\t\tbtnCreate.setBounds(393, 594, 220, 36);\n\t\ttxtMiddle.setBounds(333, 249, 342, 36);\n\t\ttxtName.setBounds(333, 158, 342, 36);\n\t\ttxtLastName.setBounds(333, 339, 342, 36);\n\t\ttxtPhoneNumber.setBounds(333, 429, 342, 36);\n\t\ttxtAddress.setBounds(333, 511, 342, 36);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblMiddle.setBounds(333, 201, 342, 36);\n\t\tlblName.setBounds(387, 110, 239, 36);\n\t\tlblLastName.setBounds(387, 297, 239, 36);\n\t\tlblPhoneNumber.setBounds(369, 387, 269, 36);\n\t\tlblAddress.setBounds(393, 477, 215, 30);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblBackground.setBounds(0, 0, 1000, 1000);\n\t\t//add components to frame\n\t\tgetContentPane().add(btnCreate);\n\t\tgetContentPane().add(txtMiddle);\n\t\tgetContentPane().add(txtLastName);\n\t\tgetContentPane().add(txtAddress);\n\t\tgetContentPane().add(txtPhoneNumber);\n\t\tgetContentPane().add(txtName);\n\t\tgetContentPane().add(lblMiddle);\n\t\tgetContentPane().add(lblLastName);\n\t\tgetContentPane().add(lblAddress);\n\t\tgetContentPane().add(lblPhoneNumber);\n\t\tgetContentPane().add(lblName);\n\t\tgetContentPane().add(btnBack);\n\t\tgetContentPane().add(lblTitle);\n\t\tgetContentPane().add(lblBackground);\n\t\t//set size, visible and action for close\n\t\tsetSize(1000,1000);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\n\t}",
"public static WallCourtFragment newInstance() {\n WallCourtFragment fragment = new WallCourtFragment();\n return fragment;\n }",
"public WallBlock(Direction direction) {\n super(LABEL, IS_TRAVERSABLE, IS_DIRECTIONAL, COLOR_IN_LEVEL, direction, loadTexture(TEXTURE));\n }",
"MainBoard createMainBoard();",
"void create(Feedback entity);",
"public Wall()\n {\n GreenfootImage img = this.getImage();\n img.scale(64, 64);\n \n }",
"private void doCreateWorkout(ExercisePlan exercisePlan) {\n if (getMobileClientService() == null) {\n Log.w(TAG, \"Service is still not bound\");\n creatingExercisePlanOperationResult(false, \"Not bound to the service\", null);\n return;\n }\n\n try {\n boolean isCreating = getMobileClientService().createWorkout(exercisePlan);\n if (!isCreating) {\n creatingExercisePlanOperationResult(false, \"No Network Connection\", null);\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n creatingExercisePlanOperationResult(false, \"Error sending message\", null);\n }\n }",
"@Override\n public Board createBoard(String username, String boardname, String category) throws UserNotFoundException {\n // Check the user\n User user = userDataMapper.getUserByUserName(username);\n if (user == null)\n throw new UserNotFoundException();\n\n // Get the board\n Board board = new Board(boardname, category);\n try {\n boardDataGateway.add(board);\n } catch (DataAccessException daex) {\n return null;\n }\n return board;\n }",
"@Override\r\n\tpublic void create() {\n\r\n\t}",
"public boolean addHorizontalWall(int x, int y) {\n if(x+1 > width || y > height) \n throw new IllegalArgumentException(\"Wall exceeds maze boundary\");\n return walls.add(new Wall(x, y, true));\n }",
"public static boolean saveWallMessage(WallMessage wm) {\n \tRecordStore db;\r\n\t\ttry {\r\n\t\t\tdb = RecordStore.openRecordStore(wm.getNickname() + \"wall\", true);\r\n\t\t\tbyte[] b;\r\n\t\t\tb = UtilityData.toByteArray(wm);\r\n\r\n\t \tdb.addRecord(b, 0, b.length);\r\n\t \tdb.closeRecordStore();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t} \r\n \t\r\n \treturn true;\r\n \r\n }",
"private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }",
"@Override\n\tpublic void create() {\n\t\t f=new crazyfail(this);\n\t cfg=new crazyFirstGame(this);\n\t \n\t \t setScreen(cfg);\n\t \n\t\t\n\t}",
"void create(Comment comment);",
"Relationship createRelationship();",
"@Test\n public void createUnassignedGame() throws Exception {\n final GameResource resource = TestUtils.newGameResource();\n resource.setStartsAt(\"2014-03-21T16:00:00.000\");\n\n mockMvc.perform(post(BASE_REQUEST_URL).with(superadmin)\n .header(AUTH_HEADER_NAME, createTokenForUser())\n .contentType(contentType)\n .content(TestUtils.convertObjectToJson(resource)))\n .andExpect(status().isCreated())\n .andExpect(content().contentType(contentType))\n .andExpect(jsonPath(\"$.site\", is(resource.getSite())))\n .andExpect(jsonPath(\"$.startsAt\", is(resource.getStartsAt())));\n }",
"@TargetApi(Build.VERSION_CODES.KITKAT)\n @RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void createReservation() {\n Time timeObj = null;\n DateFormat formatter= new SimpleDateFormat(\"kk:mm\");\n try {\n timeObj = new Time(formatter.parse(time).getTime());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Bitmap generatedQR = generateQR();\n //Create reservation & save to Repository\n Reservation reservation = new Reservation(film, timeObj, listPlaces, generatedQR);\n Repository.addReservation(reservation);\n }",
"protected Drawing createDrawing() {\n return new StandardDrawing();\n }",
"public HorizontalWall(int id, Vector2f position) {\n \t\tsuper(id, HORIZONTAL_WALL_SIZE, position);\n \t\tspriteID = \"horizontal_wall\";\n \t\tGameController.getInstance().getWorld().addEntity(this);\n\t\trenderLayer = RenderLayer.THIRD;\n \t}"
] | [
"0.72829753",
"0.6855897",
"0.6710254",
"0.66748935",
"0.66143215",
"0.65283746",
"0.65004736",
"0.64859205",
"0.63901716",
"0.6058376",
"0.60270727",
"0.59224445",
"0.57755774",
"0.5770485",
"0.57598513",
"0.5727457",
"0.5688981",
"0.5640074",
"0.5593567",
"0.55870646",
"0.5502585",
"0.55007017",
"0.5495958",
"0.5491994",
"0.54883254",
"0.54701185",
"0.54591656",
"0.54563224",
"0.5449241",
"0.5442802",
"0.5434007",
"0.5381923",
"0.5381506",
"0.5361865",
"0.5355582",
"0.53458345",
"0.5321283",
"0.5316888",
"0.53023475",
"0.5278827",
"0.5272044",
"0.5261532",
"0.52543193",
"0.5248625",
"0.5241618",
"0.52242726",
"0.522397",
"0.52239424",
"0.52109396",
"0.52061605",
"0.5205102",
"0.5203072",
"0.51959205",
"0.518468",
"0.51778126",
"0.5173591",
"0.5171818",
"0.51711404",
"0.51665646",
"0.51536685",
"0.51524246",
"0.5149483",
"0.5148247",
"0.51394486",
"0.5127848",
"0.5121238",
"0.5105335",
"0.510454",
"0.5097435",
"0.508863",
"0.5080652",
"0.5079276",
"0.5073042",
"0.50647855",
"0.5048543",
"0.5036555",
"0.50362134",
"0.5033232",
"0.5031934",
"0.5030371",
"0.50286686",
"0.5016475",
"0.50147027",
"0.50010383",
"0.5000621",
"0.49872273",
"0.49787483",
"0.4971395",
"0.49687997",
"0.49609476",
"0.49550194",
"0.49462897",
"0.49448514",
"0.49443513",
"0.4943943",
"0.4938905",
"0.49341905",
"0.49333492",
"0.49088842",
"0.49058387"
] | 0.81822884 | 0 |
Put robot at position (x, y) on board (if possible). Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public void putWall(Board board, long x, long y, Wall wall) throws UnsupportedOperationException
{
try
{
wall.setPosition(new Position(x,y));
wall.setBoard(board);
}
catch(IllegalStateException exc)
{
System.out.println("Either this wall or this board is terminated; the wall cannot be placed on the board.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void putRobot(Board board, long x, long y, Robot robot)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.setPosition(new Position(x,y));\r\n\t\t\trobot.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this robot or this board is terminated; the robot cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public void setRobotLocation(Point p);",
"private void placeRobot(List<String> args) {\n int x;\n int y;\n Position.Direction direction;\n\n try {\n x = Integer.parseInt(args.get(0));\n y = Integer.parseInt(args.get(1));\n direction = Position.Direction.valueOf(args.get(2));\n } catch (NumberFormatException e) {\n System.out.println(\"x and y accept only numbers\");\n return;\n } catch (IllegalArgumentException e) {\n System.out.println(args.get(2) + \" looks an unsupported direction\");\n return;\n }\n\n if(x >= lowerBound.getX() && y >= lowerBound.getY() &&\n x <= upperBound.getX() && y <= upperBound.getY() ) {\n currentPosition.setX(x);\n currentPosition.setY(y);\n currentPosition.setDirection(direction);\n } else {\n System.out.println(\"Cannot position the robot outside the table\");\n }\n }",
"boolean insertRobot(Position pos, Robot rob);",
"protected void setRobotCoordinates(int x, int y, float a) {\r\n currentPos.setCoordinates(x, y, a, (float)x, (float)y);\r\n }",
"Robot getRobot(Position pos);",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void placeRobot(String validPlaceCmd, Robot robot) {\r\n\t\ttry {\r\n\t\t\tString[] placePositionFaceArr = this\r\n\t\t\t\t\t.getRobotPositionAndFace(validPlaceCmd);\r\n\t\t\t\r\n\t\t\tif (placePositionFaceArr.length == 3) {\r\n\t\t\t\tint row = RobotSimulator.isInteger(placePositionFaceArr[0]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[0]) : -1;\r\n\t\t\t\tint col = RobotSimulator.isInteger(placePositionFaceArr[1]) ? Integer\r\n\t\t\t\t\t\t.parseInt(placePositionFaceArr[1]) : -1;\r\n\r\n\t\t\t\trobot.setRow(row);\r\n\t\t\t\trobot.setCol(col);\r\n\r\n\t\t\t\tint faceId = robot.getFaceId(placePositionFaceArr[2]);\r\n\t\t\t\trobot.setFace(faceId);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Place robot exception: \" + e.getMessage());\r\n\t\t}\r\n\t}",
"public void agregarRobot(Robot robot);",
"void setLocation(int x, int y);",
"@Override\n protected void execute() \n {\n move(Robot.oi.mechJoystick);\n }",
"interface Robot {\n // Returns true if the cell in front is open and robot moves into the cell.\n // Returns false if the cell in front is blocked and robot stays in the current cell.\n public boolean move();\n\n // Robot will stay in the same cell after calling turnLeft/turnRight.\n // Each turn will be 90 degrees.\n public void turnLeft();\n\n public void turnRight();\n\n // Clean the current cell.\n public void clean();\n }",
"public abstract void move(int row, int col) throws IllegalMoveException;",
"protected void moveTo(int x, int y) {\n\n if (x < 0 || x > 2)\n throw new IllegalArgumentException(\"x is out of bound\");\n\n if (y < 0 || y > 3)\n throw new IllegalArgumentException(\"y is out of bound\");\n\n this.xPosition = x;\n this.yPosition = y;\n }",
"public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}",
"public void teleportTo(int y, int x){\n\t\tthis.position[y][x] = 1;//makes the position here, used for other object room\n\t}",
"public abstract void move(int newXPosition, int newYPosition, PiecePosition position) throws BoardException;",
"void mouseMove(int x,int y) throws BhelpException\n{\n // BoardLog.logD(\"BHELP\",\"MOVE MOUSE \" + x + \" \" + y);\n\n checkMouse();\n\n Point sp = new Point(x,y);\n convertPointToScreen(sp);\n getRobot().mouseMove(sp.x,sp.y);\n setMouse(x,y);\n}",
"public void pushOccupyingRobot(Vector2 pos) {\n IRobot robot = getRobotOnPos(pos);\n Direction dir = getValidDir(pos);\n\n if (dir != null && robot != null) {\n //System.out.println(robot.getName());\n //System.out.println(dir.toString());\n GameScreen.getInstance().unrenderRobot(robot);\n robot.moveOne(dir);\n GameScreen.getInstance().renderRobot(robot);\n }\n }",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public abstract Piece setLocation(int row, int column);",
"void setPosition(double xPos, double yPos);",
"public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}",
"public void setPosition(float x, float y);",
"public void setDriveCoords(int x, int y) {\n this.drive_control.driveJoyStick(x, y);\n }",
"public void move(int x, int y){\n universe.erase(this);\n this.yPosition = y;\n this.xPosition = x;\n universe.draw(this);\n }",
"protected void moveTo (int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"@Override\r\n\tpublic void setRobot(Robot r) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\trobot = (BasicRobot) r;\r\n\t\t//robot.setMaze(this.mC);\r\n\t\t\r\n\t}",
"public void setMoveTo(Coordinate coordinate);",
"public void setPosition(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public void move(int x, int y) {\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public void resetRobotPositionOnUI() {\r\n\t\tthis.x = checkValidX(1);\r\n\t\tthis.y = checkValidY(1);\r\n\t\ttoggleValid();\r\n\t\trobotImage.setLocation(Constant.MARGINLEFT + (Constant.GRIDWIDTH * 3 - Constant.ROBOTWIDTH)/2 + (x-1) * Constant.GRIDWIDTH, Constant.MARGINTOP + (Constant.GRIDHEIGHT * 3 - Constant.ROBOTHEIGHT)/2 + (y-1) * Constant.GRIDHEIGHT);\r\n\t\t\r\n\t}",
"public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }",
"public void setTargetPosition2(int position,\n HwDevice[] motorArry)\n throws InterruptedException\n {\n motors.setTargetPosition(position,\n motorArry);\n }",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"protected abstract void position(int[][] gameboard, int col, int row);",
"public void setLocation(float x, float y);",
"public void move(int x, int y)\r\n\t{\r\n\t\ttheX = x;\r\n\t\ttheY = y;\r\n\t}",
"private void easyMove(Board board) {\n\t\t\r\n\t}",
"void removeRobot(Position pos);",
"void setPos(float x, float y);",
"@Override\n protected void execute() {\n Robot.driveTrain.drive(Robot.oi.joystick);\n }",
"public void putInCell (int x, int y, Sprite object){\n\t\tif (object instanceof Tile) {\n\t\t\tgameMap[x][y].setTile((Tile)object);\n\t\t\treturn;\n\t\t}\n\t\telse if(gameMap[x][y].getTile() instanceof Target && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\tdecrementOnTarget();\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\tincrementOnTarget();\n\t\t\t}\n\t\t}\n\t\telse if (gameMap[x][y].getTile() instanceof Switch && !this.setup) {\n\t\t\tif(object == null && gameMap[x][y].getObject() instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t\tif(object instanceof Block) {\n\t\t\t\t((Switch)gameMap[x][y].getTile()).turnOnOff(theDoor);\n\t\t\t}\n\t\t}\n\t\tgameMap[x][y].setObject((GameObject)object);\n\t}",
"public void turnToLiving(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = true;\n }",
"public void setPosition(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public void implement(){\n this.rb.moveForward(1);\n \n \n if(this.rb.canPickThing()){\n this.rb.pickThing();\n }\n\n //turn the rb 90 degree to the south\n this.rb.turnLeft();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the east\n this.rb.turnRight();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the north\n this.rb.turnLeft();\n\n //move the navigator\n this.rb.moveForward(2);\n\n //turn Right the robot\n this.rb.turnRight();\n\n //stop at the starting position per move()\n this.rb.moveForward(1); \n \n this.rb.putThing();\n \n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n \n //turn the navigator 90 degree to the west\n this.rb.turnRight();\n \n this.rb.moveForward(1);\n \n this.rb.turnLeft();\n \n this.rb.moveForward(1);\n \n this.rb.turnRight();\n \n this.rb.moveForward(2);\n \n this.rb.turnLeft();\n }",
"public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }",
"@Override\r\n\tpublic void putRepairKit(Board board, long x, long y, RepairKit repairKit)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trepairKit.setPosition(new Position(x,y));\r\n\t\t\trepairKit.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this repair kit or this board is terminated; the repair kit cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}",
"public void robotInit() {\n \tboardSubsystem = new BoardSubsystem();\n }",
"private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }",
"public void move(int x_pos1, int y_pos1)throws Exception{\n //check if its a legal move.\n if(isLegal(x_pos1, y_pos1)) {\n x_pos = x_pos1;\n y_pos = y_pos1;\n }\n else throw new Exception(\"Illegal move.\");\n }",
"public void setPosition(int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public abstract void setPosition(Point2D position);",
"public void setLocation(int x, int y){\n if(x < 0 || x > 19 || y < 0 || y > 19){\n // The user has tried to move outside the bounds of the world, so\n // we call the die() method which causes the Player to die.\n die();\n } else {\n // The user is trying to move within the bounds of the world. Run\n // the Actor class' own setLocation() method to move the Player.\n super.setLocation(x, y);\n }\n }",
"public void setPosition(int x, int y) {\n this.coordX = x;\n this.coordY = y;\n }",
"public abstract void moveTo(double x, double y);",
"public void setUnitOnBoard(Unit unit, int x, int y) {\n\t\tPosition pos = new Position(x, y);\n\t\tunitsOnBoard.put(pos, unit);\n\t\tunitPossitions.put(unit.getId(), pos);\n\t}",
"public PositionInTheGameBoard(int x, int y) throws PositionIsNotInGameboardException\r\n\t{\r\n\t\tif(x < 0 || x >= PositionInTheGameBoard.max_X || y < 0 || y >= PositionInTheGameBoard.max_Y) throw new PositionIsNotInGameboardException();\r\n\t\tthis.X = x;\r\n\t\tthis.Y = y;\r\n\t}",
"public void setPosition(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public void setLoc(int x, int y) {\n locX = x;\n locY = y;\n }",
"@Override\r\n\tpublic void putBattery(Board board, long x, long y, Battery battery)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbattery.setPosition(new Position(x,y));\r\n\t\t\tbattery.setBoard(board);\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Either this battery or this board is terminated; the battery cannot be placed on the board.\");\r\n\t\t}\r\n\t\tcatch(IllegalPositionException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This is not a valid position on the board to place an element.\");\r\n\t\t}\r\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException13() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 0, 0, 2);\n }",
"public void set(int x, int y, int elem){\n matriz[x][y] = elem;\n }",
"protected abstract void moveTo(final float x, final float y);",
"public Point getRobotLocation();",
"public void setPosition(Vector2 position);",
"@Override\r\n\tpublic void moveNextTo(Robot robot, Robot other)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.moveNextTo(other);\r\n\t\t}\r\n\t\tcatch(IllegalBoardException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Both robots are not placed on the same board\");\r\n\t\t}\r\n\t\tcatch(IllegalStateException exc)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"One or both robots is either terminated or does not have a board.\");\r\n\t\t}\r\n\t}",
"void setPosition(Tile t);",
"private void initialiseRobotImage(int x, int y) {\r\n\t\trobotImage = new RobotImageComponent(Constant.ROBOTIMAGEPATHS[this.getDirection()], Constant.ROBOTWIDTH, Constant.ROBOTHEIGHT);\r\n\t\tframe.add(robotImage);\r\n\t\trobotImage.setLocation(Constant.MARGINLEFT + (Constant.GRIDWIDTH * 3 - Constant.ROBOTWIDTH)/2 + (x-1) * Constant.GRIDWIDTH, Constant.MARGINTOP + (Constant.GRIDHEIGHT * 3 - Constant.ROBOTHEIGHT)/2 + (y-1) * Constant.GRIDHEIGHT);\r\n\t}",
"public void activateNearby(int x, int y)\r\n {\r\n for (int row = y - 1; row <= y + 1; row++)\r\n {\r\n for (int col = x - 1; col <= x + 1; col++)\r\n {\r\n if (row != y || col != x)\r\n {\r\n try\r\n {\r\n if (gameBoard.gameCells[row][col].isBomb() == false && gameBoard.gameCells[row][col].isDisable() == false)\r\n {\r\n updateCell(gameBoard.gameCells[row][col]);\r\n }\r\n } catch (ArrayIndexOutOfBoundsException e)\r\n {\r\n }\r\n }\r\n }\r\n }\r\n }",
"public void setMove(char player, int place) {\n\n playBoard[place] = player;\n }",
"public Coordinates shiftCoordinates(int x, int y) throws OutOfBoardException{\n if(this.x + x < 0 || this.y + y < 0){\n throw new OutOfBoardException();\n }\n return new Coordinates(this.x + x, this.y + y);\n }",
"public void setLocation(int x,int y)\n\t{\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t}",
"public void setPosition(Point position);",
"@Override\n protected void execute()\n {\n Robot.driveBase.drive(OI.pilot.leftStick.getY(), OI.pilot.rightStick.getX());\n }",
"private void turnRight() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.SOUTH;\n break;\n case WEST:\n direction = Position.Direction.NORTH;\n break;\n case NORTH:\n direction = Position.Direction.EAST;\n break;\n case SOUTH:\n direction = Position.Direction.WEST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }",
"void setBoard(Board board);",
"public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }",
"@Override\n\tpublic void setPos(int x, int y) {\n\t\txPos = x;\n\t\tyPos = y;\n\t}",
"public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}",
"void setPosition(Point point);",
"@Test\n\tpublic void testSetRobot() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\tassertNotNull(explorer.getRobot());\n\t}",
"public void moveTo(int x, int y) {\n\t\tx2 = x;\n\t\ty2 = y;\n\t}",
"protected void registerTile(int x, int y) {}",
"public void updatePosition(int xPos, int yPos, Port.PortName newPort) {\n this.pos.x = xPos;\n this.pos.y = yPos;\n this.currentPort = newPort;\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException7() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(2, 0, -4, 0);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException11() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(2, 2, 2, 4);\n }",
"public void teleportPlayer(int x, int y){\n hero.setX(x);\n hero.setY(y);\n }",
"public abstract void interagir(Robot robot);",
"public void addObstacle(Coord obstacleCoord);",
"@Test(expected = IllegalArgumentException.class)\n public void moveException1() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 3, 3, 3);\n }",
"public void putPiece(Piece piece, int x, int y)\r\n {\r\n if(isValidSqr(x, y))\r\n {\r\n board[x][y] = piece;\r\n if(piece != null) piece.setLocation(x, y);\r\n }\r\n }",
"@Test\n void RookMoveToFriendlyOccupied() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 4, 3, 1);\n Piece rook2 = new Rook(board, 4, 6, 1);\n\n board.getBoard()[4][3] = rook1;\n board.getBoard()[4][6] = rook2;\n\n board.movePiece(rook1, 4, 6);\n\n Assertions.assertEquals(rook1, board.getBoard()[4][3]);\n Assertions.assertEquals(rook2, board.getBoard()[4][6]);\n }",
"protected abstract void setTile( int tile, int x, int y );",
"@Test(expected = IllegalArgumentException.class)\n public void moveException9() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(0, 0, 2, 0);\n }",
"public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}",
"@Override\r\n\tpublic void ship(Robot t) {\n\t\t\r\n\t}",
"public void setPosition(int posX, int posY) {\n\t}",
"public interface RobotConveyor {\n\n Robot createRobot();\n}"
] | [
"0.76829004",
"0.64633375",
"0.63362956",
"0.62788033",
"0.6267895",
"0.6224045",
"0.6179415",
"0.6107979",
"0.6053112",
"0.60327864",
"0.60311943",
"0.5997327",
"0.5970898",
"0.5868566",
"0.58575785",
"0.5852853",
"0.58490163",
"0.5827849",
"0.58261156",
"0.5787169",
"0.5773875",
"0.576568",
"0.575574",
"0.5745667",
"0.57447356",
"0.5734805",
"0.5726006",
"0.5710143",
"0.5680666",
"0.565793",
"0.5657417",
"0.5648404",
"0.564705",
"0.5643093",
"0.5639491",
"0.5635282",
"0.562476",
"0.5623078",
"0.5622881",
"0.55885756",
"0.5584284",
"0.5573982",
"0.55570865",
"0.5527484",
"0.55270535",
"0.55227906",
"0.55208015",
"0.55165404",
"0.5501715",
"0.5486581",
"0.5482497",
"0.5478252",
"0.54772025",
"0.54702616",
"0.54633653",
"0.5455059",
"0.54520196",
"0.544672",
"0.5439265",
"0.5439043",
"0.54365164",
"0.543259",
"0.542542",
"0.5419786",
"0.5418945",
"0.5416435",
"0.54112065",
"0.5407455",
"0.54029816",
"0.53922063",
"0.5389691",
"0.53847677",
"0.53826976",
"0.53799176",
"0.53789824",
"0.5377281",
"0.53755975",
"0.53752214",
"0.53724",
"0.5371308",
"0.53695035",
"0.5368821",
"0.5366822",
"0.53638595",
"0.5362016",
"0.5361323",
"0.53580356",
"0.5355477",
"0.5353373",
"0.5352182",
"0.53500855",
"0.53482074",
"0.53453535",
"0.53448457",
"0.53424066",
"0.5341011",
"0.5337732",
"0.5336064",
"0.5332539",
"0.5332065"
] | 0.61846644 | 6 |
Return the xcoordinate of wall. This method must throw IllegalStateException if wall is not placed on a board. Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public long getWallX(Wall wall) throws IllegalStateException, UnsupportedOperationException
{
if (wall.getBoard() != null)
{
return wall.getPosition().getCoordX();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic long getRobotX(Robot robot) throws IllegalStateException\r\n\t{\r\n\t\tif (robot.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn robot.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getX() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.x();\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public int getxCoordinate() {\n return xCoordinate;\n }",
"public double getPositionX() {\n\t\treturn this.tilePositionX;\n\t}",
"public int getX() {\n return this.coordinate.x;\n }",
"public int getCoordX() \r\n {\r\n \treturn this.coordX;\r\n }",
"public int getxCoordinate() {\n\t\treturn xCoordinate;\n\t}",
"protected int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getTileX()\n\t{\n\t\treturn this.tileX;\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int getxCoord() {\r\n\t\treturn xCoord;\r\n\t}",
"public int setObjXCoord() {\n\t\tint objX = ThreadLocalRandom.current().nextInt(1, getRoomWidth() - 1);\r\n\t\treturn objX;\r\n\t}",
"public int getTileX() {\n\t\treturn tileX;\n\t}",
"public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}",
"public int getX() {\r\n\t\treturn xcoord;\r\n\t}",
"public final int getPositionX() {\r\n return (int) position.x();\r\n }",
"Coordinate getMinX();",
"public int get_X_Coordinate()\n {\n return currentBallX;\n }",
"public int getX() {\n return xCoord;\n }",
"public int getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getX() {\n return (int) center.getX();\n }",
"public int getX() {\r\n return (int) center.getX();\r\n }",
"public int getXCoordinate ()\n {\n return xCoordinate;\n }",
"public int getX()\r\n {\r\n return xCoord;\r\n }",
"private int get_x() {\n return center_x;\n }",
"protected Number getX() {\n return this.xCoordinate;\n }",
"public double getUserFriendlyXPos(){\n return xPos - myGrid.getWidth()/ HALF;\n }",
"public int x() {\r\n\t\treturn xCoord;\r\n\t}",
"public BoardCoordinate getLeft() {\n return new BoardCoordinate(x-1, y);\n }",
"public int getScreenX()\r\n\t{\r\n\t\treturn mScreen.getX();\r\n\t}",
"public int getX() {\n return (int) this.center.getX();\n }",
"public double getxCoordinate() {\n return xCoordinate;\n }",
"public final int getX()\n\t{\n\t\treturn pos.x;\n\t}",
"public int getX() {\n return PADDING;\n //return columnToX(this.getCols());\n //throw new UnsupportedOperationException();\n }",
"@Basic\n\tpublic double getXCoordinate() {\n\t\treturn this.x;\n\t}",
"@Override\n\t\t\tpublic float x() {\n\t\t\t\treturn swipeTile.x();\n\t\t\t}",
"@Override\n\t\t\tpublic float x() {\n\t\t\t\treturn swipeTile.x();\n\t\t\t}",
"public final double getScreenX() {\n return screenX;\n }",
"public int getXPosition() {\n\t\treturn this.position.x;\n\t}",
"public int getX() {\n synchronized (this.xLock) {\n return (int) this.movementComposer.getXPosition();\n }\n }",
"@Override\n public int getMinTileX() {\n return convertXToTileX(getMinX());\n }",
"public int getXPosition() {\n return xPosition;\n }",
"public int getXPosition() {\n return this.xPosition;\n }",
"public int getxPosition() {\n\t\treturn xPosition;\n\t}",
"public int getX()\n\t{\n\t\treturn m_nPosX;\n\t}",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getXPosition()\n {\n return xPosition;\n }",
"public int getxOnScreen(){\n this.xOnScreen = xMaze * moverStepSizeOnScreen;\n return this.xOnScreen;\n }",
"@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}",
"public double getXCoordinate() {\n return xCoordinate;\n }",
"public int getX() {\n\t\t\n\t\treturn xPosition;\t\t// Gets the x integer\n\t}",
"public float getX() { return xCoordinate;}",
"public int getX() {\n return pos_x;\n }",
"@Override\r\n\tpublic long getSurpriseBoxX(SurpriseBox surpriseBox) throws IllegalStateException\r\n\t{\r\n\t\tif (surpriseBox.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn surpriseBox.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getPositionX() {\n return positionX;\n }",
"@Override\r\n\tpublic long getBatteryX(Battery battery) throws IllegalStateException\r\n\t{\r\n\t\tif (battery.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn battery.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public int getPositionX() {\r\n\t\treturn positionX;\r\n\t}",
"public Double getLoginPosX() {\n\t\treturn this.loginPosX;\n\t}",
"public final float getPositionX() {\r\n\t\treturn getState(false).getPositionX();\r\n\t}",
"public int getX() {\n return (int) xPos;\n }",
"public int getXPoint() {\r\n return this.x;\r\n }",
"public int getX(){\n\t\treturn this.x_location;\n\t}",
"public double getLocationX() {\r\n\t\treturn location.getX();\r\n\t}",
"public int getX() { return position.x; }",
"public int getPos_x(){\n\t\treturn pos_x;\n\t}",
"@Override\r\n\tpublic long getRepairKitX(RepairKit repairKit) throws IllegalStateException\r\n\t{\r\n\t\tif (repairKit.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn repairKit.getPosition().getCoordX();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public Object getCurrentCellX() {\n\t\treturn x;\n\t}",
"public double getxCoord() {\n\t\treturn xCoord;\n\t}",
"public int getXPosition(){\n\t\treturn xPosition;\n\t}",
"public float getX()\n {\n return getBounds().left + positionAnchor.x;\n }",
"public int getSpawnX() \n\t{\n\t\treturn spawnX;\n\t}",
"public int getPositionX(){\n\t\treturn positionx;\n\t}",
"public int getxPos() \n\t{\n\t\treturn xPos;\n\t}",
"public int getxPos() {\n return xPos;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public double getPositionX() {\n return positionX_;\n }",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int xPos() {\r\n\t\treturn this.xPos;\r\n\t}",
"public int getxPos() {\n\t\treturn xPos;\n\t}",
"public int getXcoord(){\n\t\treturn this.coordinates[0];\n\t}",
"public int getWinX() {\r\n return winX;\r\n }",
"public static int getEndXCoordinate(){\n\t\tint x = getThymioEndField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n\n\t\treturn x;\n\t}",
"public int getX()\r\n {\r\n \treturn xPos;\r\n }",
"public int getX() {\r\n return xpos;\r\n }",
"public int getX() {\n return posX;\n }",
"public int getX() {\n return positionX;\n }",
"public final int getAbsoluteX() {\n assert (parent != null);\n if (parent == this) {\n return x;\n }\n if ((parent instanceof TWindow)\n && !(parent instanceof TMenu)\n && !(parent instanceof TDesktop)\n ) {\n // Widgets on a TWindow have (0,0) as their top-left, but this is\n // actually the TWindow's (1,1).\n return parent.getAbsoluteX() + x + 1;\n }\n return parent.getAbsoluteX() + x;\n }",
"public double getX() {\n return position.getX();\n }",
"public double getX() {\r\n\t\t return this.xCoord;\r\n\t }",
"public int getX() {\n return (int) Math.round(x);\n }",
"double getXPosition();",
"public int getGridX() {\r\n\t\treturn gridX;\r\n\t}",
"public int getLocationX() {\r\n\t\treturn x;\r\n\t}",
"public int getXPos() {\n\t\treturn xPos;\n\t}",
"public int getXPos() {\r\n\t\treturn this.cameraX;\r\n\t}"
] | [
"0.6827657",
"0.67032164",
"0.6682258",
"0.6682258",
"0.6642982",
"0.6640676",
"0.66188824",
"0.6599084",
"0.657369",
"0.6531217",
"0.6529813",
"0.6529813",
"0.65204847",
"0.65129364",
"0.6512649",
"0.6509771",
"0.64999187",
"0.64985466",
"0.64973116",
"0.6497107",
"0.6493967",
"0.64936006",
"0.6477278",
"0.64710253",
"0.6451408",
"0.6441207",
"0.64092946",
"0.6407201",
"0.6390425",
"0.6371386",
"0.63489074",
"0.6338178",
"0.63358945",
"0.6333964",
"0.6332276",
"0.63237315",
"0.6300073",
"0.6300073",
"0.62977356",
"0.6293003",
"0.6291925",
"0.6283344",
"0.62780875",
"0.62754035",
"0.62576514",
"0.6254436",
"0.6253949",
"0.6253949",
"0.6253131",
"0.62521005",
"0.62516356",
"0.62462276",
"0.6237694",
"0.6235993",
"0.6204972",
"0.6183676",
"0.61830467",
"0.6176978",
"0.61763203",
"0.61543185",
"0.6151175",
"0.6148355",
"0.61461663",
"0.61453533",
"0.614274",
"0.6141794",
"0.613781",
"0.6137196",
"0.6131319",
"0.6129581",
"0.61151755",
"0.6105753",
"0.6101665",
"0.6095885",
"0.60955644",
"0.60948956",
"0.6094786",
"0.6094786",
"0.6092851",
"0.6092851",
"0.60923374",
"0.6089512",
"0.6089512",
"0.60878587",
"0.6082275",
"0.6081439",
"0.607915",
"0.60788417",
"0.6063424",
"0.6052598",
"0.6047723",
"0.6045275",
"0.60425293",
"0.603781",
"0.6037533",
"0.6036101",
"0.6032742",
"0.6015785",
"0.60130584",
"0.6012188"
] | 0.8476345 | 0 |
Return the ycoordinate of wall. This method must throw IllegalStateException if wall is not placed on a board. Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public long getWallY(Wall wall) throws IllegalStateException, UnsupportedOperationException
{
if (wall.getBoard() != null)
{
return wall.getPosition().getCoordY();
}
else throw new IllegalStateException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoordinate() {\n return yCoordinate;\n }",
"public int getyCoord() {\r\n\t\treturn yCoord;\r\n\t}",
"public int y() {\r\n\t\treturn yCoord;\r\n\t}",
"public int getyCoord() {\n\t\treturn yCoord;\n\t}",
"protected Number getY() {\n return this.yCoordinate;\n }",
"public int getY() {\n return this.coordinate.y;\n }",
"public int getTileY() {\n\t\treturn tileY;\n\t}",
"public int getTileY()\n\t{\n\t\treturn this.tileY;\n\t}",
"public int getCoordY() \r\n {\r\n \treturn this.coordY;\r\n }",
"public int getY() {\n return yCoord;\n }",
"public double getyCoordinate() {\n return yCoordinate;\n }",
"public int getY() {\n if (this.coordinates == null)\n return -1;\n return this.coordinates.y();\n }",
"public int getY() {\r\n\t\treturn ycoord;\r\n\t}",
"public int getY()\r\n {\r\n return yCoord;\r\n }",
"public static int getEndYCoordinate(){\n\tint y = getThymioEndField_Y(); \n\t\t\n\t\tif(y == 0){\n\t\t\n \t}else{\n \t y *= FIELD_HEIGHT;\n \t}\n\t\treturn y;\n\t}",
"public int getYCoordinate()\n\t{\n\t\treturn yCoordinate;\n\t}",
"@Basic\n\tpublic double getYCoordinate() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n return PADDING;\n //return rowToY(this.getRows());\n //throw new UnsupportedOperationException();\n }",
"public double getPositionY() {\n\t\treturn this.tilePositionY;\n\t}",
"public int get_Y_Coordinate()\n {\n return currentBallY;\n }",
"public int getY() {\n synchronized (this.yLock) {\n return (int) this.movementComposer.getYPosition();\n }\n }",
"public double getyCoord() {\n\t\treturn yCoord;\n\t}",
"public int getYCoordinate ()\n {\n return yCoordinate;\n }",
"public final int getY()\n\t{\n\t\treturn pos.y;\n\t}",
"public int getWinY() {\r\n return winY;\r\n }",
"public int getY()\n\t{\n\t\treturn m_nPosY;\n\t}",
"@java.lang.Override\n public long getY() {\n return instance.getY();\n }",
"@Override\r\n\tpublic long getRobotY(Robot robot) throws IllegalStateException\r\n\t{\r\n\t\tif (robot.getBoard() != null)\r\n\t\t{\r\n\t\t\treturn robot.getPosition().getCoordY();\r\n\t\t}\r\n\t\telse throw new IllegalStateException();\r\n\t}",
"public double getYCoordinate() {\n return yCoordinate;\n }",
"public int getY() {\n return (int) Math.round(y);\n }",
"public int getY()\r\n {\r\n return yLoc;\r\n }",
"public int getLocationY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\n return (int) yPos;\n }",
"public int getY() {\n\t\t\n\t\treturn yPosition;\t\t// Gets the y integer\n\t}",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return y;\r\n }",
"public int getY() {\r\n return this.y;\r\n }",
"public int getY() {\r\n\t\treturn this.y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\r\n\t\treturn y;\r\n\t}",
"public int getY() {\n return y;\r\n }",
"public int getY()\r\n\t{\r\n\t\treturn (int)y;\r\n\t}",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY() {\n return y;\n }",
"public int getY()\n {\n return this.y;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn this.y;\n\t}",
"public final double getY() { return location.getY(); }",
"public int setObjYCoord() {\n\t\tint objY = ThreadLocalRandom.current().nextInt(1, getRoomLength() - 1);\r\n\t\treturn objY;\r\n\t}",
"@Override\r\n\tpublic int getY() {\n\t\treturn (int)y;\r\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY()\n\t{\n\t\treturn this.y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY() {\n\t\treturn y;\n\t}",
"public int getY()\r\n\t{\r\n\t\treturn this.Y;\r\n\t}",
"public int getY() {return y;}",
"public int getY()\r\n\t{\r\n\t\treturn y;\r\n\t}",
"public int getYPoint() {\r\n return this.y;\r\n }",
"public int getY()\n\t{\n\t\treturn mY;\n\t}",
"public int getY() { return y; }",
"public int getY() { return y; }",
"public double getY() {\r\n\t\t return this.yCoord;\r\n\t }",
"public int getY() {\n return this.y;\n }",
"public int getyPosition() {\n\t\treturn yPosition;\n\t}",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY() {\n return y_;\n }",
"public int getY()\n {\n return y;\n }"
] | [
"0.6860792",
"0.6860792",
"0.6775678",
"0.6755849",
"0.6733603",
"0.6674291",
"0.6669012",
"0.6657757",
"0.66574234",
"0.66407835",
"0.6626812",
"0.66072",
"0.65933144",
"0.65892553",
"0.6585618",
"0.6568523",
"0.65683615",
"0.65377766",
"0.6531468",
"0.6525537",
"0.6516853",
"0.6507876",
"0.6494153",
"0.64879304",
"0.64867",
"0.64176285",
"0.6417176",
"0.64154977",
"0.6408281",
"0.63988173",
"0.63861835",
"0.6382598",
"0.6381879",
"0.6375169",
"0.63694155",
"0.63629925",
"0.63629925",
"0.63591975",
"0.6358187",
"0.63564247",
"0.63564247",
"0.63564247",
"0.6356286",
"0.6353107",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.6345853",
"0.63390857",
"0.63340044",
"0.63340044",
"0.63340044",
"0.63340044",
"0.63340044",
"0.63324213",
"0.63324213",
"0.63324213",
"0.63291943",
"0.6320921",
"0.63199437",
"0.6314522",
"0.6314522",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6309289",
"0.6306454",
"0.63059807",
"0.6303233",
"0.6302328",
"0.6300426",
"0.62978125",
"0.62978125",
"0.62889457",
"0.62807226",
"0.6280315",
"0.6276943",
"0.6276943",
"0.6276943",
"0.6276943",
"0.6276943",
"0.6276888"
] | 0.8250519 | 0 |
Return a set containing all robots on board. | @Override
public Set<Robot> getRobots(Board board)
{
return board.getElements(Robot.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Robot> getRobots();",
"public List<Robot> getRobotsAlive() {\r\n\t\tList<Robot> listOfAlive = new ArrayList<Robot>();\r\n\r\n\t\tfor(int x = 0; x < 3; ++x) {\r\n\t\t\tif (robots.get(x).isAlive()) {\r\n\t\t\t\tlistOfAlive.add(robots.get(x));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn listOfAlive;\r\n\t}",
"public Set<BoardObject> boardObjects(){\r\n\t\treturn boardObjects;\r\n\t}",
"public ArrayList<String> getRobots() {\n return robotDiscovery.getRobots();\n }",
"public List<Robot> getMoveableRobots() {\r\n\t\tList<Robot> moveable = new ArrayList<Robot>();\r\n\r\n\t\tfor (Robot robot : this.getRobotsAlive()) {\r\n\t\t\tif (robot.getMovement() > 0) {\r\n\t\t\t\tmoveable.add(robot);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn moveable;\r\n\t}",
"public BoardInterface[] getBoards();",
"public LinkedHashSet<Spot> getSpotSet() {\n if (spotSet == null) {\n spotSet = new LinkedHashSet<>();\n for (int x = 0; x < WIDTH; x++) {\n for (int y = 0; y < HEIGHT; y++) {\n spotSet.add(board[x][y]);\n }\n }\n }\n return spotSet;\n }",
"public abstract HashSet<Location> getPossibleMovements(GameBoard board);",
"Set<Object> getAllCells() {\n Set<Object> ret = new HashSet<Object>();\n ret.addAll(getNodes());\n ret.addAll(getEdges());\n \n // ports\n for( DefaultGraphCell node : getNodes() ) {\n ret.add(node.getChildAt(0));\n }\n \n return ret;\n }",
"List<Moves> getMoveSet();",
"public Iterable<Board> solution() {\n\t\treturn result;\n\t}",
"public ArrayList<Tile> getAllBoardTiles() {\n\n\t\tArrayList<ArrayList<Tile>> tilesMapValues=new ArrayList<ArrayList<Tile>>(getTilesMap().values()) ;\n\t\tArrayList<Tile> allTiles =new ArrayList<Tile>() ;\n\t\tfor(ArrayList<Tile> tileList : tilesMapValues) {\n\t\t\tallTiles.addAll(tileList);\n\n\t\t}\n\t\treturn allTiles;\n\t}",
"public List<Computer> getAll(){\n\t\treturn getWithLimit(-1,-1);\n\t}",
"@Override\r\n\tpublic ArrayList<Board1> getAll() {\n\t\treturn dao.selectAll();\r\n\t}",
"public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }",
"private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}",
"public Iterable<Board> neighbors() {\n LinkedList<Board> states = new LinkedList<>();\n LinkedList<int[]> neighbors = neighborFinder();\n int[] curr_loc = blankFinder();\n\n for(int[] temp : neighbors){\n tiles[curr_loc[0]][curr_loc[1]] = tiles[temp[0]][temp[1]];\n tiles[temp[0]][temp[1]] = 0;\n states.add(new Board(deepCopy(tiles)));\n tiles[temp[0]][temp[1]] = tiles[curr_loc[0]][curr_loc[1]];\n tiles[curr_loc[0]][curr_loc[1]] = 0;\n\n }\n return states;\n }",
"public ArrayList<Bot> getAllBots() {\n final String errorMessage = \"Error getting all bots\";\n ResultSet retrievedBots = dbConnector.selectQuery(\"SELECT c.name, bot_id, active_time, probability, activity_status\" +\n \" FROM Bots as b, Company as c WHERE b.company_id = c.company_id;\");\n ArrayList<Bot> bots = null;\n try {\n bots = new ArrayList<Bot>();\n while (retrievedBots.next()) {\n bots.add(toBot(retrievedBots));\n }\n } catch (SQLException e) {\n System.out.println(errorMessage);\n }\n return bots;\n }",
"public List<CommonBoardVO> listAll() throws Exception;",
"@Override\r\n\tpublic Set<Wall> getWalls(Board board) throws UnsupportedOperationException\r\n\t{\r\n\t\treturn board.getElements(Wall.class);\r\n\t}",
"public List<Building> getBoardBuildings() {\n return mPersonalBoardCards.getBoardBuildings();\n }",
"public Set<Integer> getNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n retSet.addAll(this.getActiveNeighbors());\n retSet.addAll(this.purgedNeighbors);\n\n return retSet;\n }",
"public final Collection<DodlesActor> allActors() {\n return all.values();\n }",
"@SuppressWarnings(\"unchecked\")\n public synchronized ObjectSet<BoardThreadLink> getThreads() {\n \tfinal Query q = mDB.query();\n \tq.constrain(BoardThreadLink.class);\n \tq.descend(\"mBoard\").constrain(SubscribedBoard.this).identity(); // TODO: Benchmark whether switching the order of those two constrains makes it faster.\n \tq.descend(\"mLastReplyDate\").orderDescending();\n \treturn new Persistent.InitializingObjectSet<BoardThreadLink>(mFreetalk, q.execute());\n }",
"public abstract Set<Tile> getNeighbors(Tile tile);",
"public Iterable<Board> solution() {\n\n return initialSolvable ? solutionBoards : null;\n }",
"public Iterable<Board> solution() {\n return solution;\n }",
"public List<TicTacToeCoordinates> getAvailableSpots() {\n List<TicTacToeCoordinates> openSpots = new ArrayList<>();\n for (int x = 0; x < boardLength; x++) {\n for (int y = 0; y < boardWidth; y++) {\n if (board[x][y] == '\\u0000') {\n openSpots.add(new TicTacToeCoordinates(x, y));\n }\n }\n }\n return openSpots;\n }",
"public List<UsersRobots> findAll(){\n CriteriaBuilder cb = entityManager.getCriteriaBuilder();\n CriteriaQuery<UsersRobots> cq = cb.createQuery(UsersRobots.class);\n Root<UsersRobots> rootEntry = cq.from(UsersRobots.class);\n CriteriaQuery<UsersRobots> all = cq.select(rootEntry);\n TypedQuery<UsersRobots> allQuery = entityManager.createQuery(all);\n return allQuery.getResultList();\n }",
"public Set<Drone> getDroneSet(){\n\t\treturn new HashSet<Drone>(this.drones.values());\n\t}",
"public List<GameToken> getAllTokens() {\n\t\tList<GameToken> result = new ArrayList<GameToken>();\n\t\tfor (int row = 0; row < board.length; row++) {\n\t\t\tfor (int column = 0; column < board[row].length; column++) {\n\t\t\t\tGameToken token = this.board[row][column];\n\t\t\t\tif (token != null) {\n\t\t\t\t\tresult.add(token);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"@Override\n\tpublic List<SpringBoardVO> boardSelectAll(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelectAll(bvo);\n\t}",
"public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }",
"public Collection<MyNode> getNeighbors(){\r\n return new ArrayList<>(this.neighbors);\r\n }",
"private boolean[][] setRandomBoard() {\n\t\tint size = this.boardSize;\n\t\tboolean[][] randomBoard = new boolean[size][size];\n\t\tRandom rand = new Random();\n\t\t\n\t\tfor(int i=0; i<randomBoard.length; i++)\n\t\t\tfor(int j=0; j<randomBoard[i].length; j++)\n\t\t\t\trandomBoard[i][j] = rand.nextBoolean();\n\t\t\n\t\treturn randomBoard;\n\t}",
"public Iterable<Board> neighbors() {\n int[] pos = zeroPosition();\n int x = pos[0];\n int y = pos[1];\n\n Stack<Board> q = new Stack<>();\n if (x > 0) {\n q.push(twinBySwitching(x, y, x-1, y));\n }\n\n if (x < dimension() - 1) {\n q.push(twinBySwitching(x, y, x+1, y));\n }\n\n if (y > 0) {\n q.push(twinBySwitching(x, y, x, y-1));\n }\n\n if (y < dimension() - 1) {\n q.push(twinBySwitching(x, y, x, y+1));\n }\n\n return q;\n }",
"public ArrayList<PuzzleState> getRandomNeighbors() {\n\t\tArrayList<PuzzleState> ns = getNeighbors();\n\t\tCollections.shuffle(ns);\n\t\treturn ns;\t\n\t}",
"public BoardSquare[] findSet() {\n ArrayList<BoardSquare> allCards = new ArrayList<>(12);\n\n // flatten BoardSquares into one-dimensional array\n for (int row = 0; row < board.numRows(); row++)\n for (int col = 0; col < board.numCols(); col++)\n allCards.add(board.getBoardSquare(row, col));\n\n // loop through every single unique card combination\n for (int i1 = 0; i1 < allCards.size(); i1++) {\n for (int i2 = 1; i2 < allCards.size(); i2++) {\n for (int i3 = 2; i3 < allCards.size(); i3++) {\n if (i1 != i2 && i2 != i3 && i1 != i3) {\n BoardSquare bs1 = allCards.get(i1);\n BoardSquare bs2 = allCards.get(i2);\n BoardSquare bs3 = allCards.get(i3);\n\n boolean set = Card.isSet(\n bs1.getCard(),\n bs2.getCard(),\n bs3.getCard()\n );\n\n if (set)\n return new BoardSquare[] {bs1, bs2, bs3};\n }\n }\n }\n }\n\n // if no set found, return empty Array\n return new BoardSquare[] {};\n }",
"private List<Node> getNodes() {\n List<Node> nodes = new ArrayList<Node>();\n NodeApi.GetConnectedNodesResult rawNodes =\n Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).await();\n for (Node node : rawNodes.getNodes()) {\n nodes.add(node);\n }\n return nodes;\n }",
"Set<Point2D> getWallSet();",
"List<Computer> findAll();",
"public Set<Character> characters(){\r\n\t\tSet<Character> characters = new HashSet<Character>();\r\n\t\tfor(BoardObject object: boardObjects){\r\n\t\t\tif(object instanceof Character)\r\n\t\t\t\tcharacters.add((Character) object);\r\n\t\t}\r\n\t\treturn characters;\r\n\t}",
"public List<Tile> getNeighbors() {\n List<Tile> list = new ArrayList<Tile>();\n\n if (this.tileNorth != null) {\n list.add(this.tileNorth);\n }\n\n if (this.tileEast != null) {\n list.add(this.tileEast);\n }\n\n if (this.tileSouth != null) {\n list.add(this.tileSouth);\n }\n\n if (this.tileWest != null) {\n list.add(this.tileWest);\n }\n\n return list;\n }",
"public GameCell[] getBoardCells(){\r\n return this.boardCells;\r\n }",
"Set<EObject> getAllModelElements();",
"public Set<BoardCell> getTargets() {\n\t\treturn targets; \n\t}",
"public SetOfTiles getSetOfTiles();",
"@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}",
"@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}",
"public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }",
"public NXTRegulatedMotor[] getMotors() {\n\t\treturn new NXTRegulatedMotor[] { leftMotor, rightMotor };\n\t}",
"private Set<Node> getAllCardNodes() {\n return guiRobot.lookup(CARD_PANE_ID).queryAll();\n }",
"public FloorTile[][] getBoard(){\r\n return board;\r\n }",
"Set<Component> getComponents();",
"public Set getBoardSet(String s){\n return board.getSet(s);\n }",
"Set<MacAddress> neighbors();",
"public Collection< Remote > getPreferredRemotes()\n {\n ArrayList< Remote > remotes = new ArrayList< Remote >( preferredListModel.size() );\n for ( Enumeration< ? > e = preferredListModel.elements(); e.hasMoreElements(); )\n remotes.add( ( Remote )e.nextElement() );\n return remotes;\n }",
"public Iterable<Board> solution() {\r\n return this.solution;\r\n }",
"Collection<Node> allNodes();",
"public abstract Set<Genome> getAvailableGenomes();",
"@Override\r\n\tpublic ArrayList<BoardVO> getBoardList() {\n\t\treturn boardDao.getBoardList();\r\n\t}",
"public Iterable<Board> solution() {\n if (!isSolvable()) {\n return null;\n }\n return new BoardIterable();\n }",
"@Override\n public Iterable<WorldState> neighbors() {\n Queue<WorldState> neighbor = new ArrayDeque<>();\n int xDim = 0, yDim = 0;\n int[][] tiles = new int[_N][_N];\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n tiles[i][j] = _tiles[i][j];\n if (_tiles[i][j] == 0) {\n xDim = i;\n yDim = j;\n }\n }\n }\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (Math.abs(i - xDim) + Math.abs(j - yDim) == 1) {\n tiles[i][j] = _tiles[xDim][yDim];\n tiles[xDim][yDim] = _tiles[i][j];\n neighbor.add(new Board(tiles));\n // System.out.println(new Board(tiles));\n tiles[xDim][yDim] = _tiles[xDim][yDim];\n tiles[i][j] = _tiles[i][j];\n }\n }\n }\n return neighbor;\n }",
"public Iterable<Board> solution() {\n if (!isSolvable) return null;\n return solutions;\n }",
"public List<SpeedController> getMotors() {\n\t\treturn new ArrayList<>(motors);\n\t}",
"public Board getOpponentsBoard() {\n return opponentsBoard;\n }",
"public Connector[] getConnectors() {\n Enumeration connectorsEnum = elements();\n Connector[] connectorsArray = new Connector[size()];\n for (int i = 0; i < size(); i++) {\n connectorsArray[i] = (Connector) connectorsEnum.nextElement();\n }\n return connectorsArray;\n }",
"@Exported\n public ArrayList<Slave> getSlaves() {\n return this.slaves;\n }",
"public Set<Terminal> getTerminals() {\n Set<Terminal> ret = new HashSet<>();\n for (Terminal terminal : indices.keySet()) {\n if (contains(terminal))\n ret.add(terminal);\n }\n return ret;\n }",
"public Set<Sendable> getSendables() {\r\n\t\tSet<Sendable> sendables = new HashSet<>();\r\n\t\tfor (Entity[] es : this.entities) {\r\n\t\t\tfor (Entity e : es) {\r\n\t\t\t\tif (e instanceof Sendable) {\r\n\t\t\t\t\tsendables.add((Sendable) e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sendables;\r\n\t}",
"public List<BitOrarioOraLezione> get() {\n List<BitOrarioOraLezione> ris = new ArrayList<>();\n for (ArrayList<BitOrarioOraLezione>[] riga : orario) {\n if (riga != null)\n for (ArrayList<BitOrarioOraLezione> v : riga) {\n if (v != null)\n for (BitOrarioOraLezione bitOrarioOraLezione : v) {\n if (bitOrarioOraLezione != null)\n ris.add(bitOrarioOraLezione);\n }\n }\n }\n return ris;\n }",
"public Iterable<Board> solution() {\n if (!solvable) {\n return null;\n }\n else {\n return new SolutionBoards();\n }\n\n }",
"public ArrayList<Actor> getActors(){\n\t\t\n\t\tArrayList<Location> occupiedLocations = getGrid().getOccupiedLocations();\n\t\toccupiedLocations.remove(getLocation());\n\t\tArrayList<Actor> actors = new ArrayList<Actor>();\n\t\t\n\t\tfor(int i = 0; i < occupiedLocations.size(); i++) {\n\t\t\tactors.add(getGrid().get(occupiedLocations.get(i)));\n\t\t}\n\t\t\n\t\treturn actors;\n\t}",
"public java.util.Set getChildBoards () {\n\t\treturn this._childBoards;\n\t}",
"private List<Coordinate> getAvailableMoves(ImmutableGameBoard gameBoard) {\n List<Coordinate> availableMoves = new ArrayList<Coordinate>();\n\n for (int x = 0; x < gameBoard.getWidth(); x++) {\n for (int y = 0; y < gameBoard.getHeight(); y++) {\n if(gameBoard.getSquare(x, y) == TicTacToeGame.EMPTY)\n availableMoves.add(new Coordinate(x, y));\n }\n }\n\n return availableMoves;\n }",
"public List<String> legalMoves() {\n List<String> result = new ArrayList<>();\n for (int col = 1; col < _board.length + 1; col += 1) {\n for (int row = 1; row < _board.length + 1; row += 1) {\n String move = row + \",\" + col;\n if (isLegal(move)) {\n result.add(move);\n }\n }\n }\n return result;\n }",
"public Tile[][] getBoard() {\r\n return board;\r\n }",
"public Set<Square> validDestinations(Board b);",
"@Override\n\tpublic synchronized Set<PetrinetNode> getNodes() {\n\t\tSet<PetrinetNode> nodes = new HashSet<PetrinetNode>();\n\t\tnodes.addAll(this.transitions);\n\t\tnodes.addAll(this.places);\n\t\treturn nodes;\n\t}",
"@Override\n public List<Building> allBuildings() {\n return dao.all(Building.class);\n }",
"public boolean[][] getBoard() {\r\n return board;\r\n }",
"public Node[] getInternalNodes() {\n return internalPins;\n }",
"public Iterable<Board> solution()\n {\n SearchNode element = getSolutionNode();\n\n Stack<Board> returnList= new Stack<>();\n returnList.push(element.board);\n while (element!=null &&element.previusNode!=null){\n\n element = element.previusNode;\n returnList.push(element.board);\n }\n\n return new Iterable<Board>() {\n @Override\n public Iterator<Board> iterator()\n {\n return returnList.iterator();\n }\n };\n }",
"public List<String> allSquaresNoMove ()\n {\n List<Square> squareList = new ArrayList<>();\n List<String> stringList = new ArrayList<>();\n\n squareList.addAll(player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX() , player.getSquare().getY(),2));\n\n for (Square square : squareList)\n stringList.add(square.toStringCoordinates());\n\n return stringList;\n\n }",
"public Iterable<Board> solution() {\r\n if (!isSolvable) return null;\r\n return new NodeQueue();\r\n }",
"public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllPartOfSet_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), PARTOFSET);\r\n\t}",
"public List<REPoint> getObstacles();",
"public List<Tile> getNeighbours() {\n \r\n return neighbours;\r\n }",
"private void setNeighbors()\r\n {\r\n for (int x = 0; x < length+2; ++x)\r\n {\r\n for (int y = 0; y < width+2; ++y)\r\n {\r\n // North\r\n if (!this.board[x][y].northwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y-1]);\r\n }\r\n // South\r\n if (!this.board[x][y].southwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y+1]);\r\n }\r\n // East\r\n if (!this.board[x][y].eastwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x+1][y]);\r\n }\r\n // West\r\n if (!this.board[x][y].westwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x-1][y]);\r\n }\r\n }\r\n }\r\n }",
"private void initRobots() {\n\t\tthis.robots.clear();\n\t\tGraphRobot robot = new GraphRobot();\n\t\tString info = game.toString();\n\t\ttry {\n\t\t\tJSONObject line = new JSONObject(info);\n\t\t\tJSONObject ttt = line.getJSONObject(\"GameServer\");\n\t\t\tint rs = ttt.getInt(\"robots\");\n\t\t\tfor(int a = 0;a<rs;a++) {\n\t\t\t\tgame.addRobot(a);\n\t\t\t}\n\t\t}\n\t\tcatch (JSONException e) {e.printStackTrace();}\n\n\t\tList<String> r = game.getRobots();\n\t\tfor(String s : r) {\n\t\t\trobot.initRobot(s);\n\t\t\tthis.robots.add(robot);\n\t\t}\n\t}",
"public List<Piece> allPieces();",
"Data<List<Boards>> getBoards();",
"List<CommunicationLink> getAllNodes()\n {\n return new ArrayList<>(allNodes.values());\n }",
"Set<String> getOsPSet();",
"@Override\r\n\tpublic Set<RepairKit> getRepairKits(Board board)\r\n\t{\r\n\t\treturn board.getElements(RepairKit.class);\r\n\t}",
"@Override\n\tpublic Iterable<Oglas> findAll() {\n\t\treturn repository.findAll();\n\t}",
"Set<Client> getAllClients();",
"public List<Automotor> getAll()\n {\n\n CriteriaQuery<Automotor> criteria = this.entityManager.getCriteriaBuilder().createQuery(Automotor.class);\n return this.entityManager.createQuery(criteria.select(criteria.from(Automotor.class))).getResultList();\n }",
"@Override\n\tpublic List<Map> boardList() {\n\t\treturn dao.boardList(session);\n\t}",
"public Iterable<Board> solution() {\n \tif (!isSolvable) return null;\n \tDeque<Board> solution = new LinkedList<>();\n \tSearchNode node = solutionNode;\n \twhile (node != null) {\n \t\tsolution.addFirst(node.getBoard());\n \t\tnode = node.prev();\n \t}\n \treturn solution;\n }"
] | [
"0.6685336",
"0.6407249",
"0.6307097",
"0.62511784",
"0.61883074",
"0.6057492",
"0.6035451",
"0.5968715",
"0.59071773",
"0.5842997",
"0.5768713",
"0.57181215",
"0.5706729",
"0.56836724",
"0.5664434",
"0.56387246",
"0.5631908",
"0.5618537",
"0.5616972",
"0.56026405",
"0.55824244",
"0.5580058",
"0.5545331",
"0.5544133",
"0.5530466",
"0.5521327",
"0.5515164",
"0.55069965",
"0.549256",
"0.54820126",
"0.54795843",
"0.5474946",
"0.544783",
"0.5444654",
"0.54148734",
"0.5399719",
"0.53757083",
"0.537278",
"0.53642607",
"0.53589034",
"0.5348648",
"0.5344275",
"0.53401124",
"0.53377146",
"0.5322861",
"0.5318609",
"0.5305638",
"0.5295228",
"0.5295228",
"0.52878606",
"0.5286695",
"0.5278788",
"0.5276837",
"0.52668595",
"0.5266397",
"0.52594197",
"0.5250432",
"0.5247291",
"0.523769",
"0.5223201",
"0.5218871",
"0.52175117",
"0.52136266",
"0.52065134",
"0.5198042",
"0.51977825",
"0.51971805",
"0.51921934",
"0.51658964",
"0.5164978",
"0.51566523",
"0.51548034",
"0.5154494",
"0.51519686",
"0.51475054",
"0.51454586",
"0.51415527",
"0.51387215",
"0.51313066",
"0.51301205",
"0.5126057",
"0.51207185",
"0.51167595",
"0.5105827",
"0.5103189",
"0.50979966",
"0.5093446",
"0.5085309",
"0.5084978",
"0.50762135",
"0.5075255",
"0.5074922",
"0.50728893",
"0.5068417",
"0.5068173",
"0.5064983",
"0.50636244",
"0.5060935",
"0.5060004",
"0.50444746"
] | 0.78949624 | 0 |
Return a set containing all walls on board. Students working on their own are allowed to throw UnsupportedOperationException. | @Override
public Set<Wall> getWalls(Board board) throws UnsupportedOperationException
{
return board.getElements(Wall.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Set<Wall> getWallSet() {\n return walls;\n }",
"Set<Point2D> getWallSet();",
"public Wall[] getWalls() {\n/* 3438 */ if (this.walls != null) {\n/* 3439 */ return this.walls.<Wall>toArray(new Wall[this.walls.size()]);\n/* */ }\n/* 3441 */ return emptyWalls;\n/* */ }",
"public ArrayList<Block> getWalls() {\n\t\tArrayList<Block> b = new ArrayList<Block>();\n\t\tfor (int i = 0; i <maze.size(); i++) {\n\t\t\tif (maze.get(i).t == 'w') {\n\t\t\t\tb.add(maze.get(i));\n\t\t\t}\n\t\t}\n\t\treturn b;\n\t}",
"public void getWalls() {\n\t\tRandomMapGenerator rmg = new RandomMapGenerator();\n\n\t\tboolean[][] cm = rmg.cellmap;\n\n\t\tfor (int x = 0; x < rmg.width; x++) {\n\t\t\tfor (int y = 0; y < rmg.height; y++) {\n\t\t\t\tif (cm[x][y]) {\n\t\t\t\t\twallArray.add(new Wall(x * 12, y * 12, mode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public int[] getWalls(){\n\t\tint[] walls = new int[4];\n\t\twalls[0] = eastWall;\n\t\twalls[1] = northWall;\n\t\twalls[2] = westWall;\n\t\twalls[3] = southWall;\n\t\treturn walls;\n\t}",
"public Wall[] getExteriorWalls() {\n/* 3497 */ if (this.walls != null) {\n/* */ \n/* 3499 */ Set<Wall> wallsSet = new HashSet<>();\n/* 3500 */ for (Wall w : this.walls) {\n/* */ \n/* 3502 */ if (!w.isIndoor())\n/* 3503 */ wallsSet.add(w); \n/* */ } \n/* 3505 */ return wallsSet.<Wall>toArray(new Wall[wallsSet.size()]);\n/* */ } \n/* */ \n/* 3508 */ return emptyWalls;\n/* */ }",
"public Wall getWhiteWallsOnBoard(int index)\n {\n Wall aWhiteWallsOnBoard = whiteWallsOnBoard.get(index);\n return aWhiteWallsOnBoard;\n }",
"@SuppressWarnings(\"unchecked\")\n public synchronized ObjectSet<BoardThreadLink> getThreads() {\n \tfinal Query q = mDB.query();\n \tq.constrain(BoardThreadLink.class);\n \tq.descend(\"mBoard\").constrain(SubscribedBoard.this).identity(); // TODO: Benchmark whether switching the order of those two constrains makes it faster.\n \tq.descend(\"mLastReplyDate\").orderDescending();\n \treturn new Persistent.InitializingObjectSet<BoardThreadLink>(mFreetalk, q.execute());\n }",
"public abstract Set<Tile> getNeighbors(Tile tile);",
"private Set<Hole> createHoleSet(){\n Set<Hole> holeSet = new HashSet<>();\n for (Profile profile:profiles) {\n holeSet.addAll(profile.getHoles());\n }\n return holeSet;\n }",
"public List<Tile> getNeighbors() {\n List<Tile> list = new ArrayList<Tile>();\n\n if (this.tileNorth != null) {\n list.add(this.tileNorth);\n }\n\n if (this.tileEast != null) {\n list.add(this.tileEast);\n }\n\n if (this.tileSouth != null) {\n list.add(this.tileSouth);\n }\n\n if (this.tileWest != null) {\n list.add(this.tileWest);\n }\n\n return list;\n }",
"public void setWalls (Array<Rectangle> walls) {\n\t\tthis.walls = walls;\n\t}",
"private ArrayList<GameSquare> getAdjacentEmptySquares()\n {\n ArrayList<GameSquare> list = new ArrayList<GameSquare>();\n for (GameSquare square : getAdjacentSquares())\n {\n if (!square.mine && square.adjacentMines == 0) //Must check to see if square is a mine, because mines\n {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //may not have the correct value for adjacentMines.\n list.add(square);\n }\n }\n return list;\n }",
"public BoardInterface[] getBoards();",
"List<double[]> getHorizontalWalls();",
"protected void checkForWalls(int x, int y, ArrayList<Position> walls) {\n int x1 = x - 1;\n int x2 = x + 2;\n int y1 = y - 1;\n int y2 = y + 2;\n\n if (x == 0) // We want to avoid an OutOfBounds exception\n x1 = x;\n if (x == sizeOfFloor - 1)\n x2 = sizeOfFloor;\n if (y == 0)\n y1 = y;\n if (y == sizeOfFloor - 1)\n y2 = sizeOfFloor;\n\n\n for (int i = x1; i < x2; i++) {\n for (int j = y1; j < y2; j++) {\n if (layout[i][j].getContent() == 'a')\n walls.add(layout[i][j]);\n }\n }\n }",
"private void buildWalls() {\n for (Position floor : floors) {\n addWall(floor.xCoordinate, floor.yCoordinate);\n }\n }",
"private void renderPlayerWalls() {\n\t\tfor(List<Tile> list : game.tiles()) {\n\t\t\tfor(Tile tile : list) {\n\t\t\t\t//Why does this not work?!\n\t\t\t\tif(tile.hasWall()) {\n\t\t\t\t\tthis.output[tile.position().y][tile.position().x] = WALL_SIGN;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static Set getAllEnzymes()\n {\n return Collections.unmodifiableSet(enzymeToPattern.keySet());\n }",
"public void buildWall() {\n for (int i = 0; i < worldWidth; i += 1) {\n for (int j = 0; j < worldHeight; j += 1) {\n if (world[i][j].equals(Tileset.NOTHING)\n && isAdjacentFloor(i, j)) {\n world[i][j] = Tileset.WALL;\n }\n }\n }\n }",
"public Set<BoardObject> boardObjects(){\r\n\t\treturn boardObjects;\r\n\t}",
"private void setNeighbors()\r\n {\r\n for (int x = 0; x < length+2; ++x)\r\n {\r\n for (int y = 0; y < width+2; ++y)\r\n {\r\n // North\r\n if (!this.board[x][y].northwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y-1]);\r\n }\r\n // South\r\n if (!this.board[x][y].southwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x][y+1]);\r\n }\r\n // East\r\n if (!this.board[x][y].eastwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x+1][y]);\r\n }\r\n // West\r\n if (!this.board[x][y].westwall)\r\n {\r\n this.board[x][y].neighbors.add(this.board[x-1][y]);\r\n }\r\n }\r\n }\r\n }",
"public SetOfTiles getSetOfTiles();",
"public Wall getBlackWallsOnBoard(int index)\n {\n Wall aBlackWallsOnBoard = blackWallsOnBoard.get(index);\n return aBlackWallsOnBoard;\n }",
"public Collection<MyNode> getNeighbors(){\r\n return new ArrayList<>(this.neighbors);\r\n }",
"public Set<Square> validDestinations(Board b);",
"public ArrayList<Tile> getAllBoardTiles() {\n\n\t\tArrayList<ArrayList<Tile>> tilesMapValues=new ArrayList<ArrayList<Tile>>(getTilesMap().values()) ;\n\t\tArrayList<Tile> allTiles =new ArrayList<Tile>() ;\n\t\tfor(ArrayList<Tile> tileList : tilesMapValues) {\n\t\t\tallTiles.addAll(tileList);\n\n\t\t}\n\t\treturn allTiles;\n\t}",
"private void generateAddWalls(int x, int y) {\n\n\t\t// make center walkable\n\t\tmaze[x][y] = Block.EMPTY;\n\n\t\t// all around add to list\n\t\tfor (Point point : allDirections) {\n\t\t\tif (x > 1 && y > 1 && x < width - 2 && y < height - 2\n\t\t\t\t\t&& maze[x + point.x][y + point.y] == Block.WALL)\n\t\t\t\twallList.add(new Point(x + point.x, y + point.y));\n\t\t}\n\t}",
"private Set<Edge> basicEdges() {\n Set<Edge> set = new LinkedHashSet<>();\n set.add(new Edge(0, 1, 8, false));\n set.add(new Edge(0, 2, 7, false));\n set.add(new Edge(0, 3, 1, false));\n set.add(new Edge(1, 3, 9, false));\n set.add(new Edge(1, 5, 6, false));\n set.add(new Edge(2, 4, 2, false));\n set.add(new Edge(3, 5, 3, false));\n set.add(new Edge(3, 6, 4, false));\n set.add(new Edge(4, 5, 10, false));\n set.add(new Edge(4, 6, 5, false));\n return set;\n }",
"public Iterable<Board> neighbors() {\n LinkedList<Board> states = new LinkedList<>();\n LinkedList<int[]> neighbors = neighborFinder();\n int[] curr_loc = blankFinder();\n\n for(int[] temp : neighbors){\n tiles[curr_loc[0]][curr_loc[1]] = tiles[temp[0]][temp[1]];\n tiles[temp[0]][temp[1]] = 0;\n states.add(new Board(deepCopy(tiles)));\n tiles[temp[0]][temp[1]] = tiles[curr_loc[0]][curr_loc[1]];\n tiles[curr_loc[0]][curr_loc[1]] = 0;\n\n }\n return states;\n }",
"public List<Piece> getEdges() {\n List<Piece> result = new ArrayList<>();\n result.add(_board[0][1]);\n result.add(_board[1][0]);\n result.add(_board[1][2]);\n result.add(_board[2][1]);\n return result;\n }",
"public Iterable<Board> neighbors() {\n int[] pos = zeroPosition();\n int x = pos[0];\n int y = pos[1];\n\n Stack<Board> q = new Stack<>();\n if (x > 0) {\n q.push(twinBySwitching(x, y, x-1, y));\n }\n\n if (x < dimension() - 1) {\n q.push(twinBySwitching(x, y, x+1, y));\n }\n\n if (y > 0) {\n q.push(twinBySwitching(x, y, x, y-1));\n }\n\n if (y < dimension() - 1) {\n q.push(twinBySwitching(x, y, x, y+1));\n }\n\n return q;\n }",
"private List<Collection<Pixel>> holeFinder() {\n\n\t\tList<Pixel> holePixels = new LinkedList<Pixel>();\n\t\tList<Pixel> boundaryPixels = new LinkedList<Pixel>();\n\t\tQueue<Pixel> bfsQueue = new LinkedList<Pixel>();\n\t\tboolean[][] marked = new boolean[mRows][mCols];\n\n\t\tPixel pixel = findFirstHolePixel();\n\t\tbfsQueue.add(pixel);\n\t\tholePixels.add(pixel);\n\t\tmarked[pixel.getRow()][pixel.getCol()] = true;\n\n\t\twhile (!bfsQueue.isEmpty()) {\n\t\t\tPixel currentPixel = bfsQueue.remove();\n\n\t\t\tList<Pixel> connectedPixels = mConnections.getConnections(currentPixel);\n\n\t\t\t// iterates on the pixels who are connected to current pixel\n\t\t\t// if the pixel was already visited skip it\n\t\t\t// else, if the pixel is a hole add it to the list of the holes and to the BFS Queue to expand the hole\n\t\t\t// \t\t else add it to the result list, the pixel belongs to the boundary\n\t\t\tfor (Pixel p : connectedPixels) {\n\t\t\t\tint indexRow = p.getRow();\n\t\t\t\tint indexCol = p.getCol();\n\n\t\t\t\tif (!marked[indexRow][indexCol]) {\n\t\t\t\t\tmarked[indexRow][indexCol] = true;\n\n\t\t\t\t\tif (mImage[indexRow][indexCol] == HOLE) {\n\t\t\t\t\t\tholePixels.add(p);\n\t\t\t\t\t\tbfsQueue.add(p);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tp.setColor(mImage[p.getRow()][p.getCol()]);\n\t\t\t\t\t\tboundaryPixels.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tList<Collection<Pixel>> result = new LinkedList<Collection<Pixel>>();\n\t\tresult.add(boundaryPixels);\n\t\tresult.add(holePixels);\n\t\treturn result;\n\t}",
"private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}",
"public List<Piece> whitePieces();",
"public java.util.Set getChildBoards () {\n\t\treturn this._childBoards;\n\t}",
"public Set<Integer> getNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n retSet.addAll(this.getActiveNeighbors());\n retSet.addAll(this.purgedNeighbors);\n\n return retSet;\n }",
"public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }",
"private void addWalls() {\n wallList.add(new RectF(0, 0, wallSize, screenHeight / 2 - doorSize));\n wallList.add(new RectF(0, screenHeight / 2 + doorSize, wallSize, screenHeight));\n wallList.add(new RectF(0, 0, screenWidth / 2 - doorSize, wallSize));\n wallList.add(new RectF(screenWidth / 2 + doorSize, 0, screenWidth, wallSize));\n wallList.add(new RectF(screenWidth - wallSize, 0, screenWidth, screenHeight / 2 - doorSize));\n wallList.add(new RectF(screenWidth - wallSize, screenHeight / 2 + doorSize, screenWidth, screenHeight));\n wallList.add(new RectF(0, screenHeight - wallSize, screenWidth / 2 - doorSize, screenHeight));\n wallList.add(new RectF(screenWidth / 2 + doorSize, screenHeight - wallSize, screenWidth, screenHeight));\n }",
"public List<Tile> getOwnedTiles() {\n return new ArrayList<Tile>(ownedTiles);\n }",
"public ArrayList<Collidable> getNeighbors();",
"List<Tile> getAdjacentTiles();",
"public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }",
"public List<Building> getBoardBuildings() {\n return mPersonalBoardCards.getBoardBuildings();\n }",
"Set<Object> getAllCells() {\n Set<Object> ret = new HashSet<Object>();\n ret.addAll(getNodes());\n ret.addAll(getEdges());\n \n // ports\n for( DefaultGraphCell node : getNodes() ) {\n ret.add(node.getChildAt(0));\n }\n \n return ret;\n }",
"public ArrayList<Cell> getPseudoLegalMoves() {\n\n int[][] offsetMultiplier = {{-1,-1},{-1,1},{1,-1},{1,1}}; //4 directions NW, NE, SW, SE\n int x = getRow(); int y = getColumn();\n\n\n return Piece.slidingPieceMoves(x,y,this.getColor(),offsetMultiplier);\n\n }",
"private ArrayList<GameSquare> getAdjacentSquares()\n {\n ArrayList<GameSquare> list = new ArrayList<GameSquare>();\n for (int r = row - 1; r <= row + 1; r++)\n {\n if (r >= 0 && r < grid.length)\n {\n for (int c = col - 1; c <= col + 1; c++)\n {\n if (c >= 0 && c < grid[0].length)\n {\n list.add(grid[r][c]);\n }\n }\n }\n }\n return list;\n }",
"public List<Piece> allPieces();",
"public ArrayList<Tile> getEmptyTiles(){\n\t\tArrayList<Tile> emptyTiles = new ArrayList<Tile>();\n\t\tArrayList<Tile> boardTiles = getAllBoardTiles();\n\t\tfor (Tile tile : boardTiles) {\n\t\t\tif(tile.getPiece()== null && tile.getColor1()== PrimaryColor.BLACK) {\n\t\t\t\temptyTiles.add(tile);\n\t\t\t}\n\t\t}\n\t\treturn emptyTiles;\n\t}",
"List<Move> legalMoves(Piece side) {\r\n legalMovesArr = new ArrayList<Move>();\r\n HashSet<Square> pieceSide = pieceLocations(side);\r\n for (Square pieces : pieceSide) {\r\n for (int i = 0; i <= 8; i++) {\r\n Move x = mv(pieces, sq(pieces.col(), i));\r\n legalMovesArr.add(x);\r\n }\r\n for (int j = 0; j <= 8; j++) {\r\n Move y = mv(pieces, sq(j, pieces.row()));\r\n legalMovesArr.add(y);\r\n }\r\n while (legalMovesArr.remove(null));\r\n }\r\n return legalMovesArr;\r\n }",
"public List<String> allSquaresNoMove ()\n {\n List<Square> squareList = new ArrayList<>();\n List<String> stringList = new ArrayList<>();\n\n squareList.addAll(player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX() , player.getSquare().getY(),2));\n\n for (Square square : squareList)\n stringList.add(square.toStringCoordinates());\n\n return stringList;\n\n }",
"public ArrayList<Cell> getPseudoLegalMoves() {\n\n Cell[][] board = Board.getBoard();\n ArrayList<Cell> moves = new ArrayList<Cell>();\n\n //Possible ways to move a knight\n int[][] possibleOffsets = {{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,1},{2,-1}};\n\n for(int i=0; i<possibleOffsets.length; i++){\n int x = possibleOffsets[i][0] + getRow();\n int y = possibleOffsets[i][1] + getColumn();\n\n //Making sure we dont leave the board\n if(x >= board.length || x < 0\n || y >= board.length || y < 0)\n continue;\n\n //Making sure destination does not contain a friendly piece\n if(Board.containsPieceOfColor(x,y,this.getColor()))\n continue;\n\n moves.add(board[x][y]);\n }\n\n return moves;\n }",
"public List<OwnedWarp> getAll() {\n List<OwnedWarp> ret = new ArrayList<OwnedWarp>();\n Set<String> keyset = warps.keySet();\n for(String key : keyset)\n ret.addAll(warps.get(key));\n return ret;\n }",
"public Wall[] getWallsForLevel(int floorLevel) {\n/* 3478 */ if (this.walls != null) {\n/* */ \n/* 3480 */ Set<Wall> wallsSet = new HashSet<>();\n/* 3481 */ for (Wall w : this.walls) {\n/* */ \n/* 3483 */ if (w.getFloorLevel() == floorLevel)\n/* 3484 */ wallsSet.add(w); \n/* */ } \n/* 3486 */ return wallsSet.<Wall>toArray(new Wall[wallsSet.size()]);\n/* */ } \n/* */ \n/* 3489 */ return emptyWalls;\n/* */ }",
"Set<MacAddress> neighbors();",
"@Override\n public Iterable<WorldState> neighbors() {\n Queue<WorldState> neighbor = new ArrayDeque<>();\n int xDim = 0, yDim = 0;\n int[][] tiles = new int[_N][_N];\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n tiles[i][j] = _tiles[i][j];\n if (_tiles[i][j] == 0) {\n xDim = i;\n yDim = j;\n }\n }\n }\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (Math.abs(i - xDim) + Math.abs(j - yDim) == 1) {\n tiles[i][j] = _tiles[xDim][yDim];\n tiles[xDim][yDim] = _tiles[i][j];\n neighbor.add(new Board(tiles));\n // System.out.println(new Board(tiles));\n tiles[xDim][yDim] = _tiles[xDim][yDim];\n tiles[i][j] = _tiles[i][j];\n }\n }\n }\n return neighbor;\n }",
"public List<Square> getSquareGrid();",
"public List<Tile> getNeighbours() {\n \r\n return neighbours;\r\n }",
"public void createMaze(int rows, int cols) {\n\t\t\n\t\tint total = rows*cols;\n\t\tDisjSets ds = new DisjSets(total); //Create an object of the disjoint set class\n\t\t \n\t\tList<List<Node>> maze = new ArrayList<List<Node>>();\n\t\t \n\t\tmaze = initializeMaze(rows, cols, maze); //Initialize the maze\n\t\t \n\t\tRandom rand = new Random();\n\t\t \n\t\twhile(ds.find(0) != ds.find(total - 1)) {\n\t\t\t \n\t\t\tint currRow = rand.nextInt(rows); //Random row number\n\t\t\tint currCol = rand.nextInt(cols); //Random column number\n\t\t\tNode currNode = maze.get(currRow).get(currCol); //Current node(cell)\n\t\t\tint currValue = currNode.value;\n\t\t\t \n\t\t\tint root1 = ds.find(currValue); //Find on current node(cell)\n\t\t\tint root2;\n\t\t\tboolean removeHorizontal = false;\n\t\t\t \n\t\t\tif(currValue == total - 1) {\n\t\t\t\tcontinue; //Don't do anything if the current cell is the bottom-rightmost cell\n\t\t\t}\n\t\t\t \n\t\t\tif(currRow == rows - 1) {\n\t\t\t\t//Last row -- can only break the right wall, can't break the wall to the bottom \n\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t} else if(currCol == cols - 1) {\n\t\t\t\t//Last column -- can only break the wall to the bottom, can't break the right wall \n\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\tremoveHorizontal = true;\n\t\t\t} else {\n\t\t\t\t//Neither last row nor last column\n\t\t\t\t//Randomly select either right wall or wall to the bottom to break\n\t\t\t\tboolean selectRight;\n\t\t\t\tselectRight = rand.nextBoolean();\n\t\t\t\t \n\t\t\t\tif(selectRight) {\n\t\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t\t} else {\n\t\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\t\tremoveHorizontal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Finds resulted in different sets\n\t\t\tif(root1 != root2) {\n\t\t\t\t \n\t\t\t\tds.union(root1, root2); //Take union of the two sets\n\t\t\t\t \n\t\t\t\tif(removeHorizontal) {\n\t\t\t\t\tcurrNode.horizontal = false; //Break the horizontal wall\n\t\t\t\t} else {\n\t\t\t\t\tcurrNode.vertical = false; //Break the vertical wall\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Leave the bottom right corner open\n\t\tNode destination = maze.get(rows - 1).get(cols - 1);\n\t\tdestination.horizontal = false;\n\t\tdestination.vertical = false;\n\t\t \n\t\tprintMaze(rows, cols, maze); //Print the final maze\n\t}",
"public final java.util.List<java.util.List<org.xms.g.maps.model.LatLng>> getHoles() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getHoles()\");\n java.util.List<java.util.List<com.huawei.hms.maps.model.LatLng>> hReturn = ((com.huawei.hms.maps.model.PolygonOptions) this.getHInstance()).getHoles();\n return org.xms.g.utils.Utils.mapList(hReturn, e -> org.xms.g.utils.Utils.mapList2X(e, true));\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getHoles()\");\n java.util.List<java.util.List<com.google.android.gms.maps.model.LatLng>> gReturn = ((com.google.android.gms.maps.model.PolygonOptions) this.getGInstance()).getHoles();\n return org.xms.g.utils.Utils.mapList(gReturn, e -> org.xms.g.utils.Utils.mapList2X(e, false));\n }\n }",
"List<Moves> getMoveSet();",
"@Override\r\n\tpublic Wall createWall() throws UnsupportedOperationException\r\n\t{\r\n\t\treturn new Wall();\r\n\t}",
"public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }",
"@Override\n\tpublic List<Map> boardList() {\n\t\treturn dao.boardList(session);\n\t}",
"private void checkWalls() {\n\t\tcheckSideWalls();\n\t\tcheckTopWall();\n\t\tcheckBottomWall();\n\t}",
"public boolean isWall() {\n return type == CellType.WALL;\n }",
"IList<Edge> getWalls(ArrayList<ArrayList<Vertex>> v, ArrayList<Edge> all) {\n IList<Edge> finalEdges = new Empty<Edge>();\n for (Edge e : all) {\n boolean valid = true;\n for (ArrayList<Vertex> l : v) {\n for (Vertex vt : l) {\n for (Edge e2 : vt.outEdges) {\n if (e.equals(e2) || (e.to == e2.from && e.from == e2.to)) {\n valid = false;\n }\n }\n }\n }\n if (valid) {\n finalEdges = finalEdges.add(e);\n }\n }\n return finalEdges;\n }",
"Data<List<Boards>> getBoards();",
"public ArrayList<Coordinate> possibleTiles(Coordinate start) {\n\t\t\tHashMap<Coordinate, MapTile> wallMap = World.getMap();\n\t\t\tLinkedList<Coordinate> queue = new LinkedList<Coordinate>();\n\t\t\tArrayList<Coordinate> visited = new ArrayList<Coordinate>();\n\t\t\tqueue.add(start);\n\t\t\twhile (!queue.isEmpty()) {\n\t\t\t\tCoordinate temp = queue.poll();\n\t\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\t\tCoordinate next = new Coordinate(temp.toString());\n\t\t\t\t\tswitch(i) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tnext.y--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tnext.x++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tnext.y++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tnext.x--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!visited.contains(next) && !wallMap.get(next).isType(MapTile.Type.WALL)) {\n\t\t\t\t\t\tqueue.add(next);\n\t\t\t\t\t\tvisited.add(next);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn visited;\n\t\t}",
"public ArrayList<Hole> availableMoves(Side turnSide){\n ArrayList<Hole> holesOwned = new ArrayList<>();\n for(Hole h : holes){\n if(h.getOwner() == turnSide && h.getNumberOfKoorgools() != 0){\n holesOwned.add(h);\n }\n }\n return holesOwned;\n }",
"Set<E> getForwardNeighbors();",
"private void createWalls(){\n\t \tfloat wallWidth = GameRenderer.BOARD_WIDTH ;\n\t \tfloat wallHeight = GameRenderer.BOARD_HEIGHT ;\n\t \tint offset = -2;\n\t \tint actionBaOffset = 2;\n\t \t\n\t \t//Left Wall\n\t \tnew SpriteWall(0, actionBaOffset, 0, wallHeight+offset);\n\t \t\n\t \t//Right Wall\n\t \tnew SpriteWall(wallWidth+offset, actionBaOffset, wallWidth+offset, wallHeight+offset);\n\t \t\n\t \t//Top Wall\n\t \tnew SpriteWall(0, actionBaOffset, wallWidth+offset, actionBaOffset);\n\t \t\n\t \t//Bottom Wall\n\t \tnew SpriteWall(0, wallHeight+offset, wallWidth+offset, wallHeight+offset);\n\t \t\n\t }",
"private void createWalls() {\n int environmentWidth = config.getEnvironmentWidth();\n int environmentHeight = config.getEnvironmentHeight();\n // Left\n Double2D pos = new Double2D(0, environmentHeight / 2.0);\n Double2D v1 = new Double2D(0, -pos.y);\n Double2D v2 = new Double2D(0, pos.y);\n WallObject wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Right\n pos = new Double2D(environmentWidth, environmentHeight / 2.0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Top\n pos = new Double2D(environmentWidth / 2.0, 0);\n v1 = new Double2D(-pos.x, 0);\n v2 = new Double2D(pos.x, 0);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n\n // Bottom\n pos = new Double2D(environmentWidth / 2.0, environmentHeight);\n wall = new WallObject(physicsWorld, pos, v1, v2);\n drawProxy.registerDrawable(wall.getPortrayal());\n }",
"ArrayList<ArrayList<GamePiece>> makeBoard() {\n ArrayList<ArrayList<GamePiece>> row = new ArrayList<ArrayList<GamePiece>>();\n for (int i = 0; i < this.width; i++) {\n ArrayList<GamePiece> column = new ArrayList<GamePiece>();\n for (int j = 0; j < this.height; j++) {\n GamePiece temp = new GamePiece(i, j);\n column.add(temp);\n nodes.add(temp);\n }\n row.add(column);\n }\n return row;\n }",
"public boolean isWall () {\n if (this.equals(SquareType.WALL))\n return true;\n else\n return false;\n }",
"Wall getWall(long wallId) throws NoSuchWallException {\n/* 3520 */ if (this.walls != null)\n/* */ {\n/* 3522 */ for (Iterator<Wall> it = this.walls.iterator(); it.hasNext(); ) {\n/* */ \n/* 3524 */ Wall wall = it.next();\n/* 3525 */ if (wall.getId() == wallId)\n/* 3526 */ return wall; \n/* */ } \n/* */ }\n/* 3529 */ throw new NoSuchWallException(\"There are no walls on this tile so cannot find wallid: \" + wallId);\n/* */ }",
"private static void makeWalls(City city) \n {\n Wall[] walls = new Wall[6];\n \n for(int i=0; i<6; i++)\n {\n walls[i] = new Wall(city, i+1, 5, Direction.EAST);\n walls[i] = new Wall(city, i+1, 0, Direction.WEST);\n walls[i] = new Wall(city, 1, i, Direction.NORTH);\n walls[i] = new Wall(city, 6, i, Direction.SOUTH);\n }\n }",
"private Set<Hole> createHoleSetWithUNr(){\n ListIterator children = gridPane.getChildren().listIterator();\n Set<Hole> holeSet = new HashSet<>();\n Integer number = -1;\n for (ListIterator it = children; it.hasNext(); ) {\n Node node = (Node) it.next();\n if (node.getId() != null && node.getId().startsWith(number.toString())){\n\n Label sideLabel = (Label) node;\n Label yLabel = (Label) it.next();\n Label sizeLabel = (Label) it.next();\n TextField uNrText = (TextField) it.next();\n\n String side = sideLabel.getText();\n double y = Double.parseDouble( yLabel.getText() );\n double size = Double.parseDouble(sizeLabel.getText());\n int unr = Integer.parseInt( uNrText.getText() );\n\n Hole uniqueHole = new Hole(side,y,size,unr);\n holeSet.add(uniqueHole);\n }\n number++;\n }\n return holeSet;\n }",
"@Override\r\n\tpublic ArrayList<Board1> getAll() {\n\t\treturn dao.selectAll();\r\n\t}",
"private ArrayList<Move> whiteKing(){\n // obtain current co-ordinates\n int x = this.getX();\n int y = this.getY();\n\n // otherwise create a new vector to store legal whiteMoves\n ArrayList<Move> whiteMoves = new ArrayList<Move>();\n\n // set up m to refer to a Move object\n Move theMove = null;\n\n // first legal move is to go from x,y to x,y+1\n if (validNormalMove(x, y + 1)) {\n theMove = new Move(this, x, y, x, y + 1, false);\n if(takeOverCheck(x, y+1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n\n // legal move is to go from x,y to x,y-1 if x,y-1 is unoccupied (bottom)\n if (validNormalMove(x, y - 1)) {\n theMove = new Move(this, x, y, x, y - 1, false);\n if(takeOverCheck(x, y-1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n //left\n // legal move to go left from x,y to x-1, y if x-1,y is unoccupied (left)\n\n if (validNormalMove(x-1, y)) {\n theMove = new Move(this, x, y, x-1, y, false);\n if(takeOverCheck(x-1, y)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n //right\n // legal move to go right from x,y to x+1, y if x+1,y is unoccupied (right)\n\n if (validNormalMove(x+1, y)) {\n theMove = new Move(this, x, y, x+1, y, false);\n\n if(takeOverCheck(x+1, y)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n\n\n // legal move to diagonal top right for white king\n if (validNormalMove(x+1, y + 1)) {\n theMove = new Move(this, x, y, x+1, y + 1, false);\n if(takeOverCheck(x+1, y+1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n // legal move to diagonal bottom right\n\n if (validNormalMove(x+1, y -1)) {\n theMove = new Move(this, x, y, x+1, y - 1, false);\n if(takeOverCheck(x+1, y-1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n // legal move to diagonal bottom left\n if (validNormalMove(x-1, y -1)) {\n theMove = new Move(this, x, y, x-1, y - 1, false);\n if(takeOverCheck(x-1, y-1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n // legal move to diagonal top left\n if (validNormalMove(x-1, y+1)) {\n theMove = new Move(this, x, y, x-1, y + 1, false);\n if(takeOverCheck(x-1, y+1)){\n theMove.setOccupied(true);\n }\n whiteMoves.add(theMove);\n }\n\n\n\n if (whiteMoves.isEmpty())\n return null;\n return whiteMoves;\n }",
"public boolean isWall();",
"public Set<Coordinate> getAllSurroundingCellsAsCoordinates() {\n Set<MapCoordinate> mapCoordinates = getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(1);\n return mapCoordinates\n .stream()\n .map(mapCoordinate -> mapCoordinate.toCoordinate())\n .collect(\n Collectors.toSet()\n );\n }",
"ArrayList<Move> legalMoves() {\n ArrayList<Move> result = new ArrayList<Move>();\n int f, b;\n Move m;\n for (int i = 1; i < 8; i++) {\n for (int j = 1; j < 8; j++) {\n if (get(i,j).side() == _turn) {\n f = forward(j, i);\n b = backward(j, i);\n c = _col[j];\n r = _row[i];\n m = Move.create(j, i, j - b, i - b);\n addMove(result, m);\n m = Move.create(j, i, j + b, i + b);\n addMove(result, m);\n m = Move.create(j, i, j + f, i - f);\n addMove(result, m);\n m = Move.create(j, i, j - f, i + f);\n addMove(result, m);\n m = Move.create(j, i, j + c, i);\n addMove(result, m);\n m = Move.create(j, i, j - c, i);\n addMove(result, m);\n m = Move.create(j, i, j, i + r);\n addMove(result, m);\n m = Move.create(j, i, j, i - r);\n addMove(result, m);\n } else {\n continue;\n }\n }\n }\n return result;\n }",
"public static int minimumNumberOfWhiteWallsOnBoard()\n {\n return 0;\n }",
"public FloorTile[][] getBoard(){\r\n return board;\r\n }",
"public Set<Colour> getWinningPlayers();",
"private Set<BoardObject> createWeapons(){\r\n\t\tSet<BoardObject> weaps = new HashSet<BoardObject>();\r\n\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/revolver1.png\"), new Coordinate(3,12), \"Revolver\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/candlestick3.png\"), new Coordinate(2,3), \"Candlestick\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/knife1.png\"), new Coordinate(12,3), \"Knife\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/leadpipe1.png\"), new Coordinate(20,3), \"LeadPipe\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/rope1.png\"), new Coordinate(20,10), \"Rope\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/spanner1.png\"), new Coordinate(20,16), \"Wrench\"));\r\n\t\treturn weaps;\r\n\t}",
"public interface Wall {\n\n void create(boolean horizontal);\n List<Coordinate> getCoordinates();\n Color getColor();\n}",
"private ArrayList<GridPiece> getDirectNeighbors(GridPiece piece) {\n neighbors.clear();\n\n //Top\n if (game.gridMap.size() > piece.row + 1) {\n neighbors.add(game.gridMap.get(piece.row + 1).get(piece.column));\n }\n //Bottom\n if (piece.row > 0) {\n neighbors.add(game.gridMap.get(piece.row - 1).get(piece.column));\n }\n\n //Right\n if (game.gridMap.get(0).size() > piece.column + 1) {\n neighbors.add(game.gridMap.get(piece.row).get(piece.column + 1));\n }\n\n //Left\n if (piece.column > 0) {\n neighbors.add(game.gridMap.get(piece.row).get(piece.column - 1));\n }\n\n return neighbors;\n }",
"public void buildBoundaryWall() {\n for (int i = 0; i < worldWidth; i += 1) {\n for (int j = 0; j < worldHeight; j += 1) {\n if (i == 0 || i == worldWidth - 1\n || j == 0 || j == worldHeight - 1) {\n world[i][j] = Tileset.WALL;\n }\n }\n }\n }",
"public ArrayList<FloorTile> getFixedTilesFromBoard() {\r\n ArrayList<FloorTile> fixedTiles = new ArrayList<FloorTile>();\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if (board[i][j].isFixedTile()) {\r\n fixedTiles.add(board[i][j]);\r\n }\r\n }\r\n }\r\n\r\n return fixedTiles;\r\n }",
"private void renderWalls(Graphics g, ArrayList<GridLocation> walls, Location gridPosition){\n g.setColor(Color.BLACK);\n for(GridLocation wall : walls){\n g.fillRect(gridPosition.getX() + wall.getX()*CELL_SIZE, gridPosition.getY() + wall.getY()*CELL_SIZE,CELL_SIZE, CELL_SIZE);\n }\n }",
"public Hole[] getHoles(){\n return holes;\n }",
"public static WildBoard getBoard()\n {\n System.out.println(\"*** WildApp.getBoard() called\");\n \n return myBoard;\n }",
"public java.util.List<org.landxml.schema.landXML11.WatershedsDocument.Watersheds> getWatershedsList()\r\n {\r\n final class WatershedsList extends java.util.AbstractList<org.landxml.schema.landXML11.WatershedsDocument.Watersheds>\r\n {\r\n public org.landxml.schema.landXML11.WatershedsDocument.Watersheds get(int i)\r\n { return SurfaceImpl.this.getWatershedsArray(i); }\r\n \r\n public org.landxml.schema.landXML11.WatershedsDocument.Watersheds set(int i, org.landxml.schema.landXML11.WatershedsDocument.Watersheds o)\r\n {\r\n org.landxml.schema.landXML11.WatershedsDocument.Watersheds old = SurfaceImpl.this.getWatershedsArray(i);\r\n SurfaceImpl.this.setWatershedsArray(i, o);\r\n return old;\r\n }\r\n \r\n public void add(int i, org.landxml.schema.landXML11.WatershedsDocument.Watersheds o)\r\n { SurfaceImpl.this.insertNewWatersheds(i).set(o); }\r\n \r\n public org.landxml.schema.landXML11.WatershedsDocument.Watersheds remove(int i)\r\n {\r\n org.landxml.schema.landXML11.WatershedsDocument.Watersheds old = SurfaceImpl.this.getWatershedsArray(i);\r\n SurfaceImpl.this.removeWatersheds(i);\r\n return old;\r\n }\r\n \r\n public int size()\r\n { return SurfaceImpl.this.sizeOfWatershedsArray(); }\r\n \r\n }\r\n \r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return new WatershedsList();\r\n }\r\n }",
"public void generate() {\n\t\t// all cardinal direction for up,down,left and right\n\t\tthis.allDirections = Arrays.asList(new Point(-1, 0), new Point(1, 0), new Point(0, 1),\n\t\t\t\tnew Point(0, -1));\n\n\t\twallList = new ArrayList<>();\n\t\tgenerateAddWalls(width / 2, height / 2);\n\t\t// generateAddWalls( 3, 3);\n\n\t\tRandom rand = new Random();\n\n\t\twhile (wallList.size() > 0) {\n\t\t\tPoint wall = wallList.get(rand.nextInt(wallList.size()));\n\n\t\t\tint emptyWallX = wall.x;\n\t\t\tint emptyWallY = wall.y;\n\n\t\t\tfor (Point point : allDirections) {\n\t\t\t\tif (maze[wall.x + point.x][wall.y + point.y] == Block.EMPTY) {\n\t\t\t\t\temptyWallX = wall.x + point.x;\n\t\t\t\t\temptyWallY = wall.y + point.y;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find if oposite direction is empty by inverting the delta\n\t\t\tint deltaX = wall.x - emptyWallX;\n\t\t\tint deltaY = wall.y - emptyWallY;\n\n\t\t\tif (maze[wall.x + deltaX][wall.y + deltaY] == Block.WALL) {\n\t\t\t\tmaze[wall.x][wall.y] = Block.EMPTY;\n\t\t\t\tgenerateAddWalls(wall.x + deltaX, wall.y + deltaY);\n\t\t\t}\n\n\t\t\twallList.remove(wall);\n\t\t}\n\t}",
"public LinkedList<Move> getPossibleMoves() {\n\t\tAIPossibleMoves.clear();\n\t\tint xOrigin = 0, yOrigin = 0, xMove1 = 0, xMove2 = 0, yMove1 = 0, yMove2 = 0;\n\t\tMove move = null;\t\n\t\t\tint type = 0;\n\t\t\tfor(Checker checker: model.whitePieces) {\n\t\t\t\t\n\t\t\t\txOrigin = checker.getCurrentXPosition();\n\t\t\t\tyOrigin = checker.getCurrentYPosition();\n\t\t\t\txMove1 = (checker.getCurrentXPosition() - 1);\n\t\t\t\txMove2 = (checker.getCurrentXPosition() + 1);\n\t\t\t\tyMove1 = (checker.getCurrentYPosition() - 1);\n\t\t\t\tyMove2 = (checker.getCurrentYPosition() + 1);\n\t\t\t\ttype = checker.getType();\n\t\t\t\tswitch(type) {\n\t\t\t\tcase 2:\n\n\t\t\t\t\tif((xMove1 < 0) || (yMove1 <0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t\t//System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \n\t\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t\t// System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t\t//Moving up and left isMovingRight,IsMovingDown\n\t\t\t\t\tif((xMove1 <0) || (yMove1 < 0)) {\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving up and right\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove1 < 0) || (yMove2 > 7)) {\n\t\t\t\t//\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving down and left isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove2, false, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove2, false, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove2 > 7)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t//moving down and right isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove2, true, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove2, true, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tbreak;\t\n\t\t\t\t}\t\n\t\t\t\n\t\t\t}\n\n\t\t\treturn AIPossibleMoves;\n\t\t\t\n\t\t}",
"@Override\n public void generateMaze() {\n //Opens up the entrance to the maze\n MazeCell current=maze[0][0];\n current.openWall(Directions.North.getBValue());\n\n //A list of sets. The sets contain the cells which can be accessed from one another.\n List<List<MazeCell>> sets=new LinkedList<>();\n //All the walls in the maze\n List<InnerWall> wallList=new LinkedList<>();\n //Initially create a set for each cell\n //Also add the walls to the list\n for(int row=0;row< maze.length;row++){\n for(int column=0;column<maze[0].length;column++){\n sets.add(Arrays.asList(maze[row][column]));\n List<MazeCell> valid=returnValidNeighbours(maze[row][column].getX(), maze[row][column].getY());\n for(int i=0;i<valid.size();i++){\n wallList.add(new InnerWall(maze[row][column], valid.get(i)));\n }\n }\n }\n //Now we have as many wall sets as maze cells, each containing four walls.\n\n Random rnd=new Random();\n int idx;\n //Loops until only one set remains, meaning all cells can be reached from any cell\n while(sets.size()!=1){\n //Select a random wall\n idx=wallList.size()>1 ? rnd.nextInt(wallList.size()) : 0;\n InnerWall w= wallList.get(idx);\n //The two neighbouring cells\n MazeCell c1=w.parent;\n MazeCell c2=w.connected;\n\n //Their relative directions\n Directions d=Directions.getOffsetDirection(c1.getX(),c1.getY(),c2.getX(),c2.getY());\n\n //Check if the two cells are already connected\n if((c1.getOpenWalls() % d.getBValue())==d.getBValue())\n continue;\n\n //Two new sets\n List<MazeCell> set1=null;\n List<MazeCell> set2=null;\n //We get the sets\n boolean b1,b2;\n b1=b2=false;\n //We loop through the set of sets looking for the two which contains the two cells\n for(List<MazeCell> list : sets) {\n if(list.contains(c1)){\n set1=list;\n b1=true;\n }\n if(list.contains(c2)) {\n set2=list;\n b2=true;\n }\n if(b1 && b2)\n break;\n }\n //If the two sets are disjoint then we join them together\n if(set1!=null && set2!=null && !set1.equals(set2)){\n\n //We connect the two cells\n c1.openWall(d.getBValue());\n c2.openOppositeWall(d.getBValue());\n\n if(sleepDrawTime>0) {\n try {\n Thread.sleep(sleepDrawTime);\n mf.repaint();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n //Join the two sets\n List<MazeCell> temp= Stream.concat(set1.stream(), set2.stream())\n .collect(Collectors.toList());\n sets.remove(set2);\n sets.remove(set1);\n sets.add(temp);\n }\n //We remove the wall from the list\n wallList.remove(w);\n //As the walls are double-sided, two cells share a wall, we have to find the opposite cell's wall in the list\n InnerWall oppositeWall=wallList.stream().filter((x)->x.parent==w.connected).findFirst().orElse(null);\n wallList.remove(oppositeWall);\n\n\n }\n //We open an exit in the last row.\n maze[maze.length-1][rnd.nextInt(maze[0].length)].openWall(Directions.South.getBValue());\n\n }",
"@Override\r\n\tpublic ArrayList<BoardVO> getBoardList() {\n\t\treturn boardDao.getBoardList();\r\n\t}"
] | [
"0.75894403",
"0.7473418",
"0.6863052",
"0.6814272",
"0.66844994",
"0.64969105",
"0.64687437",
"0.61087453",
"0.6063062",
"0.60295457",
"0.6015561",
"0.6015241",
"0.60147977",
"0.5954198",
"0.5926347",
"0.59080106",
"0.5907566",
"0.5894701",
"0.58536816",
"0.58522964",
"0.5822622",
"0.582226",
"0.57880265",
"0.57821155",
"0.57535213",
"0.57345814",
"0.5724171",
"0.5715754",
"0.5703174",
"0.57015884",
"0.56905705",
"0.56812257",
"0.56730855",
"0.56646556",
"0.56617296",
"0.56614774",
"0.5644302",
"0.56187946",
"0.5615735",
"0.56045336",
"0.5603906",
"0.5597285",
"0.5597246",
"0.5584246",
"0.5573064",
"0.55562544",
"0.5525105",
"0.55169094",
"0.55135447",
"0.5506366",
"0.5505026",
"0.5498535",
"0.5497583",
"0.54932696",
"0.5489303",
"0.54834956",
"0.5483073",
"0.54754287",
"0.5458562",
"0.54571915",
"0.5449124",
"0.54325724",
"0.54315585",
"0.5424371",
"0.54159695",
"0.5404795",
"0.53794605",
"0.53777325",
"0.53638834",
"0.5357805",
"0.53569597",
"0.53484535",
"0.53456545",
"0.53423727",
"0.53409827",
"0.5340657",
"0.53405213",
"0.5329734",
"0.532924",
"0.5327159",
"0.53161085",
"0.5315117",
"0.5306386",
"0.52999",
"0.52959204",
"0.5291242",
"0.52907306",
"0.5290342",
"0.5289284",
"0.5287846",
"0.52846867",
"0.52844775",
"0.5280669",
"0.52791655",
"0.52643514",
"0.52559435",
"0.525139",
"0.5249504",
"0.5243472",
"0.52419037"
] | 0.7914331 | 0 |
Return a set containing all repair kits on board. | @Override
public Set<RepairKit> getRepairKits(Board board)
{
return board.getElements(RepairKit.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic Set<K> keySet() {\n\t\tArrayList<K> claves = new ArrayList<K>();\n\t\tIterator it = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tIterator it2 = tabla.get(i).keySet().iterator();\n\t\t\tit.next();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tclaves.add(tabla.get(i).keySet().get(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn new HashSet<K>(claves);\n\t}",
"public BoardSquare[] findSet() {\n ArrayList<BoardSquare> allCards = new ArrayList<>(12);\n\n // flatten BoardSquares into one-dimensional array\n for (int row = 0; row < board.numRows(); row++)\n for (int col = 0; col < board.numCols(); col++)\n allCards.add(board.getBoardSquare(row, col));\n\n // loop through every single unique card combination\n for (int i1 = 0; i1 < allCards.size(); i1++) {\n for (int i2 = 1; i2 < allCards.size(); i2++) {\n for (int i3 = 2; i3 < allCards.size(); i3++) {\n if (i1 != i2 && i2 != i3 && i1 != i3) {\n BoardSquare bs1 = allCards.get(i1);\n BoardSquare bs2 = allCards.get(i2);\n BoardSquare bs3 = allCards.get(i3);\n\n boolean set = Card.isSet(\n bs1.getCard(),\n bs2.getCard(),\n bs3.getCard()\n );\n\n if (set)\n return new BoardSquare[] {bs1, bs2, bs3};\n }\n }\n }\n }\n\n // if no set found, return empty Array\n return new BoardSquare[] {};\n }",
"public static Set getAllEnzymes()\n {\n return Collections.unmodifiableSet(enzymeToPattern.keySet());\n }",
"public Iterable<Board> solution() {\n\t\treturn result;\n\t}",
"@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }",
"public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }",
"public Set getBoardSet(String s){\n return board.getSet(s);\n }",
"@Override \n public Set<String> keySet() {\n \n \n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n \n try {\n \n // abre uma conecção\n conn = Connect.connect();\n \n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT nomePacote FROM Pacote WHERE visivel=TRUE;\");\n \n \n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n \n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"nomePacote\")); \n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"public Set<Cheque> getCheque() {\r\n\t\tSession session = getSessionFactory().openSession();\r\n\t\tQuery query\t=session.createQuery(\"FROM Cheque\");\r\n\t\tList myList = query.list();\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tSet<Cheque> cheque = new HashSet<Cheque>(myList);\r\n\t\tsession.close();\r\n\t\tSystem.out.println(\"Found \" + cheque.size() + \" cheque\");\r\n\t\treturn cheque;\r\n\t\t\r\n\t}",
"@Override\n\tpublic List<SnackSetVO> getAllSnackSetList() throws RemoteException {\n\t\treturn dao.getAllSnackSetList();\n\t}",
"@Override \n public Set<String> keySet() {\n \n \n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n \n try {\n \n // abre uma conecção\n conn = Connect.connect();\n \n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT nome FROM Componente WHERE visivel=TRUE;\");\n \n \n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n \n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"nome\")); // adiciona o aluno\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"public Iterable<Board> solution() {\n\n return initialSolvable ? solutionBoards : null;\n }",
"Set<K> keys();",
"public SetOfTiles getSetOfTiles();",
"public Set keySet() {\n\treturn table.keySet();\n }",
"public Object[] entrySet() {\n MyStack<Object> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current);\n current = current.getNext();\n }\n result.push(current);\n }\n }\n return result.toArray();\n }",
"public Set<Character> distincts() {\n return jumble.keySet();\n }",
"public Iterable<Board> solution() {\n return solution;\n }",
"Set<Integer> getBundledByColumns(int columnIndex);",
"public HashSet<String> conjProdutos(){\n return (HashSet)produtosComprados.values().stream().collect(Collectors.toSet());\n }",
"Set<String> getKeys();",
"public Iterable<Board> solution() {\n if (!isSolvable) return null;\n return solutions;\n }",
"public Set<List<String>> combinationForWindDragon(int[] suit) {\n if (suit.length != 7) throw new IllegalArgumentException(\"Not wind and \"\n + \"dragon suit length\");\n //Dragon and suits.\n Set<List<String>> combinations = new HashSet<>();\n List<String> element = new ArrayList<>();\n for (int i = 0; i < suit.length; i++) {\n String s = \"\";\n for (int j = 0; j < suit[i]; j++) {\n s += i;\n }\n if (s != \"\") {\n element.add(s);\n }\n }\n combinations.add(element);\n return combinations;\n }",
"public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }",
"@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> set = new HashSet<Entry<K, V>>();\n\t\tIterator it1 = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it1.hasNext()) {\n\t\t\tit1.next();\n\t\t\tIterator it2 = tabla.get(i).keySet().iterator();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tK clave = tabla.get(i).keySet().get(j);\n\t\t\t\tV valor = tabla.get(i).valueSet().get(j);\n\t\t\t\tEntrada<K, V> entry = new Entrada<K, V>(clave, valor);\n\t\t\t\tset.add(entry);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn set;\n\t}",
"@Override\n\tpublic HashSet<K> getAllKeys() {\n\t\treturn null;\n\t}",
"@Override\n public Set<K> keySet() {\n Set<K> ks = new HashSet<>();\n keySetHelper(root, ks);\n return ks;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }",
"public Iterable<Board> solution() {\n if (!isSolvable()) {\n return null;\n }\n Stack<Board> st = new Stack<>();\n SearchNode node = resultNode;\n while (node != null) {\n st.push(node.board);\n node = node.predecessor;\n }\n return st;\n\n }",
"default Set<StackKey> findAll(Predicate<ItemStack> filter) {\n Set<StackKey> items = new HashSet<>();\n for (IInventoryAdapter inventoryObject : this) {\n for (IInvSlot slot : InventoryIterator.get(inventoryObject)) {\n ItemStack stack = slot.getStack();\n if (!InvTools.isEmpty(stack) && filter.test(stack)) {\n stack = stack.copy();\n InvTools.setSize(stack, 1);\n items.add(StackKey.make(stack));\n }\n }\n }\n return items;\n }",
"@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> entrySet = map.entrySet();\n\t\tListSet<Entry<K, V>> listSet = new ListSet<Map.Entry<K,V>>();\n\t\tfor (K key : keys) {\n\t\t\t\n\t\t\tfor (Entry<K, V> entry : entrySet) {\n\t\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\t\tlistSet.add(entry);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn listSet;\n\t}",
"public Set list() {\n Set result = new HashSet();\n for( Iterator it = this.rcIterator(); it.hasNext() ; ){\n ReplicaCatalog catalog = (ReplicaCatalog) it.next();\n result.addAll( catalog.list() );\n }\n return result;\n\n }",
"public TreeSet<Integer> rankSet() {\n TreeSet<Integer> rankSet = new TreeSet<Integer>();\n for (Card c : cards) {\n \tint org = rankSet.size();\n \trankSet.add(c.getRank());\n \tif (org == rankSet.size()) {\n \tthis.sameSet.add(c.getRank());\n }\n } \n return rankSet;\n }",
"public final synchronized Set<String> m111z() {\n return this.f112Y.keySet();\n }",
"public LinkedHashSet<Spot> getSpotSet() {\n if (spotSet == null) {\n spotSet = new LinkedHashSet<>();\n for (int x = 0; x < WIDTH; x++) {\n for (int y = 0; y < HEIGHT; y++) {\n spotSet.add(board[x][y]);\n }\n }\n }\n return spotSet;\n }",
"public Iterable<Entry<K, V>> entrySet() {\n ArrayList<Entry<K, V>> buffer = new ArrayList<>();\n for (int h = 0; h < capacity; h++)\n if (!isAvailable(h)) buffer.add(table[h]);\n return buffer;\n }",
"public KeySet getKeys();",
"public Iterable<Board> solution() {\n \tif (!isSolvable) return null;\n \tDeque<Board> solution = new LinkedList<>();\n \tSearchNode node = solutionNode;\n \twhile (node != null) {\n \t\tsolution.addFirst(node.getBoard());\n \t\tnode = node.prev();\n \t}\n \treturn solution;\n }",
"public Set<Entry> getSet() {\n Set<Entry> litSet = this.litRegister;\n return litSet;\n }",
"@Override \n public Set<String> keySet() {\n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n try {\n // abre uma conecção\n conn = Connect.connect();\n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT username FROM Administrador WHERE visivel=TRUE;\");\n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"username\")); // adiciona o aluno\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"@Override\r\n\tpublic List<Repair> queryAll() {\n\t\treturn repairDao.queryAll();\r\n\t}",
"public static List<String> search(char[][] board, Set<String> set) {\n List<String> ret = new LinkedList<String>();\n if (set == null || set.size() == 0) return ret;\n boolean[][] visited = new boolean[board.length][board[0].length];\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[0].length; j++) {\n search(board, i, j, \"\", set, visited, ret);\n }\n }\n return ret;\n }",
"public HashSet<Integer> mesesComprou(){\n HashSet<Integer> hs = new HashSet<>();\n produtosComprados.keySet().stream().forEach(x->hs.add(x.getMes()));\n return hs;\n }",
"private Set<Integer> getSynsetKeys(String word) {\n HashSet<Integer> kset = new HashSet<Integer>();\n\n for (ArrayList<String> o : synsetRev.keySet()) {\n for (String p : o) {\n if (p.equals(word)) {\n kset.add(synsetRev.get(o));\n }\n }\n }\n return kset;\n }",
"@Override\r\n\tpublic Set<K> keySet() {\r\n\t\tSet<K> keySet = new HashSet<K>();\r\n\t\tfor (Object o : buckets) {\r\n\t\t\tBucket b = (Bucket) o;\r\n\t\t\tkeySet.addAll(b.keySet());\r\n\t\t}\r\n\t\treturn keySet;\r\n\t}",
"public ArrayList<WordCode<K, V>> entrySet() {\n\t\tArrayList<WordCode<K, V>> entrySet = new ArrayList<>();\n\t\t\n\t\tfor (LinkedList<WordCode<K, V>> ll : myBuckets) {\n\t\t\tfor (WordCode<K, V> wc : ll) {\n\t\t\t\tentrySet.add(wc);\n\t\t\t}\n\t\t}\n\t\treturn entrySet;\n\t}",
"public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }",
"public Set<K> keySet() {\r\n \treturn map.keySet();\r\n }",
"@Override\n public Set<K> keySet() {\n if (isEmpty()) return new HashSet<K>();\n return keys(min(), max());\n }",
"@Override\r\n\tpublic Set<SurpriseBox> getSurpriseBoxes(Board board)\r\n\t{\r\n\t\treturn board.getElements(SurpriseBox.class);\r\n\t}",
"public String getSuits() {\n return suits;\n }",
"public Set<Map.Entry<Integer, String>> entrySet() {\n return Collections.unmodifiableSet(getMacrosses().entrySet());\n }",
"public Set < NamespacedKey > getDiscoveredRecipes ( ) {\n\t\treturn extract ( handle -> handle.getDiscoveredRecipes ( ) );\n\t}",
"Set<K> keySet();",
"public int[] keySet() {\n objectCounter++;\n int[] keys = new int[contents];\n int cnt = 0;\n MapElement me = null;\n\n for (int i = 0; i < capacity; i++) {\n if (map[i] != null) {\n me = map[i];\n while (null != me) {\n keys[cnt++] = me.getKey();\n me = me.getNext();\n }\n }\n }\n return keys;\n }",
"public abstract Set<Tile> getNeighbors(Tile tile);",
"@Override\n public Set<K> keySet() {\n Set<K> keyset = new TreeSet<>();\n Inorder(root, keyset);\n return keyset;\n }",
"public HashSet<N> getNodes()\r\n/* 99: */ {\r\n/* 100:182 */ assert (checkRep());\r\n/* 101: */ \r\n/* 102:184 */ return new HashSet(this.map.keySet());\r\n/* 103: */ }",
"public Set getFullSet(int iteration) {\r\n Dataset Data = getFullDataset(iteration);\r\n return new TreeSet(Data.getEntries());\r\n }",
"private ISet<String> getKeySet(IList<String> words) {\n\t\tISet<String> keySet = new ChainedHashSet<String>();\n\t\tfor (String word: words) {\n\t\t\tkeySet.add(word);\n\t\t}\n\t\treturn keySet;\n }",
"public Set<Restaurant> getSurroundingRestaurants(){\n\n Set<Restaurant> retval = new HashSet<>();\n for (Restaurant r : restaurants){\n retval.add(r);\n }\n return retval;\n }",
"public Set<K> keySet() {\n return map.keySet();\n }",
"public Set keySet() {\n return map.keySet();\n }",
"public static Collection<Character> getWhitelist(){\n\t\treturn new HashSet<Character>(kanjiWhitelist);\n\t}",
"public Iterable<Board> solution()\n {\n SearchNode element = getSolutionNode();\n\n Stack<Board> returnList= new Stack<>();\n returnList.push(element.board);\n while (element!=null &&element.previusNode!=null){\n\n element = element.previusNode;\n returnList.push(element.board);\n }\n\n return new Iterable<Board>() {\n @Override\n public Iterator<Board> iterator()\n {\n return returnList.iterator();\n }\n };\n }",
"public Set<Key<?>> keysForTest() {\n return Collections.unmodifiableSet(this.data.keySet());\n }",
"public Set<String> keysOfMap() {\n Map<String, String> tempMap = createSimpleMap(\"Elevensies\",\"Grapes\");\n\t\tSet<String> keys = hashMap.keySet();\n\t\treturn tempMap.keySet();\n\t}",
"private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}",
"public ArrayList<K> keySet() {\n\t\t\treturn claves;\n\t\t}",
"public Set<K> keySet() {\n Set<K> keys = new HashSet<>();\n if (bucket.length != 0) {\n for (int i = 0; i < bucket.length; i++) {\n keys.add(bucket[i].getKey());\n }\n }\n return keys;\n }",
"public Set<Ticket> getTickets() { return Set.copyOf(tickets); }",
"public Set<CtColor> getColors() {\n\t\tHashSet<CtColor> hs = new HashSet<CtColor>();\n\t\tint colorIndexArr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n\t\tfor (CtColor chip : chips) {\n\t\t\tcolorIndexArr[chip.getColorNum()] = 1;\n\t\t}\n\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (colorIndexArr[i] != 0)\n\t\t\t\ths.add(new CtColor(i));\n\t\t}\n\t\treturn hs;\n\t}",
"@Override\n public Set<Shelf> getShelves() {\n return new HashSet<>(shelves);\n }",
"public Set<Card> getSolution() {\n return card.getSolution();\n }",
"public Set<String> keySet() {\n\t\t\treturn new HashSet<String>( mMap.keySet() );\n\t\t}",
"public Set<String> keySet() {\n return map.keySet();\n }",
"public static HashSet<KDNode> RootSet() {\n\t\treturn root_map;\n\t}",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }",
"public static synchronized Set<Class<?>> keySet() {\n\t\treturn ClassRegistry.dictionary.keySet();\n\t}",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn keys;\n\t}",
"@Override\n public Set keySet() {\n OmaLista palautettava = new OmaLista();\n\n for (int i = 0; i < this.values.length; i++) {\n if (this.values[i] != null) {\n for (int z = 0; z < this.values[i].size(); z++) {\n palautettava.add(this.values[i].value(z).getKey());\n }\n }\n }\n\n return palautettava;\n }",
"public Set<K> keySet() {\n\t\treturn adjLists.keySet();\n\t}",
"Lista<K> keySet();",
"Set<Object> getAllCells() {\n Set<Object> ret = new HashSet<Object>();\n ret.addAll(getNodes());\n ret.addAll(getEdges());\n \n // ports\n for( DefaultGraphCell node : getNodes() ) {\n ret.add(node.getChildAt(0));\n }\n \n return ret;\n }",
"@Override\n public Set<K> keySet() {\n return keys;\n }",
"@Override\n public Set<K> keySet() {\n keySet(root);\n return KeySet;\n }",
"public Set<Integer> getNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n retSet.addAll(this.getActiveNeighbors());\n retSet.addAll(this.purgedNeighbors);\n\n return retSet;\n }",
"public Iterable<Board> solution() {\n if (!solvable) {\n return null;\n }\n else {\n return new SolutionBoards();\n }\n\n }",
"public Collection<Suit> getGood5LengthSuits() {\r\n\t\tCollection<Suit> result = new ArrayList<Suit>();\r\n\t\tList<Suit> suitsOfLength5 = getSuitsWithCardCount(5);\r\n\t\tfor (Suit suit : suitsOfLength5) {\r\n\t\t\tList<Card> cardsInSuit = getSuitHi2Low(suit);\r\n\t\t\tif (isAtLeastAQJXX(cardsInSuit) || isAtLeastKQTXX(cardsInSuit)) {\r\n\t\t\t\tresult.add(suit);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public Iterable<Board> solution() {\n if (isSolvable)\n return solutionTree;\n else\n return null;\n }",
"public Set<Integer> getAllValuesOfby() {\n return rawStreamAllValuesOfby(emptyArray()).collect(Collectors.toSet());\n }",
"@Override\n public Set<Map.Entry<Integer,String>> entrySet() {\n return IntStream.range(0, size)\n .mapToObj(Entry::new)\n .collect(Collectors\n .toCollection(LinkedHashSet::new));\n }",
"public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}",
"public HashSet<String> getDistritos(){\r\n\t\t//return (HashSet<String>) Collections.unmodifiableSet(this.distritosPermitidos);\r\n\t\treturn this.distritosPermitidos;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n public Set<String> keySet() {\n return (Set<String>) (Set<?>) userConfig.keySet();\n }",
"public Set<Square> squaresWithMarkedSides(Square[][] board, int n) {\n \n Set<Square> theSet = new HashSet<Square>();\n for(int row = 0; row < Util.N; row++)\n for(int col = 0; col < Util.N; col++) {\n Square square = board[row][col];\n if (square.hasNMarkedSides(n))\n theSet.add(square);\n }\n return theSet;\n }",
"public Set<E> keySet() {\n\t\treturn null;\r\n\t}",
"public final Set<String> mo34356a() {\n HashSet hashSet = new HashSet();\n for (String next : m1026d()) {\n if (!m1025b(next)) {\n hashSet.add(next);\n }\n }\n return hashSet;\n }",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Set<K> keySet() {\n\t\treturn null;\n\t}"
] | [
"0.6031041",
"0.6012228",
"0.5986719",
"0.58596677",
"0.58406264",
"0.5752585",
"0.5737319",
"0.5638938",
"0.5627742",
"0.55889505",
"0.55802566",
"0.5531974",
"0.5525574",
"0.541659",
"0.5408353",
"0.5407384",
"0.5403974",
"0.53826046",
"0.5348405",
"0.53451824",
"0.5344235",
"0.53389895",
"0.5330804",
"0.5326903",
"0.53267807",
"0.53205675",
"0.53194094",
"0.5281062",
"0.52778506",
"0.52713543",
"0.52694565",
"0.5263305",
"0.5258083",
"0.5257238",
"0.52398473",
"0.5239836",
"0.5234947",
"0.5226107",
"0.5221822",
"0.52183497",
"0.52182865",
"0.5214326",
"0.52110827",
"0.521039",
"0.5205672",
"0.52032",
"0.51951647",
"0.51930183",
"0.51875377",
"0.5185424",
"0.5183829",
"0.5176221",
"0.51669663",
"0.5163547",
"0.5161676",
"0.5158919",
"0.5157845",
"0.5156503",
"0.51545507",
"0.5136019",
"0.5134089",
"0.51321054",
"0.51317275",
"0.51281196",
"0.5123518",
"0.51184654",
"0.51113284",
"0.5100705",
"0.5096378",
"0.508957",
"0.5089421",
"0.50882196",
"0.5085643",
"0.50826246",
"0.5081776",
"0.50786597",
"0.5067754",
"0.5061235",
"0.50520074",
"0.5046625",
"0.50377464",
"0.5037323",
"0.50341237",
"0.50316155",
"0.5030674",
"0.50292414",
"0.5027649",
"0.5026297",
"0.5023215",
"0.5022216",
"0.50182873",
"0.5013505",
"0.5012112",
"0.5006292",
"0.5002823",
"0.49862298",
"0.4980685",
"0.49722406",
"0.49722406",
"0.49722406"
] | 0.7947716 | 0 |
Return a set containing all surprise boxes on board. | @Override
public Set<SurpriseBox> getSurpriseBoxes(Board board)
{
return board.getElements(SurpriseBox.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BoardSquare[] findSet() {\n ArrayList<BoardSquare> allCards = new ArrayList<>(12);\n\n // flatten BoardSquares into one-dimensional array\n for (int row = 0; row < board.numRows(); row++)\n for (int col = 0; col < board.numCols(); col++)\n allCards.add(board.getBoardSquare(row, col));\n\n // loop through every single unique card combination\n for (int i1 = 0; i1 < allCards.size(); i1++) {\n for (int i2 = 1; i2 < allCards.size(); i2++) {\n for (int i3 = 2; i3 < allCards.size(); i3++) {\n if (i1 != i2 && i2 != i3 && i1 != i3) {\n BoardSquare bs1 = allCards.get(i1);\n BoardSquare bs2 = allCards.get(i2);\n BoardSquare bs3 = allCards.get(i3);\n\n boolean set = Card.isSet(\n bs1.getCard(),\n bs2.getCard(),\n bs3.getCard()\n );\n\n if (set)\n return new BoardSquare[] {bs1, bs2, bs3};\n }\n }\n }\n }\n\n // if no set found, return empty Array\n return new BoardSquare[] {};\n }",
"@Override\r\n\t@Basic\r\n\tpublic Collection<Square> getSquares() {\r\n\t\treturn squares.values();\r\n\t}",
"public Set<Square> squaresWithMarkedSides(Square[][] board, int n) {\n \n Set<Square> theSet = new HashSet<Square>();\n for(int row = 0; row < Util.N; row++)\n for(int col = 0; col < Util.N; col++) {\n Square square = board[row][col];\n if (square.hasNMarkedSides(n))\n theSet.add(square);\n }\n return theSet;\n }",
"public SetOfTiles getSetOfTiles();",
"public LinkedHashSet<Spot> getSpotSet() {\n if (spotSet == null) {\n spotSet = new LinkedHashSet<>();\n for (int x = 0; x < WIDTH; x++) {\n for (int y = 0; y < HEIGHT; y++) {\n spotSet.add(board[x][y]);\n }\n }\n }\n return spotSet;\n }",
"public Set<Coordinate> getAllSurroundingCellsAsCoordinates() {\n Set<MapCoordinate> mapCoordinates = getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(1);\n return mapCoordinates\n .stream()\n .map(mapCoordinate -> mapCoordinate.toCoordinate())\n .collect(\n Collectors.toSet()\n );\n }",
"@Override\r\n\tpublic Set<RepairKit> getRepairKits(Board board)\r\n\t{\r\n\t\treturn board.getElements(RepairKit.class);\r\n\t}",
"public List<Square> getSquareGrid();",
"public Set<TCell> getNBGrays() {\n\tSet<TCell> grays = new HashSet<TCell>();\n\tfor(TCell c : Cells) {\n\t grays.addAll((Collection<TCell>) c.getNBGrays());\n\t}\n\treturn grays;\n }",
"private ArrayList<GameSquare> getAdjacentSquares()\n {\n ArrayList<GameSquare> list = new ArrayList<GameSquare>();\n for (int r = row - 1; r <= row + 1; r++)\n {\n if (r >= 0 && r < grid.length)\n {\n for (int c = col - 1; c <= col + 1; c++)\n {\n if (c >= 0 && c < grid[0].length)\n {\n list.add(grid[r][c]);\n }\n }\n }\n }\n return list;\n }",
"public Set getBoardSet(String s){\n return board.getSet(s);\n }",
"private void findUniqueInBoxes() {\n findUniqueInBox(1,3,1,3);\n findUniqueInBox(1,3,4,6);\n findUniqueInBox(1,3,7,9);\n findUniqueInBox(4,6,1,3);\n findUniqueInBox(4,6,4,6);\n findUniqueInBox(4,6,7,9);\n findUniqueInBox(7,9,1,3);\n findUniqueInBox(7,9,4,6);\n findUniqueInBox(7,9,7,9);\n\n }",
"public Set<Square> getSquares(Square[][] board, Line line) {\n Set<Square> answer = new HashSet<Square>();\n \n int row = line.getRow();\n int col = line.getCol();\n Side side = line.getSide();\n \n answer.add(board[row][col]);\n \n if(side == Side.NORTH && row > 0)\n answer.add(board[row - 1][col]);\n if(side == Side.WEST && col > 0)\n answer.add(board[row][col - 1]);\n if(side == Side.SOUTH && row < Util.N - 1)\n answer.add(board[row + 1][col]);\n if(side == Side.EAST && col < Util.N - 1)\n answer.add(board[row][col + 1]);\n \n return answer;\n }",
"public SmartList<Square> getSquares() {\n return new SmartList<Square>(this.squares).freeze();\n }",
"public Set<Square> validDestinations(Board b);",
"Set<Point2D> getWallSet();",
"public Box[][] getBoxes() {\n \treturn boxes;\n }",
"public Square[][] getSquares() {\n \treturn squares;\n }",
"public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }",
"public static void queenSet() {\n\n boolean[][] boxes = new boolean[4][4];\n // System.out.println(queenPermutation2D(boxes, 4, 0, \"\"));\n System.out.println(queenCombination2D(boxes, 4, 0, \"\"));\n }",
"public Iterable<Board> solution() {\n\t\treturn result;\n\t}",
"private ArrayList<GameSquare> getAdjacentEmptySquares()\n {\n ArrayList<GameSquare> list = new ArrayList<GameSquare>();\n for (GameSquare square : getAdjacentSquares())\n {\n if (!square.mine && square.adjacentMines == 0) //Must check to see if square is a mine, because mines\n {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //may not have the correct value for adjacentMines.\n list.add(square);\n }\n }\n return list;\n }",
"private Set<Hole> createHoleSetWithUNr(){\n ListIterator children = gridPane.getChildren().listIterator();\n Set<Hole> holeSet = new HashSet<>();\n Integer number = -1;\n for (ListIterator it = children; it.hasNext(); ) {\n Node node = (Node) it.next();\n if (node.getId() != null && node.getId().startsWith(number.toString())){\n\n Label sideLabel = (Label) node;\n Label yLabel = (Label) it.next();\n Label sizeLabel = (Label) it.next();\n TextField uNrText = (TextField) it.next();\n\n String side = sideLabel.getText();\n double y = Double.parseDouble( yLabel.getText() );\n double size = Double.parseDouble(sizeLabel.getText());\n int unr = Integer.parseInt( uNrText.getText() );\n\n Hole uniqueHole = new Hole(side,y,size,unr);\n holeSet.add(uniqueHole);\n }\n number++;\n }\n return holeSet;\n }",
"public Square[][] getSquares()\n {\n return squares;\n }",
"public List<String> allSquaresNoMove ()\n {\n List<Square> squareList = new ArrayList<>();\n List<String> stringList = new ArrayList<>();\n\n squareList.addAll(player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX() , player.getSquare().getY(),2));\n\n for (Square square : squareList)\n stringList.add(square.toStringCoordinates());\n\n return stringList;\n\n }",
"public void removeAllSeconderyColorsFromBoard() {\n\t\tArrayList<Tile> boardTiles= getAllBoardTiles();\n\t\tif(!this.coloredTilesList.isEmpty()) {\n\t\t\tboardTiles.retainAll(coloredTilesList);\n\t\t\tfor(Tile t :boardTiles) {\n\t\t\t\tTile basicTile= new Tile.Builder(t.getLocation(), t.getColor1()).setPiece(t.getPiece()).build();\n\t\t\t\treplaceTileInSameTileLocation(basicTile);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tthis.coloredTilesList=null;\n\t\tthis.coloredTilesList=new ArrayList<Tile>();\n\t\tthis.orangeTiles=null;\n\t\tthis.orangeTiles=new ArrayList<Tile>();\n\n\t}",
"Set<Object> getAllCells() {\n Set<Object> ret = new HashSet<Object>();\n ret.addAll(getNodes());\n ret.addAll(getEdges());\n \n // ports\n for( DefaultGraphCell node : getNodes() ) {\n ret.add(node.getChildAt(0));\n }\n \n return ret;\n }",
"public void clearAllSquares()\n\t{\n\t\t/* loop through all rows and columns and remove all the highlighting */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tclearSquare(i, j);\n\t\t\t}\n\t\t}\n\t}",
"public Set<Colour> getWinningPlayers();",
"public ArrayList<Piece> getAllPieceOfCell() {\n ArrayList<Piece> overAllList = new ArrayList<>(mImmegrintsList);\n overAllList.addAll(mResidentQ);\n return overAllList;\n }",
"public static Set getAllEnzymes()\n {\n return Collections.unmodifiableSet(enzymeToPattern.keySet());\n }",
"private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}",
"public Iterable<Point2D> hull() {\r\n Stack<Point2D> s = new Stack<Point2D>();\r\n for (Point2D p : hull) s.push(p);\r\n return s;\r\n }",
"private Set<Hole> createHoleSet(){\n Set<Hole> holeSet = new HashSet<>();\n for (Profile profile:profiles) {\n holeSet.addAll(profile.getHoles());\n }\n return holeSet;\n }",
"private List<Box> initBoxes(List<Integer> deadBoxes){\n List<Box> boxes = new ArrayList<>();\n\n for(int x=0;x<16;x++){\n boxes.add(new Box(x + 1, grid[x]));\n }\n\n\n /**\n * 1 2 3 4\n * 5 6 7 8\n * 9 10 11 12\n * 13 14 15 16\n */\n\n //first row\n addNeighbours(1, new int[]{2,5,6}, boxes);\n addNeighbours(2,new int[]{1,3,5,6,7}, boxes);\n addNeighbours(3,new int[]{2,4,6,7,8}, boxes);\n addNeighbours(4,new int[]{3,7,8}, boxes);\n addNeighbours(5,new int[]{1,2,6,9,10}, boxes);\n addNeighbours(6,new int[]{1,2,3,5,7,9,10,11}, boxes);\n addNeighbours(7,new int[]{2,3,4,6,8,10,11,12}, boxes);\n addNeighbours(8,new int[]{3,4,7,11,12}, boxes);\n addNeighbours(9,new int[]{5,6,10,13,14}, boxes);\n addNeighbours(10,new int[]{5,6,7,9,11,13,14,15}, boxes);\n addNeighbours(11,new int[]{6,7,8,10,12,14,15,16}, boxes);\n addNeighbours(12,new int[]{7,8,11,15,16}, boxes);\n addNeighbours(13,new int[]{9,10,14}, boxes);\n addNeighbours(14,new int[]{9,10,11,13,15}, boxes);\n addNeighbours(15,new int[]{10,11,12,14,16}, boxes);\n addNeighbours(16,new int[]{11,12,15}, boxes);\n\n return removeBoxes(boxes,deadBoxes);\n }",
"public List<Piece> whitePieces();",
"public Set<BoardObject> boardObjects(){\r\n\t\treturn boardObjects;\r\n\t}",
"public List<Piece> allPieces();",
"public Set<Cheque> getCheque() {\r\n\t\tSession session = getSessionFactory().openSession();\r\n\t\tQuery query\t=session.createQuery(\"FROM Cheque\");\r\n\t\tList myList = query.list();\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tSet<Cheque> cheque = new HashSet<Cheque>(myList);\r\n\t\tsession.close();\r\n\t\tSystem.out.println(\"Found \" + cheque.size() + \" cheque\");\r\n\t\treturn cheque;\r\n\t\t\r\n\t}",
"public int[] getBoxes() { return boxes; }",
"public Iterable<Board> solution()\n {\n SearchNode element = getSolutionNode();\n\n Stack<Board> returnList= new Stack<>();\n returnList.push(element.board);\n while (element!=null &&element.previusNode!=null){\n\n element = element.previusNode;\n returnList.push(element.board);\n }\n\n return new Iterable<Board>() {\n @Override\n public Iterator<Board> iterator()\n {\n return returnList.iterator();\n }\n };\n }",
"public ArrayList<Piece> getPieces()\n {\n ArrayList<Piece> pieces = new ArrayList<>();\n for (Square[] s1: squares)\n {\n for (Square s: s1)\n {\n Piece p = s.getPiece();\n if (p!=null)\n pieces.add(p);\n }\n }\n return pieces;\n }",
"public void removeAllPieces()\n\t{\n\t\t/* iterate over the rows and columns */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tremovePiece(i, j);\n\t\t\t}\n\t\t}\n\t}",
"Set<Card> remove();",
"public Collection<Suit> getGood5LengthSuits() {\r\n\t\tCollection<Suit> result = new ArrayList<Suit>();\r\n\t\tList<Suit> suitsOfLength5 = getSuitsWithCardCount(5);\r\n\t\tfor (Suit suit : suitsOfLength5) {\r\n\t\t\tList<Card> cardsInSuit = getSuitHi2Low(suit);\r\n\t\t\tif (isAtLeastAQJXX(cardsInSuit) || isAtLeastKQTXX(cardsInSuit)) {\r\n\t\t\t\tresult.add(suit);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public PokemonBox[] getBoxes()\n\t{\n\t\treturn m_boxes;\n\t}",
"public abstract Set<Tile> getNeighbors(Tile tile);",
"private static Collection<Piece> getCorrectRedPieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.RED));\n\t\treturn pieces;\n\t}",
"private void findUniqueInBox(int startRow, int endRow, int startColumn, int endColumn) {\n\n //Reduce the board to consist of only the positions in the box and \n //only include those that aren't yet assigned a value.\n List<Number> box = numbers.stream()\n .filter(n -> n.getRow() >= startRow)\n .filter(n -> n.getRow() <= endRow)\n .filter(n -> n.getColumn() >= startColumn)\n .filter(n -> n.getColumn() <= endColumn)\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList());\n\n //Create a hash to count the number of occurences of each possible value.\n HashMap<Integer,Integer> possibleValues = new HashMap<Integer, Integer>();\n\n box.forEach(n -> {\n //Find the possible values...\n\n //Create a list of numbers 1-9\n List<Integer> intThrough9 = IntStream.rangeClosed(1, 9)\n .boxed()\n .collect(Collectors.toList());\n\n //Remove those that have been used to set the possible values.\n intThrough9.removeAll(n.getUsedValues());\n n.setPossibleValues(intThrough9);\n \n //Update the map with the count of each possible value\n intThrough9.stream().forEach(i -> {\n if (possibleValues.containsKey(i)) {\n possibleValues.replace(i, possibleValues.get(i) + 1);\n }\n else {\n possibleValues.put(i,1);\n }\n });\n });\n\n //Filter out those that only have 1. If there are any then we know\n //that position can be set to that value.\n possibleValues.entrySet().stream().\n filter(p -> p.getValue() == 1).\n forEach(p -> {\n //Whichever block has this unique possibility is the one to set.\n box.stream()\n .filter(b -> b.getPossibleValues() != null)\n .filter(b -> b.getPossibleValues().contains(p.getKey()))\n .findFirst()\n .ifPresent(n -> n.setValue(p.getKey()));\n });\n }",
"public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}",
"public TreeSet<Integer> rankSet() {\n TreeSet<Integer> rankSet = new TreeSet<Integer>();\n for (Card c : cards) {\n \tint org = rankSet.size();\n \trankSet.add(c.getRank());\n \tif (org == rankSet.size()) {\n \tthis.sameSet.add(c.getRank());\n }\n } \n return rankSet;\n }",
"private void setupSquares() {\n\t\tInsets buttonMargin = new Insets(0, 0, 0, 0);\n\t\tfor (int row = 0; row < chessBoardSquares.length; row++) {\n\t\t\tfor (int col = 0; col < chessBoardSquares[row].length; col++) {\n\t\t\t\tJButton button = new JButton();\n\t\t\t\tbutton.setMargin(buttonMargin);\n\t\t\t\t// our chess pieces are 64x64 px in size, so we'll\n\t\t\t\t// 'fill this in' using a transparent icon..\n\t\t\t\tImageIcon icon = new ImageIcon(new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB));\n\t\t\t\tbutton.setIcon(icon);\n\n\t\t\t\tif ((col % 2 == 1 && row % 2 == 1)\n\t\t\t\t\t\t// ) {\n\t\t\t\t\t\t|| (col % 2 == 0 && row % 2 == 0)) {\n\t\t\t\t\tbutton.setBackground(Color.WHITE);\n\t\t\t\t} else {\n\t\t\t\t\tbutton.setBackground(Color.BLACK);\n\t\t\t\t}\n\t\t\t\tchessBoardSquares[col][row] = button;\n\t\t\t}\n\t\t}\n\t}",
"public Set<Restaurant> getSurroundingRestaurants(){\n\n Set<Restaurant> retval = new HashSet<>();\n for (Restaurant r : restaurants){\n retval.add(r);\n }\n return retval;\n }",
"@Override\n public final SortedSet<Node<N>> getWells() {\n return new Wells(this);\n }",
"public List<Piece> blackPieces();",
"public ArrayList<Square> enemyValidSquares() {\r\n\t\tArrayList<Square> result = new ArrayList<Square>();\r\n\t\tArrayList<Square> enemyList = (myBoard.activeColour == Colour.WHITE) ? myBoard.myGame.blackList : myBoard.myGame.whiteList;\r\n\t\t//for every square in my enemy list\r\n\t\tArrayList<Move> tempList;\r\n\t\tfor (Square sq : enemyList) {\r\n\t\t\ttempList = sq.mySB.getValidMoves();\r\n\t\t\tfor (Move m: tempList) {\r\n\t\t\t\tresult.add(m.end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public Collection <Point> getAllPoints(){\n Collection <Point> points = new ArrayList<>();\n for(int i = 0; i < width; i++){\n for(int j = 0; j < height; j++){\n points.add(new Point(i, j));\n }\n }\n return points;\n }",
"public Iterable<Board> neighbors() {\n int[] pos = zeroPosition();\n int x = pos[0];\n int y = pos[1];\n\n Stack<Board> q = new Stack<>();\n if (x > 0) {\n q.push(twinBySwitching(x, y, x-1, y));\n }\n\n if (x < dimension() - 1) {\n q.push(twinBySwitching(x, y, x+1, y));\n }\n\n if (y > 0) {\n q.push(twinBySwitching(x, y, x, y-1));\n }\n\n if (y < dimension() - 1) {\n q.push(twinBySwitching(x, y, x, y+1));\n }\n\n return q;\n }",
"public Box[] getBoxes1D() {\n\t\tBox[] temp = new Box[size];\n\t\tint tempCounter = 0;\n\t\tfor (int j = 0; j < length; j++) {\n\t\t for (int i = 0; i < height; i++) {\n\t\t\t\ttemp[tempCounter] = boxes[i][j];\n\t\t\t\ttempCounter++;\n\t\t }\n\t\t}\n\t\treturn temp;\n }",
"public ArrayList<Square> getSquares(){\n return bSquares;\n }",
"public Iterable<Board> solution() {\n\n return initialSolvable ? solutionBoards : null;\n }",
"@Override\n\tpublic List<SnackSetVO> getAllSnackSetList() throws RemoteException {\n\t\treturn dao.getAllSnackSetList();\n\t}",
"HashSet<Square> pieceLocations(Piece side) {\r\n assert side != EMPTY;\r\n HashSet<Square> squareSides = new HashSet<Square>();\r\n for (Square mapSquare : map.keySet()) {\r\n if (get(mapSquare) == side) {\r\n squareSides.add(mapSquare);\r\n }\r\n }\r\n return squareSides;\r\n }",
"private List<Cell> getSurroundingCells(int x, int y) {\n ArrayList<Cell> cells = new ArrayList<>();\n for (int i = x - 1; i <= x + 1; i++) {\n for (int j = y - 1; j <= y + 1; j++) {\n // Don't include the current position i != x && j != y &&\n if ( isValidCoordinate(i, j)) {\n if (i == x && j == y) {\n continue;\n } else {\n cells.add(gameState.map[j][i]);\n }\n }\n }\n }\n return cells;\n }",
"Map<BoardCellCoordinates, Set<Integer>> getWinningCoordinates();",
"public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }",
"public Iterable<Point2D> range(RectHV rect) {\n if (rect == null) throw new NullPointerException();\n TreeSet<Point2D> inRangeSet = new TreeSet<>();\n for (Point2D point : pointSet) {\n if (rect.contains(point)) {\n inRangeSet.add(point);\n }\n }\n return inRangeSet;\n }",
"public Iterable<Board> solution() {\n return solution;\n }",
"List<MineTile> getSurround(int position) {\n int dimension = getDimension();\n int row = position / dimension;\n int col = position % dimension;\n List<MineTile> surround = new ArrayList<>();\n\n if (row != 0 && col != 0) {\n surround.add(getTiles().get(position - dimension - 1));\n }\n if (row != 0 && col != dimension - 1) {\n surround.add(getTiles().get(position - dimension + 1));\n }\n if (row != 0) {\n surround.add(getTiles().get(position - dimension));\n }\n if (row != dimension - 1 && col != 0) {\n surround.add(getTiles().get(position + dimension - 1));\n }\n if (row != dimension - 1 && col != dimension - 1) {\n surround.add(getTiles().get(position + dimension + 1));\n }\n if (row != dimension - 1) {\n surround.add(getTiles().get(position + dimension));\n }\n if (col != 0) {\n surround.add(getTiles().get(position - 1));\n }\n if (col != dimension - 1) {\n surround.add(getTiles().get(position + 1));\n }\n return surround;\n }",
"int violetSquares() {\n int s = 0;\n int i, j;\n for (i = 0; i < 14; i++) {\n for (j = 0; j < 14; j++) {\n if (_board[i][j] == VIOLET) {\n s++;\n }\n }\n }\n return s;\n }",
"public void resetSquares(){\n int x = 0;\n int y = 0;\n for (int i = 0; i < board.length;i++){\n if(x == row){\n x = 0;\n }\n x++;\n for(int j = 0; j < board.length; j++){\n if(y == column){\n y = 0;\n }\n y++;\n board[i][j] = new Square(x, y);\n }\n }\n }",
"ArrayList<ArrayList<GamePiece>> makeBoard() {\n ArrayList<ArrayList<GamePiece>> row = new ArrayList<ArrayList<GamePiece>>();\n for (int i = 0; i < this.width; i++) {\n ArrayList<GamePiece> column = new ArrayList<GamePiece>();\n for (int j = 0; j < this.height; j++) {\n GamePiece temp = new GamePiece(i, j);\n column.add(temp);\n nodes.add(temp);\n }\n row.add(column);\n }\n return row;\n }",
"public Set<Irrigation> getAvailableIrrigationSlots ()\n {\n Set<Irrigation> availableIrrigations = new HashSet<>();\n\n ArrayList<Cell> neightboors;\n\n neightboors = getExistingNeighboors(new Point());\n\n neightboors.forEach(cell -> {\n ArrayList<Cell> touching = getCommonNeighboors(cell.getCoords(), new Point());\n touching.stream()\n .filter(t -> !verifIrrigation(cell.getCoords(), t.getCoords()))\n .forEach(t -> availableIrrigations.add(new Irrigation((Plot) t, (Plot) cell)));\n });\n\n for (Irrigation irg : irrigation)\n {\n\n neightboors = getCommonNeighboors(irg.getPlot1().getCoords(), irg.getPlot2().getCoords());\n\n neightboors.stream().filter(cell -> !(cell.getCoords().equals(new Point()))).forEach(plot -> {\n\n if (!verifIrrigation(plot.getCoords(), irg.getPlot1().getCoords())) availableIrrigations.add(new Irrigation((Plot) plot,\n irg.getPlot1()));\n\n if (!verifIrrigation(plot.getCoords(), irg.getPlot2().getCoords())) availableIrrigations.add(new Irrigation((Plot) plot,\n irg.getPlot2()));\n\n });\n }\n availableIrrigations.removeAll(irrigation);\n return availableIrrigations;\n }",
"public Iterable<Point2D> range(RectHV rect) {\n SET<Point2D> result = new SET<Point2D>();\n if (root == null) {\n return result;\n }\n\n range(root, rect, result);\n return result;\n }",
"public Box[][] getGrid() {\n return this.grid;\n }",
"public HashSet<Point> getValidMoves(){\n HashSet<Point> set = new HashSet<Point>();\n if(this.validMove(this.x() + 2, this.y() + 1)){\n set.add(new Point(this.x() + 2, this.y() + 1));\n }\n if(this.validMove(this.x() + 2, this.y() - 1)){\n set.add(new Point(this.x() + 2, this.y() - 1));\n }\n if(this.validMove(this.x() - 2, this.y() + 1)){\n set.add(new Point(this.x() - 2, this.y() + 1));\n }\n if(this.validMove(this.x() - 2, this.y() - 1)){\n set.add(new Point(this.x() - 2, this.y() - 1));\n }\n if(this.validMove(this.x() + 1, this.y() + 2)){\n set.add(new Point(this.x() + 1, this.y() + 2));\n }\n if(this.validMove(this.x() + 1, this.y() - 2)){\n set.add(new Point(this.x() + 1, this.y() - 2));\n }\n if(this.validMove(this.x() - 1, this.y() + 2)){\n set.add(new Point(this.x() - 1, this.y() + 2));\n }\n if(this.validMove(this.x() - 1, this.y() - 2)){\n set.add(new Point(this.x() - 1, this.y() - 2));\n }\n return set;\n }",
"private void cull() {\n\t\tArrayList<NQueenBoard> temp = new ArrayList<NQueenBoard>();\n\t\ttemp.add(populationArray.get(0));\n\t\tfor (int i = 1; i < population; ++i) {\n\t\t\tfor (int j = 0; j < temp.size(); ++j) {\n\t\t\t\tif (populationArray.get(i).getFitness() > temp.get(j).getFitness()) {\n\t\t\t\t\ttemp.add(j, populationArray.get(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (populationArray.get(i).getFitness() <= temp.get(temp.size()-1).getFitness()) {\n\t\t\t\ttemp.add(populationArray.get(i));\n\t\t\t}\n\t\t}\n\t\t//replace the worst half with newly generated random boards\n\t\tfor (int i = temp.size()/2; i < temp.size(); ++i) {\n\t\t\ttemp.set(i, new NQueenBoard(n));\n\t\t}\n\t\tpopulationArray = temp;\n\t}",
"public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public Set<Scene> getAllValuesOfscene() {\n return rawStreamAllValuesOfscene(emptyArray()).collect(Collectors.toSet());\n }",
"private static Collection<Piece> getCorrectBluePieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.BLUE));\n\t\treturn pieces;\n\t}",
"public Set<VCube> getSupportedCubes();",
"public Set<Point> getHitboxPoints() {\n Set<Point> hitboxPoints = new HashSet<>();\n\n for(Point p : relevantPoints)\n {\n int currX = (int)(p.x + xPos - (getWidth() / 2));\n int currY = (int)(p.y + yPos - (getHeight() / 2));\n\n hitboxPoints.add(new Point(currX, currY));\n }\n\n return hitboxPoints;\n }",
"List<Moves> getMoveSet();",
"public BoardInterface[] getBoards();",
"private void clearStragglers() {\n for (int i = 0; i < game.gridPieces.length; i++) {\n GridPiece piece = game.gridPieces[i];\n\n if (piece.state == game.STATE_TEMP) {\n piece.restoreState();\n //restoreState(piece);\n } else if (piece.state == game.STATE_TEMP_NOTOUCH) {\n piece.setState(game.STATE_FINAL);\n }\n }\n }",
"public Iterable<Board> solution() {\n if (!isSolvable()) {\n return null;\n }\n Stack<Board> st = new Stack<>();\n SearchNode node = resultNode;\n while (node != null) {\n st.push(node.board);\n node = node.predecessor;\n }\n return st;\n\n }",
"public void winBigSquare (){\n /*for (int i =0; i<9; i++){\n for (int j=0; j<9; j++)\n System.out.print(bSquares.get(i).getSmallSquare(j).getOwnership()+\" \");\n System.out.println();\n }*/\n for (int i =0; i<9; i++){\n if (bSquares.get(i).getOwnership()==0){\n bSquares.get(i).setOwnership(bSquares.get(i).checkThreeInaRow());\n //System.out.println(\"SWAGSTA!\");\n }\n }\n \n }",
"public void clear() {\n for (int row = 0; row < 8; ++row) {\n for (int col = 0; col < 8; ++col) {\n board[row][col] = null;\n }\n }\n whitePieces = new LinkedList<Piece>();\n blackPieces = new LinkedList<Piece>();\n }",
"private static boolean[][] chese(ArrayList<Queen> chesr) {\n\t\tboolean[][] cr = new boolean[8][8];\r\n\t\tboolean res= true;\r\n\t\tfor(int i=0;i<8;i++){\r\n\t\t\tfor(int j=0;j<8;j++){\r\n\t\t\t\tcr[i][j] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(Queen quee : \tchesr){\r\n\t\t\tif(!cr[quee.x][quee.y]){\r\n\t\t\t\tres = false; \r\n\t\t\t}else{\r\n\t\t\t\tfor(int i=0;i<8;i++){\r\n\t\t\t\t\tcr[quee.x][i] = false;\r\n\t\t\t\t\tcr[i][quee.y] = false;\r\n\t\t\t\t}\r\n\t\t\t\t//斜线右下 \r\n\t\t\t\tint i=quee.x,j=quee.y;\r\n\t\t\t\twhile(0<=i&i<8&&0<=j&&j<8){\r\n\t\t\t\t\tcr[i++][j++] =false;\r\n\t\t\t\t}\r\n\t\t\t\t//斜线左下 \r\n\t\t\t\ti=quee.x;\r\n\t\t\t\tj=quee.y;\r\n\t\t\t\twhile(0<=i&i<8&&0<=j&&j<8){\r\n\t\t\t\t\tcr[i--][j++] =false;\r\n\t\t\t\t}\r\n\t\t\t\t//斜线左上\r\n\t\t\t\ti=quee.x;\r\n\t\t\t\tj=quee.y;\r\n\t\t\t\twhile(0<=i&i<8&&0<=j&&j<8){\r\n\t\t\t\t\tcr[i--][j--] =false;\r\n\t\t\t\t}\r\n\t\t\t\t//斜线右上\r\n\t\t\t\ti=quee.x;\r\n\t\t\t\tj=quee.y;\r\n\t\t\t\twhile(0<=i&i<8&&0<=j&&j<8){\r\n\t\t\t\t\tcr[i++][j--] =false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cr;\r\n\t}",
"public List<Cell> getFlaggedCells() {\n List<Cell> gameBoard = new ArrayList<Cell>();\n List<Cell> flaggedCells = new ArrayList<Cell>();\n for (Cell cell : gameBoard)\n if (cell.isFlagged())\n flaggedCells.add(cell);\n return flaggedCells;\n }",
"public java.util.Set getChildBoards () {\n\t\treturn this._childBoards;\n\t}",
"Set<X> toSet();",
"public SudokuContainer getSolutions() {return container;}",
"public Square[] adjacentCells() {\n\t\tArrayList<Square> cells = new ArrayList <Square>();\n\t\tSquare aux;\n\t\tfor (int i = -1;i <= 1; i++) {\n\t\t\tfor (int j = -1; j <= 1 ; j++) {\n\t\t\t\taux = new Square(tractor.getRow()+i, tractor.getColumn()+j); \n\t\t\t\tif (isInside(aux) && abs(i+j) == 1) { \n\t\t\t\t\tcells.add(getSquare(aux));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cells.toArray(new Square[cells.size()]);\n\t}",
"private static List<Sticker> m33731b(Collection<Sticker> collection) {\n List<Sticker> arrayList = new ArrayList(collection.size());\n for (Sticker sticker : collection) {\n if (!sticker.isFriendmoji()) {\n arrayList.add(sticker);\n }\n }\n return arrayList;\n }",
"public HashSet<BlockPos> getContainers() {\n\t\tthis.validateContainers();\n\t\treturn this.containers;\n\t}",
"@Override\n public Set<Shelf> getShelves() {\n return new HashSet<>(shelves);\n }",
"public abstract Collection<Piece> getActivePieces();",
"public abstract Collection<Piece> getActivePieces();",
"public List<Piece> getEdges() {\n List<Piece> result = new ArrayList<>();\n result.add(_board[0][1]);\n result.add(_board[1][0]);\n result.add(_board[1][2]);\n result.add(_board[2][1]);\n return result;\n }"
] | [
"0.6382069",
"0.61239845",
"0.59751225",
"0.5936398",
"0.59188485",
"0.5904096",
"0.58798903",
"0.5844808",
"0.58331496",
"0.5809781",
"0.5787834",
"0.57103693",
"0.5678979",
"0.56494516",
"0.56314117",
"0.56077373",
"0.5600531",
"0.5553062",
"0.55485106",
"0.553267",
"0.55305403",
"0.55234015",
"0.5516233",
"0.55079114",
"0.5479183",
"0.5455141",
"0.5453362",
"0.54334027",
"0.54118943",
"0.5405427",
"0.5398011",
"0.5382699",
"0.53810513",
"0.53779155",
"0.5370048",
"0.5355257",
"0.53549343",
"0.53056526",
"0.5300796",
"0.52922106",
"0.52876985",
"0.5267136",
"0.52572775",
"0.5253067",
"0.52522844",
"0.52499574",
"0.5240689",
"0.52016383",
"0.5196947",
"0.51874244",
"0.51838464",
"0.517932",
"0.51778215",
"0.5176682",
"0.51746005",
"0.5172584",
"0.5170582",
"0.5163525",
"0.5160083",
"0.5159667",
"0.5158292",
"0.5157574",
"0.51504874",
"0.5148829",
"0.514476",
"0.51410276",
"0.5134982",
"0.5124019",
"0.5123062",
"0.5120952",
"0.5105366",
"0.50989646",
"0.507489",
"0.5073218",
"0.5059841",
"0.5058954",
"0.5057288",
"0.50537974",
"0.5053067",
"0.50514764",
"0.50330037",
"0.5031491",
"0.50283396",
"0.5028223",
"0.5026999",
"0.50250494",
"0.50205666",
"0.5018274",
"0.5017481",
"0.50112045",
"0.5007082",
"0.5001615",
"0.50003237",
"0.49965587",
"0.49956515",
"0.49929145",
"0.4991259",
"0.49902493",
"0.49902493",
"0.49890822"
] | 0.80221176 | 0 |
Return a set containing all batteries on board. | @Override
public Set<Battery> getBatteries(Board board)
{
return board.getElements(Battery.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public BoardSquare[] findSet() {\n ArrayList<BoardSquare> allCards = new ArrayList<>(12);\n\n // flatten BoardSquares into one-dimensional array\n for (int row = 0; row < board.numRows(); row++)\n for (int col = 0; col < board.numCols(); col++)\n allCards.add(board.getBoardSquare(row, col));\n\n // loop through every single unique card combination\n for (int i1 = 0; i1 < allCards.size(); i1++) {\n for (int i2 = 1; i2 < allCards.size(); i2++) {\n for (int i3 = 2; i3 < allCards.size(); i3++) {\n if (i1 != i2 && i2 != i3 && i1 != i3) {\n BoardSquare bs1 = allCards.get(i1);\n BoardSquare bs2 = allCards.get(i2);\n BoardSquare bs3 = allCards.get(i3);\n\n boolean set = Card.isSet(\n bs1.getCard(),\n bs2.getCard(),\n bs3.getCard()\n );\n\n if (set)\n return new BoardSquare[] {bs1, bs2, bs3};\n }\n }\n }\n }\n\n // if no set found, return empty Array\n return new BoardSquare[] {};\n }",
"public Set getBoardSet(String s){\n return board.getSet(s);\n }",
"private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}",
"protected static List<Critter> getBabies() {\n\t\t\treturn babies;\n\t\t}",
"protected static List<Critter> getBabies() {\n\t\t\treturn babies;\n\t\t}",
"protected static List<Critter> getBabies() {\n return babies;\n }",
"protected static List<Critter> getBabies() {\r\n \t ArrayList<Critter> critterList = new ArrayList<Critter>();\r\n //iterator through the keys in the babies hash map\r\n Iterator<String> populationIterator = babies.keySet().iterator();\r\n while(populationIterator.hasNext()) {\r\n \tString coord = populationIterator.next();\r\n \t//iterator through the critter babies in a key in a hash map\r\n \tIterator<Critter> positionIterator = babies.get(coord).iterator();\r\n \twhile(positionIterator.hasNext()) {\r\n \t\tCritter critt = positionIterator.next();\r\n \t\t//add the babies to the critter population\r\n \t\tcritterList.add(critt);\r\n \t}\r\n }\r\n \r\n return critterList;\r\n }",
"public java.util.Set getChildBoards () {\n\t\treturn this._childBoards;\n\t}",
"public Set<BoardObject> boardObjects(){\r\n\t\treturn boardObjects;\r\n\t}",
"public static Set getAllEnzymes()\n {\n return Collections.unmodifiableSet(enzymeToPattern.keySet());\n }",
"public SetOfTiles getSetOfTiles();",
"Set<Integer> getBundledByColumns(int columnIndex);",
"public ArrayList<Tile> getAllBoardTiles() {\n\n\t\tArrayList<ArrayList<Tile>> tilesMapValues=new ArrayList<ArrayList<Tile>>(getTilesMap().values()) ;\n\t\tArrayList<Tile> allTiles =new ArrayList<Tile>() ;\n\t\tfor(ArrayList<Tile> tileList : tilesMapValues) {\n\t\t\tallTiles.addAll(tileList);\n\n\t\t}\n\t\treturn allTiles;\n\t}",
"public BoardInterface[] getBoards();",
"public Iterable<Board> neighbors() {\n LinkedList<Board> states = new LinkedList<>();\n LinkedList<int[]> neighbors = neighborFinder();\n int[] curr_loc = blankFinder();\n\n for(int[] temp : neighbors){\n tiles[curr_loc[0]][curr_loc[1]] = tiles[temp[0]][temp[1]];\n tiles[temp[0]][temp[1]] = 0;\n states.add(new Board(deepCopy(tiles)));\n tiles[temp[0]][temp[1]] = tiles[curr_loc[0]][curr_loc[1]];\n tiles[curr_loc[0]][curr_loc[1]] = 0;\n\n }\n return states;\n }",
"@Override\r\n\tpublic Set<RepairKit> getRepairKits(Board board)\r\n\t{\r\n\t\treturn board.getElements(RepairKit.class);\r\n\t}",
"public abstract Set<Tile> getNeighbors(Tile tile);",
"public Iterable<Board> solution() {\n\t\treturn result;\n\t}",
"public List<List<Seat>> getBuisness() {\n\t\treturn buisness;\n\t}",
"public Set<CtColor> getColors() {\n\t\tHashSet<CtColor> hs = new HashSet<CtColor>();\n\t\tint colorIndexArr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n\t\tfor (CtColor chip : chips) {\n\t\t\tcolorIndexArr[chip.getColorNum()] = 1;\n\t\t}\n\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (colorIndexArr[i] != 0)\n\t\t\t\ths.add(new CtColor(i));\n\t\t}\n\t\treturn hs;\n\t}",
"Set<Object> getAllCells() {\n Set<Object> ret = new HashSet<Object>();\n ret.addAll(getNodes());\n ret.addAll(getEdges());\n \n // ports\n for( DefaultGraphCell node : getNodes() ) {\n ret.add(node.getChildAt(0));\n }\n \n return ret;\n }",
"public LinkedHashSet<Spot> getSpotSet() {\n if (spotSet == null) {\n spotSet = new LinkedHashSet<>();\n for (int x = 0; x < WIDTH; x++) {\n for (int y = 0; y < HEIGHT; y++) {\n spotSet.add(board[x][y]);\n }\n }\n }\n return spotSet;\n }",
"public Set<Character> characters(){\r\n\t\tSet<Character> characters = new HashSet<Character>();\r\n\t\tfor(BoardObject object: boardObjects){\r\n\t\t\tif(object instanceof Character)\r\n\t\t\t\tcharacters.add((Character) object);\r\n\t\t}\r\n\t\treturn characters;\r\n\t}",
"private Set<BoardObject> createWeapons(){\r\n\t\tSet<BoardObject> weaps = new HashSet<BoardObject>();\r\n\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/revolver1.png\"), new Coordinate(3,12), \"Revolver\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/candlestick3.png\"), new Coordinate(2,3), \"Candlestick\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/knife1.png\"), new Coordinate(12,3), \"Knife\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/leadpipe1.png\"), new Coordinate(20,3), \"LeadPipe\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/rope1.png\"), new Coordinate(20,10), \"Rope\"));\r\n\t\tweaps.add(new BoardObject(getImage(\"xboardObjects/spanner1.png\"), new Coordinate(20,16), \"Wrench\"));\r\n\t\treturn weaps;\r\n\t}",
"public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }",
"public List<Bed> solvedBeds() {\n // TODO: Fix me.\n return bed;\n }",
"public Set<TCell> getNBGrays() {\n\tSet<TCell> grays = new HashSet<TCell>();\n\tfor(TCell c : Cells) {\n\t grays.addAll((Collection<TCell>) c.getNBGrays());\n\t}\n\treturn grays;\n }",
"Set<Point2D> getWallSet();",
"public List<Building> getBoardBuildings() {\n return mPersonalBoardCards.getBoardBuildings();\n }",
"public Array<BlockDrawable> getBoardBlocksToDraw() {\r\n\t\tArray<BlockDrawable> blocksToDraw = new Array<BlockDrawable>();\r\n\t\tblocksToDraw.addAll(tablero);\t\t\r\n\t\treturn blocksToDraw;\r\n\t}",
"public Set<Character> distincts() {\n return jumble.keySet();\n }",
"public @NotNull Set<Bid> findAllBids() throws BazaarException;",
"public Set<Colour> getWinningPlayers();",
"public Set<Square> validDestinations(Board b);",
"public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }",
"public Iterable<Board> neighbors() {\n int[] pos = zeroPosition();\n int x = pos[0];\n int y = pos[1];\n\n Stack<Board> q = new Stack<>();\n if (x > 0) {\n q.push(twinBySwitching(x, y, x-1, y));\n }\n\n if (x < dimension() - 1) {\n q.push(twinBySwitching(x, y, x+1, y));\n }\n\n if (y > 0) {\n q.push(twinBySwitching(x, y, x, y-1));\n }\n\n if (y < dimension() - 1) {\n q.push(twinBySwitching(x, y, x, y+1));\n }\n\n return q;\n }",
"@Override\r\n\tpublic ArrayList<Board1> getAll() {\n\t\treturn dao.selectAll();\r\n\t}",
"public Iterable<String> getAllValidWords(BoggleBoard board) {\n // precompute board\n int rows = board.rows(), cols = board.cols();\n Dice[][] diceBoard = new Dice[rows][cols];\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n diceBoard[i][j] = new Dice(board.getLetter(i, j), i, j);\n }\n }\n boggleGraph = new Dice[rows][cols][];\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n List<Dice> list = new ArrayList<Dice>();\n if (i > 0) {\n if (j > 0) {\n list.add(diceBoard[i-1][j-1]);\n }\n list.add(diceBoard[i-1][j]);\n if (j < cols - 1) {\n list.add(diceBoard[i-1][j+1]);\n }\n }\n if (j > 0) {\n list.add(diceBoard[i][j-1]);\n }\n if (j < cols - 1) {\n list.add(diceBoard[i][j+1]);\n }\n if (i < rows - 1) {\n if (j > 0) {\n list.add(diceBoard[i+1][j-1]);\n }\n list.add(diceBoard[i+1][j]);\n if (j < cols - 1) {\n list.add(diceBoard[i+1][j+1]);\n }\n }\n boggleGraph[i][j] = list.toArray(new Dice[list.size()]);\n }\n }\n\n // run\n result = new HashSet<String>();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n Stack<Dice> stack = new Stack<Dice>();\n stack.push(diceBoard[i][j]);\n find(buildWord(diceBoard[i][j].letter), stack, i, j);\n }\n }\n\n return result;\n }",
"public List<Branch> getBranchs()\r\n\t{\t\r\n\t\tif (branchs.size() == 0)\r\n\t\t{\r\n\t\t\t//Lacos abertos carga x terra (redes radiais)\r\n\t\t\tbranchs.addAll(findBranchs());\t\t\r\n\t\t\r\n\t\t}\r\n\t\treturn branchs; \r\n\t}",
"public String[][] getBoard() {\n ArrayList<Point<Integer,Integer>> bomb_positions = new ArrayList<>(this.NUMBOMBS);\n\n int size=0;\n while ( size < this.NUMBOMBS) {\n int x=(int)Math.floor(Math.random()*this.SIZE);\n int y=(int)Math.floor(Math.random()*this.SIZE);\n if (!bomb_positions.contains(new Point<>(x,y))) {\n bomb_positions.add(new Point<>(x,y));\n size++;\n }\n }\n // [ , , , ]\n // [ ,cnrXY, , ]\n // [ , ,Bomb, ]\n // [ , , , ]\n for (Point<Integer,Integer> bomb:\n bomb_positions) {\n int cornerX = bomb.getX()-1;\n int cornerY= bomb.getY()-1;\n for (int i = cornerX; i < cornerX+3 ; i++) {\n for (int j = cornerY; j < cornerY+3; j++) {\n if(i>=0 && i<SIZE && j>=0 && j< SIZE){\n if ((new Point<>(i,j)).equals(bomb)){\n board[i][j]=\"B\";\n }else {\n if (!board[i][j].equals(\"B\") && board[i][j].equals(\" \")){\n board[i][j] = \"1\";\n }else if (!board[i][j].equals(\"B\") && !board[i][j].equals(\" \")){\n int n = Integer.parseInt(board[i][j]);\n n=n+1;\n board[i][j] = String.valueOf(n);\n }\n }\n\n }\n }\n }\n }\n return board;\n }",
"public Set<Square> squaresWithMarkedSides(Square[][] board, int n) {\n \n Set<Square> theSet = new HashSet<Square>();\n for(int row = 0; row < Util.N; row++)\n for(int col = 0; col < Util.N; col++) {\n Square square = board[row][col];\n if (square.hasNMarkedSides(n))\n theSet.add(square);\n }\n return theSet;\n }",
"public Set<Integer> getNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n retSet.addAll(this.getActiveNeighbors());\n retSet.addAll(this.purgedNeighbors);\n\n return retSet;\n }",
"public static List<String> search(char[][] board, Set<String> set) {\n List<String> ret = new LinkedList<String>();\n if (set == null || set.size() == 0) return ret;\n boolean[][] visited = new boolean[board.length][board[0].length];\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[0].length; j++) {\n search(board, i, j, \"\", set, visited, ret);\n }\n }\n return ret;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<TypeBatterie> touslesTypeBatterie() {\n\t\tList<TypeBatterie> T = em.createQuery(\"from TypeBatterie t\").getResultList();\n\t\treturn T;\n\t}",
"private static Collection<Piece> getCorrectBluePieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.BLUE));\n\t\treturn pieces;\n\t}",
"public List<Piece> getEdges() {\n List<Piece> result = new ArrayList<>();\n result.add(_board[0][1]);\n result.add(_board[1][0]);\n result.add(_board[1][2]);\n result.add(_board[2][1]);\n return result;\n }",
"private Set<BoardObject> createCharacters(){\r\n\t\tSet<BoardObject> charrs = new HashSet<BoardObject>();\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/missscarlettCut.png\"),new Coordinate(23,19),\"MissScarlett\"));\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/colonelmustardCut.png\"),new Coordinate(0,17),\"ColonelMustard\"));\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/mrswhiteJ2.png\"),new Coordinate(14,0),\"MrsWhite\"));\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/revgreenCut.png\"),new Coordinate(9,0),\"ReverendGreen\"));\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/mrspeacockCut.png\"),new Coordinate(23,6),\"MrsPeacock\"));\r\n\t\tcharrs.add(new Character(getImage(\"xboardObjects/proffessorplumCut.png\"),new Coordinate(7,24),\"ProfessorPlum\"));\r\n\t\treturn charrs;\r\n\t}",
"private boolean[][] setRandomBoard() {\n\t\tint size = this.boardSize;\n\t\tboolean[][] randomBoard = new boolean[size][size];\n\t\tRandom rand = new Random();\n\t\t\n\t\tfor(int i=0; i<randomBoard.length; i++)\n\t\t\tfor(int j=0; j<randomBoard[i].length; j++)\n\t\t\t\trandomBoard[i][j] = rand.nextBoolean();\n\t\t\n\t\treturn randomBoard;\n\t}",
"public void setBoard() {\n for (int i = 0; i < 10 ; i++) {\n board[i] = coordinator.holes[i].getNumberOfMarbleBalls();\n }\n }",
"public List<Cell> getFlaggedCells() {\n List<Cell> gameBoard = new ArrayList<Cell>();\n List<Cell> flaggedCells = new ArrayList<Cell>();\n for (Cell cell : gameBoard)\n if (cell.isFlagged())\n flaggedCells.add(cell);\n return flaggedCells;\n }",
"public Iterable<Board> solution() {\n return solution;\n }",
"public Iterable<Board> solution() {\n\n return initialSolvable ? solutionBoards : null;\n }",
"public GameCell[] getBoardCells(){\r\n return this.boardCells;\r\n }",
"public Set<String> branches() {\r\n\t\treturn branchesPartOf;\r\n\t}",
"public final List<Brush> getBrushes() {\n ArrayList<Brush> result = new ArrayList<Brush>(brushMap.values());\n Collections.sort(result);\n return result;\n }",
"@Override\n public Iterable<WorldState> neighbors() {\n Queue<WorldState> neighbor = new ArrayDeque<>();\n int xDim = 0, yDim = 0;\n int[][] tiles = new int[_N][_N];\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n tiles[i][j] = _tiles[i][j];\n if (_tiles[i][j] == 0) {\n xDim = i;\n yDim = j;\n }\n }\n }\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (Math.abs(i - xDim) + Math.abs(j - yDim) == 1) {\n tiles[i][j] = _tiles[xDim][yDim];\n tiles[xDim][yDim] = _tiles[i][j];\n neighbor.add(new Board(tiles));\n // System.out.println(new Board(tiles));\n tiles[xDim][yDim] = _tiles[xDim][yDim];\n tiles[i][j] = _tiles[i][j];\n }\n }\n }\n return neighbor;\n }",
"public Set<List<String>> combinationForWindDragon(int[] suit) {\n if (suit.length != 7) throw new IllegalArgumentException(\"Not wind and \"\n + \"dragon suit length\");\n //Dragon and suits.\n Set<List<String>> combinations = new HashSet<>();\n List<String> element = new ArrayList<>();\n for (int i = 0; i < suit.length; i++) {\n String s = \"\";\n for (int j = 0; j < suit[i]; j++) {\n s += i;\n }\n if (s != \"\") {\n element.add(s);\n }\n }\n combinations.add(element);\n return combinations;\n }",
"public DisjointSets getSets()\n\t{\n\t\treturn sets;\n\t}",
"public void removeAllSeconderyColorsFromBoard() {\n\t\tArrayList<Tile> boardTiles= getAllBoardTiles();\n\t\tif(!this.coloredTilesList.isEmpty()) {\n\t\t\tboardTiles.retainAll(coloredTilesList);\n\t\t\tfor(Tile t :boardTiles) {\n\t\t\t\tTile basicTile= new Tile.Builder(t.getLocation(), t.getColor1()).setPiece(t.getPiece()).build();\n\t\t\t\treplaceTileInSameTileLocation(basicTile);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tthis.coloredTilesList=null;\n\t\tthis.coloredTilesList=new ArrayList<Tile>();\n\t\tthis.orangeTiles=null;\n\t\tthis.orangeTiles=new ArrayList<Tile>();\n\n\t}",
"public Set<Cheque> getCheque() {\r\n\t\tSession session = getSessionFactory().openSession();\r\n\t\tQuery query\t=session.createQuery(\"FROM Cheque\");\r\n\t\tList myList = query.list();\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tSet<Cheque> cheque = new HashSet<Cheque>(myList);\r\n\t\tsession.close();\r\n\t\tSystem.out.println(\"Found \" + cheque.size() + \" cheque\");\r\n\t\treturn cheque;\r\n\t\t\r\n\t}",
"public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }",
"public static Column[] all() {\n return Column.values();\n }",
"String[][] getBoard();",
"public List<Piece> blackPieces();",
"public Marker[][] getBoard() { return board; }",
"private static Set<Belief<?>> getBeliefs() {\n\t\treturn null;\r\n\t}",
"public Piece[] getBoard() {\n return board;\n }",
"public @NotNull Set<Bidder> findAllBidders() throws BazaarException;",
"BSet createBSet();",
"public static ArrayList<String> boggle(char[][] board, Trie dict) {\n ArrayList<String> result = new ArrayList<String>();\n boolean[][] history = new boolean[board.length][board[0].length];\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[0].length; j++) {\n boggle(history, board, result, i, j, \"\", dict);\n }\n }\n\n return result;\n }",
"public int[][] getBoard();",
"public Set<Coordinate> getAllSurroundingCellsAsCoordinates() {\n Set<MapCoordinate> mapCoordinates = getAllSurroundingCellsAsMapCoordinatesStartingFromTopLeft(1);\n return mapCoordinates\n .stream()\n .map(mapCoordinate -> mapCoordinate.toCoordinate())\n .collect(\n Collectors.toSet()\n );\n }",
"public List<B> getBins() {\n return ImmutableList.copyOf(bins);\n }",
"private Set<Hole> createHoleSet(){\n Set<Hole> holeSet = new HashSet<>();\n for (Profile profile:profiles) {\n holeSet.addAll(profile.getHoles());\n }\n return holeSet;\n }",
"public ArrayList<Tile> getEmptyTiles(){\n\t\tArrayList<Tile> emptyTiles = new ArrayList<Tile>();\n\t\tArrayList<Tile> boardTiles = getAllBoardTiles();\n\t\tfor (Tile tile : boardTiles) {\n\t\t\tif(tile.getPiece()== null && tile.getColor1()== PrimaryColor.BLACK) {\n\t\t\t\temptyTiles.add(tile);\n\t\t\t}\n\t\t}\n\t\treturn emptyTiles;\n\t}",
"private List<Boat> playStateBoats() {\n\t\tList<Boat> output = new ArrayList<>();\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tBoat boat = this.boats.get(generator.nextInt(this.boats.size() - 1));\n\t\t\toutput.add(boat);\n\t\t\tthis.boats.remove(boat);\n\t\t}\n\t\treturn output;\n\t}",
"public List<Piece> allPieces();",
"public boolean[][] getBoard() {\r\n return board;\r\n }",
"Set<MacAddress> neighbors();",
"public Set<Square> getSquares(Square[][] board, Line line) {\n Set<Square> answer = new HashSet<Square>();\n \n int row = line.getRow();\n int col = line.getCol();\n Side side = line.getSide();\n \n answer.add(board[row][col]);\n \n if(side == Side.NORTH && row > 0)\n answer.add(board[row - 1][col]);\n if(side == Side.WEST && col > 0)\n answer.add(board[row][col - 1]);\n if(side == Side.SOUTH && row < Util.N - 1)\n answer.add(board[row + 1][col]);\n if(side == Side.EAST && col < Util.N - 1)\n answer.add(board[row][col + 1]);\n \n return answer;\n }",
"@Override\r\n\tpublic Set<Wall> getWalls(Board board) throws UnsupportedOperationException\r\n\t{\r\n\t\treturn board.getElements(Wall.class);\r\n\t}",
"@Override\r\n\tpublic Set<Robot> getRobots(Board board)\r\n\t{\r\n\t\treturn board.getElements(Robot.class);\r\n\t}",
"public Set<Restaurant> getSurroundingRestaurants(){\n\n Set<Restaurant> retval = new HashSet<>();\n for (Restaurant r : restaurants){\n retval.add(r);\n }\n return retval;\n }",
"public Iterable<String> getAllValidWords(BoggleBoard board) {\n\t\tboolean[][] visited = new boolean[board.rows()][board.cols()];\n\t\tSet<String> results = new HashSet<>();\n\t\tTST.BacktrackTraverser<Integer> bt = tst.getTraverser();\n\t\tfor (int y = 0; y < board.rows(); y++) {\n\t\t\tfor (int x = 0; x < board.cols(); x++) {\n\t\t\t\tif (!bt.hasDown(board.getLetter(y, x))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvisited[y][x] = true;\n\t\t\t\tbt.down(board.getLetter(y, x));\n\t\t\t\tdfs(y, x, visited, results, board, bt);\n\t\t\t\tbt.up();\n\t\t\t\tvisited[y][x] = false;\n\t\t\t}\n\t\t}\n\n\t\treturn results;\n\t}",
"public int[] getBoard() {\n return board.clone(); //return board.clone();\n }",
"@Override\n\tpublic List<SpringBoardVO> boardSelectAll(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelectAll(bvo);\n\t}",
"public Bomb[] getBombs() {\r\n\t\treturn bombs;\r\n\t}",
"public ArrayList<FloorTile> getFixedTilesFromBoard() {\r\n ArrayList<FloorTile> fixedTiles = new ArrayList<FloorTile>();\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if (board[i][j].isFixedTile()) {\r\n fixedTiles.add(board[i][j]);\r\n }\r\n }\r\n }\r\n\r\n return fixedTiles;\r\n }",
"@Override\r\n\tpublic Set<SurpriseBox> getSurpriseBoxes(Board board)\r\n\t{\r\n\t\treturn board.getElements(SurpriseBox.class);\r\n\t}",
"public Tile[][] getBoard() {\r\n return board;\r\n }",
"private List<Branch> findBranchs()\r\n\t{\t\r\n\t\tList<Branch> localBranchs = new ArrayList<>();\r\n\t\tHashMap<String, Node> destinationNodes = new HashMap<>();\r\n\t\t\r\n\t\t// Percorre todos os arcos da rede\r\n\t\tfor (Edge edge: this.getEdges())\r\n\t\t{\t\r\n\t\t\t// Se ha carga no no destino do arco, este no � uma folha da rede\r\n\t\t\tif (edge != null && edge.getDestinationNode().getLoads().size() > 0) \r\n\t\t\t{\t\r\n\t\t\t\t// Verifica se h� mais de um arco com a mesma carga\r\n\t\t\t\tif (!destinationNodes.containsKey(edge.getDestinationNode().getLabel()))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tBranch branch = new Branch(edge.getDestinationNode().getLabel());\r\n\t\t\t\t\tbranch.addEdges(edge);\r\n\t\t\t\t\tEdge newEdge = edge.getReference();\r\n\t\t\t\t\tdestinationNodes.put(edge.getDestinationNode().getLabel(), edge.getDestinationNode());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// percorre os elementos amontantes do no e monta o laco\r\n\t\t\t\t\twhile (newEdge != null) \r\n\t\t\t\t\t{\t\t\r\n\t\t\t\t\t\tbranch.addEdges(newEdge.getReference());\r\n\t\t\t\t\t\tnewEdge = newEdge.getReference();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tlocalBranchs.add(branch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\r\n\t\treturn localBranchs; \r\n\t}",
"public static Collection<Character> getWhitelist(){\n\t\treturn new HashSet<Character>(kanjiWhitelist);\n\t}",
"private TreeSet<Integer> getNeightborSets(DisjointSets<Pixel> ds, int root)\n {\n return null; //TODO: remove and replace this line\n }",
"public static Set<Type> getBiomeTypes() {\n\t\ttry {\n\t\t\tfinal Field accessor = ReflectionHelper.findField(BiomeDictionary.Type.class, \"byName\");\n\t\t\tif (accessor != null) {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tfinal Map<String, BiomeDictionary.Type> stuff = (Map<String, BiomeDictionary.Type>) accessor.get(null);\n\t\t\t\treturn new ReferenceOpenHashSet<>(stuff.values());\n\t\t\t}\n\n\t\t\treturn ImmutableSet.of();\n\n\t\t} catch (final Throwable t) {\n\t\t\tthrow new RuntimeException(\"Cannot locate BiomeDictionary.Type table!\");\n\t\t}\n\n\t}",
"public Iterable<String> getAllValidWords(final BoggleBoard board) {\n HashSet<String> validwords = new HashSet<>();\n for (int i = 0; i < board.rows(); i++) {\n for (int j = 0; j < board.cols(); j++) {\n boolean[][] marked = new boolean[board.rows()][board.cols()];\n String word = \"\";\n dfs(board, marked, i, j, word, validwords);\n }\n }\n return validwords;\n }",
"private void tileSetSurroundingBombs() {\r\n for (int r = 0; r < gridSize; r++) {\r\n for (int c = 0; c < gridSize; c++) {\r\n int neighborBombs = neighborBombCount(grid[r][c]);\r\n grid[r][c].setSurroundingBombs(neighborBombs);\r\n }\r\n } \r\n }",
"ArrayList<Habit> getHabits();",
"public Iterable<String> getAllValidWords(BoggleBoard board) {\n m = board.rows();\n n = board.cols();\n graph = new char[m][n];\n marked = new boolean[m][n];\n for (int i = 0; i < m; ++i) {\n for (int j = 0; j < n; ++j) {\n graph[i][j] = board.getLetter(i, j);\n }\n }\n\n words = new HashSet<String>();\n for (int i = 0; i < m; ++i) {\n for (int j = 0; j < n; ++j) {\n dfs(i, j, \"\");\n }\n }\n return words;\n }",
"public final HashSet<Drop> getDeponents() {\r\n synchronized (f_seaLock) {\r\n return new HashSet<>(f_deponents);\r\n }\r\n }",
"private Set<Edge> basicEdges() {\n Set<Edge> set = new LinkedHashSet<>();\n set.add(new Edge(0, 1, 8, false));\n set.add(new Edge(0, 2, 7, false));\n set.add(new Edge(0, 3, 1, false));\n set.add(new Edge(1, 3, 9, false));\n set.add(new Edge(1, 5, 6, false));\n set.add(new Edge(2, 4, 2, false));\n set.add(new Edge(3, 5, 3, false));\n set.add(new Edge(3, 6, 4, false));\n set.add(new Edge(4, 5, 10, false));\n set.add(new Edge(4, 6, 5, false));\n return set;\n }"
] | [
"0.63879",
"0.6312854",
"0.6268853",
"0.61445296",
"0.61445296",
"0.6091583",
"0.6013415",
"0.5991791",
"0.5957425",
"0.59498906",
"0.5896974",
"0.5826935",
"0.5814884",
"0.57881",
"0.57737947",
"0.57624954",
"0.5761021",
"0.5756671",
"0.5741317",
"0.5709523",
"0.5708543",
"0.5704974",
"0.5685454",
"0.56666833",
"0.5632739",
"0.5622866",
"0.5619587",
"0.5619203",
"0.56046003",
"0.5575215",
"0.5557039",
"0.5518214",
"0.5515985",
"0.54732215",
"0.54655117",
"0.5460189",
"0.5454589",
"0.5452078",
"0.5448029",
"0.544122",
"0.5429286",
"0.5416851",
"0.5395358",
"0.5394737",
"0.5381773",
"0.5370238",
"0.5360044",
"0.5359091",
"0.5357814",
"0.5348625",
"0.5344706",
"0.5316597",
"0.5288562",
"0.52832687",
"0.5276509",
"0.52739084",
"0.5272975",
"0.52664053",
"0.52653587",
"0.52563006",
"0.52464426",
"0.52386814",
"0.523832",
"0.5234412",
"0.522877",
"0.5222102",
"0.5215797",
"0.5213682",
"0.52126014",
"0.52065754",
"0.52062714",
"0.5205722",
"0.5198853",
"0.51987815",
"0.519872",
"0.51947254",
"0.51785475",
"0.51731443",
"0.51713485",
"0.5168015",
"0.5164645",
"0.51624787",
"0.5160437",
"0.51532644",
"0.51490664",
"0.51392984",
"0.51351845",
"0.5134124",
"0.51298594",
"0.5127034",
"0.5117271",
"0.5113926",
"0.51129115",
"0.51096505",
"0.5104175",
"0.51036483",
"0.50932956",
"0.5092135",
"0.5085314",
"0.50833005"
] | 0.694546 | 0 |
Load the program stored at path and assign it to robot. Return 0 if the operation completed successfully; otherwise, return a negative number. | @Override
public int loadProgramFromFile(Robot robot, String path)
{
String inputProgram = null;
java.io.FileReader fileReader = null;
StringBuffer buffer = null;
java.io.File file = new java.io.File(path);
if(file.exists() && file.canRead())
{
try
{
fileReader = new java.io.FileReader(file);
buffer = new StringBuffer();
int len;
char[] chr = new char[4096];
// if the read()-method returns -1 the end of the string is reached
while ((len = fileReader.read(chr)) > 0)
{
buffer.append(chr, 0, len);
}
}
catch (IOException e)
{
}
finally
{
try
{
fileReader.close();
}
catch (IOException e)
{
}
}
inputProgram = buffer.toString();
}
if(inputProgram == null)
{
return -1;
}
try
{
robot.setProgram(inputProgram);
}
catch(IllegalSyntaxException exc)
{
return -1;
}
if(robot.getProgram() == Parser.parse(0, robot, inputProgram))
{
return -1;
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic int saveProgramToFile(Robot robot, String path)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tBufferedWriter out = new BufferedWriter(new java.io.FileWriter(new java.io.File(path)));\r\n\t\t\tout.write(robot.getProgram().toString());\r\n\t\t\tout.close();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"The operation failed.\");\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\treturn 0;\r\n\t}",
"private int loadProgram(Program program, int start) throws MemoryFault {\n int address = start;\n for (int i : program.getCode()) {\n machine.memory.store(address++, i);\n }\n return address;\n }",
"static void loadProgram(String assemblyProgramFile)\n\t{\n\t\t\n\t\tMainMemory mainmemory = Simulator.processor.getMainMemory();\n\t int currMemLocation=0;\n\t \n\t\ttry\n\t\t {\n\t\t DataInputStream instr = \n\t\t new DataInputStream(\n\t\t new BufferedInputStream(\n\t\t new FileInputStream( assemblyProgramFile ) ) );\n\t\t \t\n\t\t int instruction;\n\t\t Boolean pcSet=false;\n\t\t processor.getRegisterFile().setValue(0, 0);\n\t\t processor.getRegisterFile().setValue(1, 65535);\n\t\t processor.getRegisterFile().setValue(2, 65535);\n\n\t\t \n\t\t while(true) {\n\t\t\t try {\n\t\t\t \t instruction = instr.readInt();\n\t\t\t \t if(pcSet==false) {\n\t\t\t \t\t processor.getRegisterFile().setProgramCounter(instruction);\n\t\t\t \t\t processor.getEX_IF_Latch().setBranchPC(instruction);\n\t\t\t \t\t System.out.println(\"Simulator - pc set to \"+instruction);\n\t\t\t \t\t pcSet=true;\n\t\t\t \t }else {\n\t\t\t \t\t mainmemory.setWord(currMemLocation, instruction);\n\t\t\t \t\t currMemLocation++;\n\t\t\t \t }\n\t\t\t \t \n\t\t\t }\n\t\t\t catch(EOFException e) {\n\t\t\t \t break;\n\t\t\t }\n\t\t }\n\t\t \n\t\t instr.close();\n\t\t }\n\t\t catch ( IOException iox )\n\t\t {\n\t\t System.out.println(\"Problem reading \" + assemblyProgramFile );\n\t\t }\n\t\t\n\t\tSystem.out.println(mainmemory.getContentsAsString(0,currMemLocation+10));\n\t}",
"private void showLoadProgramDlg() {\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n SixDOFArmResources.getString(\"PIERINHO_FILE_DESCRIPTION\"),\n SixDOFArmResources.getString(\"PIERINHO_FILE_EXTENSION\")\n );\n File file;\n File dir;\n final JFileChooser fc = new JFileChooser();\n fc.setDialogTitle(SixDOFArmResources.getString(\"PIERINHO_FILE_SELECTION\"));\n fc.setFileFilter(filter);\n boolean proceed;\n String filename = programLabel.getText();\n \n if (filename.length() > 0) {\n dir = new File(FileUtils.expandFileName(filename));\n if (dir.exists()) {\n fc.setCurrentDirectory(dir);\n }\n }\n do {\n int returnVal = fc.showOpenDialog(this);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n file = fc.getSelectedFile();\n if (file.exists()) {\n proceed = true;\n } else {\n proceed = false;\n gui.showError(String.format(\n SixDOFArmResources.getString(\"ERROR_FILE_DOES_NOT_EXIST\"),\n file.getAbsolutePath()));\n }\n if (proceed) {\n programPathLabel.setText(file.getAbsolutePath());\n loadProgram();\n } else {\n }\n } else {\n break;\n }\n } while(!proceed);\n }",
"public static void load(String name) throws RuntimeException, IOException{\n\t\tif(!name.startsWith(\"/\")) name = \"/\"+name;\n\t\tFile libFile = NativeUtils.getAsLocalFile(name);\n\t\tUtils.sleep(500); // wait a bit to be sure the library is ready to be read\n\t\tSystem.load(libFile.getAbsolutePath());\n\t}",
"public void loadGame(){\r\n Scanner in = new Scanner(System.in);\r\n System.out.println(\"Choose a saved game. ( -1 : none )\");\r\n try {\r\n File[] listOfFiles = this.showFiles(this.savePath); //Show the files that have been saved earlier\r\n int i = in.nextInt();\r\n if(i==-1){\r\n return;\r\n }\r\n String filePath = listOfFiles[i].getPath(); //Get the path of the chosen file\r\n this.load(filePath);\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"There are no saved games.\");\r\n }\r\n }",
"public static void loadProgram() throws Exception{\n\t\t\n\t\tInteger instructionNumber = 0; \n\t\t\n\t\ttry {\n\t\t\tScanner scanner = new Scanner(new File(ramProgram));\n\t\t\twhile (scanner.hasNext()){\n\t\t\t\tString next = scanner.nextLine();\n\t\t\t\tnext = next.trim();\n\t\t\t\tString [] array = next.split(\"\\\\s+\");\n\t\t\t\t\n\t\t\t\tif (next.startsWith(\"#\") || next.isEmpty()){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tif (array[0].endsWith(\":\")){\n\t\t\t\t\t\ttagList.add(new Tag(array[0], instructionNumber));\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la etiqueta:\" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[1], array[2], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch (array.length){\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], \"\", getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tprogramMemory.add(new Instruction(array[0], array[1], getLine(next)));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception(\"Error en la instrucción: \" + array[0] + \". Línea: \" + getLine(next));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tinstructionNumber++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tscanner.close();\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\n\t\t}\n\t}",
"public Integer load(String pDirectory) throws CallError, InterruptedException {\n return (Integer)service.call(\"load\", pDirectory).get();\n }",
"private void loadAssembly () {\r\n Factory assemblyFactory = new AssemblyFactory(mySimulation);\r\n int response = INPUT_CHOOSER.showDialog(null, \"Assembly file\");\r\n if (response == JFileChooser.APPROVE_OPTION) {\r\n assemblyFactory.loadFile(INPUT_CHOOSER.getSelectedFile());\r\n }\r\n }",
"public void runProgram(Path p) {\n\t\ttry {\n\t\t\tFile f = new File(p.toString());\n\t\t\tString dir = f.getParent();\n\t\t\tString filename = f.getName();\n\t\t\tString currentOS = System.getProperty(\"os.name\").toLowerCase();\n\n\t\t\t//System.out.println(\"OS: \" + currentOS);\n\t\t\t\n\t\t\tif (currentOS.indexOf(\"win\") >= 0) {\n\t\t\t\tString compiled = dir.concat(\"\\\\\").concat(filename.substring(0, f.getName().lastIndexOf(\".\")).concat(\".exe\"));\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Compiled File: \" + compiled);\n\n\t\t\t\tif (this.programIfExists(compiled)) {\n\t\t\t\t\tSystem.out.println(\"Finished Compiling\");\n\t\t\t\t\tProcessBuilder pb = new ProcessBuilder(\"cmd\", \"/k\", \"start\", compiled);\n\t\t\t\t\tProcess proc = pb.start();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Some compilation error occured\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if(currentOS.indexOf(\"mac\") >= 0) {\n\t\t\t\tString compiled = dir.concat(\"\\\\\").concat(filename.substring(0, f.getName().lastIndexOf(\".\")).concat(\".out\"));\n\t\t\t\tRuntime rt = Runtime.getRuntime();\n\t\t\t\tProcess proc = rt.exec(compiled);\n\t\t\t}\n\n\t\t\telse if(currentOS.indexOf(\"nix\") >= 0 || currentOS.indexOf(\"nux\") >= 0) {\n\t\t\t\tString compiled = dir.concat(\"\\\\\").concat(filename.substring(0, f.getName().lastIndexOf(\".\")));\n\t\t\t\tRuntime rt = Runtime.getRuntime();\n\t\t\t\tProcess proc = rt.exec(compiled);\n\t\t\t}\n\t\t}\n\n\t\tcatch(Exception ex) {\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}",
"File getLoadLocation();",
"public void running(String path) {\n\t\tthis.procPath = path;\n\t\ttry{\n\t\t\tthis.readSourceData();\n\t\t\tthis.swapValue();\n\t\t\tthis.writeProc();\n\t\t\t\n\t\t\tLMain.getExportMSG().addData(\"SUCCESS - Export(mat03_thermal_expansion_const) \\n path : \"+ this.procPath);\n\t\t\tlog.info(\"SUCCESS - Export(mat03_thermal_expansion_const) \\n path : \"+ this.procPath);\n\t\t}catch(Exception e){\n\t\t\tString msg = \"ERROR - Export(mat03_thermal_expansion_const)\";\n\t\t\tmsg = msg +\"\\n\"+e.getMessage();\n\t\t\tMessageDlg messageDlg = new MessageDlg(Display.getCurrent().getActiveShell(), msg);\n\t\t\tmessageDlg.open();\n\t\t\tlog.error(msg);\n\t\t\tLMain.getExportMSG().addData(msg);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void robotInit() {\n\t\t//Get preferences from robot flash memory\n\t\tprefs = Preferences.getInstance();\n\t\tarmCalMinPosition = prefs.getDouble(\"armCalMinPosition\", 0);\n\t\tarmCal90DegPosition = prefs.getDouble(\"armCal90DegPosition\", 0);\n\t\tif (armCalMinPosition==0 || armCal90DegPosition==0) {\n\t\t\tDriverStation.reportError(\"Error: Preferences missing from RoboRio for Shooter Arm position calibration. Shooter arm disabled.\", true);\n\t\t\tshooterArmEnabled = false;\n\t\t} else {\n\t\t\tshooterArmEnabled = true;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tdebugStream = new FileWriter(\"/home/lvuser/debug.log\", true);\n\t\t\tdebugStream.write(\"Robot program started\\n\");\n\t\t\tdebugStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not open debug file: \" + e);\n\t\t}\n\n\t\t//Instantiates the subsystems\n\t\tdriveTrain = new DriveTrain();\n\t\tshifter = new Shifter();\n\t\tshooterArm = new ShooterArm();\n\t\tshooter = new Shooter();\n\t\tintake = new Intake();\n\t\tvision = new Vision();\n\t\tpanel = new PowerDistributionPanel();\n\t\tarmPiston = new ArmPiston();\n\n\t\t// OI must be constructed after subsystems. If the OI creates Commands\n\t\t// (which it very likely will), subsystems are not guaranteed to be\n\t\t// constructed yet. Thus, their requires() statements may grab null\n\t\t// pointers. Bad news. Don't move it.\n\t\toi = new OI();\n\n intake.motorCurrentTrigger.whenActive(new IntakeMotorStop());\n\n timerLEDs.start();\n timerTilt.start();\n timerRumble.start();\n \n // instantiate the command used for the autonomous period\n\t\t//autonomousCommand = new AutonomousCommandGroup();\n\t\traiseArm90 = new ShooterArmMoveToSetLocation(90);\n\t\t\n\t\t// Display active commands and subsystem status on SmartDashboard\n\t\tSmartDashboard.putData(Scheduler.getInstance());\n\t\tSmartDashboard.putData(driveTrain);\n\t\tSmartDashboard.putData(shifter);\n\t\tSmartDashboard.putData(shooterArm);\n\t\tSmartDashboard.putData(shooter);\n\t\tSmartDashboard.putData(intake);\n\t\tSmartDashboard.putData(vision);\n\t\tSmartDashboard.putData(armPiston);\n\t}",
"private void loadEnvironment () {\r\n Factory forceFactory = new ForceFactory(mySimulation);\r\n int response = INPUT_CHOOSER.showDialog(null, \"Environment file\");\r\n if (response == JFileChooser.APPROVE_OPTION) {\r\n forceFactory.loadFile(INPUT_CHOOSER.getSelectedFile());\r\n }\r\n }",
"public void exec(OxProgram pgm) {\n }",
"public void executeLoad(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString pcOffset = mIR.substring(7, 9);\n\t\tBitString wantedVal = mMemory[mPC.getValue() + pcOffset.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t\t//now I just need to set the conditional codes.\n\t}",
"public void startGame(String path) throws FileNotFoundException, IOException, BowlingGameException;",
"@Override\n public int loadGame(String foo) {\n RunGame.loadGame(foo);\n return 0;\n }",
"public String program();",
"public void run(){\n\t\tGlobal.printer.print(\"\\ngetting resource from \"+apkName+\" ... \");\n\t\tString cmd = \"java -jar \\\"\"+this.apktoolPath+\"\\\" d \\\"\"+this.filePath+\"\\\" -f -o \\\"\"+ this.apkPath+\"\\\"\";\n\t\t//Global.copyDir(this.tmpResPath, this.apkPath);\n\t\ttry {\n\t\t\tGlobal.sysCmd(cmd );//,Global.printer);\n\t\t\tGlobal.printer.print(\"succeed!!\");\n\t\t} catch (Exception e) {\n\t\t\tGlobal.printer.print(\"error!!\");\n\t\t\t//Global.printer.print(e.getMessage());\n\t\t}\n\t}",
"public void runProgram() {\n\n\t\tSystem.out.println(\"\\n Time to start the machine... \\n\");\n\n\t\tpress.pressOlive(myOlives);\n\n\t\tSystem.out.println(\"Total amount of oil \" + press.getTotalOil());\n\t}",
"private int executeProgram() {\n\n\t\tint bugNumber = 0;\n\n\t\t// running a command in java\n\t\tString command = \"./jpegconv -ppm -outfile \" + this.ppmName + \" \"\n\t\t\t\t+ this.sampleName;\n\t\tProcess child = null;\n\t\ttry {\n\t\t\tchild = Runtime.getRuntime().exec(command);\n\t\t\tchild.waitFor();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Unable to execute the command: \" + command);\n\t\t\treturn -2;\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.err.println(\"Unable to wait for the command: \" + command);\n\t\t\treturn -2;\n\t\t}\n\n\t\t// Extract the output of the program\n\t\tInputStream inputstream = child.getErrorStream();\n\t\tInputStreamReader inputstreamreader = new InputStreamReader(inputstream);\n\t\tBufferedReader bufferedreader = new BufferedReader(inputstreamreader);\n\n\t\t// Read the output of the program\n\t\tString line;\n\t\tboolean error = false;\n\t\ttry {\n\t\t\twhile ((line = bufferedreader.readLine()) != null) {\n\t\t\t\terror = true;\n\t\t\t\t// Reg expression to check if any bug was triggered\n\t\t\t\tif (line.matches(\"BUG \\\\d+ TRIGGERED\")) {\n\t\t\t\t\tbugNumber = Integer.parseInt(line.replaceAll(\"[^\\\\d]\", \"\"));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tinputstream.close();\n\t\t\tinputstreamreader.close();\n\t\t\tbufferedreader.close();\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\t// Return -1 if another bug was triggered\n\t\tif (error && bugNumber == 0)\n\t\t\tbugNumber = -1;\n\t\tchild.destroy();\n\t\treturn bugNumber;\n\t}",
"public boolean callProgram(String programId);",
"protected void execute() {\r\n\t \tRobot.arm.moveToPreload();\r\n\t }",
"@Test\n\t public void testOVerLoadWt12Kg(){\n\t\t robot = new Robot(12, 0);\n\t\t \n\t }",
"private void appInitialization(){\n openRom();\n openGuide();\n setOffset(0);\n addressChanged();\n }",
"void singleModeLoading( File dataPath, File resultsPath, int scenarioNumber );",
"public void setPath (\r\n String strPath) throws java.io.IOException, com.linar.jintegra.AutomationException;",
"private void doExecute() throws MojoExecutionException {\n URL buildUrl;\n try {\n buildUrl = buildDirectory.toURI().toURL();\n getLog().info(\"build directory \" + buildUrl.toString());\n } catch (MalformedURLException e1) {\n throw new MojoExecutionException(\"Cannot build URL for build directory\");\n }\n ClassLoader loader = makeClassLoader();\n Properties properties = new Properties(project.getProperties());\n properties.setProperty(\"lenskit.eval.dataDir\", dataDir);\n properties.setProperty(\"lenskit.eval.analysisDir\", analysisDir);\n dumpClassLoader(loader);\n EvalConfigEngine engine = new EvalConfigEngine(loader, properties);\n \n try {\n File f = new File(script);\n getLog().info(\"Loading evalution script from \" + f.getPath());\n engine.execute(f);\n } catch (CommandException e) {\n throw new MojoExecutionException(\"Invalid evaluation script\", e);\n } catch (IOException e) {\n throw new MojoExecutionException(\"IO Exception on script\", e);\n }\n }",
"public void loadingLibrary(String libraryFilename);",
"public void beginLoad(int libraryCount);",
"protected void initialize() {\n Robot.m_drivetrain.resetPath();\n Robot.m_drivetrain.addPoint(0, 0);\n Robot.m_drivetrain.addPoint(3, 0);\n Robot.m_drivetrain.generatePath();\n \n\t}",
"public static void main(String[] args){\n\t\tSystem.loadLibrary(Core.NATIVE_LIBRARY_NAME);\n\t\t\n\t\tif(args.length < 1){\n\t\t\tSystem.out.println(\"You must pass in the robbit's name!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tConfigFileReader.fileName = \"simConfig.txt\";\n\t\tConstantsFileReader.fileName = \"simConstants.csv\";\n\t\tRobotProvider.instance = new SimRobotProvider();\n\t\t\n\t\tSystem.out.println(\"========= Loading Robbit Code =========\");\n\t\tMyRobot robot = null;\n\t\ttry {\n\t\t\trobot = (MyRobot)Class.forName(args[0]).asSubclass(MyRobot.class).newInstance();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Robot couldn't be instantiated\\t :(\");\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"========== Starting up connector ==========\");\n\t\tnew Thread(VRConnector.getInstance()).start();\n\t\tVRConnector.getInstance().putCommandBool(VRConnector.RESET_SIM, true);\t\t\n\n\t\t\n\t\t/*\n\t\t * RESETING SIMULATOR\n\t\tSystem.out.println(\"Waiting for Simulator to restart...\");\n\t\tfor(int i = WAIT_TIME; i > 0; i--){\n\t\t\tSystem.out.println(i + \" seconds left...\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e1) {}\n\t\t}\n\t\t*/\n\t\t\n\t\trobot.robotInit();\n\t\t\n\t\twhile(true){\n\t\t\t//Update GameState\n//\t\t\tif(state_ != VRConnector.getInstance().getFeedback(VRConnector.Game_State))\n//\t\t\t\tinit = true;\n\t\t\t\n\t\t\tswitch(state_){\n\t\t\t\tcase Auton:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.autonomousInit();\n\t\t\t\t\trobot.autonomousPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Disabled:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.disabledInit();\n\t\t\t\t\trobot.disabledPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Teleop:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.teleopInit();\n\t\t\t\t\trobot.teleopPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Test:\n\t\t\t\t\tif(init)\n\t\t\t\t\t\trobot.testInit();\n\t\t\t\t\trobot.teleopPeriodic();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.err.println(\"GAME STATE NOT RECOGNIZED:\\t\" + state_);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tinit = false;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tThread.sleep(15);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Test\n\tpublic void testLoad() {\n\t\tWriter writer = null ;\n\t\t\n\t\tString sourceFilePath = \"testLoad1.lisp\" ;\n\t\t\n\t\t//create the test source file\n\t\ttry {\n\t\t\twriter = new BufferedWriter(\n\t\t\t\t\t\tnew OutputStreamWriter(\n\t\t\t\t\t\t\t\tnew FileOutputStream(sourceFilePath), \"utf-8\")) ;\n\t\t\twriter.write(\"(define foo 37)\\n\");\n\t\t} catch (IOException except){\n\t\t\t\n\t\t} finally {\n\t\t\ttry {writer.close();} catch (Exception ex) {}\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tLispObject result = LispReader.load(sourceFilePath, env) ;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tenv.dump() ;\n\t\t//check that the environment contains the bindings as stated in the source file.\n\t\t\n\t\tSystem.out.println(\"testLoad(): got \" + env.get(\"BAR\")) ;\n\n\t\tassertTrue(env.get(\"FOO\").toString().equals(\"37\"));\n\t}",
"public void LoadBinaryFile(String filename) throws RuntimeException\n {\n byte bytepair[];\n int memPtr = 0;\n\n bytepair = new byte[2];\n File theFile = new File(filename);\n if (!theFile.exists())\n throw new RuntimeException(Constants.Error(Constants.FILE_NOT_FOUND) + \" \" + filename);\n try\n {\n FileInputStream is = new FileInputStream(theFile);\n int readingdata = is.read(bytepair);\n while (readingdata > 0)\n {\n if (memPtr >= PROGRAM_MEMORY_SIZE)\n throw new RuntimeException(Constants.Error(Constants.OUT_OF_MEMORY));\n this.setProgramMemory(memPtr++,Utils.unsigned_byte(bytepair[0]) + (Utils.unsigned_byte(bytepair[1]) << 8));\n readingdata = is.read(bytepair);\n }\n is.close();\n }\n catch (IOException e)\n {\n System.err.println(\"Error reading in binary file \" + filename);\n System.err.println(e.toString());\n System.exit(-1);\n }\n return;\n }",
"public void loadIntoNW() throws LoadException {\n\t\tloadProgress = new LoadProgress2(targetModel.getFileSet().getRoot(), null);\n\t\trun();\n\t\tif (getException() != null) {\n\t\t\tthrow getException();\n\t\t}\n\t}",
"public void run(String[] args){\n if (args.length > 0)\n {\n try{\n InputStreamReader is = new InputStreamReader(getClass().getResourceAsStream(\"/\" + args[0]));\n BufferedReader txtReader = new BufferedReader(is);\n Scanner inputScanner = new Scanner(txtReader);\n System.out.println(String.format(\"Processing file %s\", args[0]));\n ToyRobot toyRobot = new ToyRobot();\n ToyRobotController controller = new ToyRobotController(toyRobot);\n while (inputScanner.hasNext()){\n String line = inputScanner.nextLine().toUpperCase();\n if (line.contains(Constants.COMMAND_PLACE) && Utilities.isOnTable(Utilities.getCoordinateFromInput(line))){\n controller.place(Utilities.getCoordinateFromInput(line), Utilities.getDirectionFromInput(line));\n System.out.println(String.format(\"Robot placement at %s,%s\", controller.getRobot().getCoordinates().getxCoordinate(), controller.getRobot().getCoordinates().getyCoordinate() ));;\n } else if (line.contains(Constants.COMMAND_MOVE)){\n controller.move();\n System.out.println(String.format(\"Robot moving at direction %s\", controller.getRobot().getDirection()));\n } else if ((line.contains(Constants.COMMAND_TURN_LEFT) || line.contains(Constants.COMMAND_TURN_RIGHT))){\n controller.turn(line);\n System.out.println(String.format(\"Robot changed direction to %s\", controller.getRobot().getDirection()));\n } else if (line.contains(Constants.COMMAND_REPORT)){\n controller.location();\n }\n }\n } catch (Exception e){\n System.out.println(\"No input found\");\n }\n }\n else\n {\n System.out.println(\"No input found\");\n }\n }",
"public void runProgram()\n\t{\n\t\tintro();\n\t\tfindLength();\n\t\tguessLetter();\n\t\tguessName();\n\t}",
"public static void load(String string, boolean start) {\r\n\t\ttry {\r\n\t\t\tHamster._re_init();\r\n\t\t\tinitPython();\r\n\t\t\tinterpreter.exec(string);\r\n\t\t} catch (Throwable e) {\r\n\t\t\tif (!de.hamster.debugger.model.DebuggerModel.isStop) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.toString(),\r\n\t\t\t\t\t\t\"Python-Exception\", JOptionPane.ERROR_MESSAGE, null);\r\n\t\t\t}\r\n\t\t\tde.hamster.debugger.model.DebuggerModel.isStop = false;\r\n\t\t}\r\n\t}",
"public Object run() {\n System.out.println(\"\\nYour java.home property: \"\n +System.getProperty(\"java.home\"));\n\n System.out.println(\"\\nYour user.home property: \"\n +System.getProperty(\"user.home\"));\n\n File f = new File(\"foo.txt\");\n System.out.print(\"\\nfoo.txt does \");\n if (!f.exists())\n System.out.print(\"not \");\n System.out.println(\"exist in the current working directory.\");\n return null;\n }",
"public void startLibrary();",
"public abstract void loadKnowledge(String path) throws LoadKnowledgeException;",
"public void loadGame(File fileLocation, boolean replay);",
"public void loadQuickly(){\r\n System.out.println(\"I am going to try to load your games.\");\r\n String quickLoadPath = this.savePath + File.separator + \"QuickSave.ser\";\r\n this.load(quickLoadPath);\r\n }",
"public void run() {\n\t\tif ((phase == 0) && (pState.equals(\"ru\"))) {\t\n\t\t\tPyOS.askForResource(PyOS.waitingList6, 6);\n\t\t\tneededResource = 6;\n\t\t\tphase = 1;\n\t\t}\n\t\t//2) asks for supervisor memory\n\t\tif ((phase == 1) && (receivedResource == 6) && (pState.equals(\"ru\"))) {\t\n\t\t\tPyOS.askForResource(PyOS.waitingList2, 2);\n\t\t\tneededResource = 2;\n\t\t\tphase = 2;\n\t\t}\n\t\t\n\t\t//3)asks for hard drive memory\n\t\t//TODO\n\t\tif ((phase == 2) && (receivedResource == 2) && (pState.equals(\"ru\"))) {\t\n\t\t\n\t\t\tPyOS.askForResource(PyOS.waitingList4, 4);\n\t\t\tneededResource = 4;\n\t\t\tphase = 3;\n\t\t}\n\t\t\n\t\t//4) copies task to hard drive memmory\n\t\t//TODO\n\t\tif ((phase == 3) && (receivedResource == 4) && (pState.equals(\"ru\"))) {\t\n\t\t\tneededResource = 0;\n\t\t\t\n\t\t\tString line = new String();\n\t\t\t\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tline = OSUI.flash.readLine();\n\t\t\t\t\tif (line != null) {\n\t\t\t\t\t\tHdd.openFileForWriting(filesInUse);\n\t\t\t\t\t\tHdd.writeToFile(filesInUse, line);\n\t\t\t\t\t\tHdd.closeFile(filesInUse);\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} while (line != null && !line.equals(\"$END\"));\n\t\t\t\n\t\t\tif (line == null) {\n\t\t\t\tPyOS.askForResource(PyOS.waitingList1, 1);\n\t\t\t\tPyOS.freeResource(PyOS.waitingList2, 2, ownedResList.get(1));\n\t\t\t\tPyOS.freeResource(PyOS.waitingList4, 4, ownedResList.get(1));\n\t\t\t} else {\n\t\t\t\tfilesInUse++;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tPyOS.freeResource(PyOS.waitingList6, 6, ownedResList.get(0));\n\t\t\tphase = 4;\n\t\t}\n\t\t\n\t\t//5 TODO free flash, hard drive resources\n\t\tif ((phase == 4) && (pState.equals(\"ru\"))){\n\t\t\tPyOS.freeResource(PyOS.waitingList2, 2, ownedResList.get(0));\n\t\t\tPyOS.freeResource(PyOS.waitingList4, 4, ownedResList.get(0));\n\t\t\tphase = 5;\n\t\t}\n\t\t\n\t\t//7) creates resource task in hard drive\n\t\t//TODO resource should contain fileId\n\t\tif ((phase == 5) && (pState.equals(\"ru\"))) {\n\t\t\t\n\t\t\t\n\t\t\tPyOS.createResource(7, intID);\n\t\t\townedResList.add(createdResList.get(createdResList.size()-1));\n\t\t\townedResList.get(ownedResList.size()-1).user = PyOS.findProcessByIntId(intID);\n\t\t\t((TaskInHardDrive)ownedResList.get(ownedResList.size()-1)).computingTime = 1;\n\t\t\tPyOS.freeResource(PyOS.waitingList7, 7, ownedResList.get(ownedResList.size()-1));\n\t\t\tphase = 0;\n\t\t}\n\t}",
"public void pickGivenProgram(final String programName) throws ParseException;",
"@Test\n @RunIn(TestGroup.QA_UNRELIABLE)\n public void importAndRunInstantApp() throws Exception {\n String runConfigName = \"topekabundle\";\n IdeFrameFixture ideFrame = guiTest.importProjectAndWaitForProjectSyncToFinish(\"TopekaInstantApp\");\n\n String avdName = EmulatorGenerator.ensureAvdIsCreated(\n ideFrame.invokeAvdManager(),\n new AvdSpec.Builder()\n .setSystemImageGroup(AvdSpec.SystemImageGroups.X86)\n .setSystemImageSpec(O_AVD_IMAGE)\n .build()\n );\n\n ideFrame.runApp(runConfigName, avdName);\n\n Pattern CONNECTED_APP_PATTERN = Pattern.compile(\".*Connected to process.*\", Pattern.DOTALL);\n\n ExecutionToolWindowFixture.ContentFixture runWindow = ideFrame.getRunToolWindow().findContent(runConfigName);\n runWindow.waitForOutput(new PatternTextMatcher(CONNECTED_APP_PATTERN), TimeUnit.MINUTES.toSeconds(2));\n\n runWindow.waitForStopClick();\n }",
"public boolean compute() throws Exception{\n \n String cmdLine;\n String voicedir = db.getProp(db.ROOTDIR);\n \n /* Run: perl hts/scripts/Training.pl hts/scripts/Config.pm (It can take several hours...)*/ \n cmdLine = db.getExternal(db.PERLPATH) + \"/perl \" + voicedir +\"hts/scripts/Training.pl \" + voicedir + \"hts/scripts/Config.pm\"; \n launchProcWithLogFile(cmdLine, \"\", voicedir);\n \n return true;\n }",
"int load() {\n File file = new File(\"network.dat\");\n try (BufferedReader in = file.exists() ? new BufferedReader(new InputStreamReader(new FileInputStream(file))) : Gdx.files.internal(\"network.dat\").reader(1024)) {\n int generation = Integer.parseInt(in.readLine());\n for (int i = 0; i < weightLayer1.length; i++)\n weightLayer1[i] = Float.valueOf(in.readLine().trim());\n for (int i = 0; i < weightLayer2.length; i++)\n weightLayer2[i] = Float.valueOf(in.readLine().trim());\n return generation;\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"The Neural Network could not be loaded:\\n\" + e.getLocalizedMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n return -1;\n }",
"public void runProgram() {\n\t\tJTextPane code = ((MinLFile) tabbedPane.getSelectedComponent()).CodeArea;\n\t\tminc.consolearea.setText(\"\");\n\t\tinterpretorMainMethod(code.getText(), 0);\n\t\tdouble_variables.clear();\n\t\tstring_variables.clear();\n\t\tfunctions.clear();\n\t}",
"void loadExperiment();",
"public void load(String code) {\n\n\t\tEngine.console.write(\"load method echo\");\n\t\tif (!code.matches(\"(\\\\d){4}\")) {\n\t\t\tEngine.console.write(\"code does not match regex for map ID\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tEngine.console.write(\"code matches regex\");\n\t\t\ttry {\n\t\t\t\tFileInputStream fis = new FileInputStream(\"/boards/\" + code + \".map\");\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\t\tBoard loaded = (Board) ois.readObject();\n\t\t\t\tEngine.activeBoard = loaded;\n\t\t\t\tEngine.console.write(\"loaded and assigned\");\n\t\t\t\tSystem.out.println(Engine.activeBoard);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tEngine.console.write(\"File \" + code + \".map not found\", Console.ERROR);\n\t\t\t} catch (ClassNotFoundException ex) {\n\t\t\t\tEngine.console.write(\"Class not found\", Console.ERROR);\n\t\t\t}\n\t\t}\n\t}",
"public void loadGame() {\n\t\tmanager.resumeGame();\n\t}",
"@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}",
"public void load() throws ClassNotFoundException, IOException;",
"Program createProgram();",
"Program createProgram();",
"Program createProgram();",
"public void execute() {\n\n try {\n int source = data_path.IR.decimal(15, 0);\n int destination = data_path.IR.decimal(23, 16);\n\n System.out.println(\"Source: \" + source);\n data_path.master_bus.store(source);\n data_path.bank.load(destination);\n\n } catch (Exception e) {\n System.err.println(\"In Controler:LOADI0:increment_clock\");\n System.err.println(e);\n }\n }",
"public LiveOrchestrator loadGame(String gameName, String[] parameters,\r\n\t\tboolean testMode, String resultFile) throws CowException {\r\n\t\tif (logger.isTraceEnabled())\r\n\t\t\tlogger.trace(\"Loading game (\" + gameName + \")...\");\r\n\t\t\r\n\t\t// Create game simulator\r\n\t\tif (testMode) {\r\n\t\t\tthis.simulator =\r\n\t\t\t\tnew TestOrchestrator(this, gameName, parameters, resultFile);\r\n\t\t} else {\r\n\t\t\tthis.simulator =\r\n\t\t\t\tnew SecureOrchestrator(this, gameName, parameters, resultFile);\r\n\t\t}\r\n\t\t\r\n\t\tif (logger.isDebugEnabled())\r\n\t\t\tlogger.debug(\"Game loaded.\");\r\n\t\t\r\n\t\treturn (LiveOrchestrator) simulator;\r\n\t}",
"public void loadGame() throws IOException\r\n\t{\r\n\t\tjava.io.BufferedReader reader;\r\n\t String line;\r\n\t String[] elements;\r\n\t int ammo = 0;\r\n\t String state = null;\r\n\t try\r\n\t {\r\n\t reader = new java.io.BufferedReader(new java.io.FileReader(\"Game.ser\"));\r\n\t line = reader.readLine();\r\n\t elements = line.split(\":\");\r\n\t state = elements[0];\r\n\t ammo = Integer.decode(elements[1]);\r\n\t \r\n\t reader.close();\r\n\t \r\n\t\t gamePanel.getView().getPlayer().setAmmo(ammo);\r\n\t\t gamePanel.getView().getPlayer().setState(state);\r\n\t }\r\n\t catch(Exception e)\r\n\t {\r\n\t System.out.println(\"Can't load this save\");\r\n\t }\r\n\t \r\n\t \r\n\r\n\t}",
"public static void main(String[] args){\r\n\tif (args.length>0){\r\n\t for (String arg : args){\r\n\t\tFile f = new File(arg);\r\n\t\tif (f.exists()){\r\n\t\t System.out.println(\"Parsing '\"+ f+\"'\");\r\n\t\t RobotProgramNode prog = parseFile(f);\r\n\t\t System.out.println(\"Parsing completed \");\r\n\t\t if (prog!=null){\r\n\t\t\tSystem.out.println(\"================\\nProgram:\");\r\n\t\t\tSystem.out.println(prog);}\r\n\t\t System.out.println(\"=================\");\r\n\t\t}\r\n\t\telse {System.out.println(\"Can't find file '\"+f+\"'\");}\r\n\t }\r\n\t} else {\r\n\t while (true){\r\n\t\tJFileChooser chooser = new JFileChooser(\".\");//System.getProperty(\"user.dir\"));\r\n\t\tint res = chooser.showOpenDialog(null);\r\n\t\tif(res != JFileChooser.APPROVE_OPTION){ break;}\r\n\t\tRobotProgramNode prog = parseFile(chooser.getSelectedFile());\r\n\t\tSystem.out.println(\"Parsing completed\");\r\n\t\tif (prog!=null){\r\n\t\t System.out.println(\"Program: \\n\"+prog);\r\n\t\t}\r\n\t\tSystem.out.println(\"=================\");\r\n\t }\r\n\t}\r\n\tSystem.out.println(\"Done\");\r\n }",
"public void load() {\n updater.load(-1); // -1 because Guest ID doesn't matter.\n }",
"public void chargerPartieActionPerformed(java.awt.event.ActionEvent evt) throws IOException, ClassNotFoundException{ \n loadGame();\n }",
"public void fileLoaderMethod(String filename) {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tString code = \"\";\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tcode += str + \"\\n\";\n\t\t\t\t}\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\tinterpretorMainMethod(code, 0);\n\t}",
"public Object run() {\n \n try {\n try {\n \n String targetArch=JNITargetArch.getTargetArch();\n // System.out.println(\"TargetArch: \"+targetArch);\n JCALibrary jca=JCALibrary.getInstance();\n \n \n String libPath=jca.getProperty( \"gov.aps.jca.jni.epics.\"+targetArch+\n \".library.path\", \"\" );\n loadLibrary( libPath, \"Com\" );\n loadLibrary( libPath, \"ca\" );\n \n File caRepeaterPath=new File( jca.getProperty(\n \"gov.aps.jca.jni.epics.\"+targetArch+\".caRepeater.path\", \"\" ) );\n try {\n String caRepeater=\"caRepeater\";\n if( caRepeaterPath.exists() ) {\n caRepeater= ( new File( caRepeaterPath, \"caRepeater\" ) ).\n getAbsolutePath();\n \n }\n Runtime.getRuntime().exec( caRepeater );\n } catch( java.io.IOException ex ) {\n Runtime.getRuntime().exec( \"caRepeater\" );\n }\n } catch( Throwable ex2 ) {\n // System.out.println(ex2);\n }\n // System.out.println(\"Loading jca2\");\n System.loadLibrary( \"jca\" );\n \n return null; // nothing to return\n } catch( Exception ex1 ) {\n // System.out.println(ex1);\n return ex1;\n }\n }",
"public void setExecutable(String executable);",
"@Test\n public void Day5AExample1() {\n intCodeProcessorService = new IntCodeProcessorService(\"data/day05/example1.txt\");\n intCodeProcessorService.setCpuInputValue(555L);\n intCodeProcessorService.runToCompletion();\n\n long result = intCodeProcessorService.getProgramOutput();\n Assert.assertEquals(555L, result);\n }",
"@Test\r\n public void testReadFile() {\r\n System.out.println(\"readFile and updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n \r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n instance.readFile();\r\n instance.parse();\r\n boolean assemblersFound = !((Applications)(((InparseManager)instance).getParseResults())).getAssemblers().isEmpty();\r\n assertEquals(true,assemblersFound);\r\n }",
"private void loadGame(String fileName){\n\n }",
"public static void load() {\n }",
"public String getPath () throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public static void load(){\n\t\tinbattle=true;\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tScanner s=new Scanner(f);\n\t\t\tturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tString curr=s.next();\n\t\t\tif(curr.equals(\"WildTrainer:\"))\n\t\t\t\topponent=WildTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"EliteTrainer:\"))\n\t\t\t\topponent=EliteTrainer.readInTrainer(s);\n\t\t\telse if(curr.equals(\"Trainer:\"))\n\t\t\t\topponent=Trainer.readInTrainer(s);\n\t\t\tSystem.out.println(\"Initializing previous battle against \"+opponent.getName());\n\t\t\tcurr=s.next();\n\t\t\tallunits=new ArrayList<Unit>();\n\t\t\tpunits=new ArrayList<Unit>();\n\t\t\tounits=new ArrayList<Unit>();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tpunits.add(Unit.readInUnit(null,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Player Units\n\t\t\tcurr=s.next();\n\t\t\twhile(!curr.equals(\"End\")){\n\t\t\t\tounits.add(Unit.readInUnit(opponent,s));\n\t\t\t\tcurr=s.next();\n\t\t\t}\n\t\t\ts.nextLine();// Opponent Units\n\t\t\tallunits.addAll(punits);\n\t\t\tallunits.addAll(ounits);\n\t\t\tpriorities=new ArrayList<Integer>();\n\t\t\tint[] temp=GameData.readIntArray(s.nextLine());\n\t\t\tfor(int i:temp){\n\t\t\t\tpriorities.add(i);\n\t\t\t}\n\t\t\txpgains=GameData.readIntArray(s.nextLine());\n\t\t\tspikesplaced=s.nextBoolean();\n\t\t\tnumpaydays=s.nextInt();\n\t\t\tactiveindex=s.nextInt();\n\t\t\tactiveunit=getUnitByID(s.nextInt());\n\t\t\tweather=Weather.valueOf(s.next());\n\t\t\tweatherturn=s.nextInt();\n\t\t\ts.nextLine();\n\t\t\tbfmaker=new LoadExistingBattlefieldMaker(s);\n\t\t\tinitBattlefield();\n\t\t\tplaceExistingUnits();\n\t\t\tMenuEngine.initialize(new UnitMenu(activeunit));\n\t\t}catch(Exception e){e.printStackTrace();System.out.println(e.getCause().toString());}\n\t}",
"void load();",
"void load();",
"protected void execute() {\n \tRobot.telemetry.setAutonomousStatus(\"Running \" + commandName + \": \" + distance);\n \tRobot.drivetrain.arcadeDrive(Robot.driveDistancePID.getOutput(), 0.0, false);\n }",
"@Override\n public void robotInit() {\n m_driveTrain = new DriveTrain();\n m_oi = new OI(); \n encoder = new Encoder();\n JoystickDrive = new JoystickDrive();\n RoboticArm = new RoboticArm();\n Science = new Science();\n pid = new PID();\n inverse = new Inverse();\n\n // workingSerialCom = new serialComWorking();\n\n\n // while(true){\n // // ros_string = workingSerialCom.read();\n // // System.out.println(ros_string);\n // LeftFront = Robot.m_driveTrain.dr+iveTrainLeftFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // RightFront = Robot.m_driveTrain.driveTrainRightFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // LeftFront_ros = workingSerialCom.floattosString(LeftFront);\n // RigthFront_ros = workingSerialCom.floattosString(RightFront);\n\n // ros_string = workingSerialCom.read();\n // gulce = workingSerialCom.StringConverter(ros_string, 1);\n // System.out.println(gulce);\n // workingSerialCom.write(LeftFront_ros+RigthFront_ros+\"\\n\");\n // }\n // workingSerialCom.write(\"Yavuz\\n\");\n // // RoboticArm.run();\n // // m_driveTrain.run();\n // // workingSerialCom.StringConverter(ros_string, 3);\n }",
"public static void load(){\n\t\trobot=new BufferedImage[5];\n\t\ttry {\n\t\t\tfor(int i=0;i<5;i++)\n\t\t\t\trobot[i]=ImageIO.read(new File(\"robot\" + i +\".png\"));\n\t\t\t\n\t\t\tminiRobot=ImageIO.read(new File(\"miniRobot.png\"));\n\t\t\toil=ImageIO.read(new File(\"oil.png\"));\n\t\t\tslime=ImageIO.read(new File(\"slime.png\"));\n\t\t\tmap=ImageIO.read(new File(\"map.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e + \"Failed to load images\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}",
"public void load() {\n\t}",
"public static IPath findProgramLocation(String prog, String pathsStr) {\n \t\tif (prog.trim().length()==0 || pathsStr.trim().length()==0)\n \t\t\treturn null;\n \n \t\tString locationStr = null;\n \t\tString[] dirs = pathsStr.split(File.pathSeparator);\n \n \t\t// try to find \"prog.exe\" or \"prog.com\" on Windows\n \t\tif (Platform.getOS().equals(Platform.OS_WIN32)) {\n \t\t\tfor (String dir : dirs) {\n \t\t\t\tIPath dirLocation = new Path(dir);\n \t\t\t\tFile file = null;\n \n \t\t\t\tfile = dirLocation.append(prog+\".exe\").toFile(); //$NON-NLS-1$\n \t\t\t\tif (file.isFile() && file.canRead()) {\n \t\t\t\t\tlocationStr = file.getAbsolutePath();\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\tfile = dirLocation.append(prog+\".com\").toFile(); //$NON-NLS-1$\n \t\t\t\tif (file.isFile() && file.canRead()) {\n \t\t\t\t\tlocationStr = file.getAbsolutePath();\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\t// check \"prog\" on Unix and Windows too (if was not found) - could be cygwin or something\n \t\t// do it in separate loop due to performance and correctness of Windows regular case\n \t\tif (locationStr==null) {\n \t\t\tfor (String dir : dirs) {\n \t\t\t\tIPath dirLocation = new Path(dir);\n \t\t\t\tFile file = null;\n \t\t\t\t\n \t\t\t\tfile = dirLocation.append(prog).toFile();\n \t\t\t\tif (file.isFile() && file.canRead()) {\n \t\t\t\t\tlocationStr = file.getAbsolutePath();\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tif (locationStr!=null)\n \t\t\treturn new Path(locationStr);\n \n \t\treturn null;\n \t}",
"@Override\n protected int createProgram(Context context) {\n return PGLNativeIpl.loadLipsHighLightProgram();\n }",
"private void loadText() {\n\t\ttext1 = app.loadStrings(\"./data/imports/TXT 1.txt\");\n\t\ttext2 = app.loadStrings(\"./data/imports/TXT 2.txt\");\n\t}",
"public static void load() throws RuntimeException, IOException{\n\t\ttry{\n\t\t\tSystem.loadLibrary(\"opencv_java248\");\n\t\t} catch (UnsatisfiedLinkError e) {\n\t\t\tString opencvLib = \"/\"+getOpenCVLib();\n\t\t\tload(opencvLib);\n\t\t}\n\t}",
"private void triggerRootScanProc() {\n int ret = 0;\n if (!this.mIsRootScanHasTrigger) {\n try {\n FileInputStream fileInputStream = new FileInputStream(new File(FILE_PROC_ROOT_SCAN));\n InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n if (reader.read() != -1) {\n this.mIsRootScanHasTrigger = true;\n }\n reader.close();\n inputStreamReader.close();\n fileInputStream.close();\n } catch (FileNotFoundException e) {\n HiLog.error(HILOG_LABEL, \"triggerRootScan, trigger file cannot be found\", new Object[0]);\n ret = -3;\n } catch (IOException e2) {\n HiLog.error(HILOG_LABEL, \"failed to read the trigger proc file\", new Object[0]);\n ret = -4;\n } catch (NumberFormatException e3) {\n HiLog.error(HILOG_LABEL, \"some data is not of the type Integer during parsing trigger file\", new Object[0]);\n ret = -1;\n }\n HiLog.debug(HILOG_LABEL, \"bootcompleted trigger return value = %{public}b\", new Object[]{Integer.valueOf(ret)});\n }\n }",
"public Program getProgram() {\n return this.program;\n }",
"protected void execute() {\n\t\t// Get output from PID and dvide by 4\n\t\tdouble output = Robot.minipidSubsystem.getOutput(Robot.gyroSubsystem.GyroPosition(), 90) * 0.25;\n\n\t\t// limit output to 25% in either direction\n\t\tif (output > 25)\n\t\t\toutput = 25;\n\t\telse if (output < -25)\n\t\t\toutput = -25;\n\n\t\t// convert output to a value the drive subsystem can use (-1 to 1)\n\t\toutput /= 100;\n\n\t\t// drive the robot, only providing the turn speed\n\t\tRobot.driveSubsystem.robotDrive.arcadeDrive(0, output);\n\t\t// Robot.driveSubsystem.tankDrive(-output, output);\n\t}",
"public void executePython()\n {\n\n Process pr;\n try {\n pr = Runtime.getRuntime().exec(\"/usr/local/bin//python3 /Users/jithinjose/Downloads/Corona-Tracker/src/main/resources/test12.py\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public int getLoad() {\n\t\treturn load;\n\t}",
"void execute(Executable executable);",
"private static GeneticProgram loadCheckpoint(String arg) {\n CheckpointLoader cpl = new CheckpointLoader(arg);\n GeneticProgram gp = cpl.instantiate();\n if (gp == null) {\n System.err.println(\"Could not load checkpoint.\");\n System.exit(-1);\n }\n return gp;\n }",
"public boolean execute() {\r\n\t\tif ( !make_indices_file())\r\n\t\t\treturn false;\r\n\r\n\t\t_headerObject.set( _steps);\r\n\r\n\t\tif ( !ScenarioManager.get_instance().load( _headerObject))\r\n\t\t\treturn false;\r\n\r\n\t\tAgentObjectManager.get_instance().arrange();\r\n\r\n\t\treturn true;\r\n\t}",
"public void loadGame(){\n\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n System.out.println(\"--- LOADING GAMEFILE PROPERTIES ---\");\n\n int highestReachedLevel = getHighestLevelFromProperties();\n GameModel.getInstance().setHighestCompletedLevel(highestReachedLevel);\n\n GameModel.getInstance().setfirstTimePlay(false);\n\n //TODO: Save properties to gameModel\n\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n GameModel.getInstance().setfirstTimePlay(true);\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n\n }",
"public static void RomLoadErr(){\n\t\tloadError = true;\t\t\n\t}",
"File getExecutable();",
"public void load() {\n }",
"abstract /*package*/ IValue executeRVMProgram(String moduleName, String uid_main, IValue[] posArgs, Map<String,IValue> kwArgs);",
"RoverProgram createRoverProgram();",
"public boolean execute() {\n\t\tboolean result = false;\n\t\t\n\t\tif (this.exists()) {\n\t\t\ttry {\n\t\t\t\tDesktop.getDesktop().open(this);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tresult = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"file not found: \" + this.getAbsolutePath());\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public void operation() {\n try {\n if (path==null) {\n scanner = new Scanner(System.in);\n System.out.println(\"Enter The Directory (path):\");\n path= scanner.next();\n }\n workFlow();\n\n } catch(Exception e){\n e.printStackTrace();\n }\n\n }",
"public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}"
] | [
"0.5833819",
"0.5697843",
"0.54658896",
"0.53781426",
"0.52181375",
"0.5072247",
"0.50038403",
"0.499152",
"0.49894318",
"0.49841142",
"0.49656436",
"0.4961583",
"0.49592385",
"0.4875321",
"0.4873352",
"0.48656183",
"0.48647943",
"0.48587665",
"0.48443526",
"0.48369068",
"0.4831551",
"0.48270074",
"0.48133484",
"0.48085117",
"0.48045412",
"0.47710687",
"0.4766998",
"0.4750018",
"0.47272837",
"0.47245204",
"0.47234967",
"0.46947595",
"0.46832123",
"0.4678279",
"0.46670985",
"0.4659958",
"0.46542928",
"0.4649503",
"0.46394852",
"0.4632254",
"0.46145493",
"0.46124938",
"0.46077448",
"0.45966193",
"0.45941892",
"0.45888194",
"0.45882955",
"0.45761296",
"0.45743802",
"0.45612136",
"0.45608696",
"0.4554817",
"0.4549147",
"0.45438936",
"0.45352858",
"0.45217454",
"0.45217454",
"0.45217454",
"0.452098",
"0.4512128",
"0.45113453",
"0.4511256",
"0.45095047",
"0.45089105",
"0.45026863",
"0.4502603",
"0.44998762",
"0.44993946",
"0.44927222",
"0.4492651",
"0.44917002",
"0.44903755",
"0.4489571",
"0.44863433",
"0.44863433",
"0.44863087",
"0.44835898",
"0.44826698",
"0.44819734",
"0.44768453",
"0.44727695",
"0.4468731",
"0.44623828",
"0.44595143",
"0.4454768",
"0.44513002",
"0.44490656",
"0.44464874",
"0.44449663",
"0.4443229",
"0.4440016",
"0.4436215",
"0.44320455",
"0.4418396",
"0.44115055",
"0.44075888",
"0.44060683",
"0.4405745",
"0.44040957",
"0.44028965"
] | 0.7617722 | 0 |
Save the program of robot in a file at path. Return 0 if the operation completed successfully; otherwise, return a negative number. | @Override
public int saveProgramToFile(Robot robot, String path)
{
try
{
BufferedWriter out = new BufferedWriter(new java.io.FileWriter(new java.io.File(path)));
out.write(robot.getProgram().toString());
out.close();
}
catch (IOException e)
{
System.out.println("The operation failed.");
return -1;
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void save() throws FileNotFoundException, IOException, ClassNotFoundException ;",
"public void saveGame(File fileLocation);",
"public void saveFile() {\n\t\tPrintWriter output = null;\n\t\ttry {\n\t\t\toutput = new PrintWriter(\"/Users/katejeon/Documents/Spring_2020/CPSC_35339/avengers_project/game_result.txt\");\n\t\t\toutput.println(textArea.getText());\n\t\t\toutput.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"File doesn't exist.\");\n\t\t} finally {\n\t\t\toutput.close();\n\t\t}\n\t}",
"void save(String filename);",
"public void save(String filePath){\r\n Scanner in = new Scanner(System.in);\r\n File saveFile = new File(filePath);\r\n if (saveFile.exists()){\r\n System.out.println(\"Do you really, really want to overwrite your previous game?\");\r\n System.out.println(\"Yes: '1', No: '0'.\");\r\n int input = in.nextInt();\r\n if (input!=1){\r\n return;\r\n }\r\n }\r\n File saveDir = new File(this.savePath);\r\n if (!saveDir.exists()){\r\n saveDir.mkdir();\r\n }\r\n FileOutputStream fos = null;\r\n ObjectOutputStream out = null;\r\n try {\r\n fos = new FileOutputStream(saveFile);\r\n out = new ObjectOutputStream(fos);\r\n out.writeObject(this.serialVersionUID);\r\n out.writeObject(p);\r\n out.writeObject(map);\r\n out.close();\r\n } catch (Exception ex) {\r\n System.out.println(\"Make sure you don't use spaces in your folder names.\");\r\n ex.printStackTrace();\r\n }\r\n }",
"public static boolean saveStudyProgram(StudyProgram prog,String path) {\n\t\tif(ToolModel.degree.equals(\"BS\")){\n\t\t\tnew StudyProgramWriterBS(prog,path);\t\t\t\t\n\t\t}else{\n\t\t\tnew StudyProgramWriterMS(prog,path);\n\t\t}\t\t\n\t\treturn true;\n\t}",
"void saveToFile(String filename) throws IOException;",
"static String save() {\n JFileChooser fileChooser;\n String path = FileLoader.loadFile(\"path.txt\");\n if (path != null) {\n fileChooser = new JFileChooser(path);\n } else {\n fileChooser = new JFileChooser((FileSystemView.getFileSystemView().getHomeDirectory()));\n }\n\n fileChooser.setDialogTitle(\"Save text file\");\n fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);\n\n if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {\n FileLoader.saveFile(\"path.txt\", fileChooser.getSelectedFile().getParent(), false);\n return fileChooser.getSelectedFile().getAbsolutePath() + \".mytxt\" ;\n }\n return null;\n }",
"public boolean save(Flow flow, String system, int software);",
"public void saveGame(String path) throws Exception\n\t{\n\t\tXMLFile db = new XMLFile(path);\n\t\tdb.save(this);\n\t\tSystem.out.println(\"The file '\" + path + \"' has been saved successfully.\");\n\t}",
"void save(String fileName);",
"public void storeToFile() throws IOException {\n\t\t\n\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\n\t\t//String datalogFile = inputCKR.getGlobalOntologyFilename() + \".dlv\";\n\t\t//String datalogFile = \"./testcase/output.dlv\";\n\t\t//System.out.println(datalogGlobal.getStatements().size());\n\t\t\n\t\tFileWriter writer = new FileWriter(outputFilePath);\n\t\tstorer.store(datalogCKR, writer);\n\t\t//writer.flush();\n\t\twriter.close();\n\t\t\n\t\t//System.out.println(\"CKR program saved in: \" + outputFilePath);\n\t}",
"public void autoSave(){\n\t\ttry {\n\t\t\t//read in file\n\t\t\tFile file = new File(System.getProperty(\"user.dir\")+\"/Default.scalcsave\");\n\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\toutput.close();\n\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\r\n\tpublic int loadProgramFromFile(Robot robot, String path)\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\tString inputProgram = null;\r\n\t\tjava.io.FileReader fileReader = null;\r\n\t\tStringBuffer buffer = null;\r\n\t\t\r\n\t\tjava.io.File file = new java.io.File(path);\r\n\t\tif(file.exists() && file.canRead())\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tfileReader = new java.io.FileReader(file);\r\n\t\t\t\tbuffer = new StringBuffer();\r\n\t\t\t\tint len;\r\n\t\t\t\tchar[] chr = new char[4096];\r\n\t\t\t\t// if the read()-method returns -1 the end of the string is reached\r\n\t\t\t\twhile ((len = fileReader.read(chr)) > 0) \r\n\t\t\t\t{\r\n\t\t\t\t\tbuffer.append(chr, 0, len);\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t\t\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t}\r\n\t\t\tfinally \r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tfileReader.close();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (IOException e)\r\n\t\t\t\t{\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tinputProgram = buffer.toString();\r\n\t\t}\r\n\t\t\r\n\t\tif(inputProgram == null)\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\ttry\r\n\t\t{\r\n\t\t\trobot.setProgram(inputProgram);\r\n\t\t}\r\n\t\tcatch(IllegalSyntaxException exc)\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif(robot.getProgram() == Parser.parse(0, robot, inputProgram))\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"private void saveGame() throws FileNotFoundException {\r\n\t\tJFileChooser fileChooser = new JFileChooser();\r\n\t\tFile file = null;\r\n\t\tif (fileChooser.showSaveDialog(gameView) == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tfile = fileChooser.getSelectedFile();\r\n\t\t}\r\n\t\tif (file != null) {\r\n\t\t\tFileWriter fileWriter = new FileWriter(convertToStringArrayList(), file);\r\n\t\t\tfileWriter.writeFile();\r\n\t\t}\r\n\r\n\t}",
"void save(File file);",
"String savedFile();",
"public void saveFile() {\r\n File savedFile = new File(fileName);\r\n\r\n try (FileWriter fw = new FileWriter(savedFile)) {\r\n fw.write(workSpace.getText());\r\n\r\n fw.close();\r\n } catch (IOException ex) {\r\n JOptionPane.showMessageDialog(null, \"There was an error saving the file\");\r\n }\r\n }",
"public int save() {\n\t\treturn 0;\n\t}",
"File getSaveLocation();",
"public int saveLocation(Location location){\n return 0;\n }",
"public boolean save(String file);",
"public Integer save(String pDirectory) throws CallError, InterruptedException {\n return (Integer)service.call(\"save\", pDirectory).get();\n }",
"public static void save() {\n Game.save(UI.askNgetString(\"Filename for this save file?\")+\".xml\");\n }",
"void save(String output);",
"@Override\n\tpublic void executeOp() {\n try {\n // Make a bunch of shit that will allow us to write to the file\n FileWriter fw = new FileWriter(file.getAbsoluteFile());\n BufferedWriter bw = new BufferedWriter(fw);\n\n // Write the text that's in our notepad to the file\n bw.write(textArea.getText());\n\n // Close the \"stream\"\n bw.close();\n\n // If the attempt fails, display the error message - then give up.\n } catch (IOException ioe) {\n JOptionPane.showMessageDialog(frame, \"PROBLEM SAVING\");\n }\n\t}",
"void saveGame() throws IOException, Throwable {\n Save save = new Save(\"01\");\n save.addToSaveGame(objectsToSave());\n save.saveGame();\n }",
"public void save() {\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n fileChooser.setSelectedFile(new File(\"save.ser\"));\n int saveFile = fileChooser.showSaveDialog(GameFrame.this);\n\n if (saveFile == JFileChooser.APPROVE_OPTION) {\n File saveGame = fileChooser.getSelectedFile();\n FileOutputStream fileOut = new FileOutputStream(saveGame);\n ObjectOutputStream objOut = new ObjectOutputStream(fileOut);\n objOut.writeObject(world);\n objOut.close();\n fileOut.close();\n System.out.println(\"Game saved.\");\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n }",
"public void saveAsFile(String path)\n {\n call(\"SaveAsFile\", path);\n }",
"private void saveGame(int gameId, String fileName){\n\n }",
"public static void writeToFile(String path, String dotCode) throws Exception {\n\t\ttry {\n\t\t\tFileWriter fileWriter=new FileWriter(\"tp1/Automatas/\"+path+\".dot\");\n\t\t\tfileWriter.write(dotCode);\n\t\t\tfileWriter.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void save(String fileName) throws IOException;",
"@Override\n public int saveGame(String foo) {\n RunGame.saveGameToDisk(foo);\n return 0;\n }",
"public void save (File argFile) throws IOException;",
"private void testSaveFile() {\n System.out.println(\"------ TESTING : saveFile(String filename) ------\");\n try{\n if(!iTestFileList.saveFile(sFile)) {\n throw new RuntimeException(\"FAILED -> saveFile(String filename) not working correctly\");\n }\n }catch (RuntimeException e){\n System.out.print(e.getMessage());\n }\n }",
"public boolean save() {\n\t\treturn save(_file);\n\t}",
"public static void save(){\n\t\ttry{\n\t\t\tFile f=new File(Constants.PATH+\"\\\\InitializeData\\\\battlesavefile.txt\");\n\t\t\tPrintWriter pw=new PrintWriter(f);\n\t\t\tpw.println(turn);\n\t\t\tpw.println(opponent.toString());\n\t\t\tfor(Unit u:punits){\n\t\t\t\tpw.println(u.toString());\n\t\t\t}\n\t\t\tpw.println(\"End Player Units\");\n\t\t\tfor(Unit u:ounits){\n\t\t\t\tpw.println(u.toString());\n\t\t\t}\n\t\t\tpw.println(\"End Opponent Units\");\n\t\t\tpw.println(priorities);\n\t\t\tpw.println(Arrays.asList(xpgains));\n\t\t\tpw.println(spikesplaced+\" \"+numpaydays+\" \"+activeindex+\" \"+activeunit.getID()+\" \"+weather+\" \"+weatherturn);\n\t\t\tpw.println(bfmaker.toString());\n\t\t\tpw.close();\n\t\t}catch(Exception e){e.printStackTrace();}\n\t}",
"private void savePressed(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showSaveDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t\t//make sure file has the right extention\n\t\t\tif(file.getAbsolutePath().contains(\".scalcsave\"))\n\t\t\t\tfile = new File(file.getAbsolutePath());\n\t\t\telse\n\t\t\t\tfile = new File(file.getAbsolutePath()+\".scalcsave\");\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\t\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\t\toutput.close();\n\t\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"@Test\r\n\tpublic void saveGameProgram() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: saveGameProgram \r\n\t\tInteger gameId = 0;\r\n\t\tProgram related_program = new tsw.domain.Program();\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tGame response = null;\r\n\t\tresponse = service.saveGameProgram(gameId, related_program);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: saveGameProgram\r\n\t}",
"public final void saveToFile() {\n\t\tWrite.midi(getScore(), getName()+\".mid\"); \n\t}",
"File getSaveFile();",
"public void saveGame() {\r\n\t\t//separator used by system\r\n\t\tString separator = System.getProperty(\"file.separator\");\r\n\t\t//path to where files will be saved\r\n\t\tString path = System.getProperty(\"user.dir\") + separator + \"src\" + separator + \"GameFiles\" + separator;\r\n\r\n\t\ttry {\r\n\r\n\t\t\t//Save the world objects\r\n\t\t\tString world_objects_name = EnvironmentVariables.getTitle() + \"WorldObjects\";\r\n\t\t\t//create a new file with name given by user with added text for identification\r\n\t\t\tFile world_objects_file = new File(path + world_objects_name + \".txt\");\r\n\t\t\tFileOutputStream f_world_objects = new FileOutputStream(world_objects_file);\r\n\t\t\tObjectOutputStream o_world_objects = new ObjectOutputStream(f_world_objects);\r\n\r\n\t\t\t//loop through list and write each object to file\r\n\t\t\tfor(GameObject obj: EnvironmentVariables.getWorldObjects()) {\r\n\t\t\t\to_world_objects.writeObject(obj);\r\n\t\t\t}\r\n\r\n\t\t\to_world_objects.flush();\r\n\t\t\to_world_objects.close();\r\n\t\t\tf_world_objects.flush();\r\n\t\t\tf_world_objects.close();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Save terrain is done the same ass world objects but we create a new file \r\n\t\t\t//with different added text\r\n\t\t\tString terrain_name = EnvironmentVariables.getTitle() + \"Terrain\";\r\n\t\t\tFile terrain_file = new File(path + terrain_name + \".txt\");\r\n\t\t\tFileOutputStream f_terrain = new FileOutputStream(terrain_file);\r\n\t\t\tObjectOutputStream o_terrain = new ObjectOutputStream(f_terrain);\r\n\r\n\t\t\tfor(GameObject obj: EnvironmentVariables.getTerrain()) {\r\n\t\t\t\to_terrain.writeObject(obj);\r\n\t\t\t}\r\n\r\n\t\t\to_terrain.flush();\r\n\t\t\to_terrain.close();\r\n\t\t\tf_terrain.flush();\r\n\t\t\tf_terrain.close();\r\n\t\t\t\r\n\t\t\t//Save main player, given own file but just a single object\r\n\t\t\tString main_player_name = EnvironmentVariables.getTitle() + \"MainPlayer\";\r\n\t\t\tFile main_player_file = new File(path + main_player_name + \".txt\");\r\n\t\t\tFileOutputStream f_main_player = new FileOutputStream(main_player_file);\r\n\t\t\tObjectOutputStream o_main_player = new ObjectOutputStream(f_main_player);\r\n\r\n\t\t\to_main_player.writeObject(EnvironmentVariables.getMainPlayer());\r\n\r\n\t\t\to_main_player.flush();\r\n\t\t\to_main_player.close();\r\n\t\t\tf_main_player.flush();\r\n\t\t\tf_main_player.close();\r\n\t\t\t\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error initializing stream\");\r\n\t\t} \r\n\t\t\r\n\t\t//saving the environment variables\r\n\t\ttry {\r\n\t\t\tString env_name = EnvironmentVariables.getTitle() + \"EnvVariables\";\r\n\t\t\tFile env_file = new File(path + env_name + \".txt\");\r\n\t\t\t\r\n\t\t\tif(!env_file.exists()) {\r\n\t\t\t\tenv_file.createNewFile();\r\n\t\t }\r\n\t\t\t \r\n\t\t\t//FileWriter fw = new FileWriter(env_file);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(env_file));\r\n\t\t\t//write each variable to a new line as a string\r\n\t\t\tbw.write(EnvironmentVariables.getTitle()); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getWidth())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getHeight())); bw.newLine();\r\n\t\t\tbw.write(EnvironmentVariables.getPlanet()); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getMass())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getRadius())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getAirDensity())); bw.newLine();\r\n\t\t\tbw.write(Float.toString(EnvironmentVariables.getMeter())); bw.newLine();\r\n\r\n\t\t\t\r\n\t\t\t//bw.flush();\r\n\t\t\tbw.close();\r\n\t\t\t\r\n\t\t}catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error initializing stream\");\r\n\t\t}\r\n\t\t\r\n\t\tEnvironmentVariables.getTerrain().clear();\r\n\t\tEnvironmentVariables.getWorldObjects().clear();\r\n\t}",
"private void saveRoute(String path){\n if(vMaze == null)\n inputMessage.setText(\"You must load a maze first!\");\n else try{\n vMaze.getRouteFinder().save(path);\n\n mainMessage.setText(\"Successfully saved!\");\n stage.setScene(main);\n } catch (IOException e){\n inputMessage.setText(\"Unable to read file.\");\n }\n }",
"public void saveFile() {\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\tfileloc += ((MinLFile) tabbedPane.getSelectedComponent()).filename;;\t\t\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\ttry {\n\t\t\tif(fl.exists()) {\n\t\t\t\tint option = JOptionPane.showConfirmDialog(null, \"The file with this name already exists, do you want to overwrite it?\", \"Save File\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(option == 0) {\n\t\t\t\t\tFiles.delete(fl.toPath());\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\t\tbw.close();\n\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tFileWriter fw = new FileWriter(fileloc);\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\t\tbw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText());\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t\t((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false;\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The specified folder doesnt exist.\");\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void save(){\r\n\t\ttry {\r\n\t\t\tgame.suspendLoop();\r\n\t\t\tGameStockage.getInstance().save(game);\r\n\t\t\tgame.resumeLoop();\r\n\t\t} catch (GameNotSaveException e) {\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tgame.resumeLoop();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tgame.resumeLoop();\r\n\t\t}\r\n\t}",
"public void saveCode(String code) {\n //System.out.println(\"Saving code\");\n FileChooser fileChooser = new FileChooser();\n fileChooser.setInitialDirectory(new File(lastOpenedLocation));\n fileChooser.setTitle(\"Save\");\n fileChooser.getExtensionFilters().addAll(\n new FileChooser.ExtensionFilter(\"Arduino files\", \"*.ino\", \"*.c\", \"*.cpp\")\n );\n //System.out.println(\"Show file chooser\");\n File file = fileChooser.showSaveDialog(ownerWindow);\n File selectedFile = null;\n //System.out.println(\"File has been selected\");\n if (file != null) {\n if (!file.getName().matches(\"*.xml\")) {\n // filename is OK as-is\n selectedFile = file;\n } else {\n selectedFile = new File(file.toString() + \".xml\"); // append .xml if \"foo.jpg.xml\" is OK\n }\n //System.out.println(selectedFile);\n lastOpenedLocation = selectedFile.getParent();\n //System.out.println(\"saved open location\");\n try {\n //System.out.println(\"trying to writ to file\");\n BufferedWriter bWriter = new BufferedWriter(new FileWriter(file));\n //System.out.println(\"start writing\");\n bWriter.write(code);\n bWriter.flush();\n bWriter.close();\n //System.out.println(\"writing done\");\n } catch (IOException ex) {\n //System.out.println(\"error while writing file!\");\n Logger.getLogger(DwenguinoBlocklyServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public void save () {\n // Make sure the workspace folder exist\n createFolder(this.pathToWorkspaceFolder);\n\n // Write the serialized Flow object\n System.out.println(\"Saving\");\n try (FileWriter file = new FileWriter(this.pathToWorkspaceFolder.toString() + \"/\" + FLOW_FILE_NAME)) {\n file.write(flow.serialize());\n System.out.println(\"Successfully Copied Flow \" + flow.getId() + \" to File :)\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void save() {\n\t\tWriteFile data = new WriteFile( this.name + \".txt\" );\n\t\ttry {\n\t\t\t data.writeToFile(this.toString());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Couldn't print to file\");\n\t\t}\n\t}",
"void saveAs() {\n writeFile.Export();\n }",
"public void saveWorkflow(String filename);",
"public static void saveGame(Puzzle puzzle, String name) throws IOException {\n FileWriter wr;\n File file = new File(System.getenv(\"APPDATA\")+\"\\\\SudokuGR04\\\\\" + name + \".txt\");\n wr = new FileWriter(file);\n puzzle.setName(name);\n try {\n //generate File in dir SudokuGR04\n wr.write(puzzle.export());\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n wr.close();\n }\n }",
"public void saveScore() {\r\n FileDialog fd = new FileDialog(this, \"Save as a MIDI file...\", FileDialog.SAVE);\r\n fd.setFile(\"FileName.mid\");\r\n fd.show();\r\n //write a MIDI file to disk\r\n if ( fd.getFile() != null) {\r\n Write.midi(score, fd.getDirectory() + fd.getFile());\r\n }\r\n }",
"@Override\n\tpublic void save() {\n\t\t\n\t\tFile savingDirectory = new File(savingFolder());\n\t\t\n\t\tif( !savingDirectory.isDirectory() ) {\n\t\t\tsavingDirectory.mkdirs();\n\t\t}\n\t\t\n\t\t\n\t\t//Create the file if it's necessary. The file is based on the name of the item. two items in the same directory shouldn't have the same name.\n\t\t\n\t\tFile savingFile = new File(savingDirectory, getIdentifier());\n\t\t\n\t\tif( !savingFile.exists() ) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tsavingFile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"the following item couldn't be saved: \" + getIdentifier());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t}\n\n\t\t\n\t\t//generate the savingTextLine and print it in the savingFile. the previous content is erased when the PrintWriter is created.\n\t\t\n\t\tString text = generateSavingTextLine();\n\n\t\ttry {\n\t\t\tPrintWriter printer = new PrintWriter(savingFile);\n\t\t\tprinter.write(text);\t\t\t\n\t\t\tprinter.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tsave();\n\t\t} \n\t}",
"public void save() {\n // Convert the settings to a string\n String output = readSettings();\n \n try {\n // Make sure the file exists\n if (!settingsFile.exists()) {\n File parent = settingsFile.getParentFile();\n parent.mkdirs();\n settingsFile.createNewFile(); \n }\n \n // Write the data into the file\n BufferedWriter writer = new BufferedWriter(new FileWriter(settingsFile));\n writer.write(output);\n writer.close(); \n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"static void save() {\n String fileName, line = \"\"; char answer;\n System.out.print(\"Enter file name to save: \"); fileName = scan.nextLine();\n File file = new File(fileName);\n \n if ( file.isFile() ) {\n System.out.printf(\"WARNING: %s exists.\\n\", fileName);\n System.out.print(\"Overwrite (y/n)? \");\n \n while (line.length() < 1) line = scan.nextLine().toUpperCase();\n answer = line.charAt(0);\n\n switch (answer) {\n case 'N': save(); // reprompt\n case 'Y': break; // save the file\n default: save();\n }\n }\n pgmInf.savePgmFileAs(fileName);\n System.out.println(\"Terrain file saved.\");\n }",
"public void save() {\n MidiFileIO.saveMIDIFile(sequence);\n }",
"public void saveComm() throws Exception {\n JFileChooser chooser = new JFileChooser();\n chooser.setFileFilter(new FileNameExtensionFilter(\"Log-Datei (*.log)\", \"log\"));\n\n File comfile = null;\n File home;\n File folder;\n Date date = Calendar.getInstance().getTime();\n DateFormat df = new SimpleDateFormat(\"yy.MM.dd-HH.mm.ss.SSS\");\n\n try {\n home = new File(System.getProperty(\"user.home\"));\n } catch (Exception e) {\n home = null;\n }\n\n if (home != null && home.exists()) {\n folder = new File(home + File.separator + \"Bike-Files\" + File.separator + \"Service_Files\");\n if (!folder.exists()) {\n if (!folder.mkdir()) {\n throw new Exception(\"Internal Error\");\n }\n }\n comfile = new File(folder + File.separator + \"CommLog_\" + df.format(date) + \".log\");\n }\n\n chooser.setSelectedFile(comfile);\n\n int rv = chooser.showSaveDialog(this);\n if (rv == JFileChooser.APPROVE_OPTION) {\n comfile = chooser.getSelectedFile();\n\n try (BufferedWriter w = new BufferedWriter(new FileWriter(comfile))) {\n CommunicationLogger.getInstance().writeFile(w);\n } catch (Exception ex) {\n LOG.severe(ex);\n }\n }\n }",
"public void saveGame(){\n updateProperties();\n try {\n output = new FileOutputStream(fileName);\n properties.store(output, null); //saving properties to file\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO SAVE GAME ---\");\n e.printStackTrace();\n } finally {\n if (output != null) {\n try {\n output.close();\n System.out.println(\"--- GAME SAVED ---\");\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE OUTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }",
"public void saveGame(){\r\n Scanner in = new Scanner(System.in);\r\n Boolean nameIsFine = false;\r\n String filename;\r\n int input;\r\n do {\r\n System.out.println(\"Filename?\");\r\n filename = this.savePath + File.separator + this.getFilename() + \".ser\";\r\n File newFile = new File(filename);\r\n if(newFile.exists()) {\r\n System.out.println(\"This file already exists.\");\r\n System.out.println(\"Do you want to change the file name?\");\r\n System.out.println(\"Yes: '1', No: '0'.\");\r\n input = in.nextInt();\r\n if (input == 0) {\r\n nameIsFine = true;\r\n } else {\r\n if (input != 1){\r\n System.out.println(\"This is not an option.\");\r\n }\r\n System.out.println(\"Give a different filename.\");\r\n }\r\n } else {\r\n nameIsFine = true;\r\n }\r\n } while(!nameIsFine);\r\n this.save(filename);\r\n }",
"void saveFile () {\r\n\r\n\t\ttry {\r\n\t\t\tFileOutputStream fos = new FileOutputStream (\"Bank.dat\", true);\r\n\t\t\tDataOutputStream dos = new DataOutputStream (fos);\r\n\t\t\tdos.writeUTF (saves[count][0]);\r\n\t\t\tdos.writeUTF (saves[count][1]);\r\n\t\t\tdos.writeUTF (saves[count][2]);\r\n\t\t\tdos.writeUTF (saves[count][3]);\r\n\t\t\tdos.writeUTF (saves[count][4]);\r\n\t\t\tdos.writeUTF (saves[count][5]);\r\n\t\t\tJOptionPane.showMessageDialog (this, \"The Record has been Saved Successfully\",\r\n\t\t\t\t\t\t\"BankSystem - Record Saved\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\ttxtClear ();\r\n\t\t\tdos.close();\r\n\t\t\tfos.close();\r\n\t\t}\r\n\t\tcatch (IOException ioe) {\r\n\t\t\tJOptionPane.showMessageDialog (this, \"There are Some Problem with File\",\r\n\t\t\t\t\t\t\"BankSystem - Problem\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t}\r\n\r\n\t}",
"public void save() {\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\ttry {\n\t\t\tFile file = new File(\"fileSave.txt\");\n\t\t\tif(!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tfw = new FileWriter(file);\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t//string to hold text to write on new file\n\t\t\tString text = textArea.getText();\n\t\t\t//write file\n\t\t\tif (text != null) {\n\t\t\t\tbw.write(text);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (bw != null) {\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie2) {\n\t\t\t\tie2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void saveMap() {\n this.scanMap();\n String userHome = System.getProperty(\"user.home\");\n BinaryExporter export = BinaryExporter.getInstance();\n File file = new File(userHome + \"world.j3o\");\n try {\n export.save(this.testNode, file); \n } catch (IOException ex) {\n Logger.getLogger(mapDevAppState_2.class.getName()).log(Level.SEVERE, \"File write error\");\n }\n }",
"void saveGame();",
"public void save(OutputStream os) throws IOException;",
"public void save(){\n Player temp = Arena.CUR_PLAYER;\n try{\n FileOutputStream outputFile = new FileOutputStream(\"./data.sec\");\n ObjectOutputStream objectOut = new ObjectOutputStream(outputFile);\n objectOut.writeObject(temp);\n objectOut.close();\n outputFile.close();\n }\n catch(FileNotFoundException e){\n System.out.print(\"Cannot create a file at that location\");\n }\n catch(SecurityException e){\n System.out.print(\"Permission Denied!\");\n }\n catch(IOException e){\n System.out.println(\"Error 203\");\n } \n }",
"void saveFile() {\n\t\tJFileChooser fileChooser = new JFileChooser(desktopPath);\n\t\tint returnVal = fileChooser.showSaveDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile filePath = fileChooser.getSelectedFile();\n\t\t\ttry {\n\t\t\t\tPrintWriter writer = new PrintWriter(filePath);\n\t\t\t\tScanner out = new Scanner(textEditor.getText());\n\t\t\t\twhile(out.hasNextLine()) {\n\t\t\t\t\twriter.println(out.nextLine());\n\t\t\t\t}\n\t\t\t\tout.close();\n\t\t\t\twriter.close();\n\t\t\t\ttextAreaChanged =false;\n\t\t\t\tsavedFilePath = filePath.getPath();\n\t\t\t\terrorTextArea.setText(\"\");\n\t\t\t} catch (Exception ex) {\n\t\t\t\terrorTextArea.setForeground(Color.RED);\n\t\t\t\terrorTextArea.setText(\"Error saving file\");\n\t\t\t}\n\t\t}\n\t}",
"public void saveToFile() {\n FileOutputStream fos = null;\n try {\n //write the object into file\n fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(travelGUI.getTravelAgent());\n oos.flush();\n oos.close();\n }\n catch (IOException ioe) {\n System.out.println(ioe.getMessage());\n if (fos != null) {\n try {\n fos.close();\n }\n catch (IOException ioe2) {\n System.out.println(ioe2.getMessage());\n }\n }\n return;\n }\n finally {\n if (fos != null) {\n try {\n fos.close();\n }\n catch (IOException ioe2) {\n System.out.println(ioe2.getMessage());\n }\n }\n }\n if (fos != null) {\n try {\n fos.close();\n }\n catch (IOException ioe2) {\n System.out.println(ioe2.getMessage());\n }\n }\n }",
"static void writeFile(String path , String data) throws IOException{\n\t\tFileOutputStream fo = new FileOutputStream(path,true);\n\t\tfo.write(data.getBytes());\n\t\tfo.close();\n\t\tSystem.out.println(\"Done...\");\n\t}",
"public String getPath () throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public void save() {\n\t\tlog.log(\"Attempting to save...\");\n\t\tPath spath = Paths.get(getFullSavePath());\n\t\tPath cpath = Paths.get(getFullSavePath() + \"units/\");\n\t\ttry {\n\t\t\tif(!Files.exists(spath))\n\t\t\t\tFiles.createDirectory(spath);\n\t\t\tif(!Files.exists(cpath))\n\t\t\t\tFiles.createDirectory(cpath);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tFile[] files = new File(cpath.toString()).listFiles();\n\t\tfor(File f : files) {\n\t\t\tf.delete();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tBufferedWriter mfestWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"progress.txt\"));\n\t\t\tmfestWriter.write(name);\n\t\t\tmfestWriter.close();\n\t\t\tfor(MapCharacter mc : getFriendlies()) {\n\t\t\t\tBufferedWriter charWriter = new BufferedWriter(new FileWriter(getFullSavePath() + \"units/\"\n\t\t\t\t\t\t+ mc.getEnclosed().getDirName()));\n\t\t\t\tcharWriter.write(mc.getEnclosed().save());\n\t\t\t\tcharWriter.close();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tlog.log(\"Save failed.\");\n\t\t\treturn;\n\t\t}\n\t\tlog.log(\"Game saved.\");\n\t}",
"private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n rom.save(obstacle, frog);\n isSaved = true;\n }",
"public void Save(){\n\tJFileChooser j = new JFileChooser(\"\"); \n\t// Invoke the showsSaveDialog function to show the save dialog \n\tint r = j.showSaveDialog(null);\n \n\tif (r == JFileChooser.APPROVE_OPTION) { \n\n\t// Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// Create a file writer \n\t\tFileWriter wr = new FileWriter(fi, false); \n\n\t\t// Create buffered writer to write \n\t\tBufferedWriter w = new BufferedWriter(wr); \n\n\t\t// Write\n\t\tw.write(t.getText()); \n\n\t\tw.flush(); \n\t\tw.close(); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }",
"void save();",
"void save();",
"void save();",
"String saveToFile () throws Exception {\n\n File backupFile = new File(\"../dataBackup.txt\");\n\n// checks if backup file exists, if yes, it attempts to delete it\n if (backupFile.exists() && !backupFile.delete())\n return (\"Save terminated: backup could not be deleted\");\n// attempts to rename file to backup file\n if (!file.renameTo(backupFile))\n return (\"Save terminated: backup could not be created\");\n\n// creates custom writer\n Writer writer = new Writer(new FileWriter(file));\n\n// cycles through all timelines and all their events, writing all into the same file\n for (Timeline timeline : timelines) {\n writer.writeTimeline(timeline);\n for (Event event : timeline.events) {\n writer.writeEvent(event);\n }\n }\n\n writer.close();\n return (\"Save finished successfully\");\n }",
"public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }",
"public void saveToFile() throws InterruptedException\n {\n //generate data\n StringBuilder data = new StringBuilder();\n data.append(\"X,Y,Z,GPS,Timestamp\");\n //loop voor de hardcoded data die wordt aangemaakt in de loop.\n for (int i = 0; i < 5; i++)\n {\n Long currentTime = System.currentTimeMillis();\n data.append(\"\\n\" + i + \",\" + i * i + \",\" + (i + i) + \",\" + (i+i+i)*i + \",\" + currentTime);\n TimeUnit.SECONDS.sleep(1);\n }\n\n FileOutputStream fos = null;\n try\n {\n //saving the file into device\n fos = this.mainActivity.openFileOutput(MainActivity.FILE_NAME, Context.MODE_PRIVATE);\n fos.write(data.toString().getBytes());\n mEditText.getText().clear();\n Toast.makeText(this.mainActivity, \"Saved to\" + mainActivity.getFilesDir() + \"/\" + MainActivity.FILE_NAME, Toast.LENGTH_LONG).show();\n }\n catch (FileNotFoundException e)\n {\n e.printStackTrace();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n if (fos != null)\n {\n try\n {\n fos.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n }",
"public void saveGame();",
"public static void saveFile(State state) throws Exception{\n\n buildDoc();\n writePreferences(state.language, state.background, state.pastTurtles.size());\n\n writeTurtles(state.pastTurtles);\n writeLines(state.pastLines);\n\n createFile(STATE_FILE);\n\n }",
"private void saveToFile(){\n this.currentMarkovChain.setMarkovName(this.txtMarkovChainName.getText());\n saveMarkovToCSVFileInformation();\n \n //Save to file\n Result result = DigPopGUIUtilityClass.saveDigPopGUIInformationSaveFile(\n this.digPopGUIInformation,\n this.digPopGUIInformation.getFilePath());\n }",
"public void running(String path) {\n\t\tthis.procPath = path;\n\t\ttry{\n\t\t\tthis.readSourceData();\n\t\t\tthis.swapValue();\n\t\t\tthis.writeProc();\n\t\t\t\n\t\t\tLMain.getExportMSG().addData(\"SUCCESS - Export(mat03_thermal_expansion_const) \\n path : \"+ this.procPath);\n\t\t\tlog.info(\"SUCCESS - Export(mat03_thermal_expansion_const) \\n path : \"+ this.procPath);\n\t\t}catch(Exception e){\n\t\t\tString msg = \"ERROR - Export(mat03_thermal_expansion_const)\";\n\t\t\tmsg = msg +\"\\n\"+e.getMessage();\n\t\t\tMessageDlg messageDlg = new MessageDlg(Display.getCurrent().getActiveShell(), msg);\n\t\t\tmessageDlg.open();\n\t\t\tlog.error(msg);\n\t\t\tLMain.getExportMSG().addData(msg);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public static void saveFile(String path, byte[] data) {\n //camera.stopPreview();\n\n //Ausgabepfad erstellen mit Dateinamen\n File saveFile = new File(path);\n if (saveFile == null) {\n return;\n } else {\n try {\n OutputStream out = new FileOutputStream(saveFile);\n out.write(data);\n out.flush();\n out.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n\n }",
"public void saveNewRollManager()\n\t{\n\t JFileChooser chooser = new JFileChooser(); //allows the user to choose a file\n\t chooser.setCurrentDirectory(new File(\"/home/me/Documents\"));\t//sets the directory of where to find the file\n\t int retrival = chooser.showSaveDialog(null);\n\t if (retrival == JFileChooser.APPROVE_OPTION) {\n\t try \n\t {\n\t FileWriter fw = new FileWriter(chooser.getSelectedFile()+\".txt\");\n\t fw.write (getCourseToFileString ( ));\n\t for(Student b : getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t \t;\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t }\n\t \n\t}",
"public static void save(String text) {\n File file = new File(path + \"/savedFile.txt\");\n\n Save(file, text);\n }",
"private void saveAs ()\n {\n\tJFileChooser chooser = new JFileChooser ();\n\tchooser.setFileSelectionMode (chooser.FILES_ONLY);\n\tint result = chooser.showSaveDialog (this);\n\tif (result == chooser.CANCEL_OPTION)\n\t{\n\t return;\n\t}\n\n\tFile f = chooser.getSelectedFile ();\n\tif (f.exists ())\n\t{\n\t try\n\t {\n\t\tresult = \n\t\t JOptionPane.showConfirmDialog (\n this,\n\t\t\t\"Overwrite existing file \\\"\" + f.getCanonicalPath () + \n\t\t\t\"\\\"?\",\n\t\t\t\"File Exists\",\n\t\t\tJOptionPane.YES_NO_OPTION);\n\n\t\tif (result != JOptionPane.YES_OPTION)\n\t\t{\n\t\t return;\n\t\t}\n\n\t\tf.delete ();\n\t }\n\t catch (IOException ex)\n\t {\n\t\tthrow new ShouldntHappenException (ex);\n\t }\n\t}\n\n\tString text;\n\tsynchronized (myDocument)\n\t{\n\t int len = myDocument.getLength ();\n\t try\n\t {\n\t\ttext = myDocument.getText (0, len);\n\t }\n\t catch (BadLocationException ex)\n\t {\n\t\tthrow new ShouldntHappenException (ex);\n\t }\n\t}\n\n\ttry\n\t{\n\t FileWriter fw = new FileWriter (f);\n\t fw.write (text);\n\t fw.flush ();\n\t fw.close ();\n\t}\n\tcatch (IOException ex)\n\t{\n\t JOptionPane.showMessageDialog (null,\n\t\t\t\t\t ex.getMessage (),\n\t\t\t\t\t \"Write Error\",\n\t\t\t\t\t JOptionPane.ERROR_MESSAGE);\n\t}\n }",
"public void saveArena() {\n //pick name and location\n Thread t1 = new Thread(new Runnable() {\n @Override\n public void run() {\n JFileChooser chooser = new JFileChooser();\n int approve = chooser.showSaveDialog(null);\n if (approve == JFileChooser.APPROVE_OPTION) {\t\t\t//if possible\n File selFile = chooser.getSelectedFile();\t\t\t//get output file\n File currDir = chooser.getCurrentDirectory();\t\t//get directory to save to\n\n //save\n try {\n FileWriter outFileWriter = new FileWriter(selFile);\t\t//create filewriter for selected file\n PrintWriter writer = new PrintWriter(outFileWriter);\n writer.println(saveArenaData());\t\t\t\t\t\t//save arena info to file\n writer.close();\n }\n catch (FileNotFoundException e) {\t\t\t\t\t\t\t\t//if can't find file\n e.printStackTrace();\n }\n catch (IOException e) {\t\t\t\t\t\t\t\t\t\t//if input/output error\n e.printStackTrace();\n }\n }\n }\n });\n t1.start();\n\n\n }",
"public boolean saveFile() {\n\t\tif (isProjectOpen() && projectModified) {\n\t\t\tboolean written = projectFileIO.writeFile(soundList.values());\n\t\t\tif (written)\n\t\t\t\tprojectModified = false;\n\t\t\treturn written;\n\t\t}\n\t\treturn false;\n\t}",
"void saveToFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile target = new File(directory, FILE_NAME);\n\t\t\tif (!target.exists()) {\n\t\t\t\ttarget.createNewFile();\n\t\t\t}\n\t\t\tJsonWriter writer = new JsonWriter(new FileWriter(target));\n\t\t\twriter.setIndent(\" \");\n\t\t\twriter.beginArray();\n\t\t\tfor (Scoreboard scoreboard : scoreboards.values()) {\n\t\t\t\twriteScoreboard(writer, scoreboard);\n\t\t\t}\n\t\t\twriter.endArray();\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void saveTermText() {\n String jTermText = jTerm.read();\n if (jTermText != null && jTermText.length() > 0) {\n JFileChooser fileChooser = new JFileChooser();\n File path = new File(Settings.get(\"Terminal_SavePath\"));\n if (!path.exists()) {\n path = new File(MobydroidStatic.MOBY_DATA_PATH);\n }\n fileChooser.setCurrentDirectory(path);\n fileChooser.setSelectedFile(new File(\"TerminalText_\" + (new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\")).format(new Date()) + \".txt\"));\n fileChooser.setDialogTitle(\"Save Terminal Text\");\n fileChooser.setFileFilter(new FileNameExtensionFilter(\"*.txt\", \"txt\"));\n File file;\n do {\n if (fileChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {\n return;\n }\n file = fileChooser.getSelectedFile();\n if (!file.exists()) {\n break;\n }\n if (JOptionPane.showConfirmDialog(this, \"Are you sure?\", \"Replace File\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, ResourceLoader.MaterialIcons_WARNING) == JOptionPane.YES_OPTION) {\n break;\n }\n } while (true);\n\n // save file\n try (FileOutputStream fos = new FileOutputStream(file)) {\n fos.write(jTermText.getBytes());\n } catch (IOException ex) {\n }\n // save last directory to settings ..\n Settings.set(\"Terminal_SavePath\", fileChooser.getSelectedFile().getParent());\n Settings.save();\n }\n }",
"private static void createTestFile(String path) throws IOException {\n\t\tFile file = new File(path);\n\t\tFileWriter writer = new FileWriter(file);\n\t\twriter.write(\"Jenkins Test : \"+new Date() + \" ==> Writing : \" + Math.random());\n\t\twriter.flush();\n\t\twriter.close();\n\t}",
"private void save() throws FileNotFoundException {\n\t\tm.write(new FileOutputStream(OUTPUT), \"RDF/XML\");\n\t}",
"public void saving() {\n\t\tSystem.out.println(\"7\");\n\n\t}",
"public void save(Status status, String eingabe) throws IOException {\n\t\tswitch (status) {\n\t\t\tcase Red:\n\t\t\t\tsaveFile(eingabe, \"/data/\" + project + \"/test/\");\n\t\t\t\tbreak;\n\t\t\tcase BabyRed:\n\t\t\t\tsaveFile(eingabe, \"/data/\" + project + \"/babysteps/test/\");\n\t\t\t\tbreak;\n\t\t\tcase Green:\n\t\t\t\tsaveFile(eingabe, \"/data/\" + project + \"/temp/\");\n\t\t\t\tbreak;\n\t\t\tcase BabyGreen:\n\t\t\t\tsaveFile(eingabe, \"/data/\" + project + \"/babysteps/temp/\");\n\t\t\t\tbreak;\n\t\t\tcase Refactoring:\n\t\t\t\tsaveFile(eingabe, \"/data/\" + project + \"/code/\");\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static void saveAs(String line,String path)\n {\n \ttry (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"utf-8\"))) {//goes to the directory\n \t\n \t\twriter.write(line,0,line.length());//saves the lines starting from 0 till the length of the lines\n \t} catch (Exception x) {\n \t\tx.printStackTrace();\n \t}\n }",
"public void save() throws Exception {\n\t\tgetControl(\"saveButton\").click();\n\t\tVoodooUtils.pause(3000);\n\t}",
"private static void saveActionPerformed(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogType(JFileChooser.OPEN_DIALOG);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\r\n chooser.setFileFilter(filter);\r\n int returnVal = chooser.showOpenDialog(frame);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) { \r\n try(BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(chooser.getSelectedFile()), \"UTF-8\"))){\r\n writeChosenSchedule(bw); \r\n \r\n JOptionPane.showMessageDialog(null, \"The schedule was successfully saved.\",\r\n \"Info\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n catch(IOException e){\r\n Logger.getLogger(\"File saving\").log(Level.WARNING, \"Could not write to the file\", e);\r\n JOptionPane.showMessageDialog(null, \"Failed to save the schedule to the chosen file!\",\r\n \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }\r\n }",
"public SaveResult saveShabad(Shabad shabad) throws IOException {\r\n \r\n \t\t// If no file is currently opened\r\n \t\tif (!isFileOpened()) {\r\n \t\t\tint returnVal = fc.showSaveDialog(null);\r\n \t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\r\n \t\t\t\tcurFile = fc.getSelectedFile();\r\n \r\n \t\t\t\tcurFile = appendFileExtension(curFile);\r\n \r\n \t\t\t\t// If the selected file exists and we're about to overwrite it\r\n \t\t\t\tif (curFile.exists()) {\r\n \t\t\t\t\tint result = DialogUtility.showOverwriteDialog();\r\n \r\n \t\t\t\t\t// If the user is OK with overwriting it\r\n \t\t\t\t\tif (DialogUtility.isOK(result)) {\r\n \t\t\t\t\t\twrite(shabad);\r\n \t\t\t\t\t\treturn SaveResult.OVERWRITE;\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\treturn SaveResult.NOTSAVEDCANCELLED;\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\twrite(shabad);\r\n \t\t\t\t\treturn SaveResult.SAVEDNEW;\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\treturn SaveResult.NOTSAVEDCANCELLED;\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\twrite(shabad);\r\n \t\t\treturn SaveResult.SAVEDEXISTING;\r\n \t\t}\r\n \t}",
"public void saveFile(String path, String data) throws IOException {\n\n FileWriter writer = new FileWriter(getFile(path));\n writer.write(data);\n writer.flush();\n }",
"public String saveToHardDisk() {\r\n int isDone = this.isDone ? 1 : 0;\r\n return \" | \" + isDone + \" | \" + description;\r\n }"
] | [
"0.6129017",
"0.60436314",
"0.59248626",
"0.5833849",
"0.58283156",
"0.58089364",
"0.57721525",
"0.57600737",
"0.5740215",
"0.5725687",
"0.5671113",
"0.56668633",
"0.5663856",
"0.565493",
"0.56306404",
"0.5622423",
"0.56121236",
"0.56083775",
"0.560311",
"0.5576379",
"0.55623496",
"0.5559375",
"0.55564797",
"0.5554717",
"0.5543014",
"0.55407035",
"0.5533481",
"0.55187464",
"0.5503468",
"0.5503025",
"0.5488604",
"0.54874915",
"0.54836404",
"0.5479396",
"0.54722303",
"0.5451622",
"0.5444197",
"0.54419154",
"0.5427766",
"0.54127175",
"0.5407629",
"0.5398357",
"0.53851795",
"0.5355858",
"0.5320682",
"0.53201467",
"0.53122634",
"0.5309304",
"0.5303903",
"0.5301933",
"0.52820545",
"0.52669895",
"0.5265103",
"0.5261972",
"0.526197",
"0.5261635",
"0.526159",
"0.5261149",
"0.52544117",
"0.5253889",
"0.525347",
"0.5251648",
"0.5242786",
"0.523335",
"0.52321357",
"0.5229909",
"0.52156943",
"0.5199713",
"0.5191502",
"0.5180493",
"0.5174875",
"0.5158643",
"0.51523256",
"0.51523256",
"0.51523256",
"0.51488024",
"0.5143424",
"0.5128808",
"0.5115398",
"0.51089454",
"0.50997233",
"0.50985986",
"0.5095291",
"0.50945914",
"0.5093593",
"0.5091491",
"0.50873995",
"0.50857264",
"0.5082825",
"0.50790346",
"0.50772566",
"0.50743765",
"0.5072154",
"0.5071041",
"0.50699437",
"0.5061353",
"0.50577563",
"0.5042172",
"0.50415516",
"0.50334305"
] | 0.8579439 | 0 |
Pretty print the program of robot via writer. | @Override
public void prettyPrintProgram(Robot robot, Writer writer)
{
if(robot.getProgram() == null)
{
System.out.println("This robot does not yet contain a program in its memory.");
}
else
{
try
{
writer.append(robot.getProgram().toString());
}
catch (IOException e)
{
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void printIndications() {\n\t\tSystem.out.println(\"\\n\" + \"Usage :\"\n\t\t\t\t+ \"\\n\\t\" + \"java -jar <jar-file> nodeScopeDirectoryPath windowSize\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath is the path of the directory where the tagged corpus is located\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"windowSize is the size of the sliding window; it must be an integer (usually 2)\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"Other input parameters\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the candidates terms must be located at src/main/resources/concepts/candidates.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the reference terms must be located at src/main/resources/concepts/reference_samples.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the stopwords must be located at src/main/resources/stopwords/stopwords_users.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"Output parameters\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/pat_context.json\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/med_context.json\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/frequency.json\"\n\t\t\t\t+ \"\\n\"\n\t\t\t\t);\n\t}",
"private static void writeShortManual() {\n System.out.println(\"\\nPromethean CLI v1.0.0\");\n System.out.println(\"Commands:\");\n System.out.println(\"\\tplan - create (and optionally execute) a plan given input json\");\n System.out.println(\"\\ttestgen - generate a test input file given initial and goal states\");\n System.out.println(\"Run <command> --help to see all options\\n\");\n }",
"private void print(String toBeWritten)\n\t\t{ pw.print(getIndentString() + toBeWritten); }",
"public String print(){\r\n\t\t\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.companyName, \r\n\t\t\t\tthis.numberOfRailCars, \r\n\t\t\t\tthis.destinationCity);\r\n\t}",
"void printFleet(ConsolePrinter printer);",
"public void print ()\n\t{\n\t\tSystem.out.println(\"Polyhedron File Name: \" + FileName);\n\t\tSystem.out.println(\"Object active: \" + Boolean.toString(isActive()));\n\t\tprintCoordinates();\n\t}",
"public void output(IndentedWriter out) \n {\n }",
"protected void writePreamble() throws IOException {\n\n // Begin graph\n writeLine(\"digraph workflow {\");\n\n // Overall graph style\n writeLine(\" graph [\");\n writeLine(\" bgcolor = \\\"#eeeeee\\\"\");\n writeLine(\" color = \\\"black\\\"\");\n writeLine(\" fontsize = \\\"10\\\"\");\n writeLine(\" labeljust = \\\"left\\\"\");\n writeLine(\" clusterrank = \\\"local\\\"\");\n writeLine(\" ranksep = \\\"0.22\\\"\");\n writeLine(\" nodesep = \\\"0.05\\\"\");\n writeLine(\" ]\");\n\n // Overall node style\n writeLine(\" node [\");\n writeLine(\" fontname = \\\"Helvetica\\\"\");\n writeLine(\" fontsize = \\\"10\\\"\");\n writeLine(\" fontcolor = \\\"black\\\"\");\n writeLine(\" shape = \\\"record\\\"\");\n writeLine(\" height = \\\"0\\\"\");\n writeLine(\" width = \\\"0\\\"\");\n writeLine(\" color = \\\"black\\\"\");\n writeLine(\" fillcolor = \\\"lightgoldenrodyellow\\\"\");\n writeLine(\" style = \\\"filled\\\"\");\n writeLine(\" ];\");\n\n // Overall edge style\n writeLine(\" edge [\");\n writeLine(\" fontname=\\\"Helvetica\\\"\");\n writeLine(\" fontsize=\\\"8\\\"\");\n writeLine(\" fontcolor=\\\"black\\\"\");\n writeLine(\" color=\\\"black\\\"\");\n writeLine(\" arrowsize=\\\"0.7\\\"\");\n writeLine(\" ];\");\n }",
"private void tabPrinter() {\n IntStream.range(0, tabs).forEach(i -> writer.print(\" \"));\n }",
"public void printInformation() {\n\n System.out.println(\"Name: \" + name);\n System.out.println(\"Weight: \" + weight);\n System.out.println(\"Shape: \" + shape);\n System.out.println(\"Color: \" + color);\n }",
"public void print() {\n\t\tSystem.out.println(name + \" -- \" + rating + \" -- \" + phoneNumber);\n\t}",
"public String toString(){\n\t\tFileHandler fw = new FileHandler(); //Create new object for file write\n \tformatText(title);\n \tformatText(snippet);\n \tsnippet = removeLineBreak(snippet);\n \t\n \t//Print out contents to screen\n \tSystem.out.println(urlLabel + link);\n \tSystem.out.println(titleLabel + title);\n\t\tSystem.out.println(snippetLabel + snippet);\n\t\t\n\t\t//Write contents to file\n\t\tfw.writeToFile(urlLabel, link, fw.file, false);\n\t\tfw.writeToFile(titleLabel, title, fw.file, false);\n\t\tfw.writeToFile(snippetLabel, snippet, fw.file, false);\n\t\tfw.writeToFile(\"---------- END OF RESULT -----------\",\"\", fw.file, false);\n\t return \"\";\n\t}",
"@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tpublic void printToFile() {\n\t\t\n\t}",
"public String print(){\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.trackNumber, \r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.numRailCars, \r\n\t\t\t\tthis.destCity);\r\n\t\t}",
"public String printOutput(driver driver){\n \t\tString street = new String();\n \t\tif(name == driver.start.option1.name){\n \t\t\t\tstreet = driver.start.outStreet1;\n \t\t\t}\n \t\t\telse{\n \t\t\t\tstreet = driver.start.outStreet2;\n \t\t\t}\n \tString printStr = \"Driver \" + driver.id + \" heading from \" + driver.start.name + \" to \" + name + \" via \" + street;\n \treturn printStr;\n \t\n \t}",
"protected void modelWrite(){\r\n\t\tthis.model.write(System.out);\r\n\t\tSystem.out.println(\"\\n -- model write finished --\\n\");\r\n\t\t\r\n\t}",
"private void printUsage() {\n \n // new formatter\n HelpFormatter formatter = new HelpFormatter();\n \n // add the text and print\n formatter.printHelp(\"arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]\", commandLineOptions);\n }",
"public void printer() throws Exception{\n File outputFile = new File(\"output.txt\");\n FileOutputStream is = new FileOutputStream(outputFile);\n OutputStreamWriter osw = new OutputStreamWriter(is);\n Writer w = new BufferedWriter(osw);\n w.write(this.result());\n w.close();\n }",
"public void writeOut(PrintWriter pw){}",
"void writeJavaScriptRenderer(PrintStream writer);",
"public void writeOutput()\n\t{\n\t\tSystem.out.println(this.toString());\n\t}",
"public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}",
"@Override\r\n\tpublic String toString() {\r\n\t\tboolean isRobotPlaced = this.posX != -1 && this.posY != -1 && this.direction != null;\r\n\t\tif (!isRobotPlaced) {\r\n\t\t\treturn \"Output: ROBOT MISSING\";\r\n\t\t}\r\n\t\treturn \"Output: \" + this.posX + \", \" + this.posY + \", \" + this.direction;\r\n\t}",
"@Override\n\t\tpublic void print() {\n\n\t\t}",
"@Override\n public void print() {\n System.out.println(\"VIn:- \"+getVehicalIndentificationNumber());\n System.out.println(\"Description:- \"+getVechicalDiscription());\n System.out.println(\"Manufacturer:- \"+getManufacturerName());\n System.out.println(\"isSelfDrive:- \"+getSelfDrive());\n System.out.println(\"isInsured:- \"+getInsured());\n System.out.println(\"insuranceProviderName:- \"+getInsuranceProviderName());\n System.out.println(\"NumberOfSeat:- \"+getNoOfSeat());\n System.out.println(\"FuelType:- \"+getFuelType());\n System.out.println(\"BaseRate:- \"+getBaseRate());\n System.out.println(\"RatePerKm:- \"+getRatePerKm());\n System.out.println(\"VehicleType:- \"+getVehicleType());\n System.out.println(\"Color:- \"+getColor());\n }",
"ProcessRunner print();",
"public void print_dev() {\n\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName\r\n\t\t\t\t\t\t\t\t+\t\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)\r\n\t\t\t\t\t\t\t\t+\t\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Function Limit Count\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Eat : \"+TMGCSYS.tmgcLimitEat+\", Sleep : \"+TMGCSYS.tmgcLimitSleep\r\n\t\t\t\t\t\t\t\t+\t\", Walk : \"+TMGCSYS.tmgcLimitWalk+\", Study : \"+TMGCSYS.tmgcLimitStudy+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Ability\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" STR : \"+TMGCSYS.tmgcSTR+\", INT : \"+TMGCSYS.tmgcINT\r\n\t\t\t\t\t\t\t\t+\t\", DEB : \"+TMGCSYS.tmgcDEB+\", HET : \"+TMGCSYS.tmgcHET+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Job : \"+TMGCSYS.tmgc2ndJob\r\n\t\t\t\t\t\t\t\t);\r\n\t}",
"public void dump(PrintWriter output, int pad, String title) {\n\tUtilities.dump(output, pad, title);\n\tfeatures.dump(output, pad + 4, title + \" Features\");\n\tdumpProcessors(output, pad + 4, title + \" Processors\");\n }",
"public void writeln () {\n pw.println();\n }",
"@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}",
"public void print() {\n\t// Skriv ut en grafisk representation av kösituationen\n\t// med hjälp av klassernas toString-metoder\n System.out.println(\"A -> B\");\n System.out.println(r0);\n System.out.println(\"B -> C\");\n System.out.println(r1);\n System.out.println(\"turn\");\n System.out.println(r2);\n //System.out.println(\"light 1\");\n System.out.println(s1);\n //System.out.println(\"light 2\");\n System.out.println(s2);\n }",
"public void printScreen() {\n\t\tBrowser.printScreen(this.getClass().getSimpleName());\n\t}",
"public void exportTo(PrintWriter pw, Animator animator) {\n\t\t// 1. write out the info contained in the ancestor\n\t\t// note: this ends without a space\n\t\tsuper.exportTo(pw, animator);\n\n\t\tTimedAnimator ta = (TimedAnimator) animator;\n\t\tint duration = ta.getDuration(), offset = ta.getOffset();\n\t\tboolean unitIsTicks = ta.isUnitIsTicks();\n\n\t\t// 2. print out the space\n\t\tpw.print(\" by \");\n\n\t\t// 3. print out the method used\n\t\tpw.print('\\\"');\n\t\tpw.print(ta.getMethod());\n\t\tpw.print('\\\"');\n\n\t\t// 4. write out the offset\n\t\tif (offset != 0) {\n\t\t\tpw.print(\" timed starting after \");\n\t\t\tpw.print(offset);\n\n\t\t\tpw.print((unitIsTicks) ? \" ticks\" : \" ms\");\n\t\t}\n\n\t\t// 5. write out the duration\n\t\tif (duration != 0) {\n\t\t\tpw.print(\" within \");\n\t\t\tpw.print(duration);\n\n\t\t\t// 6. write out the unit\n\t\t\tif (offset != 0 || duration != 0)\n\t\t\t\tpw.print((unitIsTicks) ? \" ticks\" : \" ms\");\n\t\t}\n\t}",
"public void writeReport() {\n\t\tint gridSize = 55; // Total character spaces between the borders\n\t\tprint(\"+-------------------------------------------------------+\");\n\t\tprint(String.format(\"|%s|\", centerName(gridSize)));\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t/*\n\t\t * Loops through each room in the hotel and prints out the relevant\n\t\t * information on a new line And draws southern, eastern and western\n\t\t * borders to allow it to connect up to the main table.\n\t\t */\n\t\tfor (int i = 0; i < myHotel.getSize(); i++) {\n\t\t\tprint(formatRooms(i).toUpperCase());\n\t\t\tprint(formatAmount(i).toUpperCase());\n\t\t\tprint(formatSleepAmount(i).toUpperCase());\n\t\t\tprint(formatOccupied(i).toUpperCase());\n\t\t\tprint(\"+---------------+---------------------------------------+\");\n\t\t}\n\t\t/*\n\t\t * After every hotel room's information has been displayed The overall\n\t\t * hotel information is displayed such as total occupancy, if there is a\n\t\t * vacancy. And if there is a vacancy, the total amount of free rooms\n\t\t * and beds.\n\t\t */\n\t\tprint(String.format(\"| Hotel\\t\\t|\\tTotal Occupancy:\\t%s\\t|\", getHotel().getTotalOccupancy()).toUpperCase());\n\t\tprint(String.format(\"| information:\\t|\\tHas Vacancies:\\t\\t%s\\t|\", convertBoolean(getHotel().getVacancies()))\n\t\t\t\t.toUpperCase());\n\t\tif (getHotel().getVacancies()) {\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Rooms:\\t\\t%s\\t|\", getHotel().getEmptyRooms()).toUpperCase());\n\t\t\tprint(String.format(\"|\\t\\t|\\tVacant Beds:\\t\\t%s\\t|\", getHotel().getTotalVacancy()).toUpperCase());\n\t\t}\n\t\t/*\n\t\t * Draws a final southern border to close the table\n\t\t */\n\t\tprint(\"+---------------+---------------------------------------+\");\n\t}",
"private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the prision.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(parser.showCommands());\n }",
"public StdOutWriter ()\n {\n super (System.out, true);\n }",
"private void printOut(String[] printerMakerResult)\n {\n //shows user the printerMaker result\n\n for(int i=0;i<printerMakerResult.length;i++)\n {\n outVideo.println(printerMakerResult[i]);\n outVideo.flush();\n }\n }",
"public void printPatch() {\r\n\t\t\tfor(int i =0; i <numOfPathes; i++)\r\n\t\t\t{\r\n\t\t\t\tfor(int j =0; j <numOfPathes; j++)\r\n\t\t\t\t{\t\t\t\t\r\n\t\t\t\t\tif (patches[i][j].getPerson().size() > 0) {\r\n\t\t\t\t\t\tif (patches[i][j].isCop()) {\r\n\t\t\t\t\t\t\tSystem.out.print(\"\\t*\");\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t} else if (patches[i][j].isActiveAgent()) {\r\n\t\t\t\t\t\t\tSystem.out.print(\"\\tA\");\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tint jail = ((Agent)patches[i][j].getPerson().get(0))\r\n\t\t\t\t\t\t\t\t\t.returnJailTerm();\r\n\t\t\t\t\t\tSystem.out.print(\"\\t\" + jail);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"\\t \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"------------------------------------\");\r\n\t\t}",
"@Override\n\tpublic void makeEyesWithMan() {\n\t\tSystem.out.println(\"Å×ÃÄÑÛÄØ¡£¡£¡£\");\n\t}",
"private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }",
"public String printFormat(){\n return \"The workout: \" + getName() + \" should be done for \" + getSets() + \" sets and in each set should be \"\n + getReps() + \" reps.\";\n }",
"public void printCommands(){\n LocalApi.print_commands();\n }",
"public static void status(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n System.out.printf(\"\\nNOMBRE:\\t\\t\\t\"+nombrePersonaje);\n\tSystem.out.printf(\"\\nPuntos De Vida (HP):\\t\"+puntosDeVida);\n\tSystem.out.printf(\"\\nPuntos De mana (MP):\\t\"+puntosDeMana);\n System.out.printf(\"\\nNivel: \\t\\t\\t\"+nivel);\n\tSystem.out.printf(\"\\nExperiencia:\\t\\t\"+experiencia);\n\tSystem.out.printf(\"\\nOro: \\t\\t\"+oro);\n System.out.printf(\"\\nPotion:\\t\\t\\t\"+articulo1);\n System.out.printf(\"\\nHi-Potion:\\t\\t\"+articulo2);\n System.out.printf(\"\\nM-Potion:\\t\\t\"+articulo3);\n System.out.printf(\"\\n\\tEnemigos Vencidos:\\t\");\n\tSystem.out.printf(\"\\nNombre:\\t\\t\\tNo.Derrotas\");\n System.out.printf(\"\\nDark Wolf:\\t\\t\"+enemigoVencido1);\n\tSystem.out.printf(\"\\nDragon:\\t\\t\\t\"+enemigoVencido2);\n System.out.printf(\"\\nMighty Golem:\\t\\t\"+enemigoVencido3);\t\n }",
"void printSpecification(PrintStream ps);",
"public void print() {\n stdout(name + \", \" + description);\n stdout(\"-----------------------------------\");\n for (MenuComponent menuComponent : components) {\n menuComponent.print();\n }\n stdout(\"\\n\");\n }",
"private static void help() {\n\t\tSystem.out.println(\"\\n----------------------------------\");\n\t\tSystem.out.println(\"---Regatta Calculator Commands----\");\n\t\tSystem.out.println(\"----------------------------------\");\n\t\tSystem.out.println(\"addtype -- Adds a boat type and handicap to file. Format: name:lowHandicap:highHandicap\");\n\t\tSystem.out.println(\"format -- Provides a sample format for how input files should be arranged.\");\n\t\tSystem.out.println(\"help -- Lists every command that can be used to process regattas.\");\n\t\tSystem.out.println(\"podium -- Lists the results of the regatta, assuming one has been processed.\");\n\t\tSystem.out.println(\"regatta [inputfile] -- Accepts an input file as a parameter, this processes the regatta results outlined in the file.\");\n\t\tSystem.out.println(\"types -- lists every available boat type.\");\n\t\tSystem.out.println(\"write [outputfile] -- Takes the results of the regatta and writes them to the file passed as a parameter.\");\n\t\tSystem.out.println(\"----------------------------------\\n\");\n\t}",
"public void print(Node node) \n{\n PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out), true);\n print(node, w);\n}",
"private static void printUsage() throws Exception {\n\t\tSystem.out.println(new ResourceGetter(\"uk/ac/cam/ch/wwmm/oscar3/resources/\").getString(\"usage.txt\"));\n\t}",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public String toString() {\n return \"Robot motors\";\n }",
"@Override\r\n\tpublic void Print() {\r\n\t\tSystem.out.print(this.tav+\" \");\r\n\t\t\r\n\t}",
"public void print()\n {\n \tSystem.out.println(\"MOTO\");\n super.print();\n System.out.println(\"Tipo da partida: \" + tipoPartida);\n System.out.println(\"Cilindradas: \" + cilindradas);\n System.out.println();\n }",
"@Override\r\n public void display(PrintWriter out) {\r\n if (this.nrBasic > 0) {\r\n out.println(\"Basic\");\r\n } else {\r\n super.display(out);\r\n }\r\n }",
"private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }",
"public void outputActualIndentation() {\n\t\tfor (int steps = 1; steps <= indentLevel; steps++) {\n\t\t\toutputJALPrintStream.print(\" \");\n\t\t}\n\t\tif (showMarkerFlag) {\n\t\t\toutputJALPrintStream.print(\"|\");\n\t\t}\n\t}",
"public String toString() { \r\n\t\tif(sw!=null) { return sw.toString(); } \r\n\t\telse { return \"AsciiWriter \"+wr; }\r\n\t}",
"private void printHeading()\n {\n System.out.println(\"==============================================\");\n System.out.println(\" Stock Management Application \");\n System.out.println(\" App05: by Haroon Sadiq \");\n System.out.println(\"==============================================\");\n }",
"private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around in a dense woods.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }",
"public void print() {\n System.out.println(\"Command: \" + command);\n }",
"private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }",
"public String write() {\n return \"gyermek \" + name + \" \" + nem.toString() + \" \" + age + \" \" + number + \" \" + money + \" \" + father + \" \" + mother;\n }",
"public void printInfo(){\n\t}",
"public void printInfo(){\n\t}",
"@Override\n\tpublic void juxing() {\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t}",
"@Override\n\tvoid prettyPrint() {\n\t\tMain.log.prettyPrint(name );\n\t}",
"public void print() {\n\t\tSystem.out.println(\"ONOMA IDIOKTITH: \" + fname);\n\t\tSystem.out.println(\"EPWNYMO IDIOKTITH: \" + lname);\n\t\tSystem.out.println(\"DIEUTHINSH FARMAKEIOU: \" + address);\n\t\tSystem.out.println(\"THLEFWNO FARMAKEIOU: \" + telephone);\n\t\tSystem.out.println();\n\t}",
"public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}",
"static void write() {\n try {\n b.setLength(0); // clear the line buffer\n\n // this next section builds the output string while protecting\n // string literals. All extra spaces are removed from the output\n // string, except that string literals are left as is.\n ArrayList list = new ArrayList();\n String s = new String(\"\");\n for (int i = 0; i < a.size(); i++) {\n Object o = a.get(i);\n if (o instanceof Token) {\n Token token = (Token)o;\n if (token.kind == JavaParserConstants.STRING_LITERAL) {\n s = s.replaceAll(\"[ ]+\", \" \");\n list.add(s);\n s = new String(\"\");\n list.add(token.image);\n }\n else {\n s += ((Token)o).image;\n s = s.replaceAll(\"[ ]+\", \" \");\n }\n }\n else {\n s += (String)o;\n s = s.replaceAll(\"[ ]+\", \" \");\n }\n }\n for (int i = 0; i < list.size(); i++) {\n b.append((String)list.get(i));\n }\n\n b.append(s);\n s = b.toString();\n\n // check for blank line(s)\n String maybe_blank = new String(s);\n if (maybe_blank.trim().length() == 0) {\n // yep, it's a blank, so just print it out\n if (s.length() >= ls.length()) {\n s = s.substring(0, s.length() - ls.length());\n }\n outputBuffer.append(s);\n a.clear();\n return;\n }\n\n // indent --\n // most lines get indented, but there are a few special cases:\n // \"else\" gets put on the same line as the closing \"}\" for the \"if\",\n // so don't want to indent. Similarly with \"catch\" and \"finally\".\n // The \"while\" at the end of a \"do\" loop is marked as \"^while\" to\n // differentiate it from a regular \"while\" block. \"else if\" is also\n // a special case.\n if (!s.startsWith(\" else\")\n && !s.startsWith(\" catch\")\n && !s.startsWith(\" finally\")\n && !s.startsWith(\" ^while\")\n && !s.startsWith(\" {\")\n && (!endsWith(outputBuffer, \"else\") && !endsWith(outputBuffer, \"else \"))) {\n s = s.trim();\n for (int i = 0; i < level; i++) {\n s = indent + s;\n }\n }\n\n // maybe clean out the ^ from the specially marked \"while\" at the\n // end of a \"do\" loop\n if (s.startsWith(\" ^while\")) {\n b.deleteCharAt(1);\n s = b.toString();\n }\n\n // check if the output buffer does NOT end with a new line. If it\n // doesn't, remove any leading whitespace from this line\n if (!endsWith(outputBuffer, \"\\u005cn\") && !endsWith(outputBuffer, \"\\u005cr\")) {\n s = trimStart(s);\n }\n\n // check that there aren't extra spaces in the buffer already --\n // this handles the case where the output buffer ends with a space\n // and the new string starts with a space, don't want 2 spaces.\n if (s.startsWith(\" \") && endsWith(outputBuffer, \" \")) {\n s = s.substring(1);\n }\n\n // check that there is one space between the end of the output\n // buffer and this line -- this handles the case where the output\n // buffer does not end in a space and the new string does not start\n // with a space, want one space in between.\n if (!s.startsWith(\" \")\n && !endsWith(outputBuffer, \" \")\n && !endsWith(outputBuffer, \"\\u005cr\")\n && !endsWith(outputBuffer, \"\\u005cn\")\n && outputBuffer.length() > 0) {\n outputBuffer.append(\" \");\n }\n\n // by the Sun standard, there is no situation where '(' is followed\n // by a space or ')' is preceded with by a space\n s = s.replaceAll(\"[(][ ]\", \"(\");\n s = s.replaceAll(\"[ ][)]\", \")\");\n\n // there should be no situation where a comma is preceded by a space,\n // although that seems to happen when formatting string arrays.\n s = s.replaceAll(\"\\u005c\\u005cs+[,]\", \",\");\n\n // finally! add the string to the output buffer\n // check for line length, may need to wrap. Sun says to avoid lines\n // longer than 80 characters. This doesn't work well yet, so I've \n // commented out the wrapping code. Still need to clean out the\n // wrapping markers.\n //s = s.replaceAll(\"[\u001c]\", \"\");\n outputBuffer.append(s);\n /*\n int wrap_sep_count = countWrapSep(s);\n if (s.length() - wrap_sep_count > 80) {\n String[] lines = wrapLines(s);\n if ( lines != null ) {\n for (int i = 0; i < lines.length; i++) {\n outputBuffer.append(lines[i]).append(ls);\n }\n }\n else {\n // whack any remaining \u001c characters\n s = s.replaceAll(\"[\u001c]\", \"\");\n outputBuffer.append(s);\n }\n }\n else {\n // whack any remaining \u001c characters\n s = s.replaceAll(\"[\u001c]\", \"\");\n outputBuffer.append(s);\n }\n */\n // clear the accumulator for the next line\n a.clear();\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }",
"public void write(java.io.PrintWriter ps) {\n ps.print(\" \" + versionId\n + \" \" + n_bits\n + \" \" + vector.toBinString()\n + \" \" + delay);\n }",
"public void print() {\n\t\tSystem.out.println(toString());\n\t}",
"public void printStatus(){\n System.out.println();\n System.out.println(\"Status: \");\n System.out.println(currentRoom.getLongDescription());\n currentRoom.printItems();\n System.out.println(\"You have made \" + moves + \" moves so far.\");\n }",
"private void printWelcome()//Method was given\n {\n System.out.println();\n System.out.println(\"Welcome to Zork!\");\n System.out.println(\"This Zork is a new adventure game. Find your way through the building and get to the exit by solving riddles and escaping each room. Good luck!\");\n System.out.println(\"Type 'help' to see a list of command words that you can use to play the game.\");\n System.out.println();\n System.out.println(currentRoom.longDescription());\n }",
"private static void printDocumentation() {\n\t\tSystem.out\n\t\t\t\t.println(\"********************************************************************\");\n\t\tSystem.out.println(\"*** Wikidata Toolkit: Dump Processing Example\");\n\t\tSystem.out.println(\"*** \");\n\t\tSystem.out\n\t\t\t\t.println(\"*** This program will download and process dumps from Wikidata.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** It will print progress information and some simple statistics.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** Downloading may take some time initially. After that, files\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** are stored on disk and are used until newer dumps are available.\");\n\t\tSystem.out\n\t\t\t\t.println(\"*** You can delete files manually when no longer needed (see \");\n\t\tSystem.out\n\t\t\t\t.println(\"*** message below for the directory where files are found).\");\n\t\tSystem.out\n\t\t\t\t.println(\"********************************************************************\");\n\t}",
"public void print() {\n System.out.println(toString());\n }",
"public static void shoInfo() {\n\t\tSystem.out.println(description);\n\t \n\t}",
"public String getDump()\n {\n String dump = \"Video status:\\n\";\n\n dump += \"Read mode: \" + videocard.graphicsController.readMode + \"\\n\";\n dump += \"Write mode: \" + videocard.graphicsController.writeMode + \"\\n\";\n \n // dump += \"Graphics mode: \" + ...\n // dump += \"Text mode: \" + ...\n \n return dump;\n }",
"public interface PrettyPrinter {\n\n\tvoid printResults(List<Player> players, PrintStream out);\n\t\n}",
"public void printOn(PrintStream os, GPVariables cfg) {\n\n super.printOn(os, cfg);\n os.println(\"StartingFunds = \"+StartingFunds);\n os.println(\"NumTestTraders = \"+NumTestTraders);\n os.println(\"NumSteps = \"+NumSteps);\n }",
"@Override\n\tpublic void writeReadableDiffereces() {\n\t\t\n\t\tPrintWriter printWriter = null; \n\t\t\n\t\tString filename = \"AGB-Versions-Aenderungen2.txt\";\n\t\t\n\t\t//System.out.println(\"Schreibe Textdatei mit Aenderungen: \");\n\t\t\n\t\ttry \n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tprintWriter = new PrintWriter(new FileWriter(filename));\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tIterator iter = readableDifferences.iterator();\n\t\t\t\n\t\t\twhile (iter.hasNext())\n\t\t\t{\n\t\t\t\t printWriter.println(iter.next()+LINE_SEPARATOR);\n\t\t\t}\n } \n\t\tfinally \n\t\t{\n if(printWriter != null) printWriter.close();\n } \n\t}",
"public void print() {\r\n\t\t System.out.println(toString());\r\n\t }",
"public void printProtocol()\n\t{\n\t\tString commands[] = {\"A\", \"UID\", \"S\", \"F\"};\n\t\t\n\t\tHashtable<String, String> commandDescription = new Hashtable<String, String>();\n\t\tHashtable<String, String> subStringCommands = new Hashtable<String, String>();\n\t\tcommandDescription.put(\"A\", \"Sends audio data using _ as a regex\");\n\t\tcommandDescription.put(\"UID\", \"Specifies the user's id so that the Network.Server may verify it\");\n\t\tcommandDescription.put(\"S\", \"Specifies server commands.\");\n\t\tcommandDescription.put(\"F\", \"Specifies audio format.\");\n\t\tsubStringCommands.put(\"A\", \"No commands\");\n\t\tsubStringCommands.put(\"UID\", \"No sub commands\");\n\t\tsubStringCommands.put(\"S\", \"Sub commands are: \\nclose - Closes the server.\\ndisconnect - Disconnects the client from the server.\\nclumpSize {int}\");\n\t\tsubStringCommands.put(\"F\", \"Split Audio specifications between spaces. The ordering is {float SampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate\");\n\t\t\n\t\tfor (String str: commands)\n\t\t{\n\t\t\tSystem.out.printf(\"Command format:\\n %s.xxxxxxx\\n\", str);\n\t\t\tSystem.out.printf(\"Command %s\\n Description: %s \\n sub commands %s\\n\", str, commandDescription.get(str),subStringCommands.get(str));\n\t\t\t\n\t\t}\n\t}",
"void genReport() {\n\n current_part.save_state(); \n\n JTextArea ta = text;\n\n ta.setText(\"\");\n\n if (!t_foil_name.equals(\"Test\"))\n ta.append(\"Hydrofoil: \" + t_foil_name);\n\n java.util.Date date = new java.util.Date();\n ta.append(\"\\n Date: \" + date);\n \n wing.print( \"Main Wing\", ta);\n stab.print( \"Stabilizer Wing\", ta);\n strut.print(\"Mast (a.k.a. Strut)\", ta);\n fuse.print( \"Fuselage\", ta);\n\n ta.append( \"\\n\\n\");\n // tail volume is LAElev * AreaElev / (MACWing * AreaWing)\n // LAElev : The elevator's Lever Arm measured at the wing's and elevator's quarter chord point\n double LAElev = stab.xpos + stab.chord_xoffs + 0.25*stab.chord - (wing.xpos + wing.chord_xoffs + 0.25*wing.chord);\n // MAC : The main wing's Mean Aerodynamic Chord\n // AreaWing : The main wing's area\n // AreaElev : The elevator's area\n \n ta.append( \"\\nTail Voulume: \" + LAElev*stab.span*stab.chord/(wing.chord*wing.chord*wing.span));\n \n\n ta.append( \"\\n\\n\");\n switch (planet) {\n case 0: { \n ta.append( \"\\n Standard Earth Atmosphere\" );\n break;\n }\n case 1: { \n ta.append( \"\\n Martian Atmosphere\" );\n break;\n }\n case 2: { \n ta.append( \"\\n Water\" );\n break;\n }\n case 3: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n case 4: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n }\n\n // ta.append( \"\\n Altitude = \" + filter0(alt_val) );\n // if (lunits == IMPERIAL) ta.append( \" ft ,\" );\n // else /*METRIC*/ ta.append( \" m ,\" );\n \n switch (lunits) {\n case 0: { /* English */\n ta.append( \"\\n Density = \" + filter5(rho_EN) );\n ta.append( \"slug/cu ft\" );\n ta.append( \"\\n Pressure = \" + filter3(ps0/144.) );\n ta.append( \"lb/sq in,\" );\n ta.append( \" Temperature = \" + filter0(ts0 - 460.) );\n ta.append( \"F,\" );\n break;\n }\n case 1: { /* Metric */\n ta.append( \" Density = \" + filter3(rho_EN*515.4) );\n ta.append( \"kg/cu m\" );\n ta.append( \"\\n Pressure = \" + filter3(101.3/14.7*ps0/144.) );\n ta.append( \"kPa,\" );\n ta.append( \" Temperature = \" + filter0(ts0*5.0/9.0 - 273.1) );\n ta.append( \"C,\" );\n break;\n }\n }\n\n ta.append( \"\\n Speed = \" + filter1(velocity * (lunits==IMPERIAL? 0.868976 : 0.539957 )) + \"Kts, or\" );\n ta.append( \" \" + filter1(velocity) );\n if (lunits == IMPERIAL) ta.append( \" mph ,\" );\n else /*METRIC*/ ta.append( \" km/hr ,\" );\n\n // if (out_aux_idx == 1)\n // ta.append( \"\\n Lift Coefficient = \" + filter3(current_part.cl) );\n // if (out_aux_idx == 0) {\n // if (Math.abs(lift) <= 10.0) ta.append( \"\\n Lift = \" + filter3(lift) );\n // if (Math.abs(lift) > 10.0) ta.append( \"\\n Lift = \" + filter0(lift) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n // if ( polarOut == 1)\n // ta.append( \"\\n Drag Coefficient = \" + filter3(current_part.cd) );\n // if (out_aux_idx == 0) {\n // ta.append( \"\\n Drag = \" + filter0(drag) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n\n ta.append( \"\\n Lift = \" + dash.outTotalLift.getText());\n ta.append( \"\\n Drag = \" + dash.outTotalDrag.getText());\n\n if (min_takeoff_speed_info != null) \n ta.append( \"\\n\\n\" + min_takeoff_speed_info);\n\n if (cruising_info != null) \n ta.append( \"\\n\\n\" + cruising_info);\n\n if (max_speed_info != null) \n ta.append( \"\\n\\n\" + max_speed_info);\n\n // ensure end ta.setCaretPosition(ta.getText().length());\n // ensure start\n ta.setCaretPosition(0);\n }",
"@Override\r\n\tpublic void drive() {\n\t\tSystem.out.println( aname + \"Berkendara\");\r\n\t}",
"private void printVersion() {\n \n // print the version\n System.out.println(\"arara \".concat(AraraConstants.VERSION).concat(\" - \").concat(localization.getMessage(\"Header_Slogan\")));\n System.out.println(\"Copyright (c) \".concat(AraraConstants.COPYRIGHTYEAR).concat(\", Paulo Roberto Massa Cereda\"));\n System.out.println(localization.getMessage(\"Header_AllRightsReserved\").concat(\"\\n\"));\n }",
"public void printOut(){\n\t\tSystem.out.println(\"iD: \" + this.getiD());\n\t\tSystem.out.println(\"Titel: \" + this.getTitel());\n\t\tSystem.out.println(\"Produktionsland: \" + this.getProduktionsLand());\n\t\tSystem.out.println(\"Filmlaenge: \" + this.getFilmLaenge());\n\t\tSystem.out.println(\"Originalsprache: \" + this.getOriginalSprache());\n\t\tSystem.out.println(\"Erscheinungsjahr: \" + this.getErscheinungsJahr());\n\t\tSystem.out.println(\"Altersfreigabe: \" + this.getAltersFreigabe());\n\t\tif(this.kameraHauptperson != null) {\n\t\t\tSystem.out.println( \"Kameraperson: \" + this.getKameraHauptperson().toString() );\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println( \"Keine Kameraperson vorhanden \");\n\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tif ( this.listFilmGenre != null) {\n\t\t\tfor( FilmGenre filmGenre: this.listFilmGenre ){\n\t\t\t\tSystem.out.println(\"Filmgenre: \" + filmGenre);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person darsteller: this.listDarsteller ){\n\t\t\tSystem.out.println(\"Darsteller: \" + darsteller);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person synchronSpr: this.listSynchronsprecher ){\n\t\t\tSystem.out.println(\"synchro: \" + synchronSpr);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person regi: this.listRegisseure ){\n\t\t\tSystem.out.println(\"regi: \" + regi);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Musikstueck mstk: this.listMusickstuecke ){\n\t\t\tSystem.out.println(\"Musikstueck: \" + mstk);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tSystem.out.println(\"Datentraeger: \" + this.getDatentraeger());\n\t\tSystem.out.println(\"----------------------------\");\n\t}",
"void dump() {\n\t\tSystem.out.print(\"I am: \" + (territoryID));\n\t\tSystem.out.print(\"\\tNeighbour of:\");\n\n\t}",
"public void printMovieInfo() {\n println(\"Title : \" + this.movie.getTitle());\n println(\"Showing Status: \" + this.movie.getShowingStatus().toString());\n println(\"Content Rating: \" + this.movie.getContentRating().toString());\n println(\"Runtime : \" + this.movie.getRuntime() + \" minutes\");\n println(\"Director : \" + this.movie.getDirector());\n print(\"Cast : \");\n StringBuilder s = new StringBuilder();\n for (String r : movie.getCasts()) {\n s.append(r + \"; \");\n }\n println(s.toString());\n println(\"Language : \" + this.movie.getLanguage());\n println(\"Opening : \" + this.movie.getFormattedDate());\n\n print(\"Synopsis : \");\n println(this.movie.getSynopsis(), 16);\n\n if(movie.getRatingTimes() != 0 ){\n print(\"Overall Rating :\");\n printStars(movie.getOverAllRating());\n } else {\n println(\"Overall Rating: N/A\");\n }\n if (movie.getRatingTimes() != 0){\n for (Review r : movie.getReview()) {\n print(\"Review : \");\n println(r.getComment(), 16);\n print(\"Rating : \");\n printStars(r.getRating());\n }\n }\n }",
"public void generate() {\n\t\t// Print generation stamp\n\t\tcontext.getNaming().putStamp(elementInterface, out);\n\t\t// Print the code\n\t\t// Print header\n\t\tout.println(\"package \"+modelPackage+\";\");\n\t\tout.println();\n\t\tout.println(\"public interface \"+elementInterface);\n\t\tif (context.isGenerateVisitor()) {\n\t\t\tout.println(indent+\"extends \"+context.getNaming().getVisitableInterface(modelName));\n\t\t}\n\t\tout.println(\"{\");\n\t\tif (context.isGenerateID()) {\n\t\t\tout.println(indent+\"/** Get the id */\");\n\t\t\tout.println(indent+\"public String getId();\");\n\t\t\tout.println(indent+\"/** Set the id */\");\n\t\t\tout.println(indent+\"public void setId(String id);\");\n\t\t\tout.println();\n\t\t}\n\t\tif (context.isGenerateBidirectional()) {\n\t\t\tout.println(indent+\"/** Delete */\");\n\t\t\tout.println(indent+\"public void delete();\");\n\t\t}\n\t\tout.println(indent+\"/** Override toString */\");\n\t\tout.println(indent+\"public String toString();\");\n//\t\tif (context.isGenerateInvariant()) {\n//\t\t\tout.println();\n//\t\t\tout.println(indent+\"/** Parse all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean parseInvariants(ILog log);\");\n//\t\t\tout.println(indent+\"/** Evaluate all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean evaluateInvariants(ILog log);\");\n//\t\t}\n\t\tout.println(\"}\");\n\t}",
"public static void preCrawling() {\n\t\ttry {\n\t\t\tHelper.directoryCheck(getOutputFolder());\n\t\t\toutput = new PrintStream(getOutputFolder() + getFilename());\n\n\t\t\t// Add opening bracket around whole trace\n\t\t\tPrintStream oldOut = System.out;\n\t\t\tSystem.setOut(output);\n\t\t\tSystem.out.println(\"{\");\n\t\t\tSystem.setOut(oldOut);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }",
"@Override\r\n\tpublic void print() {\n\t}"
] | [
"0.6230043",
"0.61794174",
"0.60264605",
"0.5896689",
"0.58197993",
"0.57704794",
"0.57285815",
"0.57258695",
"0.5687703",
"0.56849414",
"0.56774616",
"0.56743264",
"0.5649417",
"0.56473243",
"0.56374353",
"0.5614053",
"0.5601801",
"0.55833244",
"0.5580257",
"0.55745447",
"0.55569863",
"0.5547799",
"0.55375624",
"0.5521683",
"0.55212605",
"0.5508203",
"0.5498565",
"0.5486502",
"0.54840976",
"0.54819596",
"0.54703516",
"0.5469312",
"0.5468424",
"0.5465015",
"0.5457608",
"0.54573095",
"0.54456425",
"0.5439627",
"0.5439032",
"0.54278994",
"0.5425863",
"0.54244906",
"0.5403628",
"0.54016954",
"0.5397832",
"0.53977376",
"0.5394735",
"0.5390289",
"0.53893864",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.53803426",
"0.5378086",
"0.5376233",
"0.53735393",
"0.5371631",
"0.53713995",
"0.5370803",
"0.5368664",
"0.5363396",
"0.53540975",
"0.5353747",
"0.5350696",
"0.5350163",
"0.5347917",
"0.5347917",
"0.5346802",
"0.5339538",
"0.5330623",
"0.53285533",
"0.53268945",
"0.5322893",
"0.5319356",
"0.53125423",
"0.53091437",
"0.53055066",
"0.5304912",
"0.5303133",
"0.529947",
"0.5292838",
"0.5291889",
"0.52896327",
"0.52891785",
"0.5287606",
"0.5287559",
"0.5283209",
"0.5283183",
"0.5280703",
"0.52776235",
"0.5272781",
"0.5271367",
"0.52673024",
"0.52659774",
"0.52658"
] | 0.80803144 | 0 |
Execute n basic steps in the program of robot. For example, consider the program (seq (move) (shoot)). The first step performs a move command, the second step performs a shoot command and all subsequent steps have no effect. Note that if n equals 1, then only the move command is executed. The next call to stepn then starts with the shoot command. | @Override
public void stepn(Robot robot, int n)
{
robot.runProgramStep(n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void step(int nSteps) {\n \tif(simState != State.RUNNING) {\n \t\tSystem.err.println(\"ERROR: Can't step a simulation that is not\" +\n \" runnig!\");\n \t\treturn;\n \t}\n \t\n \tfor(int i = 0; i < nSteps; ++i) step();\n }",
"public void redoUndoneCommands(int n) {\r\n \t// TODO: Also three lines of code\r\n for(int i=0;i<n;i++)\r\n redoUndoneCommand();\r\n }",
"public void undoCommands(int n) {\r\n \t// TODO: Three lines of code, if you use undoCommand\r\n for(int i=0;i<n;i++){\r\n undoCommand();\r\n }\r\n }",
"void move(int steps);",
"private void takeAction(int n) {\n Character prevKey = null;\n Character nextKey = null;\n while (n > 0) {\n if (StdDraw.hasNextKeyTyped()) {\n if (!(nextKey == null)) {\n prevKey = nextKey;\n }\n nextKey = StdDraw.nextKeyTyped();\n if (nextKey.equals('N') || nextKey.equals('n')) {\n// System.out.println(\"here\");\n Long seed = getSeedSequence();\n newGame(seed);\n return;\n } else if (nextKey.equals('Q')\n || nextKey.equals('q') && prevKey.equals(':')) {\n return;\n } else if (nextKey.equals('L') || nextKey.equals('l')) {\n loadOldGame();\n }\n// } else if (nextKey.equals('P') || nextKey.equals('p')) {\n//// naming thing about the avatar\n// }\n }\n }\n }",
"abstract int steps();",
"public static void hanoiTower(int n) {\r\n\t\tif (n <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tTower source = new Tower(\"source\");\r\n\t\tTower dest = new Tower(\"dest\");\r\n\t\tTower buffer = new Tower(\"buffer\");\r\n\t\tif (n == 1) {\r\n\t\t\tdest.push(1);\r\n\t\t\tdest.print();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor (int i = n; i > 0; i--) {\r\n\t\t\tsource.push(i);\r\n\t\t}\r\n\t\tSystem.out.println(\"Before action:\");\r\n\t\tSystem.out.println(\"Source Tower:\");\r\n\t\tsource.print();\r\n\t\tSystem.out.println(\"Dest Towner:\");\r\n\t\tdest.print();\r\n\t\tSystem.out.println(\"Buffer Towner:\");\r\n\t\tbuffer.print();\r\n\t\tSystem.out.println(\"\\r\\n\");\r\n\t\t\r\n\t\tmoveDisk(n, source, dest, buffer);\r\n\t\t\r\n\t\tSystem.out.println(\"\\r\\nAfter action:\");\r\n\t\tSystem.out.println(\"Source Tower:\");\r\n\t\tsource.print();\r\n\t\tSystem.out.println(\"Dest Towner:\");\r\n\t\tdest.print();\r\n\t\tSystem.out.println(\"Buffer Towner:\");\r\n\t\tbuffer.print();\r\n\t}",
"public static void main(String[] args) {\n\t\tFastScanner fs = new FastScanner(System.in);\r\n\t\tint n = fs.nextInt();\r\n\t\tint[] stepsCount = calc(n);\r\n\t\tint[] steps = calcAndPrint(stepsCount);\r\n\t\tSystem.out.println(stepsCount[n]);\r\n\t\tfor (int i = 0; i <= stepsCount[n]; i++) {\r\n\t\t\tSystem.out.print(steps[i] + \" \");\r\n\t\t}\r\n\t}",
"public void run(int n){\n System.out.println(\"Find E Program starting on JNumber\");\n System.out.println(\"Finding E to the Nth Number\");\n System.out.println(this.toNth(n));\n System.out.println(\"Find E Program ending on JNumber\");\n }",
"public void step();",
"public void step();",
"public static void sequence(int n)\n { \n int x = n;\n if(n == 1)\n {\n System.out.print(1);\n }\n else\n { \n System.out.print(n + \" \"); \n sequence(next(x)); \n }\n }",
"@SuppressWarnings(\"boxing\")\n public void go(final int steps) {\n callFunction(\"go\", steps);\n }",
"@Test\n\tpublic void testStep() {\n\t\tsimulator.step();\n\t\tassertEquals(0, (int)simulator.averageWaitTime());\n\t\tassertEquals(0, (int)simulator.averageProcessTime());\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\n\t\tfor (int i = 0; i < 28; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(287, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1525, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\t\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(614, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1457, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(true, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(false, simulator.moreSteps());\t\n\t}",
"public AutoVisionTurretCommand() {\n \taddParallel(new VisionCommand(), 5);\n \taddSequential(new DelayedAimCommand());\n }",
"public static void NCommand() {\n if (Interface.persons.size(Interface.persons) == 0) {\n System.out.println(\"There are not any persons have been added before.\");\n return;\n }\n Interface.persons.printList(Interface.persons);\n }",
"@Override\r\n public void execute(VirtualMachine vm) {\n for(int i=0;i<n; i++){\r\n vm.popRunStack();\r\n }\r\n }",
"public static void main(String[] args) {\n Scanner sc=new Scanner (System.in);\n int n=sc.nextInt();\n\t int []arr=new int[n];\n\t for(int i=0;i<n;i++)\n\t {\n\t \t arr[i]=sc.nextInt();\n\t }\n\t moving(arr,n);\n\t}",
"public void takeStep() {\n \tRandom rand = new Random();\n\t\tint number = rand.nextInt(4);\n\t if(number == 0) {\n\t \tmoveNorth();\n\t \t}\n\t \telse if(number == 1) {\n\t \t\tmoveSouth();\n\t \t}\n \telse if(number == 2) {\n \t\tmoveWest();\n\t }\n\t \telse if(number == 3) {\n\t \t\tmoveEast();\n\t \t}\n }",
"@Override\r\n\tpublic void doTimeStep() {\n\t\tdir = Critter.getRandomInt(8);\r\n\t\t\r\n\t\tnumSteps = Critter.getRandomInt(maxStep) + 1;\r\n\t\t\r\n\t\t//go a random number of steps in that direction\r\n\t\tfor(int i = 0; i < numSteps; i++) {\r\n\t\t\twalk(dir);\r\n\t\t}\t\t\r\n\t}",
"private Behaviour objectiveSimulation(int n) {\n\n //System.out.println(\"Simulation: running objective simulation\");\n\n start();\n double distanceTravelled = 0;\n\n for(int i = 0; i < n; i++) {\n\n schedule.step(this);\n }\n\n ArrayList<RobotObject> tempBots = robotFactory.getPlacedRobots();\n ArrayList<ResourceObject> tempResources = resourceFactory.getPlacedResources();\n\n construction.updateConstructionZones();\n\n //THIS IS FOR THE OBJECTIVE FITNESS\n Behaviour behaviour = new Behaviour(construction, schemaConfigNum);\n\n finish();\n\n return behaviour;\n\n }",
"public abstract void performStep();",
"public void showResultImmediately(int n) {\n\t\tcopyBoard(board, tempBoard);\n\t\tint counter = 0;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tif (setBoard(board)) {\n\t\t\t\tcounter++;\n\t\t\t\tcopyBoard(tempBoard, board);\n\t\t\t} else\n\t\t\t\tbreak; // if there are no change\n\t\t\n\t\tif(counter < n)\n\t\t\tSystem.out.println(\"There are no change after step \" + counter);\n\t\t\n\t\tSystem.out.println(\"Board after step \" + counter + \":\");\n\t\tSystem.out.println(toString());\n\t}",
"private static void Simulate(int noCycles) throws IOException\n\t{\n\t\tfor (int i = 1; i <= noCycles; i++)\n\t\t{\n\t\t\tSystem.out.println(\"---------------------------- Cycle : \" + i + \"--------------------------------\");\n\t\t\tfetchStage();\n\t\t\tdecodeStage();\n\t\t\texecute1();\n\t\t\texecute2Stage();\n\t\t\tbranchStage();\n\t\t\tdelayStage();\n\t\t\tmemoryStage();\n\t\t\twritebackStage();\n\t\t\tDisplay();\n\t\t\tSystem.out.println(\"-----------------------------------------------------------------------------\");\n\t\t\tif (isComplete)\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected void execute() {\r\n if (machineState != 5) {\r\n shootAtBeginAutonomous();\r\n } else if (machineState == 5) {\r\n if (!lineFound()) {\r\n initalizeFeederAndShooter();\r\n Robot.chassis.driveMecanumNormalized(-0.5, 0, 0);\r\n } else {\r\n driveOnLine();\r\n shootOnce();\r\n }\r\n }\r\n }",
"public static void main(String[] args) {\n\n\t SalesforceDesignTest solution = new SalesforceDesignTest();\n\t try(Scanner sc = new Scanner(System.in))\n\t {\n\t int n = sc.nextInt();\n\t for(int t = 0; t < n; t++) {\n\t String command = sc.nextLine();\n\t while (command.trim().isEmpty())\n\t {\n\t \tcommand = sc.nextLine();\n\t }\n\t \n\t solution.executeTask(command); \n\t }\t\n\t }\n}",
"private void firstSteps() {\n\t\tturnLeft();\n\t\tmove();\n\t\tmove();\n\t\tturnRight();\n\t\tmove();\n\t}",
"@Override\n protected void defineSteps() {\n addStep(new StepStartDriveUsingMotionProfile(80, 0.0));\n addStep(new StepWaitForDriveMotionProfile());\n addStep(new StepStopDriveUsingMotionProfile());\n addStep(new AutoStepDelay(500));\n addStep(new StepSetIntakeState(true));\n addStep(new StepSetNoseState(true));\n addStep(new AutoStepDelay(500));\n addStep(new StepStartDriveUsingMotionProfile(-5, 0.0));\n addStep(new StepWaitForDriveMotionProfile());\n addStep(new StepStopDriveUsingMotionProfile());\n addStep(new AutoStepDelay(500));\n\n AutoParallelStepGroup crossCheval = new AutoParallelStepGroup();\n AutoSerialStepGroup driveOver = new AutoSerialStepGroup();\n\n driveOver.addStep(new StepStartDriveUsingMotionProfile(80, 0.0));\n driveOver.addStep(new StepWaitForDriveMotionProfile());\n driveOver.addStep(new StepStopDriveUsingMotionProfile());\n // Medium flywheel speed.\n crossCheval.addStep(new StepRunFlywheel(Shooter.FLYWHEEL_SPEED_MEDIUM));\n crossCheval.addStep(driveOver);\n addStep(crossCheval);\n addStep(new AutoStepDelay(500));\n addStep(new StepSetIntakeState(false));\n addStep(new StepSetNoseState(false));\n addStep(new AutoStepDelay(1000));\n\n addStep(new StepQuickTurn(180));\n addStep(new AutoStepDelay(1000));\n addStep(new StepVisionAdjustment());\n addStep(new AutoStepDelay(500));\n addStep(new StepSetShooterPosition(true));\n addStep(new StepResetShooterPositionToggle());\n addStep(new AutoStepDelay(2000));\n addStep(new StepShoot());\n addStep(new AutoStepDelay(1000));\n addStep(new StepResetShotToggle());\n addStep(new StepRunFlywheel(Shooter.FLYWHEEL_SPEED_ZERO));\n\n // total delay time: 7.5 seconds\n }",
"public void moveTo(int n, Tower<E> destination, Tower<E> buffer) {\n\t\t\tsteps++;\n\t\t\tif (n > 0) {\n\t\t\t\tmoveTo(n - 1, buffer, destination);\n\t\t\t\tE e = pop();\n\t\t\t\tdestination.push(e);\n\t\t\t\tSystem.out.println(\"Move \" + e + \" from \" + this + \" to \" + destination);\n\t\t\t\tbuffer.moveTo(n - 1, destination, this);\n\t\t\t}\n\t\t}",
"public static void helpermethod(int numberofsteps){\n ways(numberofsteps, 0, \"[\");\r\n }",
"public int steps(int n) {\n\n\t\tint steps = 0;\n\t\tQueue<Integer> q = new ArrayDeque<>();\n\n\t\tSet<Integer> set = new HashSet<>();\n\n\t\tq.add(n);\n\t\tset.add(n);\n\n\t\twhile (!q.isEmpty()) {\n\t\t\tint size = q.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tint curr = q.poll();\n\t\t\t\tif (curr == 1)\n\t\t\t\t\treturn steps;\n\n\t\t\t\tif (!set.contains(curr-1)) {\n\t\t\t\t\tq.add(curr - 1);\n\t\t\t\t\tset.add(curr-1);\n\t\t\t\t}\n\n\t\t\t\tif (curr % 2 == 0 && !set.contains(curr / 2)) {\n\t\t\t\t\tq.add(curr / 2);\n\t\t\t\t\tset.add(curr / 2);\n\t\t\t\t}\n\n\t\t\t\tif (curr % 3 == 0 && !set.contains(curr / 3)) {\n\t\t\t\t\tq.add(curr / 3);\n\t\t\t\t\tset.add(curr / 3);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tsteps++;\n\n\t\t}\n\n\t\treturn steps;\n\n\t}",
"public void act() {\r\n\t\tturn(steps[number % steps.length]);\r\n\t\tnumber++;\r\n\t\tsuper.act();\r\n\t}",
"public void run() throws IOException{\t\n\t\t\tString command;\n\t\t\tprintUsage();\n\t\t\tSystem.out.print(\">> \");\n\t\t\twhile(!(command = consoleIn.readLine()).trim().equals(\"exit\")){\n\t\t\t\ttry{\n\t\t\t\t\tswitch(command){\n\t\t\t\t\tcase \"1\":\n\t\t\t\t\t\tsimulatable = MordorFrameBuilds.getInstance();\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"2\":\n\t\t\t\t\t\tsimulatable = CastSimulator.getInstance();\n\t\t\t\t\t\t((CastSimulator)simulatable).configureFor(CastAlias.TRAPRUNE_TRAP);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"3\":\n\t\t\t\t\t\tsimulatable = CastSimulator.getInstance();\n\t\t\t\t\t\t((CastSimulator)simulatable).configureFor(CastAlias.TRAPRUNE_TOWER);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"4\":\n\t\t\t\t\t\tsimulatable = TroopStepSimulator.getInstance();\n\t\t\t\t\t\t((TroopStepSimulator)simulatable)\n\t\t\t\t\t\t\t.configureFor(TroopStepSimulator.TroopStepAlias.DEFAULT);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"5\":\n\t\t\t\t\t\tsimulatable = TroopStepSimulator.getInstance();\n\t\t\t\t\t\t((TroopStepSimulator)simulatable)\n\t\t\t\t\t\t\t.configureFor(TroopStepSimulator.TroopStepAlias.TRAP_AFFECTS);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"6\":\n\t\t\t\t\t\tsimulatable = MissileDamageSimulator.getInstance();\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"7\":\n\t\t\t\t\t\tsimulatable = TroopStepSimulator.getInstance();\n\t\t\t\t\t\t((TroopStepSimulator)simulatable)\n\t\t\t\t\t\t\t.configureFor(TroopStepSimulator.TroopStepAlias.TOWER_FIRES);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"8\":\n\t\t\t\t\t\tsimulatable = CastSimulator.getInstance();\n\t\t\t\t\t\t((CastSimulator)simulatable).configureFor(CastAlias.TOWER_GROUND);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"9\":\n\t\t\t\t\t\tsimulatable = CastSimulator.getInstance();\n\t\t\t\t\t\t((CastSimulator)simulatable).configureFor(CastAlias.TRAP_ROAD);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"10\":\n\t\t\t\t\t\tsimulatable = CastSimulator.getInstance();\n\t\t\t\t\t\t((CastSimulator)simulatable).configureFor(CastAlias.MAGIC);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"11\":\n\t\t\t\t\t\tsimulatable = TroopStepSimulator.getInstance();\n\t\t\t\t\t\t((TroopStepSimulator)simulatable)\n\t\t\t\t\t\t\t.configureFor(TroopStepSimulator.TroopStepAlias.DAMAGES_MOUNTAIN);\n\t\t\t\t\t\trunSimulation();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: printUsage();\n\t\t\t\t\t}\n\t\t\t\t}catch(IOException e){\n\t\t\t\t\tSystem.out.println(\"io error: \"+e.getClass().getName()+\": \"+e.getMessage());\n\t\t\t\t}catch(Exception ex){\n\t\t\t\t\tSystem.out.println(\"exception in main thread: \"+ex.getClass()+\": \"+ex.getMessage());\n\t\t\t\t}finally{\n\t\t\t\t\tSystem.out.print(\">> \");\n\t\t\t\t}\n\t\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n drunkardTest(TEST_STEP_TIMES_1, TEST_STEP_SIZE_1);\n drunkardTest(TEST_STEP_TIMES_2, TEST_STEP_SIZE_2);\n\t}",
"private void delay( int n )\n {\n try {\n Thread.sleep(n);\n } catch( InterruptedException e ) {\n System.exit(0);\n }\n }",
"public static void main(String[] args) {\n Steps ways = new Steps();\n int n=5;\n System.out.println(\"Recursion ways: \"+ways.getStepsRecur(n));\n \n System.out.println(\"DP ways: \"+ways.getStepDP(n));\n \n }",
"private void call(int n) {\n // System.out.println(\"\\\"\" + n + \"\\\"\\t -> \\t\" + solution.numSquares(n));\n System.out.print(solution.numSquares(n) + \",\");\n }",
"protected abstract R runStep();",
"public static void main(String[] args) {\n\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tSystem.out.println(outcomes(n,\"\"));\n\t\tSystem.out.println(outcomesnoconsecutiveheads(n, \"\", false));\n\t\t\n\t\t\n\t\t\n\t}",
"void doNext() throws PlayerDebugException\n\t{\n\t\twaitTilHalted();\n\n\t\tif (!allowedToStep())\n\t\t\treturn;\n\t\t\n\t\tint count = 1;\n\t\tif (hasMoreTokens())\n\t\t\tcount = nextIntToken();\n\n\t\ttry\n\t\t{\n\t\t\twhile(count-- > 0)\n\t\t\t{\n\t\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t\t{\n\t\t\t\t\t\tm_session.stepOver();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tfor (;;)\n\t\t\t\t{\n\t\t\t\t\tdumpStep();\n\n\t\t\t\t\tif (m_requestResume) // perhaps we hit a conditional breakpoint\n\t\t\t\t\t{\n\t\t\t\t\t\tm_requestResume = false;\n\t\t\t\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tm_session.stepContinue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(NoResponseException nre)\n\t\t{\n\t\t\tif (count > 0)\n\t\t\t{\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"count\", Integer.toString(count)); //$NON-NLS-1$\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"abortingStep\", args)); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\n\t\tm_repeatLine = m_currentLine;\n\t}",
"public void loop(int n) {\n\t\t// let's get it cued before we muck with any of our state vars.\n\t\tsetMillisecondPosition(loopBegin);\n\t\tloop = true;\n\t\tnumLoops = n;\n\t\tplay = true;\n\t\tline.start();\n\t\t// will wake up our data processing thread.\n\t\t// iothread.interrupt();\n\t}",
"public void tick(final int n) {\n\t\tValidate.isTrue(n > 0, String.format(\"The given tick count %d must be positive\", n));\n\n\t\tif (isStarted()) {\n\t\t\tthrow new IllegalStateException(\"The clock is started\");\n\t\t}\n\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(String.format(\"Ticking %d time(s) ...\", n));\n\t\t}\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\t_tick();\n\t\t}\n\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(String.format(\"Ticked %d time(s)\", n));\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tint nDisks=3;\r\n\t\tString steps=hanoi(nDisks,1,3);\r\n\t\t\r\n\t\tfor(String step:steps.split(\";\")){\r\n\t\t\tSystem.out.println(step);\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint jump= jumpSteps(5);\n\t\tSystem.out.println(\"Total possible jumps: \"+jump);\n\t\t\n\t}",
"protected void execute() {\n \tRobot.driveSubsystem.runLeftSide(howFastWeWantToMove);\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"The moves are: \");\r\n\t\tmoveDisks(5,'A','B','C');\r\n\t\tSystem.out.println(\"Count: \"+count);\r\n\t}",
"public void act() {\n\t\tif (canMove()) {\n\t\t\tif (isOnBase()) {\n\t\t\t\tif (steps < baseSteps) {\n\t\t\t\t\tmove();\n\t\t\t\t\tsteps++;\n\t\t\t\t} else {\n\t\t\t\t\tturn();\n\t\t\t\t\tturn();\n\t\t\t\t\tturn();\n\t\t\t\t\tsteps = 0;\n\t\t\t\t}\n\t\t\t} else if (steps == baseSteps / 2) {\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tsteps++;\n\t\t\t} else if (steps == baseSteps + 1) {\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tturn();\n\t\t\t\tsteps = 0;\n\t\t\t} else {\n\t\t\t\tmove();\n\t\t\t\tsteps++;\n\t\t\t}\n\t\t} else {\n\t\t\tturn();\n\t\t\tturn();\n\t\t\tturn();\n\t\t\tsteps = 0;\n\t\t}\n\t}",
"public static void enumerate(int n) {\n int[] a = new int[n];\n enumerate(a, 0);\n }",
"void Step(String step);",
"void doStep() throws PlayerDebugException\n\t{\n\t\twaitTilHalted();\n\n\t\tif (!allowedToStep())\n\t\t\treturn;\n\t\t\n\t\tint count = 1;\n\t\tif (hasMoreTokens())\n\t\t\tcount = nextIntToken();\n\n\t\twhile(count-- > 0)\n\t\t{\n\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t{\n\t\t\t\t\tm_session.stepInto();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\tdumpStep();\n\n\t\t\t\tif (m_requestResume) // perhaps we hit a conditional breakpoint\n\t\t\t\t{\n\t\t\t\t\tm_requestResume = false;\n\t\t\t\t\tstepWithTimeout(new AnyKindOfStep() {\n\t\t\t\t\t\tpublic void step() throws PlayerDebugException\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tm_session.stepContinue();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tm_repeatLine = m_currentLine;\n\t}",
"@Override\n public void print(int n) {\n for (int i = 0; i < n; i++) {\n System.out.print(' ');\n }\n System.out.print(\" #{Built-in Procedure \");\n symbol.print(0);\n for (int i = 0; i < n; i++) {\n System.out.print(' ');\n }\n System.out.print('}');\n System.out.println();\n }",
"private void generateActions(double[] move) {\n //Rotate Actions\n for (int i = 0; i <= move[0]; i++) {\n GameAction act1 = new LabyrinthRotateAction(this,true);\n this.push(act1);\n }\n\n //Slide Action\n GameAction act2 = new LabyrinthSlideTileAction(this,\n Arrow.values()[(int)move[1]]);\n this.push(act2);\n\n //Move Action\n GameAction act3 = new LabyrinthMovePawnAction(this,\n (int)move[2],(int)move[3]);\n this.push(act3);\n\n //End Turn Action\n GameAction act4 = new LabyrinthEndTurnAction(this);\n this.push(act4);\n }",
"protected abstract void stepImpl( long stepMicros );",
"private void executeActions (Action action, Player joueur) {\n WarPlayer player = this.castPlayer(joueur);\n super.roundSteps(action, player, player.getFood());\n this.transformResources(player);\n this.feedArmies(player);\n }",
"public static void main(String[] args) {\n BigInteger count1 = hanoiIteration(5);\r\n\r\n BigInteger count2 = hanoiIteration(64);\r\n// System.out.println(count);\r\n System.out.println(count1);\r\n System.out.println(count2);\r\n\r\n System.out.println(showStep2(5, \"A\", \"B\", \"C\"));\r\n }",
"public interface NexialCommand {\n\n /** called by Nexial when plugin is initialized to provide context */\n void init(@NotNull ExecutionContext context);\n\n ExecutionContext getContext();\n\n /** invoked by Nexial when shutting down; no guarantee of shutdown sequence */\n void destroy();\n\n String getTarget();\n\n /**\n * a \"profile\" allows multiple instances of the same command to reside in context so that they can be swapped\n * during execution to serve specific target.\n */\n String getProfile();\n\n void setProfile(String profile);\n\n boolean isValidCommand(String command, String... params);\n\n StepResult execute(String command, String... params) throws InvocationTargetException, IllegalAccessException;\n}",
"public static void main(String[] args) {\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tint instructionsLength = Integer.parseInt(scanner.nextLine());\r\n\t\tList<List<String>> instructions = new ArrayList<>();\r\n\t\t\r\n\t\tfor (int i = 0; i < instructionsLength; i++) {\r\n\t\t\tinstructions.add(splitWords(scanner.nextLine()));\r\n\t\t}\r\n\t\t\r\n\t\tscanner.close();\r\n\t\tList<String> res = simulateCallCenter(instructions);\r\n\t\t\r\n\t\tfor (String line : res) {\r\n\t\t\tSystem.out.println(line);\r\n\t\t}\r\n\t}",
"public static void enumerate(int n) {\n\t\tint[] a = new int[n];\n\t\tenumerate(a, 0);\n\t}",
"public static void main(String[] args) {\r\n\t\tRobot tl = new Robot(250, 250);\r\n\t\tRobot tm = new Robot(650, 250);\r\n\t\tRobot tr = new Robot(1050, 250);\r\n\t\tRobot bl = new Robot(450, 450);\r\n\t\tRobot br = new Robot(850, 450);\r\n\t\r\n\t\ttl.setSpeed(100);\r\n\t\ttm.setSpeed(100);\r\n\t\ttr.setSpeed(100);\r\n\t\tbl.setSpeed(100);\r\n\t\tbr.setSpeed(100);\r\n\t\t\r\n\t\ttl.setPenColor(Color.blue);\r\n\t\ttm.setPenColor(Color.black);\r\n\t\ttr.setPenColor(Color.red);\r\n\t\tbl.setPenColor(Color.yellow);\r\n\t\tbr.setPenColor(Color.green);\r\n\t\t\r\n\t\ttl.setPenWidth(3);\r\n\t\ttm.setPenWidth(3);\r\n\t\ttr.setPenWidth(3);\r\n\t\tbl.setPenWidth(3);\r\n\t\tbr.setPenWidth(3);\r\n\t\r\n\t\ttl.penDown();\r\n\t\ttm.penDown();\r\n\t\ttr.penDown();\r\n\t\tbl.penDown();\r\n\t\tbr.penDown();\r\n\t\t\r\n\t\tThread r1 = new Thread(()->tl.move(3));\r\n\t\tThread r2 = new Thread(()->tm.move(3));\r\n\t\tThread r3 = new Thread(()->tr.move(3));\r\n\t\tThread r4 = new Thread(()->bl.move(3));\r\n\t\tThread r5 = new Thread(()->br.move(3));\r\n\t\t\r\n\t\tThread t1 = new Thread(()->tl.turn(1));\r\n\t\tThread t2 = new Thread(()->tm.turn(1));\r\n\t\tThread t3 = new Thread(()->tr.turn(1));\r\n\t\tThread t4 = new Thread(()->bl.turn(1));\r\n\t\tThread t5 = new Thread(()->br.turn(1));\r\n\t\t\r\n\t\tfor(int i=0;i<360;i++) {\r\n\t\t\tr1.run();\r\n\t\t\tr2.run();\r\n\t\t\tr3.run();\r\n\t\t\tr4.run();\r\n\t\t\tr5.run();\r\n\t\t\t\r\n\t\t\tt1.run();\r\n\t\t\tt2.run();\r\n\t\t\tt3.run();\r\n\t\t\tt4.run();\r\n\t\t\tt5.run();\r\n\t\t}\r\n\t\t\r\n\t\ttl.penUp();\r\n\t\ttm.penUp();\r\n\t\ttr.penUp();\r\n\t\tbl.penUp();\r\n\t\tbr.penUp();\r\n\t\t\r\n\t\tThread l1 = new Thread(()->tl.move(2000));\r\n\t\tThread l2 = new Thread(()->tm.move(2000));\r\n\t\tThread l3 = new Thread(()->tr.move(2000));\r\n\t\tThread l4 = new Thread(()->bl.move(2000));\r\n\t\tThread l5 = new Thread(()->br.move(2000));\r\n\t\t\r\n\t\tl1.run();\r\n\t\tl2.run();\r\n\t\tl3.run();\r\n\t\tl4.run();\r\n\t\tl5.run();\r\n\t}",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter n: \");\n int n = input.nextInt();\n printMatrix(n);\n }",
"public static void main(String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(br.readLine());\n n = Integer.parseInt(st.nextToken());\n k = Integer.parseInt(st.nextToken());\n belt = new int[2 * n + 1];\n visit = new boolean[2 * n + 1];\n st = new StringTokenizer(br.readLine());\n for (int i = 1; i <= 2 * n; i++)\n belt[i] = Integer.parseInt(st.nextToken());\n\n int answer = 0;\n start = 1;\n end = n;\n while (cnt < k) {\n answer++;\n move_belt();\n move_robot();\n make_robot();\n }\n System.out.println(answer);\n }",
"@Override\r\n\tpublic void execute() {\n\t\tfor (int i = 0; i < command.length; i++) {\r\n\t\t\tcommand[i].execute();\r\n\t\t}\r\n\t}",
"public void takeStep() {\n \t//System.out.println(\"\"+Math.abs(rmd.nextInt()%4));\n \tswitch(rmd.nextInt(4)){\t\n \tcase 0:\n \t\tcurPoint = curPoint.translate(-stepSize, 0);//go right\n \t\tbreak;\n \tcase 1:\n \t\tcurPoint = curPoint.translate(0, stepSize);//go down\n \t\tbreak;\n \tcase 2:\n \t\tcurPoint = curPoint.translate(stepSize, 0);//go left\n \t\tbreak;\n \tcase 3:\n \t\tcurPoint = curPoint.translate(0, -stepSize);//go up\n \t\tbreak;\n \t}\n }",
"public void step (double dt){ \r\n setValues();\r\n //Do Step \r\n int steps=(int)dt;\r\n for (int i=0;i<steps;i++)\r\n eval(commandUpdate); \r\n getValues(); \r\n }",
"public static void main(String[] args) {\n\t\tint t;//test case\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tt = scan.nextInt();\n\t\t\n\t\tfor(int i = 0;i < t;i++){\n\t\t\tint n = scan.nextInt();\n\t\t\tint memo[] = new int[n + 1];\n\t\t\t\n\t\t\tSystem.out.println(go(memo, n));\n\t\t}\n\t\t\n\t\tscan.close();\n\t}",
"@Override\n\t\t\tpublic void execute() {\n\t\t\t\tSystem.out.println(fib1(n));\n\t\t\t}",
"public abstract void timeStep(char currCommand, World world);",
"public static void runSimulation(int n, int s, int t) {\n\t\tif(n<=0||s<2||t<0) {\n\t\t\tSystem.out.println(\"n=\"+n+\" s=\"+s+\" t=\"+t);\n\t\t\tSystem.out.println(\"Illegal Parameters!\");\n\t\t\treturn;\n\t\t}\n\t\t//constant for victory\n\t\tboolean cat = false;\n\t\t\n\t\t// Initial positions of pray and predator\n\t\tRandom rand = new Random();\n\t\tPoint pray = new Point (rand.nextInt(n-1),rand.nextInt(n-1));\n\t\tPoint predator = new Point (rand.nextInt(n-1),rand.nextInt(n-1));\n\t\t\n\t\t//Show positions before simulation\n\t\tSystem.out.println(\"n=\"+n+\" s=\"+s+\" t=\"+t);\n\t\t//System.out.println(\"\");\n\t\tSystem.out.println(\"[\"+pray.x+\";\"+pray.y+\"]\"+\"\"+\"[\"+predator.x+\";\"+predator.y+\"]\");\n\t\t//System.out.println(\"\");\n\t\tif(pray.x==predator.x&&pray.y==predator.y) {\n\t\t\tSystem.out.println(\"Catch!\");\n\t\t\treturn;\n\t\t}\n\t\tint i = 0;\n\t\twhile (i < t && cat == false) {\n\t\t//Pray and Predator positions are updated\n\t\tint [] curPray=positionUpdate(pray,n,s);\n\t\tpray.x=curPray[0];\n\t\tpray.y=curPray[1];\n\t\tint [] curPred=positionUpdate_predator(pray, predator,s,n);\n\t\tpredator.x=curPred[0];\n\t\tpredator.y=curPred[1];\n\t\t\n\t\tSystem.out.println(\"[\"+pray.x+\";\"+pray.y+\"]\"+\"\"+\"[\"+predator.x+\";\"+predator.y+\"]\");\n\t\t//System.out.println(\"\");\n\t\t\n\t\t//Checks if pray has been caught\n\t\tif (curPred[0]==curPray[0]&&curPred[1]==curPray[1]) {\n\t\t\tSystem.out.println(\"Catch!\");\n\t\t\tcat = true;\n\t\t\t}\n\t\ti++;\n\t\t}\n\t\t//checks if predator failed\n\t\tif(cat==false) {\n\t\t\tSystem.out.println(\"Failure!\");\n\t\t}\n\t}",
"public int stepthrough(int i) {\r\n\t\tswitch(sim40.memory[i]) {\r\n\r\n\t\t/* stop */\r\n\t\tcase 0: this.isProgramTerminated = true; \r\n\t\treturn i;\r\n\r\n\t\t/* print, printb, printch */\r\n\t\tcase 1: case 2: case 3: \r\n\t\t\tthis.stdStream.getOutput().add(result(i));\r\n\t\t\t++i;\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\t/* jump, comp, xcomp, ycomp, jineg, jipos, jizero, jicarry */\r\n\t\t\tif(sim40.memory[i] >= 19 && sim40.memory[i] <= 26)\r\n\t\t\t\ti = compareExecute(i);\r\n\r\n\t\t\telse if(sim40.memory[i] >= 4 && sim40.memory[i] <= 9) \r\n\t\t\t\ti = unaryExecute(i);\r\n\r\n\t\t\telse \r\n\t\t\t\ti = binaryExecute(i);\t\t\r\n\r\n\t\t}\r\n\t\t\r\n\t\tcheckResetAllRegsAndFlags();\r\n\t\tsim40.updateViewVars();\r\n\t\tsim40.memory[Simulator.PROGRAM_COUNTER] = i;\r\n\r\n\t\treturn i;\r\n\t}",
"public void doCommands(ChessBoard board){\n\t\tfor(LiftPlaceCommand command : liftCommandSequence)\n\t\t\tcommand.performLift(board);\n\t\tfor(LiftPlaceCommand command : placeCommandSequence)\n\t\t\tcommand.performPlace(board);\n\t\tperformingPiece.incrementMovesMade();\n\t}",
"protected void execute() {\n \tRobot.telemetry.setAutonomousStatus(\"Running \" + commandName + \": \" + distance);\n \tRobot.drivetrain.arcadeDrive(Robot.driveDistancePID.getOutput(), 0.0, false);\n }",
"public void run() throws IOException {\n String EXIT_COMMAND = \"7\";\n ui.printIntro();\n ui.printExeType();\n String exeCommand = ui.getStringInput();\n while (!exeCommand.equals(EXIT_COMMAND)) {\n Parser parser = new Parser(ui, tasks);\n parser.parseCommand(exeCommand); //to select the exeType and execute it\n ui.printExeType(); //user guide after execution of command\n exeCommand = ui.getStringInput(); //get the next command\n }\n ui.printExit();\n }",
"public void run(int i) {\r\n\t\twhile(sim40.memory[i] != -1) {\t\r\n\t\t\tswitch(sim40.memory[i]) {\r\n\r\n\t\t\t/* stop */\r\n\t\t\tcase 0: return;\r\n\r\n\t\t\t/* print, printb, printch */\r\n\t\t\tcase 1: case 2: case 3: \r\n\t\t\t\tthis.stdStream.getOutput().add(result(i));\r\n\t\t\t\t++i;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t/* jump, comp, xcomp, ycomp, jineg, jipos, jizero, jicarry */\r\n\t\t\t\tif(sim40.memory[i] >= 19 && sim40.memory[i] <= 26)\r\n\t\t\t\t\ti = compareExecute(i);\r\n\r\n\t\t\t\telse if(sim40.memory[i] >= 4 && sim40.memory[i] <= 9) \r\n\t\t\t\t\ti = unaryExecute(i);\r\n\r\n\t\t\t\telse \r\n\t\t\t\t\ti = binaryExecute(i);\t\t\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcheckResetAllRegsAndFlags();\r\n\t\t\tsim40.updateViewVars();\r\n\t\t\tsim40.memory[Simulator.PROGRAM_COUNTER] = i;\r\n\t\t}\r\n\r\n\t}",
"private static void sleep(int n) {\n try {\n TimeUnit.MILLISECONDS.sleep(n);\n } catch (InterruptedException e) {\n System.out.print(\"\\ndelay failed\");\n }\n }",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tLexicoCountingModi(0,n);\n\n\t}",
"public void executegenmoves() {\n \t\tObject state = gm.hashToState(new BigInteger(conf.getProperty(\"gamesman.hash\")));\n \t\tfor (Object nextstate : gm.validMoves(state)) {\n \t\t\tSystem.out.println(gm.stateToHash(nextstate));\n \t\t\tSystem.out.println(gm.displayState(nextstate));\n \t\t}\n \t}",
"public void createCards(int n) {\n mController.createCards(n);\n }",
"int stepsToGo();",
"public void doNextCommand(String line){\n tokenizer = new Tokenizer(line);\n currentPlayer = checkPlayer(line);\n currentLocation = currentPlayer.getPlayerLocation();\n results = new ArrayList<String>();\n int cmdCnt = 0;\n if(tokenizer.myContainsLower(\"look\")){\n doLook();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"goto\")){\n if(doGoTo()) {\n doLook();\n }\n cmdCnt++;\n }\n if (tokenizer.myContainsLower(\"get\")){\n doGet();\n cmdCnt++;\n }\n if (tokenizer.myContainsLower(\"drop\")) {\n doDrop();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"inv\") || tokenizer.myContains(\"inventory\")){\n doInv();\n cmdCnt++;\n }\n if(tokenizer.myContainsLower(\"health\")){\n results.add(\"Your current level of health is: \" + currentPlayer.getHealth());\n cmdCnt++;\n }\n if(checkForAction()){\n cmdCnt++;\n }\n if(cmdCnt != 1) {\n results = new ArrayList<String>();\n results.add(\"Invalid command.\");\n return;\n }\n currentPlayer.setCurrentLocation(currentLocation);\n checkPlayerHealth();\n }",
"public String nextStep();",
"public void executeSimulation() {\n\t\twhile(!world.isFinished()) { //Execute the world while the command is not exit\n\t\t\tSystem.out.println(\"Command > \");\n\t\t\tString str = in.nextLine();\n\t\t\tstr.toLowerCase();\n\t\t\t\n\t\t\tString[] inputWords = str.split(\" \");\n\t\t\tCommand command = CommandParser.parseCommand(inputWords);\n\t\t\t\n\t\t\tif (command != null) {\n\t\t\t\tcommand.execute(this.world);\n\t\t\t}\n\t\t\telse \n\t\t\t\tSystem.err.println(\"Invalid command! Please, type 'help' to know the commands availables.\\n\");\n\t\t}\n\t}",
"public void setSteps(int steps) {\n\t\tthis.steps = steps;\n\t}",
"public static void move()\n\t{\n\t\tswitch(step)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 1;\n\t\t\tbreak;\n\t\t\t// 1. Right wheels forward\n\t\t\tcase 1:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, .5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 2;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 3;\n\t\t\tbreak;\n\t\t\t// 2. Right wheels back\n\t\t\tcase 3:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, -.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 4;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 5;\n\t\t\tbreak;\n\t\t\t// 3. Left wheels forward\n\t\t\tcase 5:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 6;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 7;\n\t\t\tbreak;\n\t\t\t// 4. Left wheels back\n\t\t\tcase 7:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(-.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 8;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 9;\n\t\t\tbreak;\n\t\t\t// 5. Intake pick up\n\t\t\tcase 9:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tshoot(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 10;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 11;\n\t\t\tbreak;\n\t\t\t// 6. Intake shoot\n\t\t\tcase 11:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tpickUp(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 12;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t// Stop and reset everything\n\t\t\tcase 12:\n\t\t\t\tsetSpeed(0, 0);\n\t\t\t\tpickUp(0);\n\t\t\t\tshoot(0);\n\t\t\t\ttimer.reset();\n\t\t\tbreak;\n\t\t}\n\t}",
"protected void execute() { \n\n double move = driveCommand.getValue();\n double turn = angleCommand.getValue();\n\n SmartDashboard.putNumber(\"move\", move);\n SmartDashboard.putNumber(\"turn\", turn);\n //add the values to the drive class\n Robot.drive.arcadeDrive(-move, turn);\n // Robot.drive.setMoveVisionAssist(move);\n // Robot.drive.setTurnVisionAssist(turn);\n }",
"public static String moveNextLine(int n) {\n return CSI + n + \"E\";\n }",
"protected void execute() {\n \tswitch (auto) {\n \tcase RightRightRight:\n \t\tRightRightRight();\n \t\tbreak;\n \tcase RightRightLeft:\n \t\tRightRightLeft();\n \t\tbreak;\n \tcase RightLeftRight:\n \t\tRightLeftRight();\n \t\tbreak;\n \tcase RightLeftLeft:\n \t\tRightLeftLeft();\n \t\tbreak;\n \tcase LeftRightRight:\n \t\tLeftRightRight();\n \t\tbreak;\n \tcase LeftRightLeft:\n \t\tLeftRightLeft();\n \t\tbreak;\n \tcase LeftLeftRight:\n \t\tLeftLeftRight();\n \t\tbreak;\n\t\tcase LeftLeftLeft:\n\t\t\tLeftLeftLeft();\n\t\t\tbreak;\n\t\t}\n \t\n\t\t//Robot.drivebase.DriveTank(1, 1);\n\t\t//new drivecar(1, 1, 5);\n \t\n }",
"public String args(int n)\r\n {\r\n if (n >= 0 && n < numArgs)\r\n return args[n];\r\n else\r\n return null;\r\n }",
"public void step() {\n\t\tint step = rand.nextInt(2);\n\t\t\n\t\tif (step==0) {\n\t\t\t\n\t\t\tPoint moveRight = new Point(++x,y);\n\t\t\t\n\t\t\tif(x<=size-1) {\n\t\t\t\tpath.add(moveRight);\n\t\t\t}\n\t\t\telse --x;\n\t\t}\n\t\telse { \n\t\t\tPoint topStep = new Point(x,--y);\n\t\t\t\n\t\t\tif(y>=0) {\n\t\t\t\tpath.add(topStep);\n\t\t\t}\n\t\t\telse ++y;\n\t\t}\n\t\tif (x==size-1 && y==0) {\n\t\t\tsetDone(true);\n\t\t}\n\t\t\n\t\t\n\t}",
"private void simulate() throws Exception {\r\n\t\t// Retrieve instructions from an input file\r\n\t\tList<String> instructions = SimulationUtils.retrieveInstructionsFromFile(\r\n\t\t\t\t\t\t\t\t\t\t\tConfigUtils.getInstance().getInstructionInputFilePath());\t\t\r\n\t\t\r\n\t\t// Initialise the ToyRobot with TableSurface information\r\n\t\tToyRobot robot = new ToyRobot(new TableSurface());\r\n\t\tCommandController controller = new CommandController();\r\n\t\t\r\n\t\t// Set up a new instruction decoder with details about\r\n\t\t// the text instructions, the robot and the command controller.\t\t\r\n\t\t// The decoder parses the instructions into commands for the robot\r\n\t\t// and registers them with the command controller for execution\r\n\t\t// (\"client\" in the COMMAND pattern).\r\n\t\tnew TextInstructionDecoder(instructions, controller, robot).decodeAndRegister();\r\n\t\t\r\n\t\t// The command controller triggers the seamless execution of the commands\r\n\t\t// (\"invoker\" in the COMMAND pattern).\r\n\t\tcontroller.executeCommands();\r\n\t}",
"public static void main(String[] args) throws Exception, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine().trim());\n\t\tString[] line = br.readLine().split(\" \");\n\t\tfor(int i=0;i<n;i++) {\n\t\t\t\n\t\t}\n\t}",
"public void takeStep()\n {\n int direction = random.nextInt(4);\n switch (direction) {\n case 0:\n /* Up */\n y += 1;\n break;\n case 1:\n /* Down */\n y -= 1;\n break;\n case 2:\n /* Right */\n x += 1;\n break;\n case 3:\n /* Left */\n x -= 1;\n break;\n }\n\n stepsTaken++;\n }",
"private static void moveAndPickAllThings(Robot r, int x)\n {\n for(int i=0; i<x; i++)\n {\n r.move();\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }\n \n }",
"public static void main(final String[] args) {\n int n = 3;\n System.out.println(\"Value from f1 is: \" + f1(n)); \n System.out.println(\"Value from f2 is: \" + f2(n));\n System.out.println(\"Value from f3 is: \" + f3(n));\n System.out.println(\"Value from f4 is: \" + f4(n));\n System.out.println(\"Value from f5 is: \" + f5(n));\n System.out.println(\"Value from f6 is: \" + f6(n));\n System.out.println(\"Value from f7 is: \" + f7(n));\n }",
"public int tripleStep(int n) {\n int result = compute(n);\n return result;\n }",
"@Override\n public void timePassed() {\n moveOneStep();\n }",
"private void doStep() {\n // Add some variables to increase readability.\n int left = RotorPosition.LEFT.ordinal();\n int middle = RotorPosition.MIDDLE.ordinal();\n int right = RotorPosition.RIGHT.ordinal();\n\n //TODO see if this method can be optimized at all\n if (rotors[right].isAtTurnoverPosition()) {\n // Normal stepping.\n if (rotors[middle].isAtTurnoverPosition()) {\n if (rotors[left].isAtTurnoverPosition()) {\n reflector.doStep();\n }\n rotors[left].doStep();\n }\n rotors[middle].doStep();\n } else {\n // Handle the double stepping anomaly.\n if (rotors[middle].isAtTurnoverPosition() && rotors[middle].justStepped()) {\n rotors[left].doStep();\n rotors[middle].doStep();\n }\n }\n rotors[right].doStep();\n }",
"@Override\n public void execute() \n {\n if(mCount<mPath.kNumPoints)\n {\n Robot.mDrive.AutoDrive(\n mPath.kSpeed,\n mPath.kPoints[mCount][0],\n mPath.kPoints[mCount][1],\n mPath.kPoints[mCount][2],\n mLogFile);\n }\n mCount++;\n }",
"public void move() {\n process(2);\n }",
"public static void main(String[] args) {\n\n\t\tRobot gumi = new Robot();\n\n\t\t\t// 4. Make the robot move as fast as possible\n\t\t\tgumi.setSpeed(1000);\n\n\t\t\t// 5. Set the pen width to 5\n\t\t\tgumi.setPenWidth(5);\n\t\t\tgumi.penDown();\n\n\t\t\t// 6. Use a for loop to repeat steps #7 to #8, four times...\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\t\n\n\t\t\t\t// 7. Set the pen color to random\n\t\t\tgumi.setRandomPenColor();\n\t\t\n\t\t\t\t// 1. Call the drawSquare() method\n\t\t\tdrawSquare(gumi);\n\t\t\n\t\t\t\t// 8. Turn the robot 90 degrees to the right\n\t\t\tgumi.turn(90);\n\t\t}\n\n}",
"void start() {\n \tm_e.step(); // 1, 3\n }"
] | [
"0.6449712",
"0.58983773",
"0.5816195",
"0.57804894",
"0.5658462",
"0.5609459",
"0.5425236",
"0.5375769",
"0.53358996",
"0.529257",
"0.529257",
"0.5292459",
"0.52820677",
"0.52743214",
"0.52676123",
"0.526392",
"0.5206441",
"0.51616925",
"0.51472825",
"0.50867814",
"0.5084399",
"0.50757164",
"0.5051369",
"0.50280166",
"0.5014502",
"0.49834198",
"0.49784714",
"0.49707472",
"0.4968654",
"0.49679986",
"0.49581385",
"0.49478754",
"0.49408132",
"0.4924111",
"0.49145654",
"0.49134004",
"0.49098504",
"0.48953894",
"0.48846078",
"0.48742375",
"0.4873014",
"0.48699883",
"0.48467427",
"0.48451075",
"0.48449954",
"0.48192173",
"0.47887775",
"0.47868413",
"0.47825524",
"0.47573072",
"0.474527",
"0.4738632",
"0.47228596",
"0.47204798",
"0.47100455",
"0.47049075",
"0.46919402",
"0.46802175",
"0.46750927",
"0.46677732",
"0.46593106",
"0.46581823",
"0.46532634",
"0.46387228",
"0.46303758",
"0.4622575",
"0.46206474",
"0.46159065",
"0.45953545",
"0.45914736",
"0.45863897",
"0.45858556",
"0.4585214",
"0.45810014",
"0.4578795",
"0.4577635",
"0.45767534",
"0.45725402",
"0.4570342",
"0.45681995",
"0.45631987",
"0.45593014",
"0.45535278",
"0.4546344",
"0.45414808",
"0.4537813",
"0.45344046",
"0.45314637",
"0.4525314",
"0.45252165",
"0.45226675",
"0.4522279",
"0.45196468",
"0.4516705",
"0.45124474",
"0.45114958",
"0.4509106",
"0.4503204",
"0.45031106",
"0.45024568"
] | 0.7691127 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
SessionFactory factory = UtilesHibernate.getSessionfactory();
Session sesion = factory.getCurrentSession();
sesion.beginTransaction();
Cancion cancion = sesion.get(Cancion.class,1);
Club club = sesion.get(Club.class,1);
System.out.println(club.getNombre());
sesion.getTransaction().commit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int getCount() {
return listInfo.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Object getItem(int index) {
return listInfo.get(index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public long getItemId(int index) {
return index;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
final ScorePointsItemInfo itemInfo = listInfo.get(position);
if(convertView == null || convertView.getTag() == null){
convertView = inflater.inflate(R.layout.list_item_score_potions,null);
holder = new ViewHolder();
holder.numView = (TextView)convertView.findViewById(R.id.qt_question_num);
convertView.setTag(holder);
}else{
holder = (ViewHolder)convertView.getTag();
}
holder.numView.setText(itemInfo.score);
holder.numView.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
itemClickListener.Callback(itemInfo);
}
});
return convertView;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.