Both sides previous revision
Poprzednia wersja
|
|
pl:miw:miw08_rbs_ml:attributchange [2008/06/16 13:55] miw |
pl:miw:miw08_rbs_ml:attributchange [2019/06/27 15:50] (aktualna) |
| Nie potrafię zapisać pliku na tej stronie. Dostaję niezrozumiały dla mnie komunikat <code>"Method Not Implemented |
| |
| POST to /wiki/doku.php not supported."</code> |
| Dzieje się to podczas zapisywania gdy na stronie jest funkcja której teraz nie mam (zapisała się część bez metody public void WriteOldNewValues(String AttrName, WriteFile sw, Object[] obj)). Cały pliku znajduje się [[http://student.agh.edu.pl/~morcinek/AGH/MIW/AttributChange.java | tutaj]]. |
| <code="Java"> |
| import java.util.*; |
| |
| /** |
| * Klasa zagreguje wartości porządkowe dla atrybutu o indeksie m_attrIndex |
| * @author Angello |
| * |
| */ |
| public class AttributChange |
| { |
| Integer m_attrIndex; |
| ArrayList<Integer> m_list; |
| |
| /** |
| * Konstruktor |
| * @param tresholds |
| * @param attrIndex |
| */ |
| public AttributChange(ArrayList<Integer> tresholds, Integer attrIndex) |
| { |
| m_list = new ArrayList<Integer>(tresholds); |
| m_attrIndex = attrIndex; |
| } |
| |
| /** |
| * Zmienia atrybuty dla całej tablicy |
| * @param learning |
| */ |
| public void Change(Object[][] learning) |
| { |
| for (Object[] row : learning) |
| { |
| this.Change(row); |
| } |
| } |
| |
| /** |
| * Funkcja zamienia atrybuty dla jednego przykładu |
| * @param row |
| */ |
| public void Change(Object[] row) |
| { |
| Integer pastValue = (Integer) row[m_attrIndex]; // Wartosc pierwotnego atrybutu |
| for (Integer i = 0; i < m_list.size(); i++) |
| { |
| if (pastValue <= m_list.get(i)) |
| { |
| row[m_attrIndex] = i; // Przypisanie wartości nowego atrybutu |
| return; |
| } |
| } |
| row[m_attrIndex] = m_list.size(); // Jeśli nie zmieściło się w progach to jest to ostatnia wartość |
| } |
| |
| /** |
| * Zapisuje do pliku informację jak zostały zmienione atrybuty |
| * @param AttrName |
| * @param sw |
| */ |
| public void WriteOldNewValues(String AttrName, WriteFile sw) |
| { |
| Object[] obj = new Object[24]; |
| for (int i = 0; i < obj.length; i++) { |
| obj[i]=i; |
| } |
| WriteOldNewValues(AttrName, sw, obj); |
| } |
| } |
| </code> |