设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12641|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' K) U# `1 S  `8 ~' k5 _) r. K5 t

5 c1 w) n% P. g2 s我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( ~- [$ U. H  Z1 c; D0 W: f% c  q: Q7 C& O
begin P_read arriving6 ^2 ?' ~8 ?- @# o
    while 1=1 do begin
' J/ b! m9 X( A, Z0 [1 @; X5 Q, I        read A_tote from "data.txt" with delimiter "\n"
, U, W' \1 R* r9 N. Q/ R        read A_time from "data.txt" with delimiter "\n"* O) s. [9 Q+ ?9 v
        read A_leave from "data.txt" with delimiter "\n"% @1 S- V% Q# ~7 M
        read A_picks from "data.txt" with delimiter "\n"
# E3 N1 ?! c3 K7 x1 H        set load type to A_tote& o9 v7 T  c6 X' y$ {# Q; e
        if A_tote="tote 1" then set A_induct to 1
: {1 _  ~  C! v  C5 V4 i$ o, a4 C        else if A_tote="tote 2" then set A_induct to 2& k. N$ c) Z) K
            else set A_induct to 3    4 @/ F( a% H7 F0 W6 w/ ]" b
        set A_i to 00 ^( A0 {5 ~5 ?. }% h3 @
        clone 1 load to P_induction
: ~- \" e- v. Q) Q7 H        wait for A_time sec
$ }6 w6 Q5 p9 X2 [8 f    end: z' |* L9 r* e; ^
end
5 n2 z5 E) W; H0 n- |
! @2 e' g: P2 w- u+ ?% Bbegin P_induction arriving
# Q) z9 Q% S8 E% x    if A_induct=1 then clone 1 load to P_pick19 W. ?2 A* }1 P
    else if A_induct=2 then clone 1 load to P_pick2/ n! s6 L) S/ H5 ^
        else clone 1 load to P_pick3
4 z3 J; [; z1 |8 r1 u. Xend
. N1 ^% s4 n# Z, N. H% b3 ~0 L+ B- f
begin P_pick1 arriving7 T. o# G% D* M1 L7 o! Q
    set A_i to 1
# c- L' F  [. ^1 ]+ s! ]2 L- o    move into Q_induct1! f9 F: s, _0 O: O. f3 [
    move into pickaisle.induct1/ c* K0 P7 m( ]  A) @
    while A_i<=30 do begin
! C5 j: W3 m' o6 |        travel to pickaisle.con(A_i)2 G/ {" e9 ?8 V4 n5 i, D8 H% l8 [8 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Q1 H/ m/ r* Z8 ~8 @" ?* @4 @' R
        else wait for 10 sec
1 q9 ]% d* K5 s  u4 o+ V        if A_i=A_leave then send to die
" F) V) j) o7 a; D1 m        else inc A_i by 1
1 y, D  P; O7 c    end
6 S$ ^, D/ ]) h& V6 E  oend2 P1 K' W# }( N+ v

! Y6 x8 Y5 k2 \3 U( C' H- ~8 qbegin P_pick2 arriving8 m% l% x; q( G. F" }% U3 O4 h
    set A_i to 11
  p7 q, z& y! ^7 i7 p    move into Q_induct2! H. h+ ?# j1 l. k  @5 \! _* Y8 N
    move into pickaisle.induct2
7 N' }. Z3 E* F! V# Q    while A_i<=30 do begin
9 ~- ?  F9 P0 b) y5 a2 k6 J: b        travel to pickaisle.con(A_i)
& d+ z& h. A. U( |  w. d/ A; M7 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! o+ H: |1 m9 P" {. s( a. f
        else wait for 10 sec
2 S2 f) V0 f' N  [  \        if A_i=A_leave then send to die+ p+ s, J! l/ Y2 k, v
        else inc A_i by 19 K& c" J* o$ u+ Q4 u
    end+ ^) y  I0 P% j: |9 ]7 y8 U& F& Q5 m
end: f. U4 `! H! z& |! ~
3 u. q+ Y. R6 f. ^9 v* S
begin P_pick3 arriving) r: U7 ?0 B: [  @2 ]
    set A_i to 21
! N. p: |. S# W# P% @    move into Q_induct3& g2 J5 R# j4 V- N8 k
    move into pickaisle.induct3* F+ q; B% _, T6 }2 u7 G4 |
    while A_i<=30 do begin
- _- A9 ?( ]( M/ m2 [' t        travel to pickaisle.con(A_i)9 {) `, F$ F: [/ X- V& u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' O6 L% U9 @$ E" s
        else wait for 10 sec
; y) R% |: q' |7 h4 \        if A_i=A_leave then send to die
1 |* w3 A  y6 L        else inc A_i by 1
, F  W  l3 _$ w( R( M' O    end
2 w, u& B; s* yend

最佳答案

查看完整内容

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是个什么东东?+ d: Q) v( K0 ~, e/ {1 K8 K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. @  f  y0 A' T" }% f. c* E! ~* S4 d* U  J- e8 M1 {3 c# W0 Z, @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) l4 W' K( P  K1 R8 N' v3 M
- j0 _( T$ z+ `, c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 ]/ O; s5 ]; d# \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( t1 A% [) ?/ r) ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ g: I2 g% p1 D/ ~2 q- W& g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 x' x+ L, [: T  ~  _* c3 E$ b
begin P_induction arriving! r, G$ K  Q4 A9 b: \
    clone 1 load to P_pick(A_induct)
7 _1 E4 _- e6 L9 dend最大的系
6 A8 \6 W4 z" h# r! B# ?) j1 U5 o* {" Y2 ?/ F
begin P_pick arriving# R' D+ q% J- m. l
    set A_i to procindex * 10 + 1
$ {3 D- ~2 D3 n. v    move into Q_induct(procindex); J" g9 v  F7 u4 U% C/ a7 a
    move into pickaisle.induct(procindex)
8 o9 W, x. N0 n) D/ d7 d8 @; H    /*check the type of pickaisle.induct(i), for your last problem.*/
4 }5 z) }: L9 h2 p/ y# b6 o# @6 i0 ^
3 v0 }$ x5 M- o9 P0 [7 i    while A_i<=30 do begin" s5 M. M& c1 \3 F1 S
        travel to pickaisle.con(A_i)
' s6 L% `7 L6 c: W" Q6 g5 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' o) y% l/ q8 [        else wait for 10 sec
0 g* `) u& \/ `; l* F        if A_i=A_leave then send to die! |9 p1 M! A) z
        else inc A_i by 1
1 g( A8 C) C4 \5 [+ C9 O    end; a: B5 ^8 M5 \$ p9 `
end
( C; S$ @$ N8 x/ Z# G) H$ Q9 n# j8 h% O4 k' s/ f
其中的procindex为整形,代表当前process的序号。. l8 a. N! _" P9 x* `$ X
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-2-7 05:05 , Processed in 0.025153 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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