设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14457|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ [. {2 L3 S; l3 T0 b- \  U4 s! s: b3 a
: @' z& n( W' t. x: @. T2 w我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。# B2 r  E0 q2 y' c, f' W

" B4 |5 l5 ]2 V( n% ^$ n: B5 }  {begin P_read arriving
+ ~3 E& `8 T6 k9 \* b2 r% K    while 1=1 do begin
* _8 g- E# w4 T$ g        read A_tote from "data.txt" with delimiter "\n"1 Y/ L3 v: I5 k& {. L+ a+ ?
        read A_time from "data.txt" with delimiter "\n"; X2 S# |% x, D& [3 V
        read A_leave from "data.txt" with delimiter "\n"9 v2 P5 U, I1 [; B" g# R
        read A_picks from "data.txt" with delimiter "\n"! Y, f5 h0 D6 H  A7 f' M
        set load type to A_tote
, D. M% r# A& B$ m  V; m' r* ?. f        if A_tote="tote 1" then set A_induct to 1, I7 i" P- c9 O, l
        else if A_tote="tote 2" then set A_induct to 2# x5 ?: M. E. v% w
            else set A_induct to 3    " m( g3 ^8 {. A: R
        set A_i to 0# a( I1 q0 z6 t$ R
        clone 1 load to P_induction
8 b) f0 o0 ~' ^; m3 V+ }- b, S        wait for A_time sec2 ?5 \0 ^, v0 V+ N7 C' o3 {
    end
% _( A$ J* j; ^. z4 Oend5 A; O# Z2 P0 u' R4 o  A( a1 q
. N5 u: q2 [/ u$ }6 N5 }. r3 F
begin P_induction arriving
* ?* ^% f' `7 m( o: U( b0 ~5 K    if A_induct=1 then clone 1 load to P_pick1
0 I" v/ ]4 k5 {8 @$ C    else if A_induct=2 then clone 1 load to P_pick28 X% A# H% x- ?& a+ s( g
        else clone 1 load to P_pick3) m4 t8 F( `! ?- d/ u" L4 _
end
( L5 U) c/ A/ \0 C( F" T) Z9 h, x9 K+ E' d9 R- t- P6 i, z
begin P_pick1 arriving
% k) x- T8 |$ j) F    set A_i to 1
& j" P9 M9 d- N7 v0 G0 {0 q    move into Q_induct1$ N& B" {5 w( P+ i  E
    move into pickaisle.induct1% y" O9 v! R, N1 A, b
    while A_i<=30 do begin
+ R9 N. u1 i7 Q1 A4 F0 j$ n( O: d        travel to pickaisle.con(A_i)& }7 H+ ^/ p: ?$ ^2 k  W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 |- A8 y; h$ X- J6 h6 e        else wait for 10 sec  E+ x# H* u* {# V2 T) C
        if A_i=A_leave then send to die  q1 P! d2 p7 W( \& P+ s$ {& i
        else inc A_i by 1
9 ?2 j7 F1 F0 |( `, k    end& L" D+ c; M( Q/ r& n4 b9 m0 P
end
7 `3 r& ]2 V( [
& e' J: K6 `( H( `5 ^& Nbegin P_pick2 arriving
9 w( _& }, ?9 J/ M    set A_i to 11
% k5 T1 U# Y0 n: B) r0 W5 L0 W    move into Q_induct2, c! a/ i6 }' \, W5 o$ {
    move into pickaisle.induct2! F8 ~* c3 |  r. g. [6 W( A2 J! v
    while A_i<=30 do begin1 q; N! x9 B+ v% g3 j( I
        travel to pickaisle.con(A_i)
; a3 |. L' o* d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# s6 E8 X( `3 a% @) o- x3 X' R8 Y4 M        else wait for 10 sec9 q/ Z, m  Y) W* [2 z
        if A_i=A_leave then send to die! W9 S: w5 J5 l) u3 v# X
        else inc A_i by 1
) i0 o* T$ o: f+ M    end+ b$ C( E( Y1 n' ?$ V4 @8 K! M
end( `4 M1 d0 I4 s' n

2 \0 {2 f$ k1 H" Z  R( S( a8 Obegin P_pick3 arriving
# t8 ?3 e- L9 C( g0 l7 h8 B- F    set A_i to 21
* E0 _* R- T: H: \0 S  F& Y    move into Q_induct3
' b# F. Z% `, c    move into pickaisle.induct3' x% n/ b0 m$ _( |! C! H& [
    while A_i<=30 do begin
: i; W0 n0 [+ W2 b; s  L$ ?- X        travel to pickaisle.con(A_i)- A( w+ y3 n: L( L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( F1 A2 y/ R+ f6 M/ H
        else wait for 10 sec
2 O3 l" `: J7 _: P! a$ m4 m        if A_i=A_leave then send to die
" F2 b" e" b" `3 X* H; b$ }* v        else inc A_i by 1
0 q8 M: y, ~2 H+ ]2 \" f. ~    end
  {8 P& F' P4 Z8 i* f8 W  s1 f# |end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
2 D+ a4 I0 z- T5 E) {8 n2 c  J; smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. {7 `* x, A' E6 K
0 N! g% e  J2 C  I/ _, v, D2 U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 Q  S# i. F, `  o0 a) Y" P5 r

* D/ U$ a) E6 K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 e2 ~7 K0 u- Y8 |2 c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% i7 G- \  p/ N' f3 Y2 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ q" \" j3 h* `  c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ C" O; p$ }, p: A- a% bbegin P_induction arriving) X. \5 t5 [0 b) P
    clone 1 load to P_pick(A_induct)
! U- m1 ]9 ^& |, }0 P% Bend最大的系
: ~/ H  |% n1 p
7 q6 w! N( {) r8 \; c+ H+ x- g# Tbegin P_pick arriving. X0 M4 a6 Q6 S
    set A_i to procindex * 10 + 1
  d) r1 P" ^1 {' X8 M2 k( E. a3 F( }    move into Q_induct(procindex)
6 n5 O1 y9 e: t  @    move into pickaisle.induct(procindex)
! Q5 E5 Z  h+ F( h2 x    /*check the type of pickaisle.induct(i), for your last problem.*/4 e1 [0 D3 O: T# H+ i5 m
( ]$ R/ _8 D' k
    while A_i<=30 do begin4 k  U# [& B. y5 ]
        travel to pickaisle.con(A_i)
; p' u  v" r) B# u8 n( ]2 `! p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 I& f5 J7 i( L, |  x' e( Y5 H& L1 |
        else wait for 10 sec( D6 }/ P1 z$ E4 Y; w  i# L5 @- o
        if A_i=A_leave then send to die
0 e" s* q" J( K) K& v$ Q! V        else inc A_i by 12 Z" p3 I. _' d' I
    end
6 L  {1 w1 ]% k/ V6 `" cend  @0 W# d* o0 ]  F

$ O. q3 \5 Q3 o其中的procindex为整形,代表当前process的序号。
: j" X# K: ^0 W" x3 S) V" Nstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-7-12 08:25 , Processed in 0.017369 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表