translate these 2 classes from java to python
note the timegate class is a bit different than the one you've already translated
package LG_Core;
import java.util.Calendar;
import java.util.Date;
public class TimeGate {
// a gate that only opens x minutes after it has been set
private...
translate from java to python
package LG_Core;
public class Permission {
/*
* uses two names as lv1,2 permission levels
* requires password to change password or said names
*/
private static Permission singleton;
private String password, lv1Name, lv2Name;
private...
Personality
//the chobit class uses the personality class to load up all the skills
package LG_Core;
import java.util.ArrayList;
import java.util.Hashtable;
public class Personality {
/*this class is used in the ChobitV2 c'tor.
it enables loading a complete skill set (a sub class of the...
translate from java to python :
Fusion class :
package LG_Core;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.PriorityQueue;
public class Fusion {
/*
* fuses algorithms and sends needed algorithm to a designated cerabellum
*...
PID = P + I + D
err = setpoint-processValue
P = K(err)
reset = reset + k/tau_i*err
I = reset //once err changes direction or zero reset =0
D = K/tau_i*(error-lastError); lastErr = err;
K : gain : this is twicked
K/tau_i : can also be twicled for optimal performance
tau_i : second per repeat...
''' --------------- ZEROTIMEGATE --------------- '''
import time
import datetime
from datetime import timedelta
''' ZEROTIMEGATE CLASS '''
class ZeroTimeGate:
# a gate that only opens x minutes after it has been set
def __init__(self, minutes) -> None:
self.pause = 1...
public void open(int minutes) {
Date now = new Date();
openedGate = addMinutesToJavaUtilDate(now, minutes);
}
in java it is an inferred this actually
so the program reads it as
public void open(int minutes) {
Date now = new Date();
this.openedGate =...
continue work from this code as many errors were modified :
use explicit variables
see line 226
numberRegex("hello-789.998world")) # err : doesn't return decimal value (should be -789.998)
print("The regexChecker2 method should return ?: ",
regex.regexChecker2(r"[-+]?[0-9]{1,13}"...