设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11605|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 ]+ q: Z+ i( h9 N* M( I( V. O7 M: A" m) Y: \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 X+ i" }6 Y; ]. I; n1 f' c, \5 D$ ^. T: W5 ^' r0 \) a8 ~) w
begin P_read arriving
& l& _% l1 r4 Q% {$ h8 g, [    while 1=1 do begin$ y* E: ?3 z$ s6 W$ ]
        read A_tote from "data.txt" with delimiter "\n"" d- e$ l* Y7 X) j/ ^( z$ z8 o1 ~$ p
        read A_time from "data.txt" with delimiter "\n"1 J' L, Q: h4 w  V# t4 c
        read A_leave from "data.txt" with delimiter "\n"5 {7 \! }# V+ R, `- o; L$ a. x
        read A_picks from "data.txt" with delimiter "\n"; I6 ^0 N: ?2 h
        set load type to A_tote! [* D/ L( l3 q) A, R3 w
        if A_tote="tote 1" then set A_induct to 1
0 g' `2 w+ A+ ^# R: b7 K( k. _8 |. T        else if A_tote="tote 2" then set A_induct to 2
8 m- T  S/ e9 L            else set A_induct to 3    ( J- l# Z/ x; ]& y" }6 `
        set A_i to 02 J# L( N( I( N
        clone 1 load to P_induction
) d/ ]  K* \# H" E( W: ?        wait for A_time sec0 C/ Z* \& G" B& }' z: n: }
    end
2 }. |* I/ O( u4 _! Iend4 Y8 ~  g* l. {6 K, R8 v0 h# K3 g6 n
/ Z% Y  A& Y. A+ `$ m9 c) X
begin P_induction arriving2 |% `) ], x: f: n5 v) R
    if A_induct=1 then clone 1 load to P_pick1( D/ X) I/ ]7 h9 {/ b
    else if A_induct=2 then clone 1 load to P_pick2
. ^9 m! Q* ]& r) O! m        else clone 1 load to P_pick3- Y( @- h3 [! u5 Q8 l
end
8 a( ?+ q1 S. s3 a$ l. Y
$ E  i  G3 `- O; X  l1 Nbegin P_pick1 arriving
4 Z, U2 A) Q/ {/ e% }. o    set A_i to 1' R. I' n. \# ?. k
    move into Q_induct1: X2 ^5 m4 a; C1 [
    move into pickaisle.induct1
% z% v& T) n5 \    while A_i<=30 do begin
) u' U! Z2 R! t7 A/ q        travel to pickaisle.con(A_i); `" V6 X) _, L' K) L% q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& h/ V: m9 s8 Y8 ~3 n/ j        else wait for 10 sec* D0 W5 ^9 b3 I) Z
        if A_i=A_leave then send to die7 v* l1 C) T; u2 b3 {4 b. I
        else inc A_i by 1
% {) O& D- m: z    end
7 U3 G( O! G' k- N+ Oend
: B1 q' x9 V0 M$ g
1 Q6 t3 [# }. L2 K4 r2 T0 }begin P_pick2 arriving4 l+ N6 `: W$ B  F& A1 d4 |
    set A_i to 11
# g# c" Y5 R; q    move into Q_induct2
  W9 }! V& c& Q: \4 P, N    move into pickaisle.induct2/ L1 D/ N1 Q( e$ H7 m; z  {
    while A_i<=30 do begin3 b* ~+ I/ R# {2 x5 U
        travel to pickaisle.con(A_i)
: V, i  F' A5 \: y- Z/ o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ s* [% f* d8 I+ E/ S; V        else wait for 10 sec' j' N0 U" n# `( V0 W
        if A_i=A_leave then send to die
3 M- P: o" q; I        else inc A_i by 1( ?0 y2 q6 L; s; d1 f
    end
: p8 E4 \+ _3 i, @; L/ ]end
. p" z. x, ^# {' ^7 R! S
5 H% C- k, `/ F/ K' d4 p- A# fbegin P_pick3 arriving$ z2 [# q( k. _) |
    set A_i to 21
. W  t% d4 C3 n0 q' ~    move into Q_induct3/ @. t, @8 z" \, k
    move into pickaisle.induct3% Y9 I1 t& A" e. n# I. q
    while A_i<=30 do begin' V" p% E1 k6 A7 n5 \0 L5 Q! W
        travel to pickaisle.con(A_i)6 g8 a7 y( r6 R7 ]$ f* a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& m' u- D4 V0 ^  j' H& R        else wait for 10 sec% I7 ~* l& N' U
        if A_i=A_leave then send to die
" p- X' c2 ]4 q; ~  S        else inc A_i by 1
; s4 d7 s' g+ I3 _; c+ B% m9 P    end% B6 b/ Y# @" N$ [
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是个什么东东?
9 d: Y! y: l: X, s5 gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! _# R) B! h4 {$ O: l( @0 c; s, b/ C* a" y
$ m6 }. c, m5 d1 v, IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! V9 g- U" h2 K' @+ m/ x0 X1 y. i* k; j' p9 ~$ c' t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& T5 }% w% R* {. W  l# c2 Z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) V/ l: m* T# y1 Z# P: |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# q; D5 c+ d& N9 @/ v9 l5 D$ M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# e- s* o& N" z* y% D1 ^7 sbegin P_induction arriving# Z4 S( u7 D8 A2 _; {$ @
    clone 1 load to P_pick(A_induct)
1 b, M1 i; B4 g5 t& I% C" Q) c, o# Tend最大的系! K" W" T+ J$ H; X- m, G9 ^1 [

: ]' O1 j/ T+ \1 Bbegin P_pick arriving
* Y& a4 e+ n9 L5 O5 H- @" @% R2 d0 W    set A_i to procindex * 10 + 1
; K- I3 q$ U) E, F% e    move into Q_induct(procindex)
: W2 r% ^& E! a+ ^    move into pickaisle.induct(procindex)( S$ ?. H* e9 M8 P! f! n) o
    /*check the type of pickaisle.induct(i), for your last problem.*/& S7 g7 N1 Q! _/ K, K+ a
* r! ^2 P& E& P; u" r
    while A_i<=30 do begin
, c  Q5 @  D6 f, L) n% }        travel to pickaisle.con(A_i)
) o: K5 k" t  b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P0 e+ v6 a4 T) Z6 T( t
        else wait for 10 sec! e) O5 n$ a* Q2 J5 _& J- e8 o( e, x/ x
        if A_i=A_leave then send to die- x6 w; n% e) w* v2 o" v8 i
        else inc A_i by 1
: C4 g' t+ y+ t) g    end4 {8 @. F8 k) }3 {# ~) {' x, G
end+ C4 O  M8 p0 @2 k2 @0 b4 b7 q4 V2 H
, Q) A" s* i' t; e; u+ ?
其中的procindex为整形,代表当前process的序号。
0 p% w. O0 d& c, Z! Cstation和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, 2025-11-23 04:02 , Processed in 0.017416 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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