Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int fLoad(){
- int n=0, c=0, fLoad;
- while( Psize-Integer.parseInt(iw.get(4)[2].trim())+n < Psize){
- for(int a=0; a<Rsize; a++){
- List tm = (List)tt[a][Psize-Integer.parseInt(iw.get(4)[2].trim())+n];
- if(tm==null){
- }
- else{
- for (int l = 0; l < tm.size(); l++) {
- if(bb.get((int)tm.get(l)).length-1 >= LE[Integer.parseInt(iw.get(4)[1].trim())-1][1]){
- c+=1;
- }
- }
- }
- }
- n++;
- }
- fLoad=Integer.parseInt(iw.get(4)[3].trim())*c;
- System.out.println("Front Load: "+fLoad);
- return fLoad;
- }
- public int md(){
- int c=0, md;
- for(int x = 0; x < Rsize ;x++){
- for(int y = 0; y < Psize ;y++){
- List templist = (List)tt[x][y];
- if (templist==null){
- }
- else{
- if(templist.size()>1){
- for(int i=1;i<templist.size();i++){
- for(int j=0;j<i;j++){
- if(Integer.parseInt(bb.get((int)templist.get(i))[0].trim())!= Integer.parseInt(bb.get((int)templist.get(j))[0].trim())){
- if(j==i-1){
- c+=1;
- }
- }
- }
- }
- }
- }
- }
- }
- md=Integer.parseInt(iw.get(3)[1].trim())*c;
- System.out.println("Mixed Durations: "+md);
- return md;
- }
- public int tir(){
- int c=0, tir;
- String[] periodDate = new String[p.size()];
- for (int i = 0; i < p.size(); i++) {
- periodDate[i] = p.get(i)[0].trim();
- }
- for (int y = 0; y < Psize; y++) {
- List<Integer> col1 = new ArrayList<>();
- List<Integer> col2 = new ArrayList<>();
- if (y != Psize-1) {
- if (periodDate[y].equals(periodDate[y + 1])) {
- for (int x = 0; x < Rsize; x++) {
- if (tt[x][y] != null) {
- List templist = (List) tt[x][y];
- for (int j = 0; j < templist.size(); j++) {
- col1.add((int) templist.get(j));
- }
- }
- if (tt[x][y + 1] != null) {
- List templist2 = (List) tt[x][y + 1];
- for (int j = 0; j < templist2.size(); j++) {
- col2.add((int) templist2.get(j));
- }
- }
- }
- }
- }
- for (int i = 0; i < col1.size(); i++) {
- for (int j = 0; j < col2.size(); j++) {
- c += Integer.parseInt(aa.get(col1.get(i))[col2.get(j)].trim());
- }
- }
- }
- tir=Integer.parseInt(iw.get(0)[1].trim())*c;
- System.out.println("Two in a Row: "+tir);
- return tir;
- }
- public int tid(){
- int c=0, n=0, total, tid;
- String[] periodDate = new String[p.size()];
- for (int i = 0; i < p.size(); i++) {
- periodDate[i] = p.get(i)[0].trim();
- }
- for (int y = 0; y < Psize; y++) {
- List<Integer> col1 = new ArrayList<>();
- List<Integer> col2 = new ArrayList<>();
- List<Integer> col3 = new ArrayList<>();
- if (y <= Psize - 4) {
- if (periodDate[y].equals(periodDate[y + 2])) {
- for (int x = 0; x < Rsize; x++) {
- if (tt[x][y] != null) {
- List templist = (List) tt[x][y];
- for (int j = 0; j < templist.size(); j++) {
- col1.add((int) templist.get(j));
- }
- }
- if (tt[x][y+2] != null) {
- List templist2 = (List) tt[x][y + 2];
- for (int j = 0; j < templist2.size(); j++) {
- col2.add((int) templist2.get(j));
- }
- }
- }
- for (int i = 0; i < col1.size(); i++) {
- for (int j = 0; j < col2.size(); j++) {
- c += Integer.parseInt(aa.get(col1.get(i))[col2.get(j)].trim());
- }
- }
- }
- if (periodDate[y].equals(periodDate[y + 3])) {
- for (int x = 0; x < Rsize; x++) {
- if (tt[x][y+3] != null) {
- List templist3 = (List) tt[x][y + 3];
- for (int j = 0; j < templist3.size(); j++) {
- col3.add((int) templist3.get(j));
- }
- }
- }
- for (int i = 0; i < col1.size(); i++) {
- for (int j = 0; j < col3.size(); j++) {
- n += Integer.parseInt(aa.get(col1.get(i))[col3.get(j)].trim());
- }
- }
- }
- }
- }
- total = c + n;
- tid = total * Integer.parseInt(iw.get(1)[1].trim());
- System.out.println("Two in a Day: " +tid);
- return tid;
- }
- public int ps(){
- int sp = Integer.parseInt(iw.get(2)[1].trim()), c = 0;
- List<Integer> col1 = new ArrayList<>();
- List<Integer> col2 = new ArrayList<>();
- for (int y = 0; y < Psize; y++) {
- if( (y+sp) >= Psize){
- for (int x = 0; x < Rsize; x++) {
- if (tt[x][y] != null) {
- List templist = (List) tt[x][y];
- for (int j = 0; j < templist.size(); j++) {
- col1.add((int) templist.get(j));
- }
- }
- for(int y2=y+1; y2<Psize; y2++){
- if (tt[x][y2] != null) {
- List templist2 = (List) tt[x][y2];
- for (int i = 0; i < templist2.size(); i++){
- col2.add((int) templist2.get(i));
- }
- }
- }
- }
- for (int a = 0; a < col1.size(); a++) {
- for (int b = 0; b < col2.size(); b++) {
- c += Integer.parseInt(aa.get(col1.get(a))[col2.get(b)].trim());
- }
- }
- col1.clear();
- col2.clear();
- }
- else{
- for (int x = 0; x < Rsize; x++) {
- if (tt[x][y] != null) {
- List templist = (List) tt[x][y];
- for (int j = 0; j < templist.size(); j++) {
- col1.add((int) templist.get(j));
- }
- }
- for(int y2=y+1; y2<(y+sp); y2++){
- if (tt[x][y2] != null) {
- List templist2 = (List) tt[x][y2];
- for (int i = 0; i < templist2.size(); i++){
- col2.add((int) templist2.get(i));
- }
- }
- }
- }
- for (int a = 0; a < col1.size(); a++) {
- for (int b = 0; b < col2.size(); b++) {
- c += Integer.parseInt(aa.get(col1.get(a))[col2.get(b)].trim());
- }
- }
- col1.clear();
- col2.clear();
- }
- }
- System.out.println("Period Spread: "+c);
- return c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement