设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15114|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ L! U& L2 ~# h! V) Y+ i6 \7 r  o# U6 n" M" o: N% B+ n) g
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" M. ^' w% w0 D( a. }
7 f4 i3 d  ~+ g3 g  {
begin P_read arriving
% ?) e9 d. D# V& I    while 1=1 do begin
7 M- }' H( ^8 W% g( O2 s. ?+ \5 c        read A_tote from "data.txt" with delimiter "\n"
! J  g  O5 o1 B- I  b        read A_time from "data.txt" with delimiter "\n"
3 `5 V/ }8 A. ]2 ]        read A_leave from "data.txt" with delimiter "\n"5 Y& i! _% B" a$ ~+ H
        read A_picks from "data.txt" with delimiter "\n"7 A: ?1 a9 A9 |+ C4 y3 Q
        set load type to A_tote# O6 z3 o. T7 D' n& s) x. g
        if A_tote="tote 1" then set A_induct to 1
. F2 \$ q8 y0 [3 ^6 s        else if A_tote="tote 2" then set A_induct to 23 t* l: Z: m2 k1 {0 ^1 @3 J$ V
            else set A_induct to 3   
, w& p  F- d5 O5 c) j/ o        set A_i to 06 @# V! b# P* v  V
        clone 1 load to P_induction
4 ^: c8 N. n8 r% K+ L        wait for A_time sec
' H& v" A2 a* R) u8 n5 N    end
6 ]; k) |+ k1 d) ?& L& I4 iend+ A1 ^8 T( G5 b8 q

: N8 g: x' o4 q( Jbegin P_induction arriving# l% P* l! Q9 D5 D: B1 @
    if A_induct=1 then clone 1 load to P_pick1, t" p" C: ^3 A+ y* k8 @/ b
    else if A_induct=2 then clone 1 load to P_pick2
- Z: D+ A4 C2 b1 A" \        else clone 1 load to P_pick38 ?) [! C, @- p6 X
end: ^1 O0 a% k5 O; v
1 w* e- W9 Z( `" b6 C& W
begin P_pick1 arriving
: Y0 T. ~8 m3 L. }    set A_i to 15 K; t7 N) f2 @2 y; _; A2 A
    move into Q_induct1
8 s( n/ d4 H* W1 O  Z5 R5 e" C8 e" [    move into pickaisle.induct1" l3 A6 Q( ^7 o8 J9 j; n" s' F
    while A_i<=30 do begin- _. i  _0 {. g: N. S8 f
        travel to pickaisle.con(A_i)1 _% D1 u1 C4 V$ N) d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c; H# _& V! R
        else wait for 10 sec# H* V9 T" Y6 w$ L" C6 r
        if A_i=A_leave then send to die
& w: w3 g, Q- x0 z3 g        else inc A_i by 1
% Q" b+ k0 f. ]    end# d; X( W! p& O8 f8 |2 P
end
; d7 r+ T1 m; u% M7 A8 e
8 I6 d' H* k9 y& Q  W2 ^- lbegin P_pick2 arriving; O- J8 B8 ~! r# u2 g- \/ _% D
    set A_i to 11* M/ u% U1 [! r
    move into Q_induct2  J: |0 A$ V6 Z, J
    move into pickaisle.induct26 _/ A- e- b! g& c# u$ C
    while A_i<=30 do begin: g/ p8 f# ?: v8 y
        travel to pickaisle.con(A_i)
6 O- D3 c  _0 L( B, o7 X" @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 _) h2 a& V! w/ C) |/ R
        else wait for 10 sec; N. _0 |3 s) w2 f. Z# B* j
        if A_i=A_leave then send to die( F- `6 P; t3 k9 g$ D
        else inc A_i by 1- [1 P6 w  W) n6 z
    end' r! v8 V/ f# E( [
end2 G  n& T8 D+ k8 J: |# x
, T+ \! K$ x! d* b7 `0 z" w
begin P_pick3 arriving
& S5 M7 n: B) a3 \/ L# C+ O    set A_i to 216 O4 u. l, x! F
    move into Q_induct3
; o' D7 {. i  A( S* T, T; V0 u    move into pickaisle.induct3% y1 e/ Z* F2 `4 c0 I( s. t) K. f
    while A_i<=30 do begin+ ?# ^" x3 [/ Z% u
        travel to pickaisle.con(A_i)1 }3 ]' s0 K% k2 P5 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d2 U: `$ v; N0 ~1 B        else wait for 10 sec
2 t* d/ w  I* \1 U: b$ w3 h( P& m        if A_i=A_leave then send to die* f, r  @; a# r0 Q$ a$ d0 m9 S
        else inc A_i by 11 Q2 h7 l) N# ~1 |& }. W
    end& e  Y7 y* U+ @& Z7 E( |
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是个什么东东?
" }; F4 S5 w  b6 J' U: ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 R6 M8 E& L3 V+ O7 F: Y% r3 @8 S; U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. W% v% F0 l3 M, J5 Y( Z6 E- |" K1 v- V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 K: m; e0 t! z0 \0 }
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% D2 Y  d* B& \* A2 B, ]. z  p
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 `$ U, ?" H/ R0 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% H6 k* Y0 u# o2 s7 ]7 |
begin P_induction arriving
7 e3 G2 H8 D" ^. }3 \$ n* R    clone 1 load to P_pick(A_induct). @8 {- y: S, q5 }4 i
end最大的系! Q7 v( v. C# R  x/ h1 u) L- E
9 f- k; g, X* n& F& j
begin P_pick arriving
8 L# u! b# T6 c2 ?    set A_i to procindex * 10 + 1
& z7 V4 i4 w5 l+ @4 x    move into Q_induct(procindex)  c) @3 _% N- H4 b9 q5 G! {  _; u
    move into pickaisle.induct(procindex)$ J2 E; Q5 |) ?% C4 K% L6 K
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 n5 E' r/ S( g2 R( C
* t, H+ @) S3 E( w* D( `  s    while A_i<=30 do begin% C1 z6 O7 M7 D" b
        travel to pickaisle.con(A_i)
* z1 C5 V# y7 ~8 G# M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 I0 r6 F5 g  ?3 v8 z5 ]$ z3 P0 L& D        else wait for 10 sec& @$ ?3 x! Z" ^4 L8 s8 `
        if A_i=A_leave then send to die; |9 a2 N! `& r" d7 g+ K& _
        else inc A_i by 1
9 \& |* K* }& B8 Y& q& i/ a    end% s1 r2 ^/ }* P5 X% w9 }' ~' x
end
: S/ f9 o* [. o. y6 j' F. Q, {8 A- f& @' U5 p! A" f" a6 n8 k
其中的procindex为整形,代表当前process的序号。: }5 t' W, X- m5 p
station和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-8-11 19:02 , Processed in 0.026525 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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