This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PUSH1 0x80 | |
| PUSH1 0x40 | |
| MSTORE | |
| CALLVALUE | |
| DUP1 | |
| ISZERO | |
| PUSH2 0x0010 | |
| JUMPI | |
| PUSH1 0x00 | |
| DUP1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # complete particle filter | |
| # Anuj Bansal | |
| # | |
| # -------------- | |
| # USER INSTRUCTIONS | |
| # | |
| # Now you will put everything together. | |
| # | |
| # First make sure that your sense and move functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A program that will iteratively update and | |
| # predict based on the location measurements | |
| # and inferred motions shown below. | |
| def update(mean1, var1, mean2, var2): | |
| new_mean = float(var2 * mean1 + var1 * mean2) / (var1 + var2) | |
| new_var = 1./(1./var1 + 1./var2) | |
| return [new_mean, new_var] | |
| def predict(mean1, var1, mean2, var2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The function localize takes the following arguments: | |
| # | |
| # colors: | |
| # 2D list, each entry either 'R' (for red cell) or 'G' (for green cell) | |
| # | |
| # measurements: | |
| # list of measurements taken by the robot, each entry either 'R' or 'G' | |
| # | |
| # motions: | |
| # list of actions taken by the robot, each entry of the form [dy,dx], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Oct 12 19:42:55 2015 | |
| @author: user | |
| """ | |
| import os | |
| import sys | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import random | |
| import math | |
| from sklearn.naive_bayes import GaussianNB | |
| def loadCsv(filename): | |
| lines = csv.reader(open(filename,'rb')) | |
| dataset = list(lines) | |
| for i in range(len(dataset)): | |
| dataset[i] = [float(x) for x in dataset[i]] |