All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.agentsoz.abmjack.env.ActionList__Tuple Maven / Gradle / Ivy

Go to download

Allows the use of JACK (aosgrp.com/products/jack) as the underlying BDI system

There is a newer version: 2.0.1
Show newest version


/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  This code is generated by JAC version 5.6 by
  Agent Oriented Software. http://www.agent-software.com.au

    DO NOT ALTER THIS CODE AND DO NOT REMOVE THIS COMMENT
 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
package io.github.agentsoz.abmjack.env;

/*
 * #%L
 * BDI-ABM Integration Package
 * %%
 * Copyright (C) 2014 - 2016 by its authors. See AUTHORS file.
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * #L%
 */
import aos.jack.jak.beliefset.ClosedWorld;
import aos.jack.jak.beliefset.Tuple;

/** Automatically generated class from 'null'. */
public class ActionList__Tuple extends aos.jack.jak.beliefset.Tuple implements aos.apib.Base, java.io.Serializable {

  public static final __SS streamer = new __SS();

  /** Automatically generated method. */
  public aos.apib.StreamerSupport getStreamer()
    { return streamer; }

  /** Automatically generated method. */
  public int hashCode() {
     streamer.setup();
     return aos.apib.Util.hashCode(this);
  }

  /** Automatically generated method. */
  public boolean equals(Object o) {
     if (!(o instanceof aos.apib.Base)) return false;
     return aos.apib.Util.equals(this, (aos.apib.Base)o);
  }

  public String	actionID;
  public String	state;
  public String	parameters;


public ActionList__Tuple(boolean v)
{
    super();
    isFree = v;
}



public java.lang.String name()
{
    return "ActionList__Tuple";
}



public java.lang.String toString()
{
    java.lang.StringBuffer __s = new java.lang.StringBuffer();
    __s.append(actionID);
    __s.append(":");
    __s.append(state);
    __s.append(":");
    __s.append(parameters);
    return __s.toString();
}



public int hash(int __i)
{
    int __r = 0;
    switch (__i) {
        case 0: 
        {
            __r ^= (actionID.hashCode() & (~(1 << 31)));
            return __r;
        }
        case 1: 
        {
            return __r;
        }
    }
    return 0;
}


  /** Automatically generated constructor. */
  public ActionList__Tuple() {
    streamer.setup();
    if (!getStreamer().initialized) return;
    __init__ActionList__Tuple();
  }

  /** Automatically generated method. */
  void __init__ActionList__Tuple() {
	actionID = null;
	state = null;
	parameters = null;

  }

  /** Automatically generated JACOB streamer class */
  static class __SS extends aos.apib.StreamerSupport {
    ActionList__Tuple __def = null;

    /** Return a static instance. */

    public aos.apib.Base getDefaultInstance() { return __def; }

    private String[] fn = {
    ":actionID",
    ":state",
    ":parameters",
    };

    private String[] dn = {
    ":actionID",
    ":state",
    ":parameters",
    };

    private boolean[] ftr = {
    false,
    false,
    false,
    };

    private boolean[] fst = {
    false,
    false,
    false,
    };

    private boolean[] fhd = {
    false,
    false,
    false,
    };

    private int[] ft = {
    11,
    11,
    11,
    };

    private aos.apib.EnumInfo[] fe = {
	null,
	null,
	null,
    };

    private String[] cm = {
    null,
    null,
    null,
    };


    private aos.apib.StreamerSupport[][] al = {
	null,
	null,
	null,
    };

    private String[] fsubt = {
    null, 
    null, 
    null, 
    };

    /** Construct the streamer. */
    public __SS() {
      __type = "ActionList__Tuple";
      __icon = null;
      __comment = "Auto generated by the JACK Agents Compiler";
      __field_names = fn;
      __display_names = dn;
      __field_types = ft;
      __field_static = fst;
      __field_hidden = fhd;
      __field_transient = ftr;
      __field_subtypes = fsubt;
      __field_comments = cm;
      __enuminfos = fe;
      __allowed = al;
      register(__type, this);
    }

    private boolean setup_done = false;

    /** Initialization. */
    protected void setup() {
      if ( setup_done ) return;

      setup_done = true; 

      __def = (ActionList__Tuple)newInstance();
      setStreamedType(__def.getClass());
      baseclasses = findBaseStreamer(__def.getClass());
    }

    /** Initialization. */
    protected void init() {
      setup();
      __def.__init__ActionList__Tuple();
    }

    /** JACOB method. */
    public boolean isDummy() { return false; }

    /** JACOB method. */
    public aos.apib.Base new_instance() {
      return new ActionList__Tuple();
    }

    /** JACOB method. */
    public aos.apib.Base[] new_array(int n) {
      return new ActionList__Tuple[n];
    }

    /** JACOB class reading method. */
    public boolean read(aos.apib.InStream in, aos.apib.Base o) {
      int i = -1;
      while ((i = in.nextField(i, this)) >= 0) {
        if ( !readField( in, o, i ) ) {
          return false;
        }
      }
      return true;
    }

    /** JACOB method to read fields. */
    public boolean readField(aos.apib.InStream in, aos.apib.Base o,int i) {
      if ( i > __field_names.length )
        return getBaseClassStreamer().readField( in, o, i - __field_names.length - 1 );
      ActionList__Tuple v = (ActionList__Tuple)o;
      switch (i) {
      case 0:
	v.actionID = in.getString(true);
	break;
   case 1:
	v.state = in.getString(true);
	break;
   case 2:
	v.parameters = in.getString(true);
	break;
      case 3:
        in.readBaseClasses(o, this, 0);
        break;
      default:
        if (i >= 0 && i <= 3) break;
        in.error("Reader for ActionList__Tuple: illegal field number:"+i);
        return false;
      }
      return true;
    }

    /** JACOB class writing method. */
    public boolean write(aos.apib.OutStream out, aos.apib.Base o) {
      ActionList__Tuple v = (ActionList__Tuple)o;
      int i = -1;
      while ((i = out.nextField(i, this)) >= 0) {
        switch (i) {
      case 0:
	out.putString(v.actionID, i, __def.actionID, this);
	break;
   case 1:
	out.putString(v.state, i, __def.state, this);
	break;
   case 2:
	out.putString(v.parameters, i, __def.parameters, this);
	break;
        case 3:
          out.writeBaseClasses(o, this);
          break;
        default:
          if (i >= 0 && i <= 3) break;
          out.error("Writer for ActionList__Tuple: illegal field number:"+i);
          return false;
        }
      }
      return true;
    }

    /** JACOB method. */
    public boolean isDefault(aos.apib.Base o) {
      ActionList__Tuple v = (ActionList__Tuple)o;

	if (v.actionID != __def.actionID) {
	   if (v.actionID == null) return false;
	   if (__def.actionID == null) return false;
	   if (!v.actionID.equals(__def.actionID)) return false;
	}
	if (v.state != __def.state) {
	   if (v.state == null) return false;
	   if (__def.state == null) return false;
	   if (!v.state.equals(__def.state)) return false;
	}
	if (v.parameters != __def.parameters) {
	   if (v.parameters == null) return false;
	   if (__def.parameters == null) return false;
	   if (!v.parameters.equals(__def.parameters)) return false;
	}
      if (baseclasses != null && baseclasses.length == 1)
        return baseclasses[0].isDefault(o);
      return true;
    }

    /** JACOB method. */
    public void findNonApib(aos.apib.OutStream out, aos.apib.Base o) {
     ActionList__Tuple v = (ActionList__Tuple)o;

      if (baseclasses != null && baseclasses.length == 1)
        baseclasses[0].findNonApib(out, o);
    }
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy